plotting simple one variable functions for beginner using fplot
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
bluesky
le 15 Avr 2015
Réponse apportée : Jonathan Campelli
le 15 Avr 2015
How to create a plot for a function of one variable f(x)=x^3? If I define x1 as a symbolic real variable, and define f=x1^3, why do I get the following error when plotting f(x) for values of x between -1 and 1?
Code:
>>syms x1 real
>>f=x1^3
f =
x1^3
>> fplot(f,[-1,1]) Error using fcnchk (line 106) If FUN is a MATLAB object, it must have an feval method.
Error in fplot (line 60) fun = fcnchk(fun);
0 commentaires
Réponse acceptée
Jonathan Campelli
le 15 Avr 2015
Hello bluseky,
Try "ezplot" instead:
syms x1 real
f=x1^3
ezplot(f,[-1,1])
If you require the use of "fplot", give me a shout, and I'll cook something else up,
Jonathan Campelli
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!