[Scilab-users] How replace symbols and letters in a matrix

Serge Steer serge.steer at inria.fr
Thu Jan 10 23:18:00 CET 2013



----- Mail original -----
> De: "constantina" <geofyss at gmail.com>
> À: users at lists.scilab.org
> Envoyé: Jeudi 10 Janvier 2013 14:50:31
> Objet: Re: [Scilab-users] How replace symbols and letters in a matrix
> 
> Thank u so much Serge it works perfect! but i used an specific file ,
> I have
> to program an "authomatic" process, and and have some doubts , if you
> could
> help me would be awesome:
> 
> ==========================================================================
> 
> stacksize('max');
> clf;clear;
> ieee(2);
>  //
> 
> //READ DATA
> 
> exedir=pwd();
> //
> path=tk_getdir(title='Select your folder with .txt files');
> chdir(path);
> fpath=strcat(path+"/*.txt");
> flist=listfiles(fpath);
> nf=max(size(flist));
> for ii=1:nf;
>       d(1:2,ii)=strsplit(flist(ii),length(fpath)-5);
>       dflist(ii)=d(2,ii);
>     end;
> rep=x_choose(dflist,'Select your file');
> 
> In this part the program fails
> 
> *t=mgetl('rep');
> t=strsubst(strsubst(t," *" ," 0 ")," S "," 0 ")
> mputl(t,'rep')
> Data=fscanfMat('rep')
> 
You should use dflist(rep) (without quotes) because rep is the index of the selected file
fpath=dflist(rep)
t=mgetl(fpath);
t=strsubst(strsubst(t," *" ," 0 ")," S "," 0 ");
mputl(t,fpath)
Data=fscanfMat(fpath)
>  *
> 
> 
> 
> If you could help me Ill be so thankful!
> 
> Constantina
> 
> 
> 
> --
> View this message in context:
> http://mailinglists.scilab.org/How-replace-symbols-and-letters-in-a-matrix-tp4025637p4025644.html
> Sent from the Scilab users - Mailing Lists Archives mailing list
> archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
> 



More information about the users mailing list