From: Ahmad Alkandri on
dear all

how to write a for loop to get the range of numbers from 0<=1 by incrementing 0.001 ... and store the output values in a vector ?
From: us on
"Ahmad Alkandri" <a_alkandri(a)yahoo.com> wrote in message <hu1f25$fli$1(a)fred.mathworks.com>...
> dear all
>
> how to write a for loop to get the range of numbers from 0<=1 by incrementing 0.001 ... and store the output values in a vector ?

one of the many solutions
- it's time you read the getting started section of the docs...

r=0:.001:1;

us
From: Walter Roberson on
Ahmad Alkandri wrote:

> how to write a for loop to get the range of numbers from 0<=1 by
> incrementing 0.001 ... and store the output values in a vector ?

x = 0 : 0.001 : 1;


If you are required to use a 'for' loop, you could use

for K = 1:1
x = 0 : 0.001 : 1;
end

;-)



Alternately,

x = zeros(1,1001);
for K = 0 : 1000
x(K+1) = K/1000;
end
From: Ahmad Alkandri on
hi

this is what i have done

for i = 1:8
k(i) = a(i)+b(1)+y(1);
disp(k)
end

what i need to do now is to run the for loop to cover each value of the variable a,b and y .... the variable are something like this a = [ 1 2 3 4 5 6 7 8 9 ]

Ahmad
From: ImageAnalyst on
On Jun 1, 7:58 am, "Ahmad Alkandri" <a_alkan...(a)yahoo.com> wrote:
> hi
>
> this is what i have done
>
> for i = 1:8
>     k(i) = a(i)+b(1)+y(1);
>     disp(k)
> end
>
> what i need to do now is to run the for loop to cover each value of the variable a,b and y .... the variable are something like this a = [ 1 2 3 4 5 6 7 8 9 ]
>
> Ahmad

--------------------------------------------------------------------------------------------------------------------------
Explain what you mean by "cover." I'm not sure if you need 3 nested
for loops because I don't know what you mean. Show the output that
you expect to get.