フィルターのクリア

Plot surface from a stored handle (handle of a surface) in .mat file

3 ビュー (過去 30 日間)
Freddy Ordonez
Freddy Ordonez 2020 年 5 月 5 日
コメント済み: Freddy Ordonez 2020 年 5 月 5 日
Hi everyone. It's possible to plot with a handles stored in mat file. For example:
% Points for any surface
[x,y,z] = peaks(50);
% Getting handle, plotting surface and save in object.mat
handle = surf(x,y,z);
save('object.mat','handle')
Now read handle from the object.mat file:
sobf = load('object.mat');
sobf = sobf.handle;
% Any way to plot directly without extract X,Y or ZData

採用された回答

Tommy
Tommy 2020 年 5 月 5 日
How about this?
set(sobf, 'Parent', gca)
If you want to save the view, gridlines, ticks, anything else about the axes rather than the plot, you could save the axes as well:
% Points for any surface
[x,y,z] = peaks(50);
% Getting handle, plotting surface and save in object.mat
ax = axes;
handle = surf(ax, x,y,z);
save('axes.mat', 'ax')
save('object.mat','handle')
delete(gcf);
sobf = load('object.mat');
hax = load('axes.mat');
sobf = sobf.handle;
ax = hax.ax;
set(sobf, 'Parent', ax)
set(ax, 'Parent', gcf);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by