Nerdy
Nerdy

Reputation: 101

How to diplay MATLAB output in readable format?

I am using MATLAB for symbolic calculations.
It always give output of mathematical expressions in one line which is not very readable
for example-

  >> syms x y z  
  >> int(sin(y*cos(x)),y)  
  >> ans =   
  -cos(y*cos(x))/cos(x)

Is there any way to get a readable output like how I read in text books.

Upvotes: 0

Views: 79

Answers (1)

am304
am304

Reputation: 13876

Use pretty:

syms x y z  
s = int(sin(y*cos(x)),y);
pretty(s)

Upvotes: 2

Related Questions