第五课 控制语句和方程 For,while,if statements and functions (1)For loop v=zeros(10,1) %initial vectors for i=1:10, %Assign for the vectors v(i) = 2^i; end; v (%You can also do that: indices=1:10; for i=indices, v(i)=2^i; end; v ) (2)whileloop I = 1; while I <=…