Bonjour, j'ai un problème pour exporter mon fichier texte.
Voici mon fichier matlab:
et mon fichier texte:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 [filename, pathname]=uigetfile('*.prc','sélectionner le fichier .prc'); if (pathname == 0); return; end; fid = fopen(fullfile(pathname,filename),'rt'); tline = fgetl(fid); mat = []; tline, while (~feof(fid)) a = strread(tline,'%s','delimiter','='); if (strcmp(a{1},'SITE')) mat = [mat a(2)]; end tline = fgetl(fid); end mat,
Je veux récupérer les chiffres dans la ligne SITE
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 fefefe ZEZEZ SITE A=3 SITE B=4 SITE C=5
Le soucis c'est quand je passe à la ligne suivante matlab me dit : tline=''
alors qu'il y a encore des lignes en dessous.... et du coup n'extrait pas les chiffres.
Partager