matrix calculation for matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
mehmet salihi
am 9 Mai 2021
Kommentiert: arsenic 陈
am 10 Mai 2021
hi everyone,
i need urgent help for my code,
i have A=400x5 matrix, and B=0x5 matrix, i want to take the 10th rows(10 20 30 40 50 60) of the A matrix and equal them to the B matrix
for example , B(5,:)=A(50,:) and B(6,:)=A(60,:) goes like this.
please need help.
0 Kommentare
Akzeptierte Antwort
arsenic 陈
am 10 Mai 2021
a = zeros(400,5);
b = ones(1,5)
for i = 10:10:400
a(i,:) = b;
end
2 Kommentare
Weitere Antworten (1)
John D'Errico
am 10 Mai 2021
Bearbeitet: John D'Errico
am 10 Mai 2021
Simple. One line. No for loop. Nothing hard.
B = A(10:10:end,:);
3 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!