Function RunButtonPushed(app, event) nothing happens when button is pushed.
Afficher commentaires plus anciens
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
ResolutioninnmEditField matlab.ui.control.NumericEditField
ResolutioninnmEditFieldLabel matlab.ui.control.Label
RunButton matlab.ui.control.Button
centeredwavelengthnmEditField matlab.ui.control.NumericEditField
centeredwavelengthnmEditFieldLabel matlab.ui.control.Label
Resincm1EditField matlab.ui.control.NumericEditField
Resincm1EditFieldLabel matlab.ui.control.Label
end
methods (Access = private)
% Button pushed function: RunButton
function RunButtonPushed(app, event)
ScriptPath = pwd; % Find current path to script as start point
% converts given spectral resolution to theoretical resolution limit
% ignoring pixel size
% initializing variables
wavenumsp = app.centeredwavelengthnmEditField;
wavelengthcenter = app.Resincm1EditField; % user input for centeral wave in um
wavenumcenter = 1/(wavelengthcenter*10000); % converting wavelength to wavenumber
delwave = wavenumcenter - wavenumsp; % finding delta of wavenumbers
Result = ((1/delwave)*1E7)-wavelengthcenter*1000; % Result in nm
app.ResolutioninnmEditField.Value = wavenumsp;
end
end
This is the code above, it's a very simple function I just need it to display the calculated value nothing happens when I push the button, the code runs fine just the button doesn't work.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Develop Apps Programmatically dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!