Azzera filtri
Azzera filtri

for loop in order to put matrix elements in single row vectors

1 visualizzazione (ultimi 30 giorni)
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

Risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by