Creating a new variable in a loop automatically. Please help!
조회 수: 3 (최근 30일)
이전 댓글 표시
I need to create a new variable every time the loop occurs. I am pretty new to matlab please help!
I need the variable to change automatically each time the conditions are met and the variable is stored. (Yaxisvarible1, Yaxisvariable2, and so on). Thanks in advance.
댓글 수: 0
채택된 답변
lvn
2014년 4월 19일
You can use the eval function to create such variables. However this practice is not recommended and can almost always be circumvented by other and better data representation (e.g. vectors/ structures/cells, etc..)
추가 답변 (1개)
Azzi Abdelmalek
2014년 4월 19일
This is not a good idea http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!