how do I swap both axes in the current plot
99 ビュー (過去 30 日間)
古いコメントを表示
I have symbollic function, I'm plotting that function using fplot
syms y
U = y^2/2 - (3*y)/4;
yrange = [0,1];
fplot(U,yrange)
so i want to swap both axis in the plot, which means my yrange is in y-axis and U in x-axis?
0 件のコメント
採用された回答
Les Beckham
2022 年 8 月 5 日
syms y
U = y^2/2 - (3*y)/4;
yrange = [0,1];
fp = fplot(U,yrange);
plot(fp.YData,fp.XData)
grid on
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2022 年 8 月 5 日
You have three options:
- you can solve U for y, taking caution because it will be multi-valued
- you can use hg transform group and a rotation matrix to rotate the plot
- you can use view() to change the camera angle
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!