Error using fopen for obj file

Hi all,
Using MATLAB to open an obj file, fopen is currently throwing up -1: Hence fgets is throwing up an error!
Top level code looks as follows:
modName = 'Slender_solar';
modIn = fullfile(ADBSat_path,'inou','obj_files',[modName,'.obj']);
Then in the import function of the code: Note fileIn is designated as ModIn
fid = fopen(fileIn,'r');
line = fgets(fid);
Any idea of what could be going wrong?
Cheers

 Respuesta aceptada

Star Strider
Star Strider el 17 de En. de 2024

1 voto

A returned value of -1 means that fopen can’t open the file.
First, run:
which fileIn
to see if MATLAB can find it. If not, provide the correct path to it in your fullfile call.

2 comentarios

Benjamin
Benjamin el 20 de En. de 2024
Thanks, solved my issue!
Star Strider
Star Strider el 20 de En. de 2024
My pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Large Files and Big Data en Centro de ayuda y File Exchange.

Productos

Versión

R2023a

Etiquetas

Preguntada:

el 17 de En. de 2024

Movida:

el 24 de En. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by