Re: [Scilab-users] Is there any way to supress th plot() output.

2013-10-21 Thread Paul BIGNIER


Hello,

Did you try to Export the graph via the File menu?

Have a good day,
Paul.


On 10/21/2013 07:24 AM, hilife5 wrote:

yes i want the plot output in file directly..I will use this plot in my vb
application,. Thanks for your response.



--
View this message in context: 
http://mailinglists.scilab.org/scilab-users-Is-there-any-way-to-supress-the-plot-command-output-tp4027647p4027656.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



--
Paul BIGNIER
Scilab Engineer & Xcos Developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Is there any way to supress th plot() output.

2013-10-21 Thread hilife5
My query has been solved. I have to save the plot through VB programming with
open the plot window 



--
View this message in context: 
http://mailinglists.scilab.org/scilab-users-Is-there-any-way-to-supress-the-plot-command-output-tp4027647p4027658.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Xcos custom block - icon path problem

2013-10-21 Thread Clément David
Hello Peter,

> 2. loading (xcos_toolbox_skeleton.start executed from SciNotes - is
> this
> correct ?) generate error message

I checked  "exec ('builder.sce'); exec ('loader.sce')" using
scilab-5.5.0-beta1 with xcos_toolbox_skeleton from Scilab 5.5.0-beta1
and Scilab 5.4.1 and everything seems to be fine.

Can you track the 'permanent variable' issue ? what's the variable ? did
you define it ?


-- 
Clément DAVID
Development Engineer / Account Manager
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Mobile: +33.6.26.26.51.90
Phone: +33.2.90.22.78.96
http://www.scilab-enterprises.com

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Xcos custom block - icon path problem

2013-10-21 Thread pf
Hello Clément,

I found that this variable (xcos_skeletonlib) is defined in XCPL toolbox
(ScicosPowerLab,  XCPL.start) that I install via Atom.

After uninstalling XCLP everything works fine. I think the return
variable of each macro *.start should have its own name (to prevent
similar conflicts) ...

Thanks for helping,
with regards
Peter



On Mon, 2013-10-21 at 09:49 +0200, Clément David wrote:
> Hello Peter,
> 
> > 2. loading (xcos_toolbox_skeleton.start executed from SciNotes - is
> > this
> > correct ?) generate error message
> 
> I checked  "exec ('builder.sce'); exec ('loader.sce')" using
> scilab-5.5.0-beta1 with xcos_toolbox_skeleton from Scilab 5.5.0-beta1
> and Scilab 5.4.1 and everything seems to be fine.
> 
> Can you track the 'permanent variable' issue ? what's the variable ? did
> you define it ?
> 
> 


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Matrix of characters conversion

2013-10-21 Thread Carrico, Paul
Dear All

 

How can I convert a matrix of characters into integers when the
separator has different number of spaces ?

 

The spaces come probably  from a printf format such as :
printf("%10d\n",var)

 

I 'm currently using csvTextScan and I've some troubles/errors  with
csvRead ...

 

Example :

! 36 12799 24678 17504 21558212801 24680
17508 21560 !

 

NB:

-  I read first an ascii file

-  I removed some specific lines directly in the matrix

-  Then I'm trying to convert the matrix of characters into a
matrix of intergers

 

Thanks for any suggestion

 

Paul

 

#

PATH_FILE = get_absolute_file_path("lecture.sce"); 
FILE_NAME = 'topology_elem.rad';
 
stacksize('max'); 
M = mopen(PATH_FILE + "/" + FILE_NAME,'r');
record = mgetl(M);
[nl,nc] = size(record);
 
nbre_elem = (nl / 3);
Nodes_char(1:nbre_elem) = record(1:3:nl);
 
// convert
Nodes = csvTextScan(Nodes_char," "); //
!
 
mclose(M)

 

 

 





Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Paul BIGNIER

Dear Paul,

How about manually editing your file to standardize the spacing between 
the numbers?


For instance, using your editor's "Find and Replace" tool to replace two 
spaces "  " with one space " " until you get only one space between each 
number?


Hope this helps,
Have a good day,
Paul.


On 10/21/2013 02:29 PM, Carrico, Paul wrote:


Dear All

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ?


The spaces come probably  from a printf format such as :
 printf("%10d\n",var)


I 'm currently using*_csvTextScan_*  and I've some troubles/errors  
with*_csvRead_*  ...

_Example_:

! 36 12799 24678 17504 21558212801 24680 
17508 21560 !


NB:

-I read first an ascii file

-I removed some specific lines directly in the matrix

-Then I'm trying to convert the matrix of characters into a matrix of 
intergers


Thanks for any suggestion

Paul

#

PATH_FILE  =  get_absolute_file_path("lecture.sce");  
FILE_NAME  =  'topology_elem.rad';
  
stacksize('max');  
M  =  mopen(PATH_FILE  +  "/"  +  FILE_NAME,'r');

record  =  mgetl(M);
[nl,nc]  =  size(record);
  
nbre_elem  =  (nl  /  3);

Nodes_char(1:nbre_elem)  =  record(1:3:nl);
  
/// convert/

Nodes  =  csvTextScan(Nodes_char,"");/// 
!/
  
mclose(M)





Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





--
Paul BIGNIER
Scilab Engineer & Xcos Developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Carrico, Paul
Dear Paul

 

Yes, you're right ...  it can be done easily under vi for example ...  but it 
remains a trick !

 

Is it out of Scilab scope to directly manage the number of spaces (as 
separator) ?

 

Paul

 

De : Paul BIGNIER [mailto:paul.bign...@scilab-enterprises.com] 
Envoyé : lundi 21 octobre 2013 14:51
À : International users mailing list for Scilab.; Carrico, Paul
Objet : Re: [Scilab-users] Matrix of characters conversion

 

Dear Paul,

How about manually editing your file to standardize the spacing between the 
numbers?

For instance, using your editor's "Find and Replace" tool to replace two spaces 
"  " with one space " " until you get only one space between each number?

Hope this helps,
Have a good day,
Paul.


On 10/21/2013 02:29 PM, Carrico, Paul wrote:

Dear All

 

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ?

 

The spaces come probably  from a printf format such as : 
printf("%10d\n",var)

 

I 'm currently using csvTextScan and I've some troubles/errors  with 
csvRead ...

 

Example :

! 36 12799 24678 17504 21558212801 24680
 17508 21560 !

 

NB:

-  I read first an ascii file

-  I removed some specific lines directly in the matrix

-  Then I'm trying to convert the matrix of characters into a 
matrix of intergers

 

Thanks for any suggestion

 

Paul

 

#

PATH_FILE = get_absolute_file_path("lecture.sce"); 
FILE_NAME = 'topology_elem.rad';
 
stacksize('max'); 
M = mopen(PATH_FILE + "/" + FILE_NAME,'r');
record = mgetl(M);
[nl,nc] = size(record);
 
nbre_elem = (nl / 3);
Nodes_char(1:nbre_elem) = record(1:3:nl);
 
// convert
Nodes = csvTextScan(Nodes_char," "); // 
!
 
mclose(M)

 

 

 



 
 
Le présent mail et ses pièces jointes sont confidentiels et destinés à 
la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail 
par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message 
de votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.
 
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error, please contact the sender 
and delete the email from your system. If you are not the named addressee you 
should not disseminate, distribute or copy this email.
 
 
 
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
 
 






-- 
Paul BIGNIER
Scilab Engineer & Xcos Developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com




Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Samuel Gougeon

Hello,

Le 21/10/2013 14:29, Carrico, Paul a écrit :


Dear All

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ?


The spaces come probably  from a printf format such as :
 printf("%10d\n",var)


I 'm currently using*_csvTextScan_*  and I've some troubles/errors  
with*_csvRead_*  ...

_Example_:

! 36 12799 24678 17504 21558212801 24680 
17508 21560 !


ligne = "36 12799 24678 17504 21558212801 
24680 17508 21560"

evstr(tokens(ligne))  // yields:

-->evstr(tokens(ligne))
 ans  =
36.
12799.
24678.
17504.
21558.
212801.
24680.
17508.
21560.

HTH
Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Adrien Vogt-Schilb
I would read the string matrix, trying to obtain a 1x1 string matrix (or 
at least a 1 column string matri, eg with csvRead)


then use *regexp *to replace several spaces by only one, i guess you 
have to replace " *" by "*" (without the quotes: replace [SPACE][STAR] 
by [SPACE])


then split the matrix where the single spaces are separtors with 
*csvTextScan*




On 21/10/2013 09:02, Carrico, Paul wrote:


Dear Paul

Yes, you're right ...  it can be done easily under vi for example ...  
but it remains a trick !


Is it out of Scilab scope to directly manage the number of spaces (as 
separator) ?


Paul

*De :*Paul BIGNIER [mailto:paul.bign...@scilab-enterprises.com]
*Envoyé :* lundi 21 octobre 2013 14:51
*À :* International users mailing list for Scilab.; Carrico, Paul
*Objet :* Re: [Scilab-users] Matrix of characters conversion

Dear Paul,

How about manually editing your file to standardize the spacing 
between the numbers?


For instance, using your editor's "Find and Replace" tool to replace 
two spaces "  " with one space " " until you get only one space 
between each number?


Hope this helps,
Have a good day,
Paul.


On 10/21/2013 02:29 PM, Carrico, Paul wrote:

Dear All

How can I convert a matrix of characters into integers when the
separator has different number of spaces ?

The spaces come probably  from a printf format such as :
 printf("%10d\n",var)

I 'm currently using*_csvTextScan_*  and I've some troubles/errors  
with*_csvRead_*  ...

_Example_:

! 36 12799 24678 17504 21558212801 24680
17508 21560 !

NB:

-I read first an ascii file

-I removed some specific lines directly in the matrix

-Then I'm trying to convert the matrix of characters into a matrix
of intergers

Thanks for any suggestion

Paul

#

PATH_FILE=  get_absolute_file_path("lecture.sce");

FILE_NAME=  'topology_elem.rad';

  


stacksize('max');

M=  mopen(PATH_FILE+  "/"  +  FILE_NAME,'r');

record=  mgetl(M);

[nl,nc]  =  size(record);

  


nbre_elem=  (nl/  3);

Nodes_char(1:nbre_elem)  =  record(1:3:nl);

  


/// convert/

Nodes=  csvTextScan(Nodes_char,"");/// 
!/

  


mclose(M)




  

  


Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

  


This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.

  

  

  


___

users mailing list

users@lists.scilab.org  

http://lists.scilab.org/mailman/listinfo/users

  

  





--
Paul BIGNIER
Scilab Engineer & Xcos Developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com



Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





--
Adrien Vogt-Schilb
PhD Student (Cired) and Consultant (The World Bank)
1 202 473 79 80

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Carrico, Paul
It works well with one line, but I do not figure out how to use it with a 
matrix without using a loop ?

 

//i = [1 : nbre_elem]';

//A = zeros(nbre_elem,9);

//A(i,:) = evstr(tokens(Nodes_char(i)))' è doesn't work

 

// works

for i = 1 : 10

A(i,:) = evstr(tokens(Nodes_char(i)))';

end

 

 

NB: I've some troubles with csvTextScan for example when the first character is 
a separator ...

 

 

 

De : users [mailto:users-boun...@lists.scilab.org] De la part de Samuel Gougeon
Envoyé : lundi 21 octobre 2013 15:21
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Matrix of characters conversion

 

Hello,

Le 21/10/2013 14:29, Carrico, Paul a écrit :

Dear All

 

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ? 



The spaces come probably  from a printf format such as : 
printf("%10d\n",var)

I 'm currently using csvTextScan and I've some troubles/errors  with 
csvRead ...

Example :

! 36 12799 24678 17504 21558212801 24680
 17508 21560 !

ligne = "36 12799 24678 17504 21558212801 24680 
17508 21560"
evstr(tokens(ligne))  // yields:

-->evstr(tokens(ligne))
 ans  = 
36.  
12799.   
24678.   
17504.   
21558.   
212801.  
24680.   
17508.   
21560.   

HTH
Samuel





Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Osvaldo Sergio Farhat de Carvalho


Hi Paul,

Suppose lines is a column vector of strings, each element being a meaningful line of your input file. Try

m = [];
[nl,nc] = lines;
for i = 1:nl
  tks = tokens(lines(i));
  intValues = (eval(tks))'; // transpose in order to get a row

  m = [m;intValues];
end

Hope it works.

Osvaldo
-"users"  escreveu: -
 
Para: "International users mailing list for Scilab." 
De: Adrien Vogt-Schilb Enviado por: "users" 
Data: 21/10/2013 11:32 AMAssunto: Re: [Scilab-users] Matrix of characters conversion

I would read the string matrix, trying to obtain a 1x1 string matrix (or at least a 1 column string matri, eg with csvRead)
then use regexp to replace several spaces by only one, i guess you have to replace " *" by "*" (without the quotes: replace [SPACE][STAR] by [SPACE])
then split the matrix where the single spaces are separtors with 
csvTextScan On 21/10/2013 09:02, Carrico, Paul wrote:



Dear Paul
 
Yes, you’re right …  it can be done easily under vi for example …  but it remains a trick !

 
Is it out of Scilab scope to directly manage the number of spaces (as separator) ?

 
Paul 


De :
 Paul BIGNIER [
mailto:paul.bign...@scilab-enterprises.com] Envoyé :
 lundi 21 octobre 2013 14:51À : International 
users mailing list for Scilab.; Carrico, PaulObjet : Re: [Scilab-users] Matrix of characters conversion
 
Dear Paul,How about manually editing your file to standardize the spacing between the numbers?
For instance, using your editor's "Find and Replace" tool to replace two spaces "  " with one space " " until you get only one space between each number?
Hope this helps,Have a good day,Paul.On 10/21/2013 02:29 PM, Carrico, Paul wrote:

Dear All
 
How can I convert a matrix of characters into integers when the separator has different number of spaces ?
 
The spaces come probably  from a printf format such as :     printf(“%10d\n”,var)
 


I ‘m currently using csvTextScan and I’ve some troubles/errors  with 
csvRead …
 
Example :
! 36 12799 24678 17504 21558    212801 24680 17508 21560 !
 
NB:
-
  
I read first an ascii file
-
  
I removed some specific lines directly in the matrix

-
  
Then I’m trying to convert the matrix of characters into a matrix of intergers
 
Thanks for any suggestion
 
Paul
 
#

PATH_FILE 
=
 
get_absolute_file_path
(
"lecture.sce"
)
; 

FILE_NAME 
=
 
'topology_elem.rad'
;

 

stacksize
(
'max'
)
; 

M 
=
 
mopen
(
PATH_FILE 
+
 
"/"
 
+
 FILE_NAME,
'r'
)
;

record 
=
 
mgetl
(
M
)
;

[
nl,nc
]
 
=
 
size
(
record
)
;

 

nbre_elem 
=
 
(
nl 
/
 
3
)
;

Nodes_char
(
1
:
nbre_elem
)
 
= record

(
1
:
3
:
nl
)
;

 

// convert
Nodes 

=
 
csvTextScan
(
Nodes_char,
" "
)
; 
// !

 


mclose
(
M
) 
 
 


 
 
Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.

 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.

 
 
 
___

users mailing list
users@lists.scilab.org


http://lists.scilab.org/mailman/listinfo/users

 
 

-- 
Paul BIGNIER
Scilab Engineer & Xcos Developer
---

Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France

Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com


Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.

___users mailing list

users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

-- Adrien Vogt-SchilbPhD Student (Cired) and Consultant (The World Bank)
1 202 473 79 80
_

Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Serge Steer

You can use evstr for that
example
M=["1 2   5.54"
"3.45 8 -123"
"0   -432.512  -0.435"]

-->evstr(M)
 ans  =

1.  2. 5.54
3.458.   - 123.
0.- 432.512  - 0.435

Serge

Le 21/10/2013 14:29, Carrico, Paul a écrit :


Dear All

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ?


The spaces come probably  from a printf format such as :
 printf("%10d\n",var)


I 'm currently using*_csvTextScan_*  and I've some troubles/errors  
with*_csvRead_*  ...

_Example_:

! 36 12799 24678 17504 21558212801 24680 
17508 21560 !


NB:

-I read first an ascii file

-I removed some specific lines directly in the matrix

-Then I'm trying to convert the matrix of characters into a matrix of 
intergers


Thanks for any suggestion

Paul

#

PATH_FILE  =  get_absolute_file_path("lecture.sce");  
FILE_NAME  =  'topology_elem.rad';
  
stacksize('max');  
M  =  mopen(PATH_FILE  +  "/"  +  FILE_NAME,'r');

record  =  mgetl(M);
[nl,nc]  =  size(record);
  
nbre_elem  =  (nl  /  3);

Nodes_char(1:nbre_elem)  =  record(1:3:nl);
  
/// convert/

Nodes  =  csvTextScan(Nodes_char,"");/// 
!/
  
mclose(M)





Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.



___
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


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Carrico, Paul
Hi Osvaldo

 

I absolutely want to avoid a loop in order to convert fast my ascii file into a 
matrix of integer ... I might be possible to use vectorization 

 

For example, my matrix has more than a 100 000 lines .

 

De : users [mailto:users-boun...@lists.scilab.org] De la part de Osvaldo Sergio 
Farhat de Carvalho
Envoyé : lundi 21 octobre 2013 16:05
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Matrix of characters conversion

 

Hi Paul,

 

Suppose lines is a column vector of strings, each element being a meaningful 
line of your input file. Try

m = [];

[nl,nc] = lines;

for i = 1:nl

  tks = tokens(lines(i));

  intValues = (eval(tks))'; // transpose in order to get a row

  m = [m;intValues];

end

 

Hope it works.

 

Osvaldo




-"users"  escreveu: - 

Para: "International users mailing list for Scilab." 
De: Adrien Vogt-Schilb 
Enviado por: "users" 
Data: 21/10/2013 11:32 AM
Assunto: Re: [Scilab-users] Matrix of characters conversion

I would read the string matrix, trying to obtain a 1x1 string matrix (or at 
least a 1 column string matri, eg with csvRead)

then use regexp to replace several spaces by only one, i guess you have to 
replace " *" by "*" (without the quotes: replace [SPACE][STAR] by [SPACE])

then split the matrix where the single spaces are separtors with csvTextScan 




On 21/10/2013 09:02, Carrico, Paul wrote:

Dear Paul

 

Yes, you're right ...  it can be done easily under vi for example ...  
but it remains a trick ! 

 

Is it out of Scilab scope to directly manage the number of spaces (as 
separator) ? 

 

Paul

  

De : Paul BIGNIER [ mailto:paul.bign...@scilab-enterprises.com 
 ] 
Envoyé : lundi 21 octobre 2013 14:51
À : International users mailing list for Scilab.; Carrico, Paul
Objet : Re: [Scilab-users] Matrix of characters conversion 

 

Dear Paul,

How about manually editing your file to standardize the spacing between 
the numbers?

For instance, using your editor's "Find and Replace" tool to replace 
two spaces "  " with one space " " until you get only one space between each 
number?

Hope this helps,
Have a good day,
Paul.


On 10/21/2013 02:29 PM, Carrico, Paul wrote: 

Dear All

 

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ? 

  

The spaces come probably  from a printf format such as : 
printf("%10d\n",var) 

  

I 'm currently using csvTextScan and I've some troubles/errors  
with csvRead ...

 

Example :

! 36 12799 24678 17504 21558212801 
24680 17508 21560 ! 

  

NB:

-I read 
first an ascii file

-I removed 
some specific lines directly in the matrix

-Then I'm 
trying to convert the matrix of characters into a matrix of intergers 

  

Thanks for any suggestion 

  

Paul

 

#

PATH_FILE =   get_absolute_file_path ( "lecture.sce" ) ; 

FILE_NAME =   'topology_elem.rad' ;

 

stacksize ( 'max' ) ; 

M =   mopen ( PATH_FILE +   "/"   +  FILE_NAME, 'r' ) ;

record =   mgetl ( M ) ;

[ nl,nc ]   =   size ( record ) ;

 

nbre_elem =   ( nl /   3 ) ;

Nodes_char ( 1 : nbre_elem )   = record ( 1 : 3 : nl ) ;

 

// convert

Nodes =   csvTextScan ( Nodes_char, " " ) ; // 
! 

  

mclose ( M )

  

  

 



 

 

 

Le présent mail et ses pièces jointes sont confidentiels et 
destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu 
cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer 
le message de votre système. Toute divulgation, copie ou distribution de cet 
e-mail est strictement interdite. 

 

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error, please contact the sen

Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Carrico, Paul
Thanks

 

It works for small matrix ... but troubles with huge ones  L

 

De : users [mailto:users-boun...@lists.scilab.org] De la part de Serge Steer
Envoyé : lundi 21 octobre 2013 16:20
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Matrix of characters conversion

 

You can use evstr for that
example
M=["1 2   5.54"
"3.45 8 -123"
"0   -432.512  -0.435"]

-->evstr(M)
 ans  =
 
1.  2. 5.54   
3.458.   - 123.   
0.- 432.512  - 0.435  
 
Serge

Le 21/10/2013 14:29, Carrico, Paul a écrit :

Dear All

 

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ?

 

The spaces come probably  from a printf format such as : 
printf("%10d\n",var)

 

I 'm currently using csvTextScan and I've some troubles/errors  with 
csvRead ...

 

Example :

! 36 12799 24678 17504 21558212801 24680
 17508 21560 !

 

NB:

-  I read first an ascii file

-  I removed some specific lines directly in the matrix

-  Then I'm trying to convert the matrix of characters into a 
matrix of intergers

 

Thanks for any suggestion

 

Paul

 

#

PATH_FILE = get_absolute_file_path("lecture.sce"); 
FILE_NAME = 'topology_elem.rad';
 
stacksize('max'); 
M = mopen(PATH_FILE + "/" + FILE_NAME,'r');
record = mgetl(M);
[nl,nc] = size(record);
 
nbre_elem = (nl / 3);
Nodes_char(1:nbre_elem) = record(1:3:nl);
 
// convert
Nodes = csvTextScan(Nodes_char," "); // 
!
 
mclose(M)

 

 

 



 
 
Le présent mail et ses pièces jointes sont confidentiels et destinés à 
la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail 
par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message 
de votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.
 
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error, please contact the sender 
and delete the email from your system. If you are not the named addressee you 
should not disseminate, distribute or copy this email.
 
 
 
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
 
 

 





Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Carrico, Paul
Erreur de l'API :

dans getAllocatedSingleString : Type erroné de l'argument 
d'entrée n°1 : Une seule chaîne de caractères attendue.

 

toto = fscanfMat(Nodes_char)

 !--error 999 

fscanfMat : Erreur d'allocation mémoire.

 

De : users [mailto:users-boun...@lists.scilab.org] De la part de Adrien 
Vogt-Schilb
Envoyé : lundi 21 octobre 2013 16:43
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Matrix of characters conversion

 

Did you try fscanfMat? It could work 


On 21/10/2013 10:30, Carrico, Paul wrote:

Thanks

 

It works for small matrix ... but troubles with huge ones  L

 

De : users [mailto:users-boun...@lists.scilab.org] De la part de Serge 
Steer
Envoyé : lundi 21 octobre 2013 16:20
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Matrix of characters conversion

 

You can use evstr for that
example
M=["1 2   5.54"
"3.45 8 -123"
"0   -432.512  -0.435"]

-->evstr(M)
 ans  =
 
1.  2. 5.54   
3.458.   - 123.   
0.- 432.512  - 0.435  
 
Serge

Le 21/10/2013 14:29, Carrico, Paul a écrit :

Dear All

 

How can I convert a matrix of characters into integers when the 
separator has different number of spaces ?

 

The spaces come probably  from a printf format such as : 
printf("%10d\n",var)

 

I 'm currently using csvTextScan and I've some troubles/errors  
with csvRead ...

 

Example :

! 36 12799 24678 17504 21558212801 
24680 17508 21560 !

 

NB:

-  I read first an ascii file

-  I removed some specific lines directly in the matrix

-  Then I'm trying to convert the matrix of characters 
into a matrix of intergers

 

Thanks for any suggestion

 

Paul

 

#

PATH_FILE = get_absolute_file_path("lecture.sce"); 
FILE_NAME = 'topology_elem.rad';
 
stacksize('max'); 
M = mopen(PATH_FILE + "/" + FILE_NAME,'r');
record = mgetl(M);
[nl,nc] = size(record);
 
nbre_elem = (nl / 3);
Nodes_char(1:nbre_elem) = record(1:3:nl);
 
// convert
Nodes = csvTextScan(Nodes_char," "); // 
!
 
mclose(M)

 

 

 



 
 
Le présent mail et ses pièces jointes sont confidentiels et 
destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu 
cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer 
le message de votre système. Toute divulgation, copie ou distribution de cet 
e-mail est strictement interdite.
 
This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error, please contact the sender 
and delete the email from your system. If you are not the named addressee you 
should not disseminate, distribute or copy this email.
 
 
 
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
 
 

 



 
 
Le présent mail et ses pièces jointes sont confidentiels et destinés à 
la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail 
par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message 
de votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.
 
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error, please contact the sender 
and delete the email from your system. If you are not

Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Adrien Vogt-Schilb

Did you try fscanfMat? It could work


On 21/10/2013 10:30, Carrico, Paul wrote:


Thanks

It works for small matrix ... but troubles with huge ones  L

*De :*users [mailto:users-boun...@lists.scilab.org] *De la part de* 
Serge Steer

*Envoyé :* lundi 21 octobre 2013 16:20
*À :* International users mailing list for Scilab.
*Objet :* Re: [Scilab-users] Matrix of characters conversion

You can use evstr for that
example
M=["1 2   5.54"
"3.45 8 -123"
"0   -432.512  -0.435"]

-->evstr(M)
 ans  =

1.  2. 5.54
3.458.   - 123.
0.- 432.512  - 0.435

Serge

Le 21/10/2013 14:29, Carrico, Paul a écrit :

Dear All

How can I convert a matrix of characters into integers when the
separator has different number of spaces ?

The spaces come probably  from a printf format such as :
 printf("%10d\n",var)

I 'm currently using*_csvTextScan_*  and I've some troubles/errors  
with*_csvRead_*  ...

_Example_:

! 36 12799 24678 17504 21558212801 24680
17508 21560 !

NB:

-I read first an ascii file

-I removed some specific lines directly in the matrix

-Then I'm trying to convert the matrix of characters into a matrix
of intergers

Thanks for any suggestion

Paul

#

PATH_FILE=  get_absolute_file_path("lecture.sce");

FILE_NAME=  'topology_elem.rad';

  


stacksize('max');

M=  mopen(PATH_FILE+  "/"  +  FILE_NAME,'r');

record=  mgetl(M);

[nl,nc]  =  size(record);

  


nbre_elem=  (nl/  3);

Nodes_char(1:nbre_elem)  =  record(1:3:nl);

  


/// convert/

Nodes=  csvTextScan(Nodes_char,"");/// 
!/

  


mclose(M)




  

  


Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

  


This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.

  

  

  


___

users mailing list

users@lists.scilab.org  

http://lists.scilab.org/mailman/listinfo/users

  

  





Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par 
erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de 
votre système. Toute divulgation, copie ou distribution de cet e-mail est 
strictement interdite.

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error, please contact the sender and delete the 
email from your system. If you are not the named addressee you should not 
disseminate, distribute or copy this email.




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





--
Adrien Vogt-Schilb
PhD Student (Cired) and Consultant (The World Bank)
1 202 473 79 80

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Matrix of characters conversion

2013-10-21 Thread Samuel Gougeon

Le 21/10/2013 16:13, Carrico, Paul a écrit :


It works well with one line, but I do not figure out how to use it 
with a matrix without using a loop ?



-->M
 M  =

!36 12799 24678 17504 21558212801 24680 
17508 21560  !
!36 12799 24678 17504 21558212801 24680 
17508 21560  !


-->mputl(M,"mat.txt");

-->fscanfMat("mat.txt")
 ans  =

36.12799.24678.17504.21558.212801. 
24680.17508.21560.
36.12799.24678.17504.21558.212801. 
24680.17508.21560.


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users