필터 지우기
필터 지우기

Using a statement to identify a specific matrix with a given range of values.

조회 수: 1 (최근 30일)
I am hoping to get some help with a question concerning using a value range in MatLab. I am trying to write a statement where if the value of a variable falls within a given range, than a specific table of values is selected.
I am using the following code to round values for atmosT and RH:
roud_atmosT = round(atmosT);
roud_RH = round(RH);
and have the following selection of matrices: x15C_ab, x17_5C_ab, x20C_ab, x22_5C_ab, x23C_ab
so for example, "if the value for roud_atmosT is 15 to 17, than ambient_T = 'x15C_ab'
Let me know if you need any more info or further explanation/definition. Thanks for any help you can give.

채택된 답변

Orion
Orion 2014년 10월 16일
편집: Orion 2014년 10월 16일
Hi,
for what I understand, you need something like
if roud_atmosT>=15 || roud_atmosT<=17
matrix_name = sprintf('x%dC_ab',roud_atmosT);
ambient_T = eval(matrix_name);
end
and then add some else if cases for all your values.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by