Sorry i kept the file in the wrong directory. It works fine now
Am 07. Juni 2020 um 11:36 Uhr schrieb "Ganesh Kini":
> Hi i was trying to run this code for the first time
>
> fid = fopen ('data.txt');
> data = "" (fid, '% f', 'HeaderLines', 5);
> period_arr = data {1};
> fclose (fid);
>
> error
> >> test
> Error using textscan
> Invalid file identifier. Use fopen to generate a valid file identifier.
>
> Error in test (line 2)
> data = "" (fid, '% f', 'HeaderLines', 5);
>
>
> Please help me
>
Did you try querying the message returned by "fopen"?
[fid, msg] = fopen ('data.txt')
What does it say?
Markus