How do I export primitive data from MuPAD Waterman plots for use in MATLAB?

6 ビュー (過去 30 日間)
I need to extract the coordinates of the vertices of the waterman polyhedron that are generated by the MuPAD "plot::waterman" command.

採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
The ability to directly export this data is not available in MuPAD.
There is a workaround:
First create an example MuPAD file, 'run_waterman.mn'. Open MuPAD by typing 'mupad' at the MATLAB command prompt, and put the following commands in the MuPAD notebook file:
contents of "run_waterman.mn":
export::stl("C:\\TEMP\\waterman.stl", plot::Waterman(5)):
x:=plot::STL::triangles:
y := matrix(x):
Now close MuPAD and reopen it using the following command:
mu=mupad('run_waterman.mn');
Now run the statements inside of MuPAD by selecting in MuPAD: Notebook -> Evaluate All...
Finally, execute the following at the MATLAB command prompt:
y = mu.getVar('y');
z = num2cell(y);
z = cellfun(@double,z,'UniformOutput',false);
points = cell2mat(z(:));
The waterman points will be in the variable "points" in the code above. The code above works by writing a temporary STL file to a temporary directory. For non-windows platforms, you will need to change the path to the temporary directory.

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange3-D Function Plots についてさらに検索

製品


リリース

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by