How to make matlab display complete final results

You can also use the "Simplify" function to simplify the answer, which may make it easier to read. In summary, the answer to R(1) is 0.6348 + 1.7128i, but it may be displayed in a long and complex form. To make it easier to read, you can use the "Pretty Print" or "Simplify" options in Matlab.
  • #1
mtxx
2
0
Here's an example

Code:
>> R(1)
 
ans =
 
-log(- 1004229921906619062839952526185507/1913851274991446601508198548841385*i - 143584884070040384103267078403784/1913851274991446601508198548841385)

i want to know the value of R(1)
R is a 3x1 matrix, and R(1) will display the result in R(1,1)
but the results is in a long form,

i need to highlight the results, right click, and click "evaluate selection"

Code:
>> -log(- 1004229921906619062839952526185507/1913851274991446601508198548841385*i - 143584884070040384103267078403784/1913851274991446601508198548841385)
 

ans =

   0.6348 + 1.7128i

why is this happening, how can i make it display the final answer 0.6348 + 1.7128i straight away?
 
Physics news on Phys.org
  • #2
This is happening because the answer is too long and complex to display in a single line. To make it display the final answer straight away, you can use the "Pretty Print" option in Matlab. This will display the answer in a more readable format.
 

What is the syntax for displaying complete final results in Matlab?

The syntax for displaying complete final results in Matlab is "disp(var)", where "var" is the variable containing the results you want to display.

Can I customize the format of the displayed results?

Yes, you can use the "format" function in Matlab to specify the display format for numerical values. For example, "format long" will display results with more decimal places.

How can I display results in a table format?

You can use the "table" function in Matlab to create a table from your results. You can also use the "fprintf" function to display results in a specific format, such as a table.

Can I display results in a separate window?

Yes, you can use the "figure" function in Matlab to create a new figure window and then use the "disp" or "fprintf" functions to display your results in that window.

What should I do if my results are too long to display in one line?

You can use the "disp" or "fprintf" functions with the "split" option to display long results in multiple lines. You can also use the "format" function to specify the number of rows or columns to display.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • General Engineering
Replies
15
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
956
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
Back
Top