From: Mohammad A. Mezher on 27 Apr 2010 17:00 Hi, how can i add different size of vectors in the same matrix??? e.g. x = ones(1,5); y= ones(1,6); z= ones(1,4); the required matrix: mat=[x; y; z]; I appreciate any help
From: Nathan on 27 Apr 2010 17:04 On Apr 27, 2:00 pm, "Mohammad A. Mezher" <mohabedalg...(a)yahoo.com> wrote: > Hi, > > how can i add different size of vectors in the same matrix??? > e.g. > x = ones(1,5); > y= ones(1,6); > z= ones(1,4); > > the required matrix: > mat=[x; y; z]; > > I appreciate any help Use a cell array. mat = {x;y;z} %%%%%%%%%%%% mat = [1x5 double] [1x6 double] [1x4 double] mat{1} %%%%%%%%%%%% ans = 1 1 1 1 1 -Nathan
|
Pages: 1 Prev: Retaining precision after subtraction Next: filtfilt function |