Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I am using the element names as symbolic variables to make the answer look nice. Why will it not perform the function when my equivalence ratio is more than one?

1 回表示 (過去 30 日間)
Elizabeth Browne
Elizabeth Browne 2018 年 9 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
if phi > 1
N_rO2 = a/phi;
N_rN2 = a*3.76/phi;
N_CO2 = x/phi;
N_H2O = y/(2*phi);
N_pO2 = 0;
N_pN2 = N_rN2;
N_pfuel = (1 - (1/phi))*fuel;
end
fuel + N_rO2*O2 + N_rN2*N2
disp('<=>')
(N_CO2*CO2)+(N_H2O*H2O)+(N_pO2*O2)+(N_pN2*N2)+(N_pfuel*fuel)
Error using *
Inner matrix dimensions must agree.
Error in ReactantMolFractions (line 59)
(N_CO2*CO2)+(N_H2O*H2O)+(N_pO2*O2)+(N_pN2*N2)+(N_pfuel*fuel)
  2 件のコメント
Stephen23
Stephen23 2018 年 9 月 17 日
編集済み: Stephen23 2018 年 9 月 17 日
@Elizabeth Browne: I suspect that you need to learn about the differences between matrix operations and array operations:
If any of phi, a, x, y, etc. are non-scalar, then probably none of your * and / operations are actually doing what you think they are doing. But because your code contains no comments or explanation, this is just a guess.
Elizabeth Browne
Elizabeth Browne 2018 年 9 月 17 日
I am sure I need to learn more. I am a newbie, but I figured out which variable was not a scalar.
I appreciate the quick response though! I struggled with this for quite awhile before asking for help. Funny that as soon as I asked I figured it out.
Thank you!

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by