how do i plot a graph in xy?

回答 (2 件)

Chad Greene
Chad Greene 2014 年 11 月 5 日

0 投票

If you mean y equals x cubed,
1. define an x array:
x = 1:100;
2. calculate y
y = x.^3;
3. plot
plot(x,y)
James Tursa
James Tursa 2014 年 11 月 5 日

0 投票

Do you mean y = x^3? If so, first pick a range for x, then calculate y, then plot it. E.g.,
x = 0:0.1:3; % From 0 to 3 in increments of 0.1
y = x.^3; % Element-wise power uses .^
plot(x,y)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2014 年 11 月 5 日

回答済み:

2014 年 11 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by