# Take values from a matrix, line by line.

1 visualización (últimos 30 días)
Ricardo Gutierrez el 6 de Sept. de 2019
Comentada: Ricardo Gutierrez el 6 de Sept. de 2019
Hello good day.
I have the following matrix:
A = [2 4 6
3 6 9
4 8 12];
and the following variables:
W = exp ( )
D = exp ( )
V = exp ( )
What to do so that the values of matrix A are automatically taken starting with the first line and put in the exponent
for example taking the first line;
W = exp (2)
D = exp (4)
V = exp (6)
Then the values of the second line are taken;
W = exp (3)
D = exp (6)
V = exp (9)
Finally, the values of the third line are taken;
W = exp (4)
D = exp (8)
V = exp (12)
Greetings.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

the cyclist el 6 de Sept. de 2019
I would do this as follows:
WDV = exp(A.');
and any time later I need to refer to "W", I would reference WDV(:,1).
If you absolutely, positively need to refer to this variable as "W", then I would do
W = WDV(:,1);
and so on. But this is probably a terrible idea. See this question/answer for some reasons that will be relevant to you.
Is there a reason this does not work for you?
##### 1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Ricardo Gutierrez el 6 de Sept. de 2019
Excellent!!!
It worked
Thank you

Iniciar sesión para comentar.

### Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

R2014a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by