From: aashay vanarase on 18 Mar 2010 11:23 i'm trying to add string objects to a array inside a loop, the problem i am encountering is that by using the... a=[a, b] command, instead of conc the array and adding new string, it is conc all the strings.. any solutions... i know it is something silly... i just cant get it... thx
From: aashay vanarase on 18 Mar 2010 11:29 or else.. how can i create a empty string array... ie how do i say it is string array
From: Oleg Komarov on 18 Mar 2010 11:29 "aashay vanarase" <aashayv(a)gmail.com> wrote in message <hntggp$e3o$1(a)fred.mathworks.com>... > i'm trying to add string objects to a array inside a loop, > the problem i am encountering is that by using the... > a=[a, b] > command, instead of conc the array and adding new string, it is conc all the strings.. > > any solutions... > i know it is something silly... i just cant get it... > > thx Use cell arrays of strings: a = {'Hello'}; b = {'Hi'}; a = [a,b]; Oleg
From: Matt J on 18 Mar 2010 11:35 "aashay vanarase" <aashayv(a)gmail.com> wrote in message <hntggp$e3o$1(a)fred.mathworks.com>... > i'm trying to add string objects to a array inside a loop, > the problem i am encountering is that by using the... > a=[a, b] > command, instead of conc the array and adding new string, it is conc all the strings.. > > any solutions... c=cell(1,N); for i=1:N c{i}=newstring; end finalstring=[c{:}]; % Better than growing string inside loop!!!!
|
Pages: 1 Prev: How to open two .fig figures on top of each other Next: PCA- SVM |