Use of the Surf function and examples in Matlab

4 ビュー (過去 30 日間)
sally_wu
sally_wu 2016 年 2 月 6 日
コメント済み: Star Strider 2016 年 2 月 6 日
Does anyone can give me some good and detailed example of using the Surf function in Matlab? I want to plot a 3D view of the data. Mathworks did not provide detailed examples on how to plot the surfaces using this function. Thanks.

回答 (3 件)

the cyclist
the cyclist 2016 年 2 月 6 日
There are examples in the documentation of surf and in the MATLAB Plot Gallery.

Star Strider
Star Strider 2016 年 2 月 6 日
I found the MATLAB documentation quite thorough.
What do you want to do that the documentation does not describe? Please go into some detail as to what you want to do. Including your data (preferably as a .mat file) would help.
  2 件のコメント
sally_wu
sally_wu 2016 年 2 月 6 日
Thanks @ Star Strides!
I am trying to plot the 3D map of my data using the surf function. I have X and Y coordinates and Z value so I would like to plot Z value with the legend on the side.
My problem is I do not know how to read in my file into Matlab, take appropriate columns for X, Y, and Z and read them all, and plot the 3D surf map. I know I have to use this command: surf(X,Y,Z,C), but how? Any examples illustrating my questions would be greatly appreciated. P.S. I am very new to the Matlab.
Star Strider
Star Strider 2016 年 2 月 6 日
My pleasure.
In order to understand what you need to do, I would have to see your data. Columns of data would not work for surf unless your data turned out to be gridded already, or if not, interpolated to a form surf could use.
If you are having problems reading your data into MATLAB, upload it here so I can look at it and see how best to import it.
To upload your file here, click the ‘paperclip’ icon at the top of the Comment window, then complete both the ‘Choose file’ and ‘Attach file’ steps.

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


sally_wu
sally_wu 2016 年 2 月 6 日
I am trying to plot the 3D map of my data using the surf function. I have X and Y coordinates and Z value so I would like to plot Z value with the legend on the side.
My problem is I do not know how to read in my file into Matlab, take appropriate columns for X, Y, and Z and read them all, and plot the 3D surf map. I know I have to use this command: surf(X,Y,Z,C), but how? Any examples illustrating my questions would be greatly appreciated. P.S. I am very new to the Matlab.
  1 件のコメント
sally_wu
sally_wu 2016 年 2 月 6 日
I also looked up here, but the examples seem not enough...

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by