Je fais une interface MATLAB. La fenètre graphique que je crée actuellement doit présenter 2 figures avec 2 courbes. Une des figure est en echelles normale, l'autre doit etre en echelle logarithmique. Cependant, lorsque j'execute mon programme, la figure qui devrait etre en logarithme est en echelle normale.
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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
global Graph1aN; 
global Graph1Par; 
global Graph2aN; 
global Graph2Par; 
global courbe1; 
global courbe2; 
 
function graphval_OpeningFcn(hObject, eventdata, handles, varargin) 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
%   Variables globales 
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
global Graph1aN; 
global Graph1Par; 
global Graph2aN; 
global Graph2Par; 
global courbe1; 
global courbe2; 
 
% Choose default command line output for graphval 
handles.output = hObject; 
 
% Update handles structure 
guidata(hObject, handles); 
 
% This sets up the initial plot - only do when we are invisible 
% so window can get raised using graphval. 
 
cla(handles.graphsimudadn); 
set(handles.graphsimuan, 'Visible', 'on'); 
set(handles.graphsimudadn, 'Visible', 'off'); 
 
hold on 
axes(handles.graphsimuan); 
plot(Graph2aN(:,1),Graph2aN(:,2),Graph1aN(:,1),Graph1aN(:,2)); 
legend(courbe2,courbe1) 
grid on 
 
hold on 
axes(handles.graphsimudadn); 
loglog(Graph2Par(:,1),Graph2Par(:,2),Graph1Par(:,1),Graph1Par(:,2)); 
legend(courbe2,courbe1) 
grid on 
 
% UIWAIT makes graphval wait for user response (see UIRESUME) 
% uiwait(handles.figure1); 
 
 
% --- Outputs from this function are returned to the command line. 
function varargout = graphval_OutputFcn(hObject, eventdata, handles) 
 
% Get default command line output from handles structure 
varargout{1} = handles.output; 
 
 
% --- Executes during object creation, after setting all properties. 
function choixgraph_CreateFcn(hObject, eventdata, handles) 
 
if ispc 
    set(hObject,'BackgroundColor','white'); 
else 
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); 
end 
 
%s'execute lorsqu'on choisi le type de courbe dans le menu déroulant 
function choixgraph_Callback(hObject, eventdata, handles) 
 
global Graph1aN; 
global Graph1Par; 
global Graph2aN; 
global Graph2Par; 
global courbe1; 
global courbe2; 
 
%a(N) 
hold on 
axes(handles.graphsimuan); 
plot(Graph2aN(:,1),Graph2aN(:,2),Graph1aN(:,1),Graph1aN(:,2)); 
legend(courbe2,courbe1) 
grid on 
 
%dadn 
hold on 
axes(handles.graphsimudadn); 
loglog(Graph2Par(:,1),Graph2Par(:,2),Graph1Par(:,1),Graph1Par(:,2)); 
legend(courbe2,courbe1) 
grid on 
 
switch get(handles.choixgraph, 'Value') 
    case (1) 
 
        cla(handles.graphsimudadn); 
        set(handles.graphsimudadn, 'Visible', 'off'); 
 
        set(handles.graphsimuan, 'Visible', 'on'); 
        set(handles.titre, 'String', 'Taille de fissure en fonction du nombre de cycles de chargement'); 
        set(handles.ordonnee, 'String', 'Taille de fissure (mm)'); 
        set(handles.absisse, 'String', 'Nombre de cycle'); 
 
    case (2) 
 
        cla(handles.graphsimuan); 
        set(handles.graphsimuan, 'Visible', 'off'); 
 
        set(handles.graphsimudadn, 'Visible', 'on'); 
        set(handles.titre, 'String', 'Vitesse cyclique de fissuration en fonction de l''amplitude du facteur d''intensitée de contrainte') 
        set(handles.ordonnee, 'String', 'Vitesse cyclique de fissuration (m/cycle)'); 
        set(handles.absisse, 'String', 'Amplitude du facteur d''intensité de contrainte (MPa.m^{1/2})'); 
 
end