フィルターのクリア

Help with suppressing the display of 'ans' !

21 ビュー (過去 30 日間)
Roger Vegeta
Roger Vegeta 2016 年 5 月 24 日
コメント済み: Jon Bragg 2018 年 5 月 12 日
I don't want the output 'ans'. How could I fix it so that it doesn't display 'ans = 1.6929e+04'. I just want the temperatures, constants and the Enthalpy displayed. Thanks so much.
  1 件のコメント
Image Analyst
Image Analyst 2016 年 5 月 24 日
You just got rid of all the fixes I did to your post and ruined it after I had fixed it for you. Now we can't run it anymore. Read this to learn how to format your code and avoid this problem in the future. Then read my answer below.

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

採用された回答

Star Strider
Star Strider 2016 年 5 月 24 日
My guess is that you’re calling it without a semicolon after the function call.
See if this helps:
Ea = Arrhenius_Equation_Enthalpy;
You also need to specifically request an output from the function, or it will return the output to the default ‘ans’ variable.
  5 件のコメント
Star Strider
Star Strider 2016 年 5 月 24 日
My pleasure.
Jon Bragg
Jon Bragg 2018 年 5 月 12 日
Thanks Star, that fixed my problem as well

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 5 月 24 日
Put a semicolon at the end so it doesn't echo the return value, Ea, to the command window:
>> Arrhenius_Equation_Enthalpy;
  2 件のコメント
Roger Vegeta
Roger Vegeta 2016 年 5 月 24 日
nothing,
Image Analyst
Image Analyst 2016 年 5 月 24 日
I didn't say to put it at the end of the function line. I told you to put it at the end of the line where you actually call the function, just like Star told you. Notice the >> in my answer - that is the command line prompt. Accepting the output into an output variable like Star showed you is optional but probably a good idea since you go to trouble of returning it.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by