how to plot this

1 次查看(过去 30 天)
Solancho
Solancho 2022-11-14
x=0:1:10;
y=x^3-5^x+3;
plot(x,y)

回答(3 个)

Deepak Gupta
Deepak Gupta 2022-11-14
移动:Jan 2022-11-14
Are you trying to evaluate Y at each x?
Use this in that case: y=x.^3-5.^x+3;

Askic V
Askic V 2022-11-14
移动:Jan 2022-11-14
Use element wise operations:
.^
Element-wise power
A.^B is the matrix with elements A(i,j) to the B(i,j) power.

RAGHUNATHRAJU DASHARATHA
As per my understanding you want to plot x and y but you are unable to do that beacuse you are not using element wise operations.
I'll be demonstarting it using your code
x=0:1:10;
y=x.^3-5.^x+3;
plot(x,y)
for more information you can refer the link

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by