In Ap Designer: put new data into a (ui)table
This should be easy… Data comes in from a serial device consisting of a character and a number (time in msec) and I want to insert it into a table on screen.
I’ve got my serial callback working (after much effort) and I thought the next step would be easier. I have created a uitable that is displayed on the screen. Empty at first, called ResultsTable and thus referred to as app.ResultsTable with 2 columns named ‘Event’ and ‘Time’. Everything else about the table is defaulted.
The app.ResultsTable.Data is initially [ ] as expected and as each bit of info comes in I want to add it to the table. Serial callback parsed the input into PType (a character) and PTime (uint32) so why does
app.ResultsTable.Data(app.NextTrial,’Event’) = char(PType);
app.ResultsTable.Data(app.NextTrial,’Time’) = PData;
Give me multiple columns where the number of columns is the ascii value of the character? If PType is ‘A’ I get 64 zeros and then a 65. I’ve tried various combinations of [ PType PData ] ( etc.) { another attempt }. All kinds of complicated merging of multiple tables is described in help but not simply putting new data into a new table within App Designer code (which has to be different than MatLab of course)
And after I get that first row in, I sure hope I can keep adding rows (app.NextTrial is the row index of course) for as long as I have enough memory (maybe 1000 rows?), that I can later export to an excel file or .CSV.
Thanks for the help for an old time C coder new to Matlab.This should be easy… Data comes in from a serial device consisting of a character and a number (time in msec) and I want to insert it into a table on screen.
I’ve got my serial callback working (after much effort) and I thought the next step would be easier. I have created a uitable that is displayed on the screen. Empty at first, called ResultsTable and thus referred to as app.ResultsTable with 2 columns named ‘Event’ and ‘Time’. Everything else about the table is defaulted.
The app.ResultsTable.Data is initially [ ] as expected and as each bit of info comes in I want to add it to the table. Serial callback parsed the input into PType (a character) and PTime (uint32) so why does
app.ResultsTable.Data(app.NextTrial,’Event’) = char(PType);
app.ResultsTable.Data(app.NextTrial,’Time’) = PData;
Give me multiple columns where the number of columns is the ascii value of the character? If PType is ‘A’ I get 64 zeros and then a 65. I’ve tried various combinations of [ PType PData ] ( etc.) { another attempt }. All kinds of complicated merging of multiple tables is described in help but not simply putting new data into a new table within App Designer code (which has to be different than MatLab of course)
And after I get that first row in, I sure hope I can keep adding rows (app.NextTrial is the row index of course) for as long as I have enough memory (maybe 1000 rows?), that I can later export to an excel file or .CSV.
Thanks for the help for an old time C coder new to Matlab. This should be easy… Data comes in from a serial device consisting of a character and a number (time in msec) and I want to insert it into a table on screen.
I’ve got my serial callback working (after much effort) and I thought the next step would be easier. I have created a uitable that is displayed on the screen. Empty at first, called ResultsTable and thus referred to as app.ResultsTable with 2 columns named ‘Event’ and ‘Time’. Everything else about the table is defaulted.
The app.ResultsTable.Data is initially [ ] as expected and as each bit of info comes in I want to add it to the table. Serial callback parsed the input into PType (a character) and PTime (uint32) so why does
app.ResultsTable.Data(app.NextTrial,’Event’) = char(PType);
app.ResultsTable.Data(app.NextTrial,’Time’) = PData;
Give me multiple columns where the number of columns is the ascii value of the character? If PType is ‘A’ I get 64 zeros and then a 65. I’ve tried various combinations of [ PType PData ] ( etc.) { another attempt }. All kinds of complicated merging of multiple tables is described in help but not simply putting new data into a new table within App Designer code (which has to be different than MatLab of course)
And after I get that first row in, I sure hope I can keep adding rows (app.NextTrial is the row index of course) for as long as I have enough memory (maybe 1000 rows?), that I can later export to an excel file or .CSV.
Thanks for the help for an old time C coder new to Matlab. data into table MATLAB Answers — New Questions