Easy Questions: Generating Variables
이전 댓글 표시
I want to generate a set of N-1 variables, N-2 variables, N-3 variables, ... for N-i > 0 (i.e. the set of variables should finish when the number of variables in the set is 1
Easy question, but I am just getting to grips with coding. I'm guessing some kind of loop and if statement is required in conjunction with each other?
Also need to work out how I can then edit the variables generated automatically, for example: I have variables C1, C2, C3 in set 1; C4, C5 in set 2; C6 in set 3.
I want C1 to equal a certain value based on a formula regarding its position in the set. Same for C2 and C3, and C(n) if there were more in that set.
I also want C4 and C5 (and any more that could be in set 2) to equal a certain value based on a DIFFERENT formula regarding its position in the set. And so on.
답변 (0개)
카테고리
도움말 센터 및 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!