surfPlot(data,varargin)
The surf function requires a certain variable format. here is a function that allows you to plot data from a n*3 matrix using the surf function.
to be used for example with a data matrix of the form [time, position, temperature] or [position in x, position in y, concentration]
Help of the function:
surf plot from [x, y, z] data
data is in the form data = [x, y, z]; where x, y, and z are column vectors
This code works for an input dataset were x and y are like the following :
x only contains n values
y only contains m values
x contains m times all the different n values => length(x)=m*n
y contains n times all the different m values => length(y)=n*m
z contains the corresponding z value for each of those (x;y) points
=> length(z) = m*n
Example : (notice that x is either 1,2 or 3, y is 1,2,3 or 4)
data= [1 1 4.5;...
1 2 5 ;...
1 3 6;...
1 4 7;...
2 1 4.6;...
2 2 5.3;...
2 3 6.4;...
2 4 7.1;...
3 1 5;...
3 2 6;...
3 3 7;...
3 4 8];
Cite As
Ambroise (2024). surfPlot(data,varargin) (https://www.mathworks.com/matlabcentral/fileexchange/51097-surfplot-data-varargin), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: sub images
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.