j'ai recopié exactement ton morceau de code, et ça me renvoit bien :
Tu peux nous envoyer ton toto.txt pour voir ?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 ans = 'Julien' 'Marc' 'julie' ans = 18 25 12 ans = 32 39 29
Version imprimable
Je ne comprends pas comment ça peut fonctionner chez toi et pas chez moi
Ok maintenant ça fonctionne
J'ai pris ce fichier toto pour essayer avant de tester sur mon fichier
Je viens de tester sur mon vrai fichier et ça ne fonctionne pas alors qu'il est à peu près pareil.
Code:
1
2
3
4 fid2 = fopen('tata.txt'); C = textscan(fid2,'%s %s RBF=%f C=%f '); C{:} fclose(fid2);
Bizarrement, ça fonctionne bien...
tu lances exactement ces lignes-là ?
Peut-être une version différente de matlab, mais ça m'étonnerait que ce soit lié à ça :?Code:
1
2
3
4 fid2 = fopen('toto.txt'); C = textscan(fid2,'%s age=%f taille=%f '); C{:} fclose(fid2);
Voici le résulats
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 ans = '1:gridsel(svm' ans = 'kernel' ans = Empty matrix: 0-by-1 ans = Empty matrix: 0-by-1
C'est bon j'ai compris mon erreur je n'ai pas utiliser la bonne case.
ça marche.
MERCI d'avoir jeté un coup d'oeil
j'ai réussi avec ça :
quelle est la solution que tu as trouvée ?Code:
1
2
3
4 fid = fopen('tata.txt'); C = textscan(fid,'%f:gridsel(svm kernel rbf=%f C=%f) '); C{:} fclose(fid);
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71 >> C C = {9x1 cell} {9x1 cell} [9x1 double] [9x1 double] {9x1 cell} >> C{:} ans = '1:gridsel(svm' '2:gridsel(svm' '3:gridsel(svm' '4:gridsel(svm' '5:gridsel(svm' '6:gridsel(svm' '7:gridsel(svm' '8:gridsel(svm' '9:gridsel(svm' ans = 'kernel' 'kernel' 'kernel' 'kernel' 'kernel' 'kernel' 'kernel' 'kernel' 'kernel' ans = 8 9 8 8 8 11 12 12 10 ans = 8 8 8 8 8 8 8 8 8 ans = ')' ')' ')' ')' ')' ')' ')' ')' ')'
Si ça te convient, tant mieux :)
Moi, j'obtiens ça :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 >> fid = fopen('tata.txt'); C = textscan(fid,'%f:gridsel(svm kernel rbf=%f C=%f) '); C{:} fclose(fid); ans = 1 2 3 4 5 6 7 8 9 ans = 8 9 8 8 8 11 12 12 10 ans = 8 8 8 8 8 8 8 8 8