plotting function over interval
Show older comments
a=62; b=95;
v = linspace(-pi, pi, 1000); y = @(x) (3*x.^2.*sin(a*x))/(x.^2+b); plot(y,v)
how is it possible to plot this function?
Accepted Answer
More Answers (1)
Star Strider
on 4 Mar 2017
You have to call the function in the plot statement in order to plot it.
The Code —
a=62; b=95;
v = linspace(-pi, pi, 1000);
y = @(x) (3*x.^2.*sin(a*x))./(x.^2+b);
figure(1)
subplot(1,2,1)
plot(y(v),v)
xlabel('y(v)')
ylabel('v')
subplot(1,2,2)
plot(v, y(v))
xlabel('v')
ylabel('y(v)')
The left subplot plots ‘v’ against ‘y(v)’, and the right subplot plots ‘y(v)’ against ‘v’.
The Plots —

Categories
Find more on Axes Appearance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!