From: carlos on 27 May 2010 17:43 Hello guys!! I've got my guide almost made it but I need a last help. In a edit_box I insert the next one string: [1.2 0.001 44] I'd like to turn this expression into an array in which I could mean to every single component, as follows: the first component ==> 1.2 the second one==>0.001 the third one==> 44 can you help me??? Many thanks dudes!
From: carlos on 27 May 2010 17:52 I was wrong, it's a edit_text Apologies!! "carlos " <parryonline(a)wanadoo.es> wrote in message <htmp1a$8re$1(a)fred.mathworks.com>... > Hello guys!! > > I've got my guide almost made it but I need a last help. > > In a edit_box I insert the next one string: > [1.2 0.001 44] > > I'd like to turn this expression into an array in which I could mean to every single component, as follows: > the first component ==> 1.2 > the second one==>0.001 > the third one==> 44 > > > can you help me??? > > > Many thanks dudes!
From: Walter Roberson on 27 May 2010 17:51 carlos wrote: > In a edit_box I insert the next one string: > [1.2 0.001 44] > > I'd like to turn this expression into an array in which I could mean to > every single component, as follows: the first component ==> 1.2 > the second one==>0.001 > the third one==> 44 > can you help me??? str2mat('[1.2 0.001 44]') > Many thanks dudes! Not all of us are dudes.
From: us on 27 May 2010 17:54 "carlos " <parryonline(a)wanadoo.es> wrote in message <htmp1a$8re$1(a)fred.mathworks.com>... > Hello guys!! > > I've got my guide almost made it but I need a last help. > > In a edit_box I insert the next one string: > [1.2 0.001 44] > > I'd like to turn this expression into an array in which I could mean to every single component, as follows: > the first component ==> 1.2 > the second one==>0.001 > the third one==> 44 > > > can you help me??? > > > Many thanks dudes! one of the solutions v=[1.2,0.001,44]; uh=uicontrol('position',[10,10,100,100],'style','edit','string',v,'max',2); s=get(uh,'string'); r=cellfun(@(x) sscanf(x,'%f'),cellstr(s)) %{ % r = % <- DOUBLEs 1.2 0.001 44 %} us
From: us on 27 May 2010 18:03
Walter Roberson > str2mat('[1.2 0.001 44]') in the context of this OP, walter most likely meant to say str2num('[1.2 0.001 44]') us |