[Scilab-users] Read matrix from text file

Frieder Nikolaisen Frieder.Nikolaisen at student.hs-rm.de
Mon Mar 20 19:13:41 CET 2017


Hi Osvaldo,

thanks. It does run well.

I have different text documents, sometimes I want to skip the header or 
not load the entire document.  I do not find a solution in the help. 
Like with mgetl, just read a few lines as the variabale A and then use B 
for the wanted Matrix.

Cheers
Frieder


Am 20.03.2017 um 18:30 schrieb Osvaldo Sergio Farhat de Carvalho:
> Hi Frieder,
>
> Try
>
> Koeffizienten_Pfad  =  uigetfile(["*.txt"],'',"Wählen Sie die Datei Koeffizienten");
>
> m = fscanfMat(Koeffizienten_Pfad)
>
> disp(B)
>
> Regards,
> Osvaldo
>
> -----"users" <users-bounces at lists.scilab.org> escreveu: -----
> Para: <users at lists.scilab.org>
> De: Frieder Nikolaisen
> Enviado por: "users"
> Data: 20/03/2017 01:37 PM
> Assunto: [Scilab-users] Read matrix from text file
>
> Hello,
>
> I do try to read a matrix of floating point numbers from a text file. 
> I want to have floating point numbers in Sciliab. (I used before mgetl 
> which return strings).
>
> I have attached the example text file and scilab file. The error it 
> says is: read: Wrong number of output argument(s): 0 expected.
>
> Thank you.
>
> Greetings
>
> Frieder
>
> My code:
>
> Koeffizienten_Pfad = uigetfile(["*.txt"],'',"Wählen Sie die Datei 
> Koeffizienten");
>
> Koeffizienten = mopen(Koeffizienten_Pfad)
>
> B = read(Koeffizienten,-1,4)
>
> disp(B)
>
> mclose('all')
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
> [anexo "Dieselmotor_v2.0.sce" removido por Osvaldo Sergio Farhat de 
> Carvalho/PROF/DCC/ICEX/UFMG]
> [anexo "Koeffizienten_DM_Matrix.txt" removido por Osvaldo Sergio 
> Farhat de Carvalho/PROF/DCC/ICEX/UFMG]
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170320/dbd4f16a/attachment.htm>


More information about the users mailing list