[scilab-Users] Save a matrix of string

Adrien Vogt-Schilb vogt at centre-cired.fr
Thu Aug 11 22:22:54 CEST 2011


hi

did you try write_csv(Matrice,"max.txt") ?


On 11/08/2011 16:10, boutardd wrote:
> Hi,
>
> I got some files called Full_abcde1.txt, Full_abcde2.txt,.....to read.
> The *.txt files is a matrix of double element like [1, 2,3, 4]
>
> I would like to be able to create a matrix or something similar in which the
> first column is a part of the name of the files "abcde1" and the second
> column is the 3rd row in my files (=3).
> My problem is that I do not know the format (matrix or other) to save string
> and double in the same object. So I convert double to string and get a
> matrix of string but I did not find the right function save or right syntax
> to record data into .txt file. I copy my file if someone got a solution for
> me :)
>
> Thanks in advanced
> David
>
> My file is :
>
> a=length('full_')
>
> FichTxt=uigetfile(["*.txt"],"","Fichier texte",%t)
>
> NbFiles=size(FichTxt,2)
>
> for i = 1:NbFiles
>
> temp1=fscanfMat(FichTxt(i))
> pos(i,1)=strindex(FichTxt(i), 'full_')
> pos(i,2)=strindex(FichTxt(i), '.txt')
> index(i)=part(FichTxt(i),(pos(i,1)+a):pos(i,2))
>
> Matrice(i,1)=index(i)
> Matrice(i,2)=string(temp1(1,3))
> Matrice(:,:) // Allow me to see what is int the matrix
> end
>
> //My problem start now because I do not know function to save "Matrice", I
> have tried savematfile, fprintfmat or save but nothing work or I have not
> got the right syntax.
>
> save('max.txt',Matrice)
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/Save-a-matrix-of-string-tp3246029p3246029.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.


-- 

*Adrien Vogt-Schilb*
Research Fellow
vogt at centre-cired.fr
Tel: (+33) 1 43 94 73 96
Fax: (+33) 1 43 94 73 70

CIRED

	

45 bis, Av de la Belle Gabrielle
F-94736 Nogent-sur-Marne
http://www.centre-cired.fr/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110811/da6eabcb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logocired.png
Type: image/png
Size: 4092 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20110811/da6eabcb/attachment.png>


More information about the users mailing list