Converting a 2D nxm Array into appropriate seperate 1D Arrays
Show older comments
Hi,
I seem to struggle with MATLAB alot whenever I have a single 2D array of values that I want to use. Surfacefitting (what I want to use here - e.g. fit(), sftool), ploting etc seem to all want individiual x,y,z column arrays.
Is there a simple way to convert my matrix to these forms?
Many thanks.
Accepted Answer
More Answers (1)
Titus Edelhofer
on 8 Aug 2012
Hi,
if you know the x and y values (somehow), converting the 2D matrix (which is Z I guess) to a vector would just be
z = Z(:);
If you don't have x and y you might start as well with the fitting, assuming at least that x and y are both with a constant stepsize.
Titus Titus
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!