IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Interfaces Graphiques Discussion :

Interface et axe Matlab


Sujet :

Interfaces Graphiques

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 36
    Par défaut Interface et axe Matlab
    Bonjour, étant débutant sous Matlab (je l'utilise depuis 2 jours...), j'aurais besoin de votre aide.

    En fait j'aimerais pouvoir dessiner une forme principale dans axes1 (un cercle) puis pouvoir rajouter d'autres formes à l'intérieur (cercles ou polygones).

    Il faudrait aussi que je puisse garder les informations sur les différentes formes dessinées pour pouvoir les éditer par la suite.

    D'ici quelques jours j'essayerais d'envoyer un screen du résultat souhaité. Bien sûr si vous avez besoin d'informations supplémentaires je suis à votre disposition. Et soyez indulgents avec mon code qui doit être vraiment affreux...

    Merci d'avance pour vos réponses.

    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
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    function varargout = interface1(varargin)
    % INTERFACE1 M-file for interface1.fig
    %      INTERFACE1, by itself, creates a new INTERFACE1 or raises the existing
    %      singleton*.
    %
    %      H = INTERFACE1 returns the handle to a new INTERFACE1 or the handle to
    %      the existing singleton*.
    %
    %      INTERFACE1('CALLBACK',hObject,eventData,handles,...) calls the local
    %      function named CALLBACK in INTERFACE1.M with the given input arguments.
    %
    %      INTERFACE1('Property','Value',...) creates a new INTERFACE1 or raises the
    %      existing singleton*.  Starting from the left, property value pairs are
    %      applied to the GUI before interface1_OpeningFunction gets called.  An
    %      unrecognized property name or invalid value makes property application
    %      stop.  All inputs are passed to interface1_OpeningFcn via varargin.
    %
    %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
    %      instance to run (singleton)".
    %
    % See also: GUIDE, GUIDATA, GUIHANDLES
     
    % Edit the above text to modify the response to help interface1
     
    % Last Modified by GUIDE v2.5 07-Apr-2009 15:07:57
     
    % Begin initialization code - DO NOT EDIT
    gui_Singleton = 1;
    gui_State = struct('gui_Name',       mfilename, ...
                       'gui_Singleton',  gui_Singleton, ...
                       'gui_OpeningFcn', @interface1_OpeningFcn, ...
                       'gui_OutputFcn',  @interface1_OutputFcn, ...
                       'gui_LayoutFcn',  [] , ...
                       'gui_Callback',   []);
    if nargin && ischar(varargin{1})
        gui_State.gui_Callback = str2func(varargin{1});
    end
     
    if nargout
        [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
    else
        gui_mainfcn(gui_State, varargin{:});
    end
    % End initialization code - DO NOT EDIT
     
     
    % --- Executes just before interface1 is made visible.
    function interface1_OpeningFcn(hObject, eventdata, handles, varargin)
    % This function has no output args, see OutputFcn.
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % varargin   command line arguments to interface1 (see VARARGIN)
     
    % Choose default command line output for interface1
    handles.output = hObject;
     
    % Update handles structure
    guidata(hObject, handles);
     
    % UIWAIT makes interface1 wait for user response (see UIRESUME)
    % uiwait(handles.figure1);
     
     
    % --- Outputs from this function are returned to the command line.
    function varargout = interface1_OutputFcn(hObject, eventdata, handles) 
    % varargout  cell array for returning output args (see VARARGOUT);
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Get default command line output from handles structure
    varargout{1} = handles.output;
     
     
     
    function txtIndRef_Callback(hObject, eventdata, handles)
    % hObject    handle to txtIndRef (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtIndRef as text
    %        str2double(get(hObject,'String')) returns contents of txtIndRef as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtIndRef_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtIndRef (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function txtFactCroi_Callback(hObject, eventdata, handles)
    % hObject    handle to txtFactCroi (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtFactCroi as text
    %        str2double(get(hObject,'String')) returns contents of txtFactCroi as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtFactCroi_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtFactCroi (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function txtNbDetec_Callback(hObject, eventdata, handles)
    % hObject    handle to txtNbDetec (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtNbDetec as text
    %        str2double(get(hObject,'String')) returns contents of txtNbDetec as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtNbDetec_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtNbDetec (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function txtNbSource_Callback(hObject, eventdata, handles)
    % hObject    handle to txtNbSource (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtNbSource as text
    %        str2double(get(hObject,'String')) returns contents of txtNbSource as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtNbSource_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtNbSource (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function txtInterSimul_Callback(hObject, eventdata, handles)
    % hObject    handle to txtInterSimul (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtInterSimul as text
    %        str2double(get(hObject,'String')) returns contents of txtInterSimul as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtInterSimul_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtInterSimul (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function txtResolTempo_Callback(hObject, eventdata, handles)
    % hObject    handle to txtResolTempo (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtResolTempo as text
    %        str2double(get(hObject,'String')) returns contents of txtResolTempo as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtResolTempo_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtResolTempo (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function txtAngleVue_Callback(hObject, eventdata, handles)
    % hObject    handle to txtAngleVue (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtAngleVue as text
    %        str2double(get(hObject,'String')) returns contents of txtAngleVue as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtAngleVue_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtAngleVue (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function txtPosPremDetec_Callback(hObject, eventdata, handles)
    % hObject    handle to txtPosPremDetec (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of txtPosPremDetec as text
    %        str2double(get(hObject,'String')) returns contents of txtPosPremDetec as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function txtPosPremDetec_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to txtPosPremDetec (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in btnEdit.
    function btnEdit_Callback(hObject, eventdata, handles)
    % hObject    handle to btnEdit (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in btnPoly.
    function btnPoly_Callback(hObject, eventdata, handles)
    % hObject    handle to btnPoly (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    prompt = {'Rayon = ','Theta = ','Rho = ','N = ','mua = ','mus = '};
    dlg_title = 'Polygone';
    num_lines = 1;
    def = {'','','','','',''};
    answer = inputdlg(prompt,dlg_title,num_lines,def);
     
    % --- Executes on button press in btnCercle.
    function btnCercle_Callback(hObject, eventdata, handles)
    % hObject    handle to btnCercle (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    prompt = {'Rayon = ','Theta = ','Rho = ','mua = ','mus = '};
    dlg_title = 'Cercle';
    num_lines = 1;
    def = {'','','','',''};
    answer = inputdlg(prompt,dlg_title,num_lines,def);
     
    XCentre = 0;
    YCentre = 0;
    Rayon = str2double(answer(1));
    VThetaDeg = 0:1:360;
    VTheta = VThetaDeg *pi / 180;
    XCercle = XCentre + Rayon * cos(VTheta);
    YCercle = YCentre + Rayon * sin(VTheta);
    plot(XCercle, YCercle)
     
     
    % --- Executes on button press in btnOk.
    function btnOk_Callback(hObject, eventdata, handles)
    % hObject    handle to btnOk (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    indRef = get(handles.txtIndRef,'String');
    factCroi = get(handles.txtFactCroi,'String');
    nbDetec = get(handles.txtNbDetec,'String');
    nbSource = get(handles.txtNbSource,'String');
    interSimul = get(handles.txtInterSimul,'String');
    resolTempo = get(handles.txtResolTempo,'String');
    angleVue = get(handles.txtAngleVue,'String');
    posPremDetec = get(handles.txtPosPremDetec,'String');
    infos = ['Indice de réfraction : ' indRef ', Facteur de croissance : ' factCroi ', Nombre de détecteurs : ' nbDetec ', Nombre de sources : ' nbSource ', Intervalle de simulation : ' interSimul ', Résolution temporelle : ' resolTempo ', Angle de vue : ' angleVue ', Position du premier détecteur : ' posPremDetec];
    %msgbox(infos,'Informations entrées');
    Fichiers attachés Fichiers attachés

  2. #2
    Membre averti
    Profil pro
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    36
    Détails du profil
    Informations personnelles :
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 36
    Par défaut
    Bon ben c'est de nouveau moi.
    Après avoir lu quelques petits trucs sur le forum, j'ai décidé de recommencer mon interface mais sans les guides cette fois. Je me permet donc de mettre mon nouveau fichier en pièce jointe.

    Cette fois par contre j'aurais d'autres questions.

    Sur cette nouvelle interface, lorsque je clique sur cercle ou polygone, une nouvelle fenêtre dans laquelle on peut entrer des informations s'ouvre.

    J'aimerais savoir comment faire pour stocker ces différentes informations pour pouvoir ensuite les utilisées dans la listbox créée dans la fenêtre edit.

    Merci d'avance pour vos réponses.

    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
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
     
     function simulation
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Début de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    %Création de l'objet Figure
    handles(1) = figure('units','pixels',...
                        'menubar','none',...
                        'position',[5 500 800 600],...
                        'Color', get(0,'defaultuicontrolbackgroundcolor'),...
                        'name','Interface principale',...
                        'tag','interface');
     
    %Création de l'objet axe
    handles(2) = axes(  'parent',handles(1),...
                        'units','pixels',...
                        'position',[40 100 400 400]);
     
    %Création de l'objet Panel
    handles(3)= uipanel(    'parent',handles(1),...
                            'units','pixels',...
                            'position',[500 100 260 400]);
     
    %Création de l'objet Label indice de réfraction
    handles(4) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblIndRef',...
                            'HorizontalAlignment','left',...
                            'String','Indice de réfraction :',...
                            'position',[15 355 100 15]);
     
    %Création de l'objet Label facteur de croissance
    handles(5) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblFacCroi',...
                            'HorizontalAlignment','left',...
                            'String','Facteur de croissance :',...
                            'position',[15 315 150 15]);
     
    %Création de l'objet Label nombre de détecteurs
    handles(6) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblNbDet',...
                            'HorizontalAlignment','left',...
                            'String','Nombre de détecteurs :',...
                            'position',[15 275 150 15]);
     
    %Création de l'objet Label nombre de sources
    handles(7) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblNbSou',...
                            'HorizontalAlignment','left',...
                            'String','Nombre de sources :',...
                            'position',[15 235 100 15]);
     
    %Création de l'objet Label intervalle de simulation
    handles(8) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblIntSim',...
                            'HorizontalAlignment','left',...
                            'String','Intervalle de simulation :',...
                            'position',[15 195 150 15]);
     
    %Création de l'objet Label résolution temporelle
    handles(9) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblResTem',...
                            'HorizontalAlignment','left',...
                            'String','Résolution temporelle :',...
                            'position',[15 155 150 15]);
     
    %Création de l'objet Label angle de vue
    handles(10) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblAngVue',...
                            'HorizontalAlignment','left',...
                            'String','Angle de vue :',...
                            'position',[15 115 100 15]);
     
    %Création de l'objet Label position du premier détecteur
    handles(11) = uicontrol( handles(3),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblPreDet',...
                            'HorizontalAlignment','left',...
                            'String','Position du premier détecteur :',...
                            'position',[15 75 150 15]);
     
    %Création de l'objet TextBox indice de réfraction
    handles(12) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtIndRef',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 355 45 20]);
     
    %Création de l'objet TextBox facteur de croissance
    handles(13) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtFacCroi',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 315 45 20]);
     
    %Création de l'objet TextBox nombre de détecteurs
    handles(14) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtNbDet',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 275 45 20]);
     
    %Création de l'objet TextBox nombre de sources
    handles(15) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtNbSou',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 235 45 20]);
     
    %Création de l'objet TextBox intervalle de simulation
    handles(16) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtIntSim',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 195 45 20]);
     
    %Création de l'objet TextBox résolution temporelle
    handles(17) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtResTem',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 155 45 20]);
     
    %Création de l'objet TextBox angle de vue
    handles(18) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtAngVue',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 115 45 20]);
     
    %Création de l'objet TextBox position du premier détecteur
    handles(19) = uicontrol( handles(3),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtPreDet',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[195 75 45 20]);
     
    %Création de l'objet Bouton quitter
    handles(20) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnQuit',...
                            'String','Quitter',...
                            'callback',@fermer,...
                            'position',[690 20 70 25]);
     
    %Création de l'objet Bouton Cercle
    handles(21) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnCercle',...
                            'String','Cercle',...
                            'callback',@circle,...
                            'position',[500 55 70 25]);
     
    %Création de l'objet Bouton Polygone
    handles(22) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnPolygone',...
                            'String','Polygone',...
                            'callback',@poly,...
                            'position',[595 55 70 25]);
     
    %Création de l'objet Bouton Edit
    handles(23) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnEdit',...
                            'String','Edit',...
                            'callback',@edition,...
                            'position',[690 55 70 25]);
     
    %Création de l'objet Bouton Ok
    handles(24) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnOk',...
                            'String','Ok',...
                            'callback',@fermer,...
                            'position',[595 20 70 25]);
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Fin de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % Début de créations de fonctions %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        function fermer(obj,event)
            close all;
        end
     
        function circle(obj,event)
            cercle();   % Appel de la form Cercle
        end
     
        function edition(obj,event)
            edit();     % Appel de la form Edition
        end
     
        function poly(obj,event)
            polygone(); % Appel de la form Polygone
        end
     
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % Fin de créations de fonctions %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    end % Fin fonction principale
    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
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
     
     function cercle (varargin)
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Début de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    %Création de l'objet Figure
    handles(1) = figure('units','pixels',...
                        'menubar','none',...
                        'position',[200 500 260 130],...
                        'Color', get(0,'defaultuicontrolbackgroundcolor'),...
                        'name','Cercle',...
                        'tag','cercle');
     
    %Création de l'objet Label rho
    handles(2) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblRho',...
                            'HorizontalAlignment','right',...
                            'String','rho =',...
                            'position',[8 91 40 15]);
     
    %Création de l'objet Label theta
    handles(3) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblTheta',...
                            'HorizontalAlignment','right',...
                            'String','theta =',...
                            'position',[91 91 40 15]);
     
    %Création de l'objet Label R
    handles(4) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblR',...
                            'HorizontalAlignment','right',...
                            'String','R =',...
                            'position',[155 91 40 15]);
     
    %Création de l'objet Label mua
    handles(5) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblMua',...
                            'HorizontalAlignment','right',...
                            'String','mua =',...
                            'position',[10 61 40 15]);
     
    %Création de l'objet Label mus
    handles(6) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblMus',...
                            'HorizontalAlignment','right',...
                            'String','mus =',...
                            'position',[125 61 40 15]);
     
    %Création de l'objet TextBox rho
    handles(7) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtRho',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[53 90 40 20]);
     
    %Création de l'objet TextBox theta
    handles(8) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtTheta',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[136 90 40 20]);
     
    %Création de l'objet TextBox R
    handles(9) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtR',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[200 90 40 20]);
     
    %Création de l'objet TextBox mua
    handles(10) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtMua',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[55 60 70 20]);
     
    %Création de l'objet TextBox mus
    handles(11) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtMus',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[170 60 70 20]);
     
    %Création de l'objet Bouton ok
    handles(12) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnOk',...
                            'String','Ok',...
                            'callback',@fermer,...
                            'position',[50 20 70 25]);
     
    %Création de l'objet Bouton fermer
    handles(13) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnFermer',...
                            'String','Fermer',...
                            'callback',@fermer,...
                            'position',[140 20 70 25]);
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Fin de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % Début de créations de fonctions %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        function fermer(obj,event)
            close;
        end % Fin fonction fermer
     
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % Fin de créations de fonctions %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    end % Fin fonction principale
    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
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
     
     function edit (varargin)
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Début de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    %Création de l'objet Figure
    handles(1) = figure('units','pixels',...
                        'menubar','none',...
                        'position',[200 500 300 400],...
                        'Color', get(0,'defaultuicontrolbackgroundcolor'),...
                        'name','Edition',...
                        'tag','edit');
     
    %Création de l'objet Label rho
    handles(2) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblRho',...
                            'HorizontalAlignment','left',...
                            'String','rho =',...
                            'position',[190 331 40 15]);
     
    %Création de l'objet Label theta
    handles(3) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblTheta',...
                            'HorizontalAlignment','left',...
                            'String','theta =',...
                            'position',[190 281 40 15]);
     
    %Création de l'objet Label N
    handles(4) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblN',...
                            'HorizontalAlignment','left',...
                            'String','N =',...
                            'position',[190 231 40 15]);
     
    %Création de l'objet Label R
    handles(5) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblR',...
                            'HorizontalAlignment','left',...
                            'String','R =',...
                            'position',[190 181 40 15]);
     
    %Création de l'objet Label mua
    handles(6) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblMua',...
                            'HorizontalAlignment','left',...
                            'String','mua =',...
                            'position',[190 131 40 15]);
     
    %Création de l'objet Label mus
    handles(7) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblMus',...
                            'HorizontalAlignment','left',...
                            'String','mus =',...
                            'position',[190 81 40 15]);
     
    %Création de l'objet TextBox rho
    handles(8) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtRho',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[230 330 50 20]);
     
    %Création de l'objet TextBox theta
    handles(9) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtTheta',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[230 280 50 20]);
     
     
    %Création de l'objet TextBox N
    handles(10) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtN',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[230 230 50 20]);
     
    %Création de l'objet TextBox R
    handles(11) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtR',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[230 180 50 20]);                    
    %Création de l'objet TextBox mua
    handles(12) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtMua',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[230 130 50 20]);
     
    %Création de l'objet TextBox mus
    handles(13) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtMus',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[230 80 50 20]);
     
    %Création de l'objet Bouton Effacer
    handles(14) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnEff',...
                            'String','Effacer',...
                            'callback',@suppr,...
                            'position',[20 20 70 25]);
     
    %Création de l'objet Bouton Changer
    handles(15) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnChange',...
                            'String','Changer',...
                            'callback',@test,...
                            'position',[115 20 70 25]);
     
    %Création de l'objet Bouton fermer
    handles(16) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnFermer',...
                            'String','Fermer',...
                            'callback',@fermer,...
                            'position',[210 20 70 25]);
     
    %Création de l'objet LisBox formes
    handles(17) = uicontrol(handles(1),...
                            'Style','listbox',...
                            'units','pixels',...
                            'tag','lstFormes',...
                            'String','',...
                            'callback',@affiche,...
                            'position',[20 60 130 320]);
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Fin de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % Début de créations de fonctions %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        function fermer(obj,event)
            close;
        end % Fin fonction fermer
     
        function test(obj,event)
            for m = 0:5
                str = get(handles(17),'string');
                str = cellstr(str);
                str{end+1} = m;
                set(handles(17),'string',str);
            end
        end
     
        function suppr(obj,event)
            contents = get(handles(17),'string');
            imclick= get(handles(17),'value');
            contents(imclick,: ) = [];
            set(handles(17),'string',cellstr(contents))
        end
     
        function affiche(obj,event)
            val=get(obj,'value');
            str=get(obj,'string');
            h = str{val};
            set(handles(8),'string',h);
            test = num2str(str2double(h)+5);
            set(handles(9),'string',test);
        end
     
    end % Fin fonction principale
    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
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
     
     function polygone (varargin)
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Début de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    %Création de l'objet Figure
    handles(1) = figure('units','pixels',...
                        'menubar','none',...
                        'position',[200 500 260 160],...
                        'Color', get(0,'defaultuicontrolbackgroundcolor'),...
                        'name','Polygone',...
                        'tag','polygone');
     
    %Création de l'objet Label rho
    handles(2) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblRho',...
                            'HorizontalAlignment','right',...
                            'String','rho =',...
                            'position',[8 121 40 15]);
     
    %Création de l'objet Label theta
    handles(3) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblTheta',...
                            'HorizontalAlignment','right',...
                            'String','theta =',...
                            'position',[91 121 40 15]);
     
    %Création de l'objet Label N
    handles(4) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblN',...
                            'HorizontalAlignment','right',...
                            'String','N =',...
                            'position',[155 121 40 15]);
     
    %Création de l'objet Label R
    handles(5) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblR',...
                            'HorizontalAlignment','right',...
                            'String','R =',...
                            'position',[88 91 40 15]);
     
    %Création de l'objet Label mua
    handles(6) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblMua',...
                            'HorizontalAlignment','right',...
                            'String','mua =',...
                            'position',[10 61 40 15]);
     
    %Création de l'objet Label mus
    handles(7) = uicontrol( handles(1),...
                            'Style','text',...
                            'units','pixels',...
                            'tag','lblMus',...
                            'HorizontalAlignment','right',...
                            'String','mus =',...
                            'position',[125 61 40 15]);
     
    %Création de l'objet TextBox rho
    handles(8) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtRho',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[53 120 40 20]);
     
    %Création de l'objet TextBox theta
    handles(9) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtTheta',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[136 120 40 20]);
     
     
    %Création de l'objet TextBox N
    handles(10) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtN',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[200 120 40 20]);
     
    %Création de l'objet TextBox R
    handles(11) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtR',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[133 90 40 20]);                    
    %Création de l'objet TextBox mua
    handles(12) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtMua',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[55 60 70 20]);
     
    %Création de l'objet TextBox mus
    handles(13) = uicontrol( handles(1),...
                            'Style','edit',...
                            'units','pixels',...
                            'tag','txtMus',...
                            'BackgroundColor','white',...
                            'String','',...
                            'position',[170 60 70 20]);
     
    %Création de l'objet Bouton ok
    handles(14) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnOk',...
                            'String','Ok',...
                            'callback',@fermer,...
                            'position',[50 20 70 25]);
     
    %Création de l'objet Bouton fermer
    handles(15) = uicontrol(handles(1),...
                            'Style','pushbutton',...
                            'units','pixels',...
                            'tag','btnFermer',...
                            'String','Fermer',...
                            'callback',@fermer,...
                            'position',[140 20 70 25]);
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Fin de création des objets %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % Début de créations de fonctions %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
        function fermer(obj,event)
            close;
        end % Fin fonction fermer
     
    end % Fin fonction principale
    Version de Matlab : MATLAB 7.3.0.267 (R2006b)
    Fichiers attachés Fichiers attachés

Discussions similaires

  1. [Débutant] Interface graphique sur matlab
    Par leparadis1 dans le forum Interfaces Graphiques
    Réponses: 1
    Dernier message: 07/12/2009, 07h44
  2. Convertir une interface graphique de MATLAB en Java
    Par T-MAT dans le forum Interfaces Graphiques
    Réponses: 4
    Dernier message: 19/08/2008, 08h40
  3. Interface graphique avec matlab
    Par painouch21 dans le forum Interfaces Graphiques
    Réponses: 1
    Dernier message: 11/10/2007, 16h07
  4. Réponses: 7
    Dernier message: 31/03/2007, 01h35
  5. Créer une Interface entre Delphi/Matlab
    Par Yearning dans le forum MATLAB
    Réponses: 1
    Dernier message: 29/03/2007, 09h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo