To create numbered variables from a for loop

Hi,
Is there a way to generate numbered variables by a for loop ?
For example, if I have:
for i = 1:4
How can I generate the variables:
A_1
A_2
A_3
A_4
(named automatically by for loop)

 채택된 답변

bym
bym 2012년 11월 21일

1 개 추천

Don't
Please see this FAQ

댓글 수: 2

Anant Mane comments to bym,
'Accepted Answer' is not an answer at all.
Anant Mane:
Not creating numbered variables is the recommended approach from all of the main volunteers here, most of whom have extensive MATLAB experience.
The FAQ that bym linked to has explanations of why it is not a good idea, and gives several alternatives, and also gives a method of creating such variables for those who feel that they really must.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

질문:

2012년 11월 21일

댓글:

2018년 7월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by