How do you create a plot of a function using fplot?
Show older comments
f(t)=@(t) 5*t.^2;
fplot(f(t))
why is this wrong?
Answers (2)
Maybe you want ezplot instead of fplot. Your anonymous function definition syntax is wrong as well.
Try this:
f = @(t) 5*t.^2;
ezplot(f)
grid on
f = @(t)5*t.^2;
fplot(f)
2 Comments
Dyuman Joshi
on 20 Dec 2022
Edited: Dyuman Joshi
on 20 Dec 2022
Thanks for pointing out. I looked into the documentation of fplot function which is a part of symbolic math toolbox.
Voss
on 20 Dec 2022
Ahh. Makes sense.
Categories
Find more on Symbolic Math Toolbox 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!
