How to plot two different 3D graphics together?

Hello , I have these two graphics, representung results of a simulation and want to plot those results together, however I'm only getting two separate graphics with the function I'm working on. Any thoughts?
This is my current work and results
hold on
N = 1000;
xv = linspace(min(x), max(x), N);
yv = linspace(min(y), max(y), N);
[Xm,Ym] = ndgrid(xv, yv);
Zm = griddata(x, y, F1, Xm, Ym);
figure
surf(Xm, Ym, Zm)
shading interp
grid on
N = 7.5;
xv = linspace(min(xr), max(xr), N);
yv = linspace(min(yr), max(yr), N);
[Xr,Yr] = ndgrid(xv, yv);
Zr = griddata(xr, yr, F1r, Xr, Yr);
figure
plot3(Xr, Yr, Zr,'o','Color','g')
grid on
hold off
Thank in Advance!!

 採用された回答

Fangjun Jiang
Fangjun Jiang 2021 年 2 月 17 日

0 投票

The command "figure" creates a new figure.
Use just one of them, and run "hold on".

1 件のコメント

Eduardo Hulse
Eduardo Hulse 2021 年 2 月 17 日
It worked, thank you very much!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by