I need the best way to write the loop commands

3 views (last 30 days)
for i=1:15,
y(i+1)=vec(i);
end
y(1)=vec(16);

Accepted Answer

Walter Roberson
Walter Roberson on 18 Feb 2016
y = vec([16, 1:15]);

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!