function for loop - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

function for loop

frwmetricfrwmetric Posts: 2Member
> function n=test(ni)
>
> for i=1:n
>
> x=i;
>
>
> n=[x,0,0];
>
> end
>
> end
>
> ie ni=4
>
> result is just "4 0 0"
> why I cannot see other possibilities for i=1,2,3... s.t
> for ni=4, my expectation is
> 100
> 200
> 300
> 400
Sign In or Register to comment.