[Solved] Is colon notation (:) equal to array(vector) [closed]


In your commented line,

% n=[0:10:100];

you create a vector with values from 0 to 100, with spacing 10, ie [0 10 20 30 40 50 60 70 80 90 100].

With your uncommented line,

n=[0 3 5 10 50 100];

you have the values you specify.

Since they’re not the same input, you won’t get identical output.

1

solved Is colon notation (:) equal to array(vector) [closed]