Problem with num2str, complex?

Hi, im using the num2str command in this script:
for i=1:N
p=[path,'/dire.',num2str(i),'/info.out'];
fid=fopen(p);
c=textscan(fid,'%s %s %s %s %s %s %s %s %s');
fclose(fid);
(...)
end
when i=1, the file path/dire.1/info.out is loaded normally, but when i=2 i get this message ??? Error using ==> textscan Invalid file identifier. Use fopen to generate a valid file identifier.
When i display p on screen i get:
p =
/home/f302/Trabajo final/Simulaciones/Migycapt/tipo 1/out1/dire.0+1i/info.out
is the program assuming i as a complex? thanks to all!

Antworten (1)

Jos (10584)
Jos (10584) am 6 Mär. 2014

0 Stimmen

clear all
i
i = 1 ;
i
Tip : avoid using i as a iterator …

Kategorien

Mehr zu Scope Variables and Generate Names finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 6 Mär. 2014

Beantwortet:

am 6 Mär. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by