Easy Questions: Generating Variables
Show older comments
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.
Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!