分数関数の使い方が知りたいです.

matlabで,y = 1 / (3x^2 + 2x + 4) のような分数関数を入力し,さらにそれをグラフに表す方法を教えてください.
xの範囲をlinspaceで指定して,とりあえずy = 1 / (3*x^2 + ...)と入力してみましたが,案の定できなかったため質問しました.
よろしくお願いします.

 Accepted Answer

Takumi
Takumi on 2 Jun 2020

1 vote

行列の乗算ではなく要素単位の乗算を実行するには、.* 演算子を使用します。割り算、べき乗も同じです。
x = linspace(-2,2,100);
y = 1 ./ (3*x.^2 + 2*x + 4);
plot(x,y);

1 Comment

Kosuke Yamasaki
Kosuke Yamasaki on 2 Jun 2020
解決しました!ありがとうございます!!

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2020a

Tags

Community Treasure Hunt

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

Start Hunting!