opening two files within a function
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hello! i need to open two files within a function, but it doesn't work. i can open one file - no problem, but when i try to open an other it says:
??? Error using ==> fgetl at 44 Invalid file identifier. Use fopen to generate a valid file identifier.
Error in ==> fileopentest at 18 zahl = str2num(fgetl(fid2));
i've tried to close the first file, i've tried to use the full path of the second file, its allways the same message i get. can anybody please help?
0 comentarios
Respuesta aceptada
Walter Roberson
el 29 de Mayo de 2013
Use the two-output form of fopen:
[fid2, message2] = fopen(....);
if fid2 < 0
disp(['open #2 failed because: ', message2])
end
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Low-Level File I/O en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!