MATLAB Answers

0

more convenient way to present a result of a symbolic calculation

Asked by Eliraz Nahum on 4 Nov 2018
Latest activity Commented on by madhan ravi
on 4 Nov 2018
hello everyone,
is there a more convenient/elegant way of presenting the result? I am adding the code:
clear all
close all
clc
syms t y(t) b m k w
dsolve(diff(y,t,2)+(k/m)*y==(1/m)*cos(w*t))
I am attaching a photo in which we can see the desirable way of presentation I am interested in.
thanks!

  0 Comments

Sign in to comment.

Products


Release

R2018b

2 Answers

Answer by madhan ravi
on 4 Nov 2018
Edited by madhan ravi
on 4 Nov 2018
 Accepted Answer

Use
pretty(sol)
Or if you use live editor you can see the result like the one in your question

  5 Comments

For me they look the same but represented in a different way , in matlab you have solved it with respect to t but in Wolfram you it with respect to x , it’s just a notation

Sign in to comment.


Answer by Eliraz Nahum on 4 Nov 2018

for some reason I don't get the desired result. the result I got:
the right result (by wolfram):
any recommendations? maybe something in the syntax is wrong?

  0 Comments

Sign in to comment.