Matlab Variable Naming For Another Variable

조회 수: 7 (최근 30일)
Veysel Ahmet Özdemir
Veysel Ahmet Özdemir 2020년 8월 4일
답변: Chidvi Modala 2020년 8월 7일
I have a question. I want "a" to be "h", which varies according to the value of "a" depending on some variables. For example, if a = 2x + y, a = 4 for x = 1 y = 2, show "ha" as "h4" and see the value of "h4". How can i do it?

답변 (1개)

Chidvi Modala
Chidvi Modala 2020년 8월 7일
You can make use of the following piece of code
for i=1:3
eval(['A' num2str(i)])
end
But there are many disadvantages of using this method. The following links might be of help to you for other workarounds

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by