Recent content by pizza89
-
P
Creating a 'For' Loop to Calculate Answers for Sets of 11 Values
That looks weird, this will be easier to understand: function G=galarm(c) G=zeros(numel(c),1); % create G, 1 output for each element in c x = c(1:5379); for k = (1:11:5379)'; x(k:k+10); s = x(k+9:k+10); % source counts b = mean(k:k+7); %background stdev = std(k:k+7); %standard...- pizza89
- Post #5
- Forum: Engineering and Comp Sci Homework Help
-
P
Creating a 'For' Loop to Calculate Answers for Sets of 11 Values
Thanks! I did something like that and ended up getting, "Undefined function 'galarm' for input arguments of type 'double'." Maybe a 'str2double' (or actually 'double2--whatever type of argument it wants'... I'm not very familiar with those types of things) Here's what I have: function...- pizza89
- Post #4
- Forum: Engineering and Comp Sci Homework Help
-
P
Creating a 'For' Loop to Calculate Answers for Sets of 11 Values
I have a 5000x1 vector and am trying to write a function to calculate an answer for entry 1-11, then 12-22, then 23-33, etc. ... I've been trying to use a 'for' loop, basically: for i = (??) x=i+1 end Not sure what to put in the ? area. I want it to spit out answers for each set of...- pizza89
- Thread
- Loop Sets
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help