필터 지우기
필터 지우기

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

조회 수: 1 (최근 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에서 Thermodynamics & Statistical Physics에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by