フィルターのクリア

Resolution of plot code errors

2 ビュー (過去 30 日間)
영석
영석 2023 年 12 月 1 日
コメント済み: Voss 2023 年 12 月 1 日
syms x;
y=1/sqrt((1-x^2)^2+(2*x)^2);
plot(x,y);
xlim([0 5]); ylim([0 4]);
I can't draw a graph. A code error appears
I need your help

採用された回答

Les Beckham
Les Beckham 2023 年 12 月 1 日
Why are you trying to do this with symbolic variables? It works using simple numeric variables.
x = linspace(-5, 5, 500);
y = 1 ./ sqrt((1-x.^2).^2 + (2*x).^2); % <<< use element-wise powers and division
plot(x, y);
% xlim([0 5])
ylim([0 4])
grid on
  2 件のコメント
영석
영석 2023 年 12 月 1 日
thank you:)
Les Beckham
Les Beckham 2023 年 12 月 1 日
You are quite welcome.

サインインしてコメントする。

その他の回答 (1 件)

Voss
Voss 2023 年 12 月 1 日
Use fplot instead of plot:
syms x;
y=1/sqrt((1-x^2)^2+(2*x)^2);
fplot(x,y);
xlim([0 5]); ylim([0 4]);
  2 件のコメント
영석
영석 2023 年 12 月 1 日
That's what I wanted. thank you:)
Voss
Voss 2023 年 12 月 1 日
You're welcome! If this answer helped, please vote for and/or Accept it. Thanks!

サインインしてコメントする。

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by