can someone help me convert the for loop to a while loop
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
function [ cumsum ] = q2(v) n = length(v); cumsum = zeros(1,n); for ii = 1:n if ii == 1 cumsum(ii) = v(ii); else cumsum(ii) = cumsum(ii-1)+v(ii); end end end
1 Kommentar
Stephen23
am 9 Nov. 2016
Antworten (0)
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!