UI Table In App Designer Matlab

Hi all
I was hoping someone could help me with the following:-
I have 7 x matrices each matrix contains a set of XY co-ordinates of varying rows.
I am trying to display the co-ordiantes of each of these matrixes in a UI table using App Designer.
However I i can only display 1 x set of co-ordinates only. The code I have is shown below.
My current output looks like:-
p1.JPG
As you can see Matlab only ouputs one set of co-ordinates.
Any ideas?
Thank you.
app.Results.Data = Data_Set_One, Data_Set_Two

7 Commenti

That command is equivalent to
app.Results.Data = Data_Set_One
Data_Set_Two
except for some details about exactly when timer interrupts can occur or the execution can be paused by the debugger.
Consider
app.Results.Data = [Data_Set_One; Data_Set_Two];
Hi Walter
Thank you for the reply.
I have amended the code to what you have recommended and i'm still having the same problem, only the one set of co-ordinates is being shown. This is what my outptu looks like:-
same.JPG
It's driving me nuts?
Also on a side note, app.Results.Data is a UI table that i have renamed as Results.
The attribute of the UI table i am amending is the Data field - my question do you know where i can find the attributes for a UI table?
Thank you.
You said you have 7 matrices, each with xy coordinates. That sounds like two columns per matrix, which matches the number of columns that you see displayed. It is not clear what the source is for the other two columns that you have labeled with the uninformative "Column 1" and "Column 2"
Hi Walter
I got it working.
Thank you.
Hi Walter
I thought i had it fixed but it turns out that i was wrong.
It turns out that that I can add data to as many columns as i want which was part of the problem but now resolved, However all the columns must have the same number of rows because the data is being loaded into the UI table as a matrix.
Data set One contains a 30 x 2 matrix of XY co-ordinates. I can add these co-ordinates to the UI Table using the code:-
app.Results.Data = [Data_Set_One(:,1) Data_Set_One(:,2)] % this works fine
Data Set Two contains a 67 x 2 matrix of XY co-ordinates. I attempted to add these co-ordinates to the UI table along with data set one using the code:-
app.Results.Data = [Data_Set_One(:,1) Data_Set_One(:,2) Data_Set_Two(:,1) Data_Set_Two(:,2)]
But this does not work, and i am struggling.
Can you shed anymore light?
Thanks
Instead of using a numeric matrix, use cell arrays.
part1 = num2cell(Data_Set_One(:,1:2));
n1 = size(part1,1);
part2 = num2cell(Data_Set_Two(:,1:2));
n2 = size(part2,1);
nr = max(n1, n2);
newdata = cell(nr, 4);
newdata(1:n1, 1:2) = part1;
newdata(1:n2, 3:4) = part2;
app.Results.Data = newdata;
Now that worked.
Thanks

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange

Richiesto:

il 7 Mag 2019

Commentato:

il 11 Mag 2019

Community Treasure Hunt

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

Start Hunting!

Translated by