I have been trying to open files in a loop. I did this:
file='';
loc='F:\UT_timestep\';
name='time_';
gridext='.grd';
for i={'a','b','c'}
file=strcat(loc,name,i,gridext);
f=fopen(file,'rb');
...
fclose(f);
end
but it gives this error :
Error using fopen
First input must be a file name of type char, or a file identifier of type double.Error in script_UT (line 28) f=fopen(file,'rb');
I am not able to understand why this is giving error. Please help.