Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

function = importfile not working in APP DESIGNER

조회 수: 1 (최근 30일)
Karel Starý
Karel Starý 2021년 4월 26일
마감: Karel Starý 2021년 8월 4일
Hello guys, another day, another odd issue with my favorite app APP DESIGNER.
I am working on a app which should load a data file from my PC and do a first preprocesing. I just need ti to delete some rows in the file so it wouldn't be so heavy.
For my funktion I am used the basic one which could be created by MATLab itself behind the import data tool.
methods (Access = private)
function R = importfile(filename, dataLines)
%IMPORTFILE Import data from a text file
% BOOK1 = IMPORTFILE(FILENAME) reads data from text file FILENAME for
% the default selection. Returns the data as a table.
%
% BOOK1 = IMPORTFILE(FILE, DATALINES) reads data for the specified row
% interval(s) of text file FILENAME. Specify DATALINES as a positive
% scalar integer or a N-by-2 array of positive scalar integers for
% dis-contiguous row intervals.
%
% Example:
% Book1 = importfile("C:\Users\staryk\Desktop\Book1.csv", [1, Inf]);
%
% See also READTABLE.
%
% Auto-generated by MATLAB on 26-Apr-2021 12:34:34
%% Input handling
% If dataLines is not specified, define defaults
if nargin < 2
dataLines = [1, Inf];
end
%% Set up the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 76);
% Specify range and delimiter
opts.DataLines = dataLines;
opts.Delimiter = ";";
% Specify column names and types
opts.VariableNames = ["TIME_STAMP", "Var2", "Var3", "GPSLon", "GPSLat", "Var6", "Var7", "Var8", "GPSSpeedkmh", "GPSDistancem", "Var11", "Var12", "Var13", "LTEKPIChipType", "LTEKPIPCellServingPCI", "LTEKPIPCellServingBand", "LTEKPIPCellServingEARFCNDL", "Var18", "Var19", "Var20", "LTEKPIPCellServingRSRPdBm", "LTEKPIPCellServingRSRQdB", "LTEKPIPCellServingRSSIdBm", "Var24", "Var25", "Var26", "Var27", "Var28", "Var29", "Var30", "Var31", "Var32", "Var33", "Var34", "Var35", "LTEKPIPCellMTxXNRxAnt", "Var37", "Var38", "Var39", "LTEKPIPCellDLModulation0", "Var41", "LTEKPIPCellULModulation", "Var43", "Var44", "Var45", "Var46", "Var47", "Var48", "Var49", "Var50", "Var51", "Var52", "Var53", "Var54", "Var55", "Var56", "Var57", "Var58", "Var59", "Var60", "Var61", "Var62", "Var63", "Var64", "Var65", "Var66", "Var67", "Var68", "Var69", "LTEKPICAType", "Var71", "Var72", "Var73", "Var74", "Var75", "Var76"];
opts.SelectedVariableNames = ["TIME_STAMP", "GPSLon", "GPSLat", "GPSSpeedkmh", "GPSDistancem", "LTEKPIChipType", "LTEKPIPCellServingPCI", "LTEKPIPCellServingBand", "LTEKPIPCellServingEARFCNDL", "LTEKPIPCellServingRSRPdBm", "LTEKPIPCellServingRSRQdB", "LTEKPIPCellServingRSSIdBm", "LTEKPIPCellMTxXNRxAnt", "LTEKPIPCellDLModulation0", "LTEKPIPCellULModulation", "LTEKPICAType"];
opts.VariableTypes = ["datetime", "string", "string", "double", "double", "string", "string", "string", "double", "double", "string", "string", "string", "categorical", "double", "double", "double", "string", "string", "string", "double", "double", "double", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "categorical", "string", "string", "string", "double", "string", "categorical", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "categorical", "string", "string", "string", "string", "string", "string"];
% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";
% Specify variable properties
opts = setvaropts(opts, ["Var2", "Var3", "Var6", "Var7", "Var8", "Var11", "Var12", "Var13", "Var18", "Var19", "Var20", "Var24", "Var25", "Var26", "Var27", "Var28", "Var29", "Var30", "Var31", "Var32", "Var33", "Var34", "Var35", "Var37", "Var38", "Var39", "Var41", "Var43", "Var44", "Var45", "Var46", "Var47", "Var48", "Var49", "Var50", "Var51", "Var52", "Var53", "Var54", "Var55", "Var56", "Var57", "Var58", "Var59", "Var60", "Var61", "Var62", "Var63", "Var64", "Var65", "Var66", "Var67", "Var68", "Var69", "Var71", "Var72", "Var73", "Var74", "Var75", "Var76"], "WhitespaceRule", "preserve");
opts = setvaropts(opts, ["Var2", "Var3", "Var6", "Var7", "Var8", "Var11", "Var12", "Var13", "LTEKPIChipType", "Var18", "Var19", "Var20", "Var24", "Var25", "Var26", "Var27", "Var28", "Var29", "Var30", "Var31", "Var32", "Var33", "Var34", "Var35", "LTEKPIPCellMTxXNRxAnt", "Var37", "Var38", "Var39", "Var41", "LTEKPIPCellULModulation", "Var43", "Var44", "Var45", "Var46", "Var47", "Var48", "Var49", "Var50", "Var51", "Var52", "Var53", "Var54", "Var55", "Var56", "Var57", "Var58", "Var59", "Var60", "Var61", "Var62", "Var63", "Var64", "Var65", "Var66", "Var67", "Var68", "Var69", "LTEKPICAType", "Var71", "Var72", "Var73", "Var74", "Var75", "Var76"], "EmptyFieldRule", "auto");
opts = setvaropts(opts, "TIME_STAMP", "InputFormat", "yyyy-MM-dd HH:mm:ss.SSS");
opts = setvaropts(opts, ["LTEKPIPCellServingBand", "LTEKPIPCellDLModulation0"], "TrimNonNumeric", true);
opts = setvaropts(opts, ["LTEKPIPCellServingBand", "LTEKPIPCellDLModulation0"], "ThousandsSeparator", ",");
% Import the data
R = readtable(filename, opts)
end
Rest of the code is there just to open a window and load the data. Last part of code is there just to show me in command window if the process did something or not (and guess what, it doesn't).
end
% Button pushed function: LButton
function LButtonPushed(app, event)
[file,path,~] = uigetfile({'.csv'}); % open the dialog box,
N = file; %create variable with the name of the document
app.EditField.Value = N; % show document name in text filed
filename = [path file]; %combine path and name
A = R(app)
end
This is the errors I am having....
this is the dataset i am using: https://drive.google.com/drive/folders/1nCXV5Stf-5oMKg3asAsr2PF0YbLflIs3?usp=sharing
Please be kind and try to explain the stuff to me because I might be dumb.
Whole code so you can just copy and try it by yourself ...
classdef working < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
UITable matlab.ui.control.Table
Panel_4 matlab.ui.container.Panel
TabGroup matlab.ui.container.TabGroup
QUATab matlab.ui.container.Tab
CheckBox4_12 matlab.ui.control.CheckBox
CheckBox3_12 matlab.ui.control.CheckBox
CheckBox2_12 matlab.ui.control.CheckBox
CheckBox_12 matlab.ui.control.CheckBox
CheckBox4_11 matlab.ui.control.CheckBox
CheckBox3_11 matlab.ui.control.CheckBox
CheckBox2_11 matlab.ui.control.CheckBox
CheckBox_11 matlab.ui.control.CheckBox
CheckBox4_10 matlab.ui.control.CheckBox
CheckBox3_10 matlab.ui.control.CheckBox
CheckBox2_10 matlab.ui.control.CheckBox
CheckBox_10 matlab.ui.control.CheckBox
XButton matlab.ui.control.Button
LButton matlab.ui.control.Button
SamTab matlab.ui.container.Tab
CheckBox4_9 matlab.ui.control.CheckBox
CheckBox3_9 matlab.ui.control.CheckBox
CheckBox2_9 matlab.ui.control.CheckBox
CheckBox_9 matlab.ui.control.CheckBox
CheckBox4_8 matlab.ui.control.CheckBox
CheckBox3_8 matlab.ui.control.CheckBox
CheckBox2_8 matlab.ui.control.CheckBox
CheckBox_8 matlab.ui.control.CheckBox
CheckBox4_7 matlab.ui.control.CheckBox
CheckBox3_7 matlab.ui.control.CheckBox
CheckBox2_7 matlab.ui.control.CheckBox
CheckBox_7 matlab.ui.control.CheckBox
XButton_5 matlab.ui.control.Button
LButton_5 matlab.ui.control.Button
KiriTab matlab.ui.container.Tab
CheckBox4_6 matlab.ui.control.CheckBox
CheckBox3_6 matlab.ui.control.CheckBox
CheckBox2_6 matlab.ui.control.CheckBox
CheckBox_6 matlab.ui.control.CheckBox
CheckBox4_5 matlab.ui.control.CheckBox
CheckBox3_5 matlab.ui.control.CheckBox
CheckBox2_5 matlab.ui.control.CheckBox
CheckBox_5 matlab.ui.control.CheckBox
CheckBox4_4 matlab.ui.control.CheckBox
CheckBox3_4 matlab.ui.control.CheckBox
CheckBox2_4 matlab.ui.control.CheckBox
CheckBox_4 matlab.ui.control.CheckBox
XButton_6 matlab.ui.control.Button
LButton_6 matlab.ui.control.Button
Tab4 matlab.ui.container.Tab
CheckBox4_3 matlab.ui.control.CheckBox
CheckBox3_3 matlab.ui.control.CheckBox
CheckBox2_3 matlab.ui.control.CheckBox
CheckBox_3 matlab.ui.control.CheckBox
CheckBox4_2 matlab.ui.control.CheckBox
CheckBox3_2 matlab.ui.control.CheckBox
CheckBox2_2 matlab.ui.control.CheckBox
CheckBox_2 matlab.ui.control.CheckBox
CheckBox4 matlab.ui.control.CheckBox
CheckBox3 matlab.ui.control.CheckBox
CheckBox2 matlab.ui.control.CheckBox
CheckBox matlab.ui.control.CheckBox
XButton_7 matlab.ui.control.Button
LButton_7 matlab.ui.control.Button
Panel_3 matlab.ui.container.Panel
UIAxes matlab.ui.control.UIAxes
Panel_5 matlab.ui.container.Panel
EditField matlab.ui.control.EditField
end
methods (Access = private)
function R = importfile(filename, dataLines)
%IMPORTFILE Import data from a text file
% BOOK1 = IMPORTFILE(FILENAME) reads data from text file FILENAME for
% the default selection. Returns the data as a table.
%
% BOOK1 = IMPORTFILE(FILE, DATALINES) reads data for the specified row
% interval(s) of text file FILENAME. Specify DATALINES as a positive
% scalar integer or a N-by-2 array of positive scalar integers for
% dis-contiguous row intervals.
%
% Example:
% Book1 = importfile("C:\Users\staryk\Desktop\Book1.csv", [1, Inf]);
%
% See also READTABLE.
%
% Auto-generated by MATLAB on 26-Apr-2021 12:34:34
%% Input handling
% If dataLines is not specified, define defaults
if nargin < 2
dataLines = [1, Inf];
end
%% Set up the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 76);
% Specify range and delimiter
opts.DataLines = dataLines;
opts.Delimiter = ";";
% Specify column names and types
opts.VariableNames = ["TIME_STAMP", "Var2", "Var3", "GPSLon", "GPSLat", "Var6", "Var7", "Var8", "GPSSpeedkmh", "GPSDistancem", "Var11", "Var12", "Var13", "LTEKPIChipType", "LTEKPIPCellServingPCI", "LTEKPIPCellServingBand", "LTEKPIPCellServingEARFCNDL", "Var18", "Var19", "Var20", "LTEKPIPCellServingRSRPdBm", "LTEKPIPCellServingRSRQdB", "LTEKPIPCellServingRSSIdBm", "Var24", "Var25", "Var26", "Var27", "Var28", "Var29", "Var30", "Var31", "Var32", "Var33", "Var34", "Var35", "LTEKPIPCellMTxXNRxAnt", "Var37", "Var38", "Var39", "LTEKPIPCellDLModulation0", "Var41", "LTEKPIPCellULModulation", "Var43", "Var44", "Var45", "Var46", "Var47", "Var48", "Var49", "Var50", "Var51", "Var52", "Var53", "Var54", "Var55", "Var56", "Var57", "Var58", "Var59", "Var60", "Var61", "Var62", "Var63", "Var64", "Var65", "Var66", "Var67", "Var68", "Var69", "LTEKPICAType", "Var71", "Var72", "Var73", "Var74", "Var75", "Var76"];
opts.SelectedVariableNames = ["TIME_STAMP", "GPSLon", "GPSLat", "GPSSpeedkmh", "GPSDistancem", "LTEKPIChipType", "LTEKPIPCellServingPCI", "LTEKPIPCellServingBand", "LTEKPIPCellServingEARFCNDL", "LTEKPIPCellServingRSRPdBm", "LTEKPIPCellServingRSRQdB", "LTEKPIPCellServingRSSIdBm", "LTEKPIPCellMTxXNRxAnt", "LTEKPIPCellDLModulation0", "LTEKPIPCellULModulation", "LTEKPICAType"];
opts.VariableTypes = ["datetime", "string", "string", "double", "double", "string", "string", "string", "double", "double", "string", "string", "string", "categorical", "double", "double", "double", "string", "string", "string", "double", "double", "double", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "categorical", "string", "string", "string", "double", "string", "categorical", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "string", "categorical", "string", "string", "string", "string", "string", "string"];
% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";
% Specify variable properties
opts = setvaropts(opts, ["Var2", "Var3", "Var6", "Var7", "Var8", "Var11", "Var12", "Var13", "Var18", "Var19", "Var20", "Var24", "Var25", "Var26", "Var27", "Var28", "Var29", "Var30", "Var31", "Var32", "Var33", "Var34", "Var35", "Var37", "Var38", "Var39", "Var41", "Var43", "Var44", "Var45", "Var46", "Var47", "Var48", "Var49", "Var50", "Var51", "Var52", "Var53", "Var54", "Var55", "Var56", "Var57", "Var58", "Var59", "Var60", "Var61", "Var62", "Var63", "Var64", "Var65", "Var66", "Var67", "Var68", "Var69", "Var71", "Var72", "Var73", "Var74", "Var75", "Var76"], "WhitespaceRule", "preserve");
opts = setvaropts(opts, ["Var2", "Var3", "Var6", "Var7", "Var8", "Var11", "Var12", "Var13", "LTEKPIChipType", "Var18", "Var19", "Var20", "Var24", "Var25", "Var26", "Var27", "Var28", "Var29", "Var30", "Var31", "Var32", "Var33", "Var34", "Var35", "LTEKPIPCellMTxXNRxAnt", "Var37", "Var38", "Var39", "Var41", "LTEKPIPCellULModulation", "Var43", "Var44", "Var45", "Var46", "Var47", "Var48", "Var49", "Var50", "Var51", "Var52", "Var53", "Var54", "Var55", "Var56", "Var57", "Var58", "Var59", "Var60", "Var61", "Var62", "Var63", "Var64", "Var65", "Var66", "Var67", "Var68", "Var69", "LTEKPICAType", "Var71", "Var72", "Var73", "Var74", "Var75", "Var76"], "EmptyFieldRule", "auto");
opts = setvaropts(opts, "TIME_STAMP", "InputFormat", "yyyy-MM-dd HH:mm:ss.SSS");
opts = setvaropts(opts, ["LTEKPIPCellServingBand", "LTEKPIPCellDLModulation0"], "TrimNonNumeric", true);
opts = setvaropts(opts, ["LTEKPIPCellServingBand", "LTEKPIPCellDLModulation0"], "ThousandsSeparator", ",");
% Import the data
R = readtable(filename, opts)
end
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: LButton
function LButtonPushed(app, event)
[file,path,~] = uigetfile({'.csv'}); % open the dialog box,
N = file; %create variable with the name of the document
app.EditField.Value = N; % show document name in text filed
filename = [path file]; %combine path and name
A = R(app)
%A2 = A1(:, {'TIME_STAMP', 'GPSLon','GPSLat','PSSpeed k m h'});
% A2 = removevars(A1,{':','Lon' 'Lat' 'GPSAltitude_m_' 'GPSTime' 'GPSHead' 'GPSSource' 'GPSDataInd' 'GPSArea' "LTEKPIPCellServingEARFCNDL" ...
% "LTEKPIPCellServingEARFCN_UL_" 'LTEKPIPCellServingBandWidthDL' 'LTEKPIPCellServingBandWidthUL' 'LTEKPIPCellPUSCHPowerdBm' ...
% 'LTEKPIPCellPUCCHPowerdBm' 'LTEKPIPCellSRSPowerdBm' 'LTEKPIPCellTotalTxPowerdBm' 'LTEKPIPCellWBCQICW0' 'LTEKPIPCellWBRI' ...
% 'LTEKPIPCellWBRI1Rate' 'LTEKPIPCellWBRI2Rate' 'LTEKPIPCellWBRI3Rate' 'LTEKPIPCellWBRI4Rate' 'LTEKPIPCellDLMCS0' 'LTEKPIPCellDLMCS1' ...
% 'LTEKPIPCellULMCS' 'LTEKPIPCellDLModulation0' 'LTEKPIPCellDLModulation1' 'LTEKPIPCellULModulation' 'LTEKPIPCellPDSCHPRBNumberTB0Including0' ...
% 'LTEKPIPCellPDSCHPRBNumberTB1Including0''LTEKPIPCellPUSCHPRBNumberIncluding0' 'LTEKPIPCellPDSCHBLER' 'LTEKPIPCellPUSCHBLER' ...
% 'LTEKPIPCellPUSCHThroughputMbps' 'LTEKPIPCellMACDLThroughputMbps' 'LTEKPIPCellMACULThroughputMbps' 'LTEKPIPDSCHPRBNumberAvgTotal' ...
% 'LTEKPIPUSCHPRBNumberAvgTotal' 'LTEKPIPDSCHPRBNumberIncluding0Total' 'LTEKPIPUSCHPRBNumberIncluding0Total' 'LTEKPIPDSCHBLER' ...
% 'LTEKPIPUSCHBLER' 'LTEKPIPDSCHThroughputMbps' 'LTEKPIPUSCHThroughputMbps' 'LTEKPIMACDLThroughputMbps' 'LTEKPIMACULThroughputMbps' ...
% 'LTEKPIRLCDLThroughputMbps' 'LTEKPIRLCULThroughputMbps' 'LTEKPIPDCPDLThroughputMbps' 'LTEKPIPDCPULThroughputMbps' 'LTEKPITAC' ...
% 'LTEKPICAType' 'LTEKPIULCAType' 'LTEKPIBandCombination' 'QualcommLteLteAdvIntrafreqMeasurePCellNeighborCellNeighborCellC' ...
% 'QualcommLteLteAdvIntrafreqMeasurePCellNeighborCellNeighborCellL' 'QualcommLteLteAdvIntrafreqMeasurePCellNeighborCellSummaryNeighb' ...
% 'QualcommLteLteAdvIntrafreqMeasurePCellNeighborCellNeighborMeasu'}); % delete all shitty collums I dont need
% x = table2array(A2(:,1));
%y = table2array(A2(:,10));
% plot(app.UIAxes,x,y);
% opts = detectImportOptions(filename,"DatetimeType","datetime");
%varOpts = getvaropts(opts,'OutageTime');
end
% Button pushed function: XButton
function XButtonPushed(app, event)
A=0
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 1176 588];
app.UIFigure.Name = 'MATLAB App';
% Create Panel_5
app.Panel_5 = uipanel(app.UIFigure);
app.Panel_5.Position = [2 392 1171 196];
% Create EditField
app.EditField = uieditfield(app.Panel_5, 'text');
app.EditField.HorizontalAlignment = 'center';
app.EditField.Position = [392 170 755 20];
% Create Panel_4
app.Panel_4 = uipanel(app.UIFigure);
app.Panel_4.TitlePosition = 'centertop';
app.Panel_4.FontWeight = 'bold';
app.Panel_4.Position = [2 392 1176 161];
% Create Panel_3
app.Panel_3 = uipanel(app.Panel_4);
app.Panel_3.Position = [316 1 855 158];
% Create UIAxes
app.UIAxes = uiaxes(app.Panel_3);
title(app.UIAxes, 'Title')
xlabel(app.UIAxes, 'X')
ylabel(app.UIAxes, 'Y')
zlabel(app.UIAxes, 'Z')
app.UIAxes.Position = [0 0 855 157];
% Create TabGroup
app.TabGroup = uitabgroup(app.Panel_4);
app.TabGroup.Position = [4 0 313 158];
% Create QUATab
app.QUATab = uitab(app.TabGroup);
app.QUATab.Title = 'QUA';
% Create LButton
app.LButton = uibutton(app.QUATab, 'push');
app.LButton.ButtonPushedFcn = createCallbackFcn(app, @LButtonPushed, true);
app.LButton.Position = [0 109 25 25];
app.LButton.Text = 'L';
% Create XButton
app.XButton = uibutton(app.QUATab, 'push');
app.XButton.ButtonPushedFcn = createCallbackFcn(app, @XButtonPushed, true);
app.XButton.Position = [24 109 25 25];
app.XButton.Text = 'X';
% Create CheckBox_10
app.CheckBox_10 = uicheckbox(app.QUATab);
app.CheckBox_10.Position = [11 79 80 22];
% Create CheckBox2_10
app.CheckBox2_10 = uicheckbox(app.QUATab);
app.CheckBox2_10.Text = 'Check Box2';
app.CheckBox2_10.Position = [11 57 87 22];
% Create CheckBox3_10
app.CheckBox3_10 = uicheckbox(app.QUATab);
app.CheckBox3_10.Text = 'Check Box3';
app.CheckBox3_10.Position = [11 36 87 22];
% Create CheckBox4_10
app.CheckBox4_10 = uicheckbox(app.QUATab);
app.CheckBox4_10.Text = 'Check Box4';
app.CheckBox4_10.Position = [11 15 87 22];
% Create CheckBox_11
app.CheckBox_11 = uicheckbox(app.QUATab);
app.CheckBox_11.Position = [116 78 80 22];
% Create CheckBox2_11
app.CheckBox2_11 = uicheckbox(app.QUATab);
app.CheckBox2_11.Text = 'Check Box2';
app.CheckBox2_11.Position = [116 56 87 22];
% Create CheckBox3_11
app.CheckBox3_11 = uicheckbox(app.QUATab);
app.CheckBox3_11.Text = 'Check Box3';
app.CheckBox3_11.Position = [116 35 87 22];
% Create CheckBox4_11
app.CheckBox4_11 = uicheckbox(app.QUATab);
app.CheckBox4_11.Text = 'Check Box4';
app.CheckBox4_11.Position = [116 14 87 22];
% Create CheckBox_12
app.CheckBox_12 = uicheckbox(app.QUATab);
app.CheckBox_12.Position = [215 79 80 22];
% Create CheckBox2_12
app.CheckBox2_12 = uicheckbox(app.QUATab);
app.CheckBox2_12.Text = 'Check Box2';
app.CheckBox2_12.Position = [215 57 87 22];
% Create CheckBox3_12
app.CheckBox3_12 = uicheckbox(app.QUATab);
app.CheckBox3_12.Text = 'Check Box3';
app.CheckBox3_12.Position = [215 36 87 22];
% Create CheckBox4_12
app.CheckBox4_12 = uicheckbox(app.QUATab);
app.CheckBox4_12.Text = 'Check Box4';
app.CheckBox4_12.Position = [215 15 87 22];
% Create SamTab
app.SamTab = uitab(app.TabGroup);
app.SamTab.Title = 'Sam';
% Create LButton_5
app.LButton_5 = uibutton(app.SamTab, 'push');
app.LButton_5.Position = [0 109 25 25];
app.LButton_5.Text = 'L';
% Create XButton_5
app.XButton_5 = uibutton(app.SamTab, 'push');
app.XButton_5.Position = [24 109 25 25];
app.XButton_5.Text = 'X';
% Create CheckBox_7
app.CheckBox_7 = uicheckbox(app.SamTab);
app.CheckBox_7.Position = [11 79 80 22];
% Create CheckBox2_7
app.CheckBox2_7 = uicheckbox(app.SamTab);
app.CheckBox2_7.Text = 'Check Box2';
app.CheckBox2_7.Position = [11 57 87 22];
% Create CheckBox3_7
app.CheckBox3_7 = uicheckbox(app.SamTab);
app.CheckBox3_7.Text = 'Check Box3';
app.CheckBox3_7.Position = [11 36 87 22];
% Create CheckBox4_7
app.CheckBox4_7 = uicheckbox(app.SamTab);
app.CheckBox4_7.Text = 'Check Box4';
app.CheckBox4_7.Position = [11 15 87 22];
% Create CheckBox_8
app.CheckBox_8 = uicheckbox(app.SamTab);
app.CheckBox_8.Position = [116 78 80 22];
% Create CheckBox2_8
app.CheckBox2_8 = uicheckbox(app.SamTab);
app.CheckBox2_8.Text = 'Check Box2';
app.CheckBox2_8.Position = [116 56 87 22];
% Create CheckBox3_8
app.CheckBox3_8 = uicheckbox(app.SamTab);
app.CheckBox3_8.Text = 'Check Box3';
app.CheckBox3_8.Position = [116 35 87 22];
% Create CheckBox4_8
app.CheckBox4_8 = uicheckbox(app.SamTab);
app.CheckBox4_8.Text = 'Check Box4';
app.CheckBox4_8.Position = [116 14 87 22];
% Create CheckBox_9
app.CheckBox_9 = uicheckbox(app.SamTab);
app.CheckBox_9.Position = [215 79 80 22];
% Create CheckBox2_9
app.CheckBox2_9 = uicheckbox(app.SamTab);
app.CheckBox2_9.Text = 'Check Box2';
app.CheckBox2_9.Position = [215 57 87 22];
% Create CheckBox3_9
app.CheckBox3_9 = uicheckbox(app.SamTab);
app.CheckBox3_9.Text = 'Check Box3';
app.CheckBox3_9.Position = [215 36 87 22];
% Create CheckBox4_9
app.CheckBox4_9 = uicheckbox(app.SamTab);
app.CheckBox4_9.Text = 'Check Box4';
app.CheckBox4_9.Position = [215 15 87 22];
% Create KiriTab
app.KiriTab = uitab(app.TabGroup);
app.KiriTab.Title = 'Kiri';
% Create LButton_6
app.LButton_6 = uibutton(app.KiriTab, 'push');
app.LButton_6.Position = [0 109 25 25];
app.LButton_6.Text = 'L';
% Create XButton_6
app.XButton_6 = uibutton(app.KiriTab, 'push');
app.XButton_6.Position = [24 109 25 25];
app.XButton_6.Text = 'X';
% Create CheckBox_4
app.CheckBox_4 = uicheckbox(app.KiriTab);
app.CheckBox_4.Position = [11 79 80 22];
% Create CheckBox2_4
app.CheckBox2_4 = uicheckbox(app.KiriTab);
app.CheckBox2_4.Text = 'Check Box2';
app.CheckBox2_4.Position = [11 57 87 22];
% Create CheckBox3_4
app.CheckBox3_4 = uicheckbox(app.KiriTab);
app.CheckBox3_4.Text = 'Check Box3';
app.CheckBox3_4.Position = [11 36 87 22];
% Create CheckBox4_4
app.CheckBox4_4 = uicheckbox(app.KiriTab);
app.CheckBox4_4.Text = 'Check Box4';
app.CheckBox4_4.Position = [11 15 87 22];
% Create CheckBox_5
app.CheckBox_5 = uicheckbox(app.KiriTab);
app.CheckBox_5.Position = [116 78 80 22];
% Create CheckBox2_5
app.CheckBox2_5 = uicheckbox(app.KiriTab);
app.CheckBox2_5.Text = 'Check Box2';
app.CheckBox2_5.Position = [116 56 87 22];
% Create CheckBox3_5
app.CheckBox3_5 = uicheckbox(app.KiriTab);
app.CheckBox3_5.Text = 'Check Box3';
app.CheckBox3_5.Position = [116 35 87 22];
% Create CheckBox4_5
app.CheckBox4_5 = uicheckbox(app.KiriTab);
app.CheckBox4_5.Text = 'Check Box4';
app.CheckBox4_5.Position = [116 14 87 22];
% Create CheckBox_6
app.CheckBox_6 = uicheckbox(app.KiriTab);
app.CheckBox_6.Position = [215 79 80 22];
% Create CheckBox2_6
app.CheckBox2_6 = uicheckbox(app.KiriTab);
app.CheckBox2_6.Text = 'Check Box2';
app.CheckBox2_6.Position = [215 57 87 22];
% Create CheckBox3_6
app.CheckBox3_6 = uicheckbox(app.KiriTab);
app.CheckBox3_6.Text = 'Check Box3';
app.CheckBox3_6.Position = [215 36 87 22];
% Create CheckBox4_6
app.CheckBox4_6 = uicheckbox(app.KiriTab);
app.CheckBox4_6.Text = 'Check Box4';
app.CheckBox4_6.Position = [215 15 87 22];
% Create Tab4
app.Tab4 = uitab(app.TabGroup);
app.Tab4.Title = 'Tab4';
% Create LButton_7
app.LButton_7 = uibutton(app.Tab4, 'push');
app.LButton_7.Position = [1 109 25 25];
app.LButton_7.Text = 'L';
% Create XButton_7
app.XButton_7 = uibutton(app.Tab4, 'push');
app.XButton_7.Position = [25 109 25 25];
app.XButton_7.Text = 'X';
% Create CheckBox
app.CheckBox = uicheckbox(app.Tab4);
app.CheckBox.Position = [11 79 80 22];
% Create CheckBox2
app.CheckBox2 = uicheckbox(app.Tab4);
app.CheckBox2.Text = 'Check Box2';
app.CheckBox2.Position = [11 57 87 22];
% Create CheckBox3
app.CheckBox3 = uicheckbox(app.Tab4);
app.CheckBox3.Text = 'Check Box3';
app.CheckBox3.Position = [11 36 87 22];
% Create CheckBox4
app.CheckBox4 = uicheckbox(app.Tab4);
app.CheckBox4.Text = 'Check Box4';
app.CheckBox4.Position = [11 15 87 22];
% Create CheckBox_2
app.CheckBox_2 = uicheckbox(app.Tab4);
app.CheckBox_2.Position = [116 78 80 22];
% Create CheckBox2_2
app.CheckBox2_2 = uicheckbox(app.Tab4);
app.CheckBox2_2.Text = 'Check Box2';
app.CheckBox2_2.Position = [116 56 87 22];
% Create CheckBox3_2
app.CheckBox3_2 = uicheckbox(app.Tab4);
app.CheckBox3_2.Text = 'Check Box3';
app.CheckBox3_2.Position = [116 35 87 22];
% Create CheckBox4_2
app.CheckBox4_2 = uicheckbox(app.Tab4);
app.CheckBox4_2.Text = 'Check Box4';
app.CheckBox4_2.Position = [116 14 87 22];
% Create CheckBox_3
app.CheckBox_3 = uicheckbox(app.Tab4);
app.CheckBox_3.Position = [215 79 80 22];
% Create CheckBox2_3
app.CheckBox2_3 = uicheckbox(app.Tab4);
app.CheckBox2_3.Text = 'Check Box2';
app.CheckBox2_3.Position = [215 57 87 22];
% Create CheckBox3_3
app.CheckBox3_3 = uicheckbox(app.Tab4);
app.CheckBox3_3.Text = 'Check Box3';
app.CheckBox3_3.Position = [215 36 87 22];
% Create CheckBox4_3
app.CheckBox4_3 = uicheckbox(app.Tab4);
app.CheckBox4_3.Text = 'Check Box4';
app.CheckBox4_3.Position = [215 15 87 22];
% Create UITable
app.UITable = uitable(app.UIFigure);
app.UITable.ColumnName = {'Column 1'; 'Column 2'; 'Column 3'; 'Column 4'};
app.UITable.RowName = {};
app.UITable.Position = [261 93 899 185];
% Show the figure after all components are created
app.UIFigure.Visible = 'on';
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = working
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end
  댓글 수: 3
Karel Starý
Karel Starý 2021년 4월 27일
Nope, it wasn't it. Thnkas for try...
Cris LaPierre
Cris LaPierre 2021년 6월 18일
I get a different error when I try to run your code:
Undefined function 'R' for input arguments of type 'working'.
Error in working/LButtonPushed (line 81)
A = R(app)
Error while evaluating Button PrivateButtonPushedFcn.
Can you share you app? You can attach it using the paperclip icon.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by