Take values from a matrix, line by line.

2 vues (au cours des 30 derniers jours)
Ricardo Gutierrez
Ricardo Gutierrez le 6 Sep 2019
Hello good day.
Waiting for your valuable help
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.

Réponse acceptée

the cyclist
the cyclist le 6 Sep 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 commentaire
Ricardo Gutierrez
Ricardo Gutierrez le 6 Sep 2019
Excellent!!!
It worked
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by