From: carlos on
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
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
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
"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
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