Plotting symbolic equation in matlab

1 view (last 30 days)
whats wrong with this?
Here i tried to plot a sybolic equation for range x=[1,20] but it shows
How to fix it .and plotting the curve

Accepted Answer

Cris LaPierre
Cris LaPierre on 18 Apr 2021
Try creating your symbolic equation using the approach shown in the examples here.
syms eq(x)
eq(x) = (sin(sqrt(x)+5)*exp(sqrt(x)))/sqrt(x)
eq(x) = 
fplot(eq,[0 20])
  2 Comments
Md. Ashikur Rahman Any
Md. Ashikur Rahman Any on 18 Apr 2021
If i want to get all the intersecting point of x axis for a particular range like the graph below.For instance here the intersecting ponit is in range of 1 to 400.
how to get that ?
Thanks in Advance
Cris LaPierre
Cris LaPierre on 18 Apr 2021
I think you want to use vpasolve. It does not appear to be able to return all solutions at once, so you'll have to define intervals to search in. See this example.
syms x
eq = (sin(sqrt(x)+1)*exp(sqrt(x)))/sqrt(x)==0
eq = 
vpasolve(eq,x)
ans = 
70.976883688265468138734558699208
% restricting range
vpasolve(eq,x,[0 10])
ans = 
4.5864190939097721419092042333171
vpasolve(eq,x,[10 30])
ans = 
27.912046989998261521487390466387

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!