How to plot a trinomial graph

Im having trouble plotting a trinomial graph, for the function y = x^3. I wrote out the function and tried the plot command but it wont work really.

Réponses (1)

Are Mjaavatten
Are Mjaavatten le 22 Fév 2021
Modifié(e) : Are Mjaavatten le 22 Fév 2021

0 votes

fun = @(x) x^3;
fplot(fun,[-3,3])
Alternatively:
x = linspace(-3,3);
plot(x,x.^3); % Note the use of .^, for element by element operation as opposed to matrix operation
Please type
doc fplot
doc linspace
doc plot
for more details.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Produits

Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by