Substituting input array into an equation.
2 次查看(过去 30 天)
显示 更早的评论
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
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
2021-12-27
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!