form a row vector
Mostrar comentarios más antiguos
I have to form a row vector x=[5 6 16 17 27 28 38 39....] till the total number of elements become 'n' where 'n' is entered by the user. Say, I enter n=4 so my x=[5 6 16 17]
basically what I want is that if I have two numbers say, X and Y and I wish to give some increment to these numbers to form a row matrix containing 'n' elements. Say, increment is 3 and n is 6 A=[X Y X+3 Y+3 X+6 Y+6]
1 comentario
akshata k
el 9 de Mzo. de 2015
for i=1:n
x1(1,n)=x(1,n);
end
Respuesta aceptada
Más respuestas (1)
Chandrasekhar
el 9 de Mzo. de 2015
x = [5 6 16 17 27 28 38 39....]
n = input('enter the total number of elements');
x = x[1:n];
disp(x);
4 comentarios
Ace_ventura
el 9 de Mzo. de 2015
Ace_ventura
el 9 de Mzo. de 2015
Jan
el 9 de Mzo. de 2015
@Jeff: What have you tried so far and which problems occur? It is much easier to answer, if you show us what you have done so far.
Ace_ventura
el 9 de Mzo. de 2015
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!