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 :

incrémenter à l'aide d'un bouton


Sujet :

Interfaces Graphiques

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Candidat au Club
    Inscrit en
    Février 2009
    Messages
    3
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 3
    Par défaut incrémenter à l'aide d'un bouton
    Bonjour tout le monde,
    Je débute sur Matlab.
    J'ai réussi à faire ma boite grâce à l'outil GUI :



    mais j'arrive pas à comprendre comment je dois modifier le programme (ci-dessous) pour pouvoir incrémenter mon "0" lorsque je clique sur "X+".

    Merci pour votre aide ;-)

    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
    function varargout = untitled1(varargin)
    % UNTITLED1 M-file for untitled1.fig
    %      UNTITLED1, by itself, creates a new UNTITLED1 or raises the existing
    %      singleton*.
    %
    %      H = UNTITLED1 returns the handle to a new UNTITLED1 or the handle to
    %      the existing singleton*.
    %
    %      UNTITLED1('CALLBACK',hObject,eventData,handles,...) calls the local
    %      function named CALLBACK in UNTITLED1.M with the given input arguments.
    %
    %      UNTITLED1('Property','Value',...) creates a new UNTITLED1 or raises the
    %      existing singleton*.  Starting from the left, property value pairs are
    %      applied to the GUI before untitled1_OpeningFunction gets called.  An
    %      unrecognized property name or invalid value makes property application
    %      stop.  All inputs are passed to untitled1_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
     
    % Copyright 2002-2003 The MathWorks, Inc.
     
    % Edit the above text to modify the response to help untitled1
     
    % Last Modified by GUIDE v2.5 25-Feb-2009 17:01:43
     
    % Begin initialization code - DO NOT EDIT
    gui_Singleton = 1;
    gui_State = struct('gui_Name',       mfilename, ...
                       'gui_Singleton',  gui_Singleton, ...
                       'gui_OpeningFcn', @untitled1_OpeningFcn, ...
                       'gui_OutputFcn',  @untitled1_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 untitled1 is made visible.
    function untitled1_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 untitled1 (see VARARGIN)
     
    % Choose default command line output for untitled1
    handles.output = hObject;
     
    % Update handles structure
    guidata(hObject, handles);
     
    % UIWAIT makes untitled1 wait for user response (see UIRESUME)
    % uiwait(handles.figure1);
     
     
    % --- Outputs from this function are returned to the command line.
    function varargout = untitled1_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;
     
     
    % --- Executes on button press in pushbutton1.
    function pushbutton1_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)

  2. #2
    Expert confirmé
    Avatar de Caro-Line
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    9 458
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 9 458
    Par défaut
    C'est quasiment l'exemple donné dans le tutoriel Développement efficace des interfaces graphiques (GUI)

  3. #3
    Candidat au Club
    Inscrit en
    Février 2009
    Messages
    3
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 3
    Par défaut
    Merci pour la réponse. A vrai dire, j'avais déjà vu ce tutoriel. c'est clair qu'à première vu c'est exactement la même chose. Mais en fait, le fichier que me génère le .fig quand je clique sur Run, il a pas la même gueule (d'un point de vu de débutant) que celui qui est dans le tutoriel.
    Sinon pour être plus clair, je suis en stage de fin d'étude d'ingénierie mécanique et j'ai mon patron qui me demander de programmer un robot avec matlab... Autant demander à un chien de miauler

Discussions similaires

  1. Réponses: 5
    Dernier message: 04/01/2011, 14h03
  2. Réponses: 6
    Dernier message: 17/12/2010, 08h56
  3. [C#] insertion tableau à l'aide d'un bouton
    Par liliprog dans le forum ASP.NET
    Réponses: 2
    Dernier message: 17/06/2005, 09h33
  4. [VB.NET] Naviguer dans un DATAGRID a l'aide de 2 boutons
    Par stephane93fr dans le forum Windows
    Réponses: 3
    Dernier message: 13/06/2005, 12h39
  5. ouvrir word a l'aide d'un bouton
    Par Loule dans le forum MFC
    Réponses: 12
    Dernier message: 19/02/2004, 14h55

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