- symbolic expressions
- symbolic functions
- function handles
Error Using fplot for plotting a function
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Teoman Selcuk
il 1 Nov 2021
Commentato: Walter Roberson
il 1 Nov 2021
Without setting a xlim how would i be able to plot the function y according to its domain (-∞, 1]. I get an error whilst plotting the graph and the plot function prints the invalid params D: (-∞,∞) hencewhy I want to use the fplot function.
x = [-1.5:0.01:1.5];
y= -sqrt((1-x))+nthroot(x.^2,5);
fplot(x, y);
Error:
Error using fplot (line 149)
Invalid parameter '-0.4050...'.
0 Commenti
Risposta accettata
Walter Roberson
il 1 Nov 2021
fplot() can be used for:
fplot() cannot be used for numeric vectors. You should use plot() for numeric vectors.
1 Commento
Walter Roberson
il 1 Nov 2021
x = [-1.5:0.001:1.5];
y = -sqrt((1-x))+nthroot(x.^2,5);
mask = imag(y) ~= 0 | real(y) > 1;
y(mask) = nan;
plot(x, y);
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!