Unknown variable complex equation

7 ビュー (過去 30 日間)
Karl Zammit
Karl Zammit 2021 年 4 月 15 日
コメント済み: Star Strider 2021 年 4 月 19 日
I know all of the values of the equation shown apart from M. How do I go about finding it?
Cp = -6521
gamma = 1.4

採用された回答

Star Strider
Star Strider 2021 年 4 月 15 日
I ahve no idea what ‘Cp’ does here.
Otherwise:
gamma = 1.4;
prat = @(Me,gamma) ((1+(gamma-1)/2.*Me.^2).^(gamma/(gamma-1))) ./ (2*gamma/(gamma+1).*Me.^2 - (gamma-1)/(gamma+1));
Me = fsolve(@(Me)prat(Me,gamma), 10);
produces:
Me =
1.4832
.
  10 件のコメント
Karl Zammit
Karl Zammit 2021 年 4 月 19 日
Would oyu by any chance also know the answer to this question please ? ReadTable
Star Strider
Star Strider 2021 年 4 月 19 日
It would appear that Walter Roberson got there first. I will add an Answer if Walter’s does not do what you want.
The problem with your original code to read that file is that it did not account for every column. Consider using this textscan call instead:
dataBuffer = textscan(finputCdCl, repmat('%f',1,7), 'CollectOutput', 1, ... %Read data from file
'Delimiter', '', 'HeaderLines', 12);
I did not test that with that file, however it would likely do what you want. If it does, and if the readtable approach does not work the way you want it to, I will add this as an Answer. Also, if you want to save the columns as separate cell arrays, set 'CollectOutput' to 0. Check to be certain that the 'Delimiter' is correct, since it could be '\t'.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by