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

2 vues (au cours des 30 derniers jours)
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?

Réponses (1)

KSSV
KSSV le 24 Jan 2022
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 commentaires
KSSV
KSSV le 25 Jan 2022
My intention was to show that, both the plots are in the figure. What exactly you are expecting?
Mehdi
Mehdi le 25 Jan 2022
To show a realistic view of my results in different pespectives.

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by