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
| function pertes_Callback(hObject, eventdata, handles)
% hObject handle to pertes (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
switch a
case 'homme'
coef=[0.003 0.003 0.0035 0.004 0.0055 0.007 0.0115 0.016 0.018 0.022];%%%ce sont les coefficients
pertes=coef.*(b-18)^2;
p=polyfit(freq,pertes,4);
f=polyval(p,freq);
plot(freq,pertes,'o') ; title (' Approximation des pertes auditives chez l homme ');
xlabel (' frequence(KHz) ') ;ylabel ('pertes auditives (dB) ') ;hold on;plot(freq,f), grid on;
case 'femme'
coef=[0.003 0.003 0.0035 0.004 0.005 0.006 0.0075 0.009 0.012 0.015];
pertes=coef.*(b-18)^2;
p=polyfit(freq,pertes,6);
f=polyval(p,freq);
plot(freq,pertes,'o'); title (' Approximation des pertes auditives chez la femme');
xlabel (' frequence(KHz) '),ylabel ('pertes auditives (dB) ' ) ;hold on;plot(freq,f), grid on ;
end
guidata(hObject,handles); |
Partager