for loop in order to put matrix elements in single row vectors
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a nxk (10x20) matrix called M and I am setting its rows in 1x20 vectors with
n=10;
for i=1:1:n
vector1(1,:)=M(1,:);
...
vector10(1,:)=M(10,:);
Afterwards, I do some operations with the vectors like
sum(vector1,...,vector10)
I need to form a loop that it considers the changing of n within a range, for example
2<n<40
The operation sum should be done for each n seperately,
for n=2; sum2=
. . .
for n=40; sum40=
Any help please?
Thank you very much.
Best,
Pavlos
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!