Take values from a matrix, line by line.

조회 수: 2 (최근 30일)
Ricardo Gutierrez
Ricardo Gutierrez 2019년 9월 6일
댓글: Ricardo Gutierrez 2019년 9월 6일
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