Function RunButtonPushed(app, event) nothing happens when button is pushed.
古いコメントを表示
% 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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Develop Apps Programmatically についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!