Loop step size for MATLAB

Asked

Viewed 78 times

1

I have the following loop in MATLAB, I would like to know how I can increase my k variable from 0.15 to 0.15 until 10.

 for k=1:1:10
 %...
 end

2 answers

1


Loop control works with

A= inicio:passo:final;

In your case

for x=0.15:0.15:10
...

Solves the problem.

0

Hello, in this case the increment (step) should be 0.15 and not 1 as suggested in the example. Then do the following:

for k=1:0.15:10 % k = start:increment/decrease:end

  %...

end

Browser other questions tagged

You are not signed in. Login or sign up in order to post.