The output value of the for loop is wrong
Show older comments
Hi all,
The output structure is right but somehow the logic is wrong
please find the script below
D_Calc=[];
Filter=[];
for jj=1:12
D_Calc(:,end+1)=D(:,jj); % both D_Calc and D are same
Filter=D_Calc(D_Calc(:,jj)<PlusThreesigma(jj))
MeanFilter(:,end+1)=mean(Filter);
end
output
The filter and the mean filter value takes only the 1st column.
4 Comments
Bob Thompson
on 19 Jun 2019
We cannot run the code you provided, as D and PlusThreesigma re undefined.
'The filter and the mean filter value takes only the 1st column.' What does this statement mean? Are you saying that Filter and MeanFilter only give results for the first column? That they only use the first column of the input, so all the results are identical? That something with D_Calc is not correct? Please explain more. What kind of result are you seeing, and how would you expect it to be different.
rajasekar dhandapani
on 19 Jun 2019
Bob Thompson
on 19 Jun 2019
Ok, I was able to run your code, and I am not seeing the problem you are mentioning. For me, MeanFilter is coming out as a single row of values, with corresponding means in each column.
rajasekar dhandapani
on 19 Jun 2019
Accepted Answer
More Answers (1)
rajasekar dhandapani
on 19 Jun 2019
0 votes
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!