Hi, I'm working on my first ever app and there is a learning curve I wasn't expecting. I have a pretty simple app.
- User inputs group name and QR code and TXID, says if it passed or failed, and why it failed.
- Some of this data gets displayed to a table that the user can edit if they did something wrong
- User moves on to the next one
- When they are done, they press done and a spreadsheet will be made with all the data they input in the formatting I want.
It looks like this (some potentially proprietary information removed):
So, I can't get anything to display to the table (Num is the counter in the upper left that goes up if you press "Next TXID"). When it tries to put the count in the table I get the error: Error setting property 'Data' of class 'Table':Data must be a numeric, logical, string, cell, or table array.
The counter variable is app.Count, and when I try to store data into arrays for future use (e.g. TXID(app.Count.Value) = app.TXIDEditField.Value then it says the two sides are incompatible.
I'm not sure what code to include here that is most helpful, but here are the most relevant functions:
% Value changed function: TXIDEditField
function TXIDEditFieldValueChanged(app, event) app.UITable.Data.Num(app.Count.Value) = app.Count.Value; %add count # to table
app.UITable.Data.TXID(app.Count.Value) = upper(app.TXIDEditField.Value); %input TXID into table
drawnow(); end
% Button pushed function: NextTXIDButton
function NextTXIDButtonPushed(app, event) %when the next button is pushed, store all data in variables for
%use in the spreadsheet later
%pass/fail
if app.PassButton.Value == true deploymentPASSFAIL(app.Count.Value) = 'Pass'; else deploymentPASSFAIL(app.Count.Value) = 'Fail'; end deploymentFAILUREMODE(app.Count.Value) = app.FailureModeListBox.Value; %failure mode
%if the table is not already filled in, fill it in with the
%proper information
app.UITable.Data.PassFail(app.Count.Value) = deploymentPASSFAIL(app.Count.Value); %pass/fail app.UITable.Data.FailureMode(app.Count.Value) = deploymentFAILUREMODE(app.Count.Value); %failure mode %when the "next txid" button is pushed, clear all the values
%and increase the counter by 1
app.Count.Value = app.Count.Value + 1; app.QRCodeEditField.Value = ''; app.TXIDEditField.Value = ''; app.PassButton.Value = true; app.FailButton.Value = false; app.FailureModeListBox.Value = 'N/A'; drawnow(); end
Best Answer