Reduce programming for a lot of variables display -lots of combinations, posibilites-

5 次查看(过去 30 天)
I'm working with thermodynamic cicles, so I have 4 states and 12 variables that are input. (P1, P2, P3, P4, V1, V2....T1...)
If a variable is missing, it gets calculated and then displayed in a message box, I can have one variable missing from each state, so I can have from 1 to 4 variables missing. I want to display the calculated variables in a message box, but I want it to be a single message box if there are 2, 3 or 4 variables missing (I do know how to do this). What I want to know is if there is a simplier way to program all the posibilities with some sort of repetition structure or something.
I don't know if I made my point very clear, so I'll repeat it
I have 12 variables (P1, P2, P3, P4, V1, V2, V3, V4, T1, T2, T3, T4), 3 for each state, so 4 states, each state can be missing one variable, for example, state 1 has P1, V1 and T1 conditions. State 1 may miss any of those 3 variables and it can be calculated and displayed. One of the 3 properties from each state can be missing, so I can have from 0 to 4 variables displayed. I want to display all the posibilities in a single message box without having to program so much, because there are over 100 combinations. Is there a simplier way?
  1 个评论
Walter Roberson
Walter Roberson 2020-5-26
Each state can be:
A B C D
A B C
A B D
A C D
B C D
which is 5 possibilities independent of the other states. There are 4 states, so there are 5^4 = 625 possibilities.
Listing all of those possibilities individually for a message is not going to be productive.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by