Save a matrix of string
boutardd
d_boutard2000 at yahoo.fr
Thu Aug 11 16:10:17 CEST 2011
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.
More information about the users
mailing list