Re: [Scilab-users] Converting a matrix of string into real
Le 05/03/2013 08:34, Carrico, Paul a écrit : .../... After reading a text file (mgetl), removing the comments, I've finally a matrix of string containing only numbers... what is the fastest way to convert those string into reals (I don't remember)? using "eval" function is quite slow In addition to solutions already provided, you may use*strtod()*. It is made for that. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Converting a matrix of string into real
it works fine ... thanks De : users-boun...@lists.scilab.org [mailto:users-boun...@lists.scilab.org] De la part de Adrien Vogt-Schilb Envoyé : mardi 5 mars 2013 11:10 À : International users mailing list for Scilab. Objet : Re: [Scilab-users] Converting a matrix of string into real hi my mistake the function name is csvTextScan http://help.scilab.org/docs/5.4.0/en_US/csvTextScan.html On 05/03/2013 11:06, Carrico, Paul wrote: Thanks .. but is it in an Atoms package ? I failed in finding it on the web site and the function seems not to be defined in Scilab (5.4.0) Paul De : users-boun...@lists.scilab.org [mailto:users-boun...@lists.scilab.org] De la part de A. Vogt-Schilb Envoyé : mardi 5 mars 2013 10:12 À : International users mailing list for Scilab. Objet : Re: [Scilab-users] Converting a matrix of string into real Hi csvStringtodouble Sent from my phone "Carrico, Paul" <mailto:paul.carr...@esterline.com> wrote: Dear All After reading a text file (mgetl), removing the comments, I've finally a matrix of string containing only numbers... what is the fastest way to convert those string into reals (I don't remember)? using "eval" function is quite slow Thanks Paul 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] Converting a matrix of string into real
You can use msscanf function too http://help.scilab.org/docs/5.4.0/en_US/mfscanf.html sample : //your data dataIn = string(rand(500,500)); typeof(dataIn) size(dataIn) //convert to double tic(); dataOut = matrix(msscanf(-1, dataIn, "%f"), size(dataIn)); disp("convertion time : " + string(toc())); typeof(dataOut) size(dataOut) Antoine Le 05/03/2013 11:09, Adrien Vogt-Schilb a écrit : > hi > > my mistake > > the function name is csvTextScan > > http://help.scilab.org/docs/5.4.0/en_US/csvTextScan.html > > On 05/03/2013 11:06, Carrico, Paul wrote: >> Thanks .. but is it in an Atoms package ? I failed in finding it on the web >> site and the function seems not to be defined in Scilab (5.4.0) >> >> Paul >> >> >> *De :* users-boun...@lists.scilab.org >> [mailto:users-boun...@lists.scilab.org] *De la part de* A. Vogt-Schilb >> *Envoyé :* mardi 5 mars 2013 10:12 >> *À :* International users mailing list for Scilab. >> *Objet :* Re: [Scilab-users] Converting a matrix of string into real >> >> Hi >> >> csvStringtodouble >> >> Sent from my phone >> >> "Carrico, Paul" wrote: >> >> Dear All >> >> After reading a text file (mgetl), removing the comments, I've finally a >> matrix of string containing only numbers... what is the fastest way to >> convert those string into reals (I don't remember)? >> >> using "eval" function is quite slow >> >> Thanks >> >> Paul >> >> >> >> 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 -- Antoine ELIAS Software developer --- Scilab Enterprises 143bis rue Yves Le Coz - 78000 Versailles Phone: 01.80.77.04.70 http://www.scilab-enterprises.com ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Converting a matrix of string into real
hi my mistake the function name is csvTextScan http://help.scilab.org/docs/5.4.0/en_US/csvTextScan.html On 05/03/2013 11:06, Carrico, Paul wrote: Thanks .. but is it in an Atoms package ? I failed in finding it on the web site and the function seems not to be defined in Scilab (5.4.0) Paul *De :* users-boun...@lists.scilab.org [mailto:users-boun...@lists.scilab.org] *De la part de* A. Vogt-Schilb *Envoyé :* mardi 5 mars 2013 10:12 *À :* International users mailing list for Scilab. *Objet :* Re: [Scilab-users] Converting a matrix of string into real Hi csvStringtodouble Sent from my phone "Carrico, Paul" wrote: Dear All After reading a text file (mgetl), removing the comments, I've finally a matrix of string containing only numbers... what is the fastest way to convert those string into reals (I don't remember)? using "eval" function is quite slow Thanks Paul 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] Converting a matrix of string into real
Thanks .. but is it in an Atoms package ? I failed in finding it on the web site and the function seems not to be defined in Scilab (5.4.0) Paul De : users-boun...@lists.scilab.org [mailto:users-boun...@lists.scilab.org] De la part de A. Vogt-Schilb Envoyé : mardi 5 mars 2013 10:12 À : International users mailing list for Scilab. Objet : Re: [Scilab-users] Converting a matrix of string into real Hi csvStringtodouble Sent from my phone "Carrico, Paul" wrote: Dear All After reading a text file (mgetl), removing the comments, I've finally a matrix of string containing only numbers... what is the fastest way to convert those string into reals (I don't remember)? using "eval" function is quite slow Thanks Paul 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] Converting a matrix of string into real
Hi csvStringtodouble Sent from my phone "Carrico, Paul" wrote: >Dear All > >After reading a text file (mgetl), removing the comments, I've finally a >matrix of string containing only numbers... what is the fastest way to >convert those string into reals (I don't remember)? > >using "eval" function is quite slow > >Thanks > >Paul > > > > >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
[Scilab-users] Converting a matrix of string into real
Dear All After reading a text file (mgetl), removing the comments, I've finally a matrix of string containing only numbers... what is the fastest way to convert those string into reals (I don't remember)? using "eval" function is quite slow Thanks Paul 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