Prev: Indexing matrices
Next: I NEED HELP WITH CONVERTING A STRING TO A BOOLEAN VARIABLE!!! PLEASE HELP ME!!!!
From: Robert Wickham on 27 Jul 2010 12:58 So I am looking to create an array that is 2 dimensional for all columns except for one. So for example, Column A B C D E are 2D F is 3D with every element itself being an array So I want to create a matrix that looks like this A B C D E F* .. .. .. .. I cannot figure out how to do this without getting dimensionality issues.
From: Matt Fig on 27 Jul 2010 13:09 help cell
From: guyz Smarty on 27 Jul 2010 15:16 Though I am not an expert in MATLAB code, I would like to suggest you that you should use cell arrays to contain matrices with unequal dimensions. I will try to explain it by following example: Let us say: A = [1 2 3 4]; B = [5 6 7 8]; C = [9 10 11 12]; D = [13 14 15 16]; E = [17 18 19 20]; F = magic(3); combined_array = {A B C D E F}; In this case combined_array{1} will give matrix A, combined_array{2} will give matrix B and so on.. It means that combined_array{6} will give matrix F. I guess this would help you. "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i2n3rv$h99$1(a)fred.mathworks.com>... > help cell
From: Steven_Lord on 27 Jul 2010 15:27
"Robert Wickham" <wickh077(a)umn.edu> wrote in message news:i2n36s$3bm$1(a)fred.mathworks.com... > So I am looking to create an array that is 2 dimensional for all columns > except for one. > > So for example, > > Column A B C D E are 2D > F is 3D with every element itself being an array > > So I want to create a matrix that looks like this > A B C D E F* > > . > . > . > . > > I cannot figure out how to do this without getting dimensionality issues. An array in MATLAB MUST be rectangular (all the rows have the same number of columns, all the columns have the same number of rows, all the pages have the same number of rows and columns, etc.) Therefore there is no way to do what you want, unless you store each of your arrays inside a cell in a cell array. In that case, while the contents of the cells may be different sizes or may have different numbers of dimensions, the cell array as a whole is rectangular. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com |