how can we plot this function as 3d with matlab?
古いコメントを表示

how can we plot this fucntion as 3d with matlab? I tried surf and ezplot to plot function. but they didnt work. thanks for help.
採用された回答
その他の回答 (3 件)
Azzi Abdelmalek
2012 年 9 月 12 日
編集済み: Azzi Abdelmalek
2012 年 9 月 12 日
sol=[];
for k=-3:0.1:3
for m=-3:0.1:3
x=[k m];
a=x(1)^2+x(2)^2*9/4-1;
v=[1 0 3*a 0 + 3*a^2 0 a^3 ];
z=roots(v);
z=z(imag(z)==0);
n=length(z);
if n>0
xyz=[repmat(x(1:2),n,1) z];
sol=[sol;xyz];
end
end
end
plot3(sol(:,1),sol(:,2),sol(:,3))
murat can
2012 年 9 月 12 日
3 件のコメント
murat can
2012 年 9 月 12 日
Sean de Wolski
2012 年 9 月 12 日
編集済み: Sean de Wolski
2012 年 9 月 12 日
You don't need to define X,Y,Z,V as syms since they won't be syms but rather double arrays....
Removing that line, it works for me.
murat can
2012 年 9 月 12 日
murat can
2012 年 9 月 12 日
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!