Resolution of plot code errors
2 ビュー (過去 30 日間)
古いコメントを表示
syms x;
y=1/sqrt((1-x^2)^2+(2*x)^2);
plot(x,y);
xlim([0 5]); ylim([0 4]);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1557939/image.png)
I can't draw a graph. A code error appears
I need your help
0 件のコメント
採用された回答
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
参考
カテゴリ
Help Center および File Exchange で Number Theory についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!