Why i'm getting this error
Mostrar comentarios más antiguos
for i =1:N
fx =[ 'C:\Users\SC23M048-BABARMALIKM\Downloads\Abaqus\Hierarchical composite\aax1\jjx' num2str(i) '.txt'];
fy =[ 'C:\Users\SC23M048-BABARMALIKM\Downloads\Abaqus\Hierarchical composite\aay1\jjy' num2str(i) '.txt'];
fu =[ 'C:\Users\SC23M048-BABARMALIKM\Downloads\Abaqus\Hierarchical composite\aau11\jju1' num2str(i) '.txt'];
fv =[ 'C:\Users\SC23M048-BABARMALIKM\Downloads\Abaqus\Hierarchical composite\aau21\jju2' num2str(i) '.txt'];
x = textfile(fx);
y = textfile(fy);
z1 = textfile(fu);
z2 = textfile(fv);
U1 = griddata(x,y,z1,K1,K2);
U2 = griddata(x,y,z2,K1,K2);
zz1 = U1+zz1;
zz2 = U2+zz2;
i ;
end
Error using fscanf
Invalid file identifier. Use fopen to generate a valid file identifier.
value= fscanf(fileID,'%f');
this is the error i'm getting
6 comentarios
Ayush Aniket
el 13 de Jun. de 2024
It seems the error originates in the process of opening files. Can you share the textfile function you are using?
Mohd Babar
el 13 de Jun. de 2024
Ayush Aniket
el 13 de Jun. de 2024
It's working fine on my end. Make sure that the file path (i.e. 'fx' and so) actually has the text files. You can try debugging for one of the files by just providing its path to the textfile function and see if you get the error or not.
Mohd Babar
el 13 de Jun. de 2024
Editada: Mohd Babar
el 13 de Jun. de 2024
Ganesh
el 13 de Jun. de 2024
I wonder how your files are structured.
In your question your directory is named "aax1" but you have uploaded ".txt" files with the same name. The "code final.txt" does not have any file of the format "aa.." at all.
You can send the folder structure so we could get a better idea of what you need to access.
Mohd Babar
el 14 de Jun. de 2024
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Low-Level File I/O en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!