Reason for line not plotting?

1 次查看(过去 30 天)
x = 1:10:100;
y = (((20*x+35000)/(70))-1)/x;
plot(x,y)
I was wondering why the above code does not plot the function, y? As soon as the x is put in the denominator the function refuses to plot.

采纳的回答

madhan ravi
madhan ravi 2018-9-9
编辑:madhan ravi 2018-9-9
Use element wise operation because as you defined x as a vector you should use dot it means each element is calculated one by one.
x = 1:10:100;
y = (((20*x+35000)/(70))-1)./x;
plot(x,y)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by