Take values from a matrix, line by line.

2 次查看(过去 30 天)
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.

采纳的回答

the cyclist
the cyclist 2019-9-6
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?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

产品


版本

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by