How to plot a trinomial graph

3 次查看(过去 30 天)
Owen Fernandez
Owen Fernandez 2021-2-22
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.

回答(1 个)

Are Mjaavatten
Are Mjaavatten 2021-2-22
编辑:Are Mjaavatten 2021-2-22
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.

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by