Hallo, ich möchte eine GUI erstellen mit zwei Buttons. Einen damit die Funktion gestartet wird und den anderen dafür, dass die Funktion beendet wird.
Nun komme ich nicht mehr weiter und hoffe ihr könnt mir helfen. Ich habe mit GUIDE zwei Buttons erstellt:
Code:
functionvarargout = guide(varargin) % GUIDE MATLAB code for guide.fig % GUIDE, by itself, creates a new GUIDE or raises the existing % singleton*.
%
% H = GUIDE returns the handle to a new GUIDE or the handle to % the existing singleton*.
%
% GUIDE('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GUIDE.M with the given input arguments.
%
% GUIDE('Property','Value',...) creates a new GUIDE or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before guide_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to guide_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 guide
% Last Modified by GUIDE v2.5 20-May-2019 15:48:22
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @guide_OpeningFcn, ...
'gui_OutputFcn', @guide_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
ifnargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
% --- Executes just before guide is made visible. function guide_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 guide (see VARARGIN)
% Choose default command line output for guide
handles.output = hObject;
% UIWAIT makes guide wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. functionvarargout = guide_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 coloration1. function coloration1_Callback(hObject, eventdata, handles) % hObject handle to coloration1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
p = 0.02;
outputFilePath = 'degraded.wav';
degType = "noi";
case 'ref'
process = @(x) x;
case 'noi'
process = @(x) x + p * randn(audioReader.SamplesPerFrame, 1);
case 'dis'
process = @(x) x .*(rand>p);
case 'loud'
process = @(x) x .* p;
case 'col'
mPEQ = multibandParametricEQ('HasLowpassFilter', true, 'LowpassCutoff', p);
process = @(x) mPEQ(x);
% --- Executes on button press in coloration2. function coloration2_Callback(hObject, eventdata, handles) % hObject handle to coloration2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
kannst du das Problem bzw. die Frage näher eingrenzen?
Dass du nicht weiterkommst, ist wenig aussagekräftig.
Grüße,
Harald
_________________
1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
% --- Executes on button press in coloration2. function coloration2_Callback(hObject, eventdata, handles) % hObject handle to coloration2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
Ich würde auch mal
drawnow
in die while-Schleife einfügen. Das sollte dazu führen, dass der andere Callback ausgeführt wird.
Grüße,
Harald
_________________
1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
Einstellungen und Berechtigungen
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.