Error dividing polynomials in plot

1 回表示 (過去 30 日間)
Paul Robbins
Paul Robbins 2019 年 1 月 29 日
編集済み: madhan ravi 2019 年 1 月 29 日
Trying to plot from 3 to 10 but the graph shows blank. The numerator and denominator plot seperately so I think I must be telling matlab to divide in the wrong way. Here is my code:
x3 = linspace(3,10,100);
piot(x3,(2*x3+1)/((3*x3-1).^(1/3)))

採用された回答

Kevin Phung
Kevin Phung 2019 年 1 月 29 日
x3 = linspace(3,10,100);
y = (2.*x3+1)./((3.*x3-1).^(1/3));
plot(x3,y)

その他の回答 (1 件)

madhan ravi
madhan ravi 2019 年 1 月 29 日
編集済み: madhan ravi 2019 年 1 月 29 日
You just have to put ./ instead of / , it’s called element wise operation in MATLAB see https://www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html .
Remark: plot not piot.

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by