Hello Matlab Community, Can someone write sum loop for me as menstion in the image and how to use subscript 1 with Q..
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
0 Kommentare
Antworten (2)
Walter Roberson
am 26 Nov. 2022
A = rand(1,20); B = rand(1,20);
X = A./B;
%looped sum
total_looped = 0;
for Index = 1 : numel(X)
total_looped = total_looped + X(Index);
end
%Unlooped sum
total_unlooped = sum(X);
format long g
total_looped
total_unlooped
difference = total_looped - total_unlooped
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!