Is it possible generate and handle generated variable names?
조회 수: 3 (최근 30일)
이전 댓글 표시
For example is it possible to make a for cycle which generates the following variables? v1 = 1; v2 = 2; v3 = 3;
댓글 수: 0
답변 (2개)
Star Strider
2015년 5월 19일
It is, but it is considered to be very bad programming practice.
It is better to create them as an array instead:
v(1) = 1;
v(2) = 2;
v(3) = 3;
This has the same effect, but is much more efficient and much easier to work with.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!