Bonsoir, je suis étudiant en informatique mais débutant en matlab, je suis blocké avec cette fonction , j'aurai besoin d'aide svp merci il me dit :
voiçi la fonctionError: File: modulo.m Line: 6 Column: 1 A BREAK statement appeared outside of a loop. Use RETURN instead.
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 function vec2spec(wavel, int, filename) % Error checking len = length(wavel); if (len ~= length(int)) disp('ERROR! Vector lengths must agree.') break; end % Initialize output file file = fopen([filename '.spec'], 'w'); fprintf(file, '%d', len); % Save data to file for i = 1:len, fprintf(file, '\n%e %e', wavel(i), int(i)); end fclose(file);
Partager