![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/254965/image.png)
plot of a function with multiple variables
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
kavita mudan
le 15 Déc 2019
Réponse apportée : Chidvi Modala
le 18 Déc 2019
I am trying to plot a function which gives the sum of variables x and y.
clear all
syms x y
seriessum = @(n,x,y) symsum((x./y).^i,i,i,n)
while i>= 1
i = i + 1;
end
figure
fplot(seriessum)
When using fplot, it returns the error "input must be a function or functions of a single variable" and when using fplot3 it returns the the error "not enough input arguments."
0 commentaires
Réponse acceptée
Chidvi Modala
le 18 Déc 2019
seriessum = @(n,x,y) symsum((x./y).^i,i,i,n) is equivalent to
which is not a valid expression for a function which gives the sum of variables x and y. And fplot plots a function which contains single variable but the function you specified contains 3 variables. So it was throwing "input must be a function or functions of a single variable" error. fplot3 also doesn't work in this case because fplot3(funx,funy,funz) plots a parametric curve where funx, funy, funz are the functions of a single variable.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/254965/image.png)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus 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!