Hello Matlab Community, Can someone write sum loop for me as menstion in the image and how to use subscript 1 with Q..
Show older comments
Answers (2)
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
1 Comment
Umar Farooq
on 28 Nov 2022
Umar Farooq
on 28 Nov 2022
0 votes
Categories
Find more on Matrix Indexing 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!