loop basic , need help.
1 view (last 30 days)
Show older comments
Can anyone explain me the behaviour of this particular loop and its behaviour after each iteration ??
clc;
M=3;
N=3;
for jj = 1:N
if data(jj)
signal((1:M)+M*(jj-1)) = 0
% (1:M)+M*(jj-1)
end
end
2 Comments
ES
on 9 Apr 2014
what is data ? what is signal? apparently, the snippet, makes some points on the signal when the value of data is 0!
Answers (1)
Walter Roberson
on 9 Apr 2014
It is emulating a 2D matrix with M rows, setting the first N columns of it to 0. It is as if you had written
for jj = 1 : N
signal(:,jj) = 0;
end
with signal having been defined as M x something.
0 Comments
See Also
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!