Thursday, 28 July 2016

MATLAB Programming 36 - for loop (Example)

Example 2


Create a script file and type the following code:


for a = 1.0: -0.1: 0.0
     disp(a)
end


When you run the file, it displays the following result:


1
0.9000
0.8000
0.7000
0.6000
0.5000
0.4000
0.3000
0.2000
0.1000

No comments:

Post a Comment