I have an input array which looks like this;
while count < Set_data
y = input('Input initial Pressure ')
z = input('Input Temperature ')+273
x=[x y z]
count=count+1;
end
How do i substitute the said array into
Density=y/(0.287*z)
Final_Pressure=-1*Density*10000/2

댓글 수: 1

DGM
DGM 2021년 12월 27일
Maybe instead of interleaving two variables in the same vector and then trying to figure out how to work around the obstacle that created, just store them separately to begin with.

댓글을 달려면 로그인하십시오.

 채택된 답변

Voss
Voss 2021년 12월 27일

0 개 추천

x = [];
x_initial_size = numel(x);
Set_data = 3;
count = 0;
while count < Set_data
y = input('Input initial Pressure ')
z = input('Input Temperature ')+273
x=[x y z]
count=count+1;
end
y = x(x_initial_size+1:2:end);
z = x(x_initial_size+2:2:end);
Density=y./(0.287*z)
Final_Pressure=-1*Density*10000/2

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2021년 12월 27일

댓글:

2021년 12월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by