Info

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

Problem with format rational

1 回表示 (過去 30 日間)
ErikJon Pérez Mardaras
ErikJon Pérez Mardaras 2021 年 2 月 5 日
閉鎖済み: John D'Errico 2021 年 2 月 5 日
I think this question is more direct, specific and right to the issue than the previous one.
The point is that I have a great script with several calls to several mini-scripts inside it. Each mini-script makes some calculations and operations.
Okay, so there is a moment in the second mini-script in which I need to use
format rational
to make some calculations, and then, I like to return to the default format by matlab (which, according to what I have read in Matlab forum, is format short) so the code could return me values with decimals. So, to do so, I write
format short
But the issue is that the following results and calculations that Matlab will give me, they are all of them in format rational, it doesn't give me results in format shor anymore.
It seems I cannot use format rational once and then get rid of it. It seems that once I use format rational, it stays forever in the code. How can ressolve that? What an I doing wrong? I even tried writing just
format
instead of format short, but still doesn`t work.
I only want to use format rational in a scpecific part of that mini-script and then go back using format short (the default one) for the rest of the code.
Thank you!
  1 件のコメント
John D'Errico
John D'Errico 2021 年 2 月 5 日
Please. This is NOT a new question. Your problem is that your variables are symbolic. rational format has NOTHING to do with symbolic expressions.

回答 (0 件)

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by