[Scilab-users] Read matrix from text file

Samuel Gougeon sgougeon at free.fr
Tue Mar 21 23:20:25 CET 2017


Le 21/03/2017 à 09:10, Frieder Nikolaisen a écrit :
>
> Thanks alot. It also works with file and read for me. But I still 
> don't know how to handle a string header: read: Wrong number of output 
> argument(s): 0 expected.
>
Do you mean: some initial rows of text?
Then you may rather use csvRead(): 
https://help.scilab.org/docs/6.0.0/en_US/csvRead.html
and its last input argument "header"


> Koeffizienten_DM=file("open",  "C:\Users\f.nikolaisen\Documents\Bachelorarbeit\Simulation\Koeffizienten_DM_Matrix.txt",  "old")
>
> E=read(Koeffizienten_DM,-1,4)
>
> disp(E)
>
> file('close',Koeffizienten_DM);
>
>
> Could I still choose the document as a user?
>

Koeffizienten_Pfad  =  uigetfile(["*.txt"],'',"Wählen Sie die Datei Koeffizienten");

Koeffizienten_DM= file("open",Koeffizienten_Pfad,  "old");

> And having there not an abselout path, but the current directory opened.
>

Koeffizienten_DM= file("open","Koeffizienten_DM_Matrix.txt",  "old");

> Sorry for this beginners questions, its really hard to get this 
> details with the Scilab help.
>

The multiple sections about files are likely the worst.


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


More information about the users mailing list