How do I get a 3D plot (surface) from a Simulink Block (two inputs, one output)?
1 次查看(过去 30 天)
显示 更早的评论
I have a subsystem which has just two inputs and a single output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156735/image.jpeg)
I believe it's something similar to a two-variables function:
"z=f(x,y)"
which is
"Output=f(Input1,Input2)"
I'd like to get a 3D plot of the function represented by the block, a surface, something which looks like this image from the web:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156737/image.gif)
How do I get that?
Thank you
0 个评论
回答(2 个)
Swarooph
2016-10-4
You can use the surf function in a MATLAB Function block. Read through the documentation of the MATLAB Function block to see stuff you need to do to get MATLAB visualization to work in it. For e.g. the following description from the documentation: To support visualization of data, the MATLAB Function block supports calls to MATLAB functions for simulation only. See Extrinsic Functions to understand some of the limitations of this capability, and how it integrates with code analysis for this block.
0 个评论
Harsha Phadke
2016-10-4
You can export the Simulink data to base workspace and then use "surf" to plot the graph for this data. Refer the documentation on the following link for more insight into Exporting Simulink Data.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!