How to plot several 3D funztions (Z_n=f_n(x,y) with arbitrary intervals for each of them in one coordinate system?

1 回表示 (過去 30 日間)
I have two functions (Z1=f(x,y) and Z2=f(x,y)) want to plot in one coordinate system but with different intervals interval_Z1=[x1_min, x1_max, y1_min, y1_max] and interval_Z2=[x2_min, x2_max, y2_min, y2_max] using fsurf and hold on commands, but it seems something went wrong and Matlab could not plot them in one coordinates and only plots one of them.
What the problem is?
Totally, how to plot several 3D funztions (Z_n=f_n(x,y) with arbitrary intervals for each of them in one coordinate system?
What about to plot them by only one command in one line, instead of using several hold on command with different commands?

回答 (1 件)

KSSV
KSSV 2022 年 1 月 24 日
It is plotting both the surfaces, but they are in the same colormap and you are unable to differentiate them. Check this:
figure
syms x y
% give f1 and f4 your functions
%figure
ax1 = axes ;
fsurf(f1,[0, 0.00995, 0, 0.02]);
hold on
ax2 = axes ;
fsurf(f4,[0.01005,0.02,0,0.02]);
hold off
linkaxes([ax1,ax2])
%%Hide the top axes
ax2.Visible = 'off';
ax2.XTick = [];
ax2.YTick = [];
%%Give each one its own colormap
colormap(ax1,'hot')
colormap(ax2,'cool')
  3 件のコメント
KSSV
KSSV 2022 年 1 月 25 日
My intention was to show that, both the plots are in the figure. What exactly you are expecting?
Mehdi
Mehdi 2022 年 1 月 25 日
To show a realistic view of my results in different pespectives.

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by