Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Problem with format rational
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
John D'Errico
il 5 Feb 2021
Please. This is NOT a new question. Your problem is that your variables are symbolic. rational format has NOTHING to do with symbolic expressions.
Risposte (0)
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!