Hi sir, i attached one code,please show hw to save result from for loop

1 view (last 30 days)
ui=[1 2 3 4 5];
for i=1:length(ui)
k=i+(i+1)/2
end

Accepted Answer

Walter Roberson
Walter Roberson on 25 Aug 2015
Edited: Walter Roberson on 25 Aug 2015
k(i) = ui(i)+ui(i+1)/2;
  2 Comments
kaavya subramani
kaavya subramani on 25 Aug 2015
Edited: Walter Roberson on 25 Aug 2015
hi sir,i attached one code please say how to find its index
op=[2 4 6 8];
q=max(op);%its answer is 8,how to find its index 4

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!