Error using fopen for obj file
4 次查看(过去 30 天)
显示 更早的评论
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
2 个评论
采纳的回答
Star Strider
2024-1-17
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!