From: Norman on 12 Jul 2010 03:07 hello is it possible to create a 2D string Matrix? % 2 Dimensional array of numbers a=[1 2 3; 3 4 5; 6 7 8] aa=[1.1 2.2 3.3; 4.4 5.5 6.6; 7.7 8.8 9.9] % Single dimension string array (2D not permitted) b={'aaa0'; 'bbb0'; 'ccc0'} % Illegal bb = {'aaa0', 'aaa1'; 'bbb0', 'bbb1'} % Illegal c=['20100701' 1.11 2.22; '20100702' 3.33 4.44; '20100703' 5.55 6.66; ]
From: Bruno Luong on 12 Jul 2010 03:26 "Norman " <norman.lm.fung(a)gmail.com> wrote in message <i1eeup$28q$1(a)fred.mathworks.com>... > > % Illegal > bb = {'aaa0', 'aaa1'; 'bbb0', 'bbb1'} The above works fine to me. >> bb = {'aaa0', 'aaa1'; 'bbb0', 'bbb1'} bb = 'aaa0' 'aaa1' 'bbb0' 'bbb1' Bruno
From: Jan Simon on 12 Jul 2010 06:10 Dear Norman, > hello is it possible to create a 2D string Matrix? Yes. Or No. It depends on what you mean with "string matrix". This is a 2D CHAR array; Str = ['ab'; 'cd'] This is a 2D cell string: CStr = {'ab', 'cd'; 'efg', 'hijk'}; But in Matlab "string arrays" are not defined. > % Illegal > bb = {'aaa0', 'aaa1'; 'bbb0', 'bbb1'} Is it your opinion, that this is illegal? Kind regards, Jan
|
Pages: 1 Prev: Functions output Next: Simulink - Warning: "Solvare to take a smaller step..." |