Hi!
I have a simple for loop im trying to write, wherein within an array from 1:5:150, if a number is even it is multiplied by 4 and if odd it is cubed:
a=[1:5:150]for a=1:5:150 if rem(a,2)==0; i(a)= 4*a else i(a)= a.^3 endend
The output here is set to place all the modified values into a new variable ,i, however this produces a column list with intervals of 4 zeros between each value as such:
Columns 1 through 13 1 0 0 0 0 24 0 0 0 0 1331
How can I produce a single row vector output instead so that the new variable represents the output in a much neater way?
Best Answer