Re: [Scilab-users] how to faster EVSTR?

2019-10-23 Thread Chin Luh Tan
welcome and great it works for you.


CL




 On Tue, 22 Oct 2019 19:34:17 +0800 anna78  wrote 




it works perfectly! 
many thanks! 
Anna 
 
 
 
-- 
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
 
___ 
users mailing list 
mailto:users@lists.scilab.org 
http://lists.scilab.org/mailman/listinfo/users___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] how to faster EVSTR?

2019-10-22 Thread anna78
it works perfectly!
many thanks!
Anna



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] how to faster EVSTR?

2019-10-21 Thread Chin Luh Tan
For the sub-question, it is not true that userdata can only have string data. 
It could be any datatype of Scilab (at least the common one, :))



the reason you could not set the numeric data likely due to you're trying to 
mix string and number: 

[spectrum_unit_x, string(spectrum(:,1)'),string(spectrum(:,2)')]

 

I believe your "spectrum_unit_x" is in string so you need to convert the second 
and 3rd to string to match the datatype.



1 option is that, you could save them in list:



set(gcbo,"userdata", list(spectrum_unit_x, spectrum(:,1)',spectrum(:,2)')



then you should be able to extract the data by using the index.



mydata = get(gcbo,'userdata')

mydata(2) and mydata(2) for the spectrum 1 and 2 respectively.



hope this helps.



CL





 On Mon, 21 Oct 2019 22:37:17 +0800 CRETE Denis 
 wrote 



Hello, 
For the first question: did you try 
test_number= msscanf(-1,test_str,'%f'); 
or 
test_number= strtod(test_str); 
? 
HTH 
Denis 
* 
Hi all, 
 
I have a 1 Milion entries array of STRING type (test_str array), I should 
convert to number (test_numer array). 
 
I do as follow: 
test_number=evstr(test_str) 
 
It looks like working but it takes a not acceptable time... 
 
Do you have a more clever idea? 
 
--- 
Sub-question: I have such a long string array because I get it from an 
uicontrol 'userdata' and it looks to me only string data can be set as 
'userdata'. 
Is that true or, in fact, I could simply set the user data as a number array 
(without converting it in string witn the 'string' command)? 
Now I do as follows: 
"set(gcbo,"userdata",[spectrum_unit_x, 
string(spectrum(:,1)'),string(spectrum(:,2)')])" 
 
-- 
Many thanks 
cheers 
Anna 
 
 
 
-- 
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
 
___ 
users mailing list 
mailto:users@lists.scilab.org 
http://lists.scilab.org/mailman/listinfo/users 
___ 
users mailing list 
mailto:users@lists.scilab.org 
http://lists.scilab.org/mailman/listinfo/users___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] how to faster EVSTR?

2019-10-21 Thread CRETE Denis
Hello,
For the first question: did you try 
test_number= msscanf(-1,test_str,'%f');
or 
test_number= strtod(test_str);
?
HTH
Denis
*
Hi all,

I have a 1 Milion entries array of STRING type (test_str array), I should
convert to number (test_numer array).

I do as follow:
test_number=evstr(test_str) 

It looks like working but it takes a not acceptable time...

Do you have a more clever idea?

---
Sub-question: I have such a long string array because I get it from an
uicontrol 'userdata' and it looks to me only string data can be set as
'userdata'.
Is that true or, in fact, I could simply set the user data as a number array
(without converting it in string witn the 'string' command)?
Now I do as follows:
"set(gcbo,"userdata",[spectrum_unit_x,
string(spectrum(:,1)'),string(spectrum(:,2)')])"

--
Many thanks
cheers
Anna



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] how to faster EVSTR?

2019-10-21 Thread anna78
Hi all,

I have a 1 Milion entries array of STRING type (test_str array), I should
convert to number (test_numer array).

I do as follow:
test_number=evstr(test_str) 

It looks like working but it takes a not acceptable time...

Do you have a more clever idea?

---
Sub-question: I have such a long string array because I get it from an
uicontrol 'userdata' and it looks to me only string data can be set as
'userdata'.
Is that true or, in fact, I could simply set the user data as a number array
(without converting it in string witn the 'string' command)?
Now I do as follows:
"set(gcbo,"userdata",[spectrum_unit_x,
string(spectrum(:,1)'),string(spectrum(:,2)')])"

--
Many thanks
cheers
Anna



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users