does not plot the normal distribution. Writes Unrecognized function or variable 'O'. What is the reason?
조회 수: 4 (최근 30일)
이전 댓글 표시
classdef app3 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Button_4 matlab.ui.control.Button
Button_3 matlab.ui.control.Button
Button_2 matlab.ui.control.StateButton
UITable matlab.ui.control.Table
Image matlab.ui.control.Image
Button matlab.ui.control.Button
UIAxes3 matlab.ui.control.UIAxes
UIAxes2 matlab.ui.control.UIAxes
UIAxes matlab.ui.control.UIAxes
end
% Callbacks that handle component events
methods (Access = private)
% Image clicked function: Image
function ImageClicked(app, event)
[filename,pathname]=uigetfile ({'*.txt'}, 'File Selector');
fullpath=strcat(pathname,filename);
x=readtable(fullpath);
app.UITable.Data=x;
app.UITable.ColumnName=x.Properties.VariableNames;
year=x(:,1);
lat=x(:,2);
lon=x(:,3);
app.O=x(:,4);
end
% Cell edit callback: UITable
function UITableCellEdit(app, event)
end
% Value changed function: Button_2
function Button_2ValueChanged(app, event)
histfit(app.UIAxes, table2array (app.O))
댓글 수: 0
답변 (1개)
Chris
2021년 10월 26일
app.O is a property that needs to be declared in a properties block before it can be used.
Since it's not declared, an error is thrown when you try to assign or retrieve it.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!