Is there a way to export/save a matlab 3D figure so that a 3rd party can view it with the rotation enabled without using Matlab?

Is there a way to export/save a matlab 3D figure so that a 3rd party can view it with the rotation enabled without using Matlab?

2 Comments

As a figure, probably not...it's proprietary format and the interface is all built into the MATLAB window functionality.
Best I can think of would be to export the data to create the figure in some form the user can do...
There are some Toolboxen for compiled apps for distribution and some runtime components available...if this is a real need, probably ought to check with TMW Sales Support and see if they have solution.

Sign in to comment.

Answers (2)

You can use the Application Compiler in MATLAB to build a standalone application, which ensures that the 3rd party (who doesn’t have MATLAB) can also view the 3D Figure. But in your case the 3rd party has to install MATLAB Runtime (which is packaged along with the standalone application). The link below explains on how to build a standalone application :-
Hope this helps!

9 Comments

I already tried and it shows:
nb of colors : 137
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in save_idtf (line 229)
count = fprintf(fid,str_with_colors,nfaces,npoints,nface_vertex_data_unique,strfaces, ...
Error in mesh_to_latex (line 46)
save_idtf(idtffile,points,faces,face_vertex_data);
That's odd. Neither mesh_to_latex nor save_idtf exist in the File Exchange contribution that I linked to.
There are comments in the code that some routines were based on save_idtf or mesh_to_latex, both by Alexandre Gramfort, but those are only comments.
It is too difficult to understand.
Could you please guide step bystep
Near the upper right of your command window, click on Add-Ons . In the menu that pops up, click on Get Add-Ons . A new window will come up. In the upper right corner in the area marked "Search for add-ons" type in interactive pdf and press return. The top entry that will show up will be Export figure to 3D interactige PDF by Ioannis Filippidis . Click on the title of that to get to a window about that contribution specifically. In the upper right corner, there will be a button Add from GitHub . Click on that. You might be required to sign in to your Mathworks account. You will then be shown a warning message, "By selecting OK, you acknowledge" and so on. Click OK. A few seconds later it will finish installing.
After that you can plot something, and then give the command
fig2u3d
... I am detecting some problems with it in practice however.
Dear Dr. Walter Roberson, thank you for your detailed explanation.
I could completely follow your steps and got it installed! Could you please provide a small example now, how to use fig2u3d command to save figure to inteactive pdf format. Suppose I have:
[X,Y,Z] = peaks(30);
surf(X,Y,Z);
fvc = u3d_pre;
3D rotatable figure. Now now can i use fig2u3d command to save figure to inteactive pdf format?
[X,Y,Z] = peaks(30);
surf(X,Y,Z);
fig2u3d
However, the code appears to need some repairs. I have repaired the most obvious problem in my version but have reached out to Mathworks for assistance with a more subtle problem.
Dear Dr. Walter Roberson, did you succeed in fixing all problems in fig2u3d (or other similar functions)?
It's really an important aspect of file conversion. Request to mathworks team to provide inbuilt solution for ease of using Matlab.
Unfortunately I have forgotten now what problem I was encountering.

Sign in to comment.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Asked:

on 26 Jul 2019

Commented:

on 25 Dec 2020

Community Treasure Hunt

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

Start Hunting!