Importing struct into app designer

8 visualizzazioni (ultimi 30 giorni)
Alexandra Philip
Alexandra Philip il 10 Lug 2020
Risposto: Matt J il 10 Lug 2020
I am having some trouble retreiving the field values of my loaded struct in app designer. I first created a Private propertty and then a function like this:
properties (Access = private)
Mystruct % Description
end
properties (Access = public)
end
methods (Access = private)
function Start(app)
Mystruct=load('AccelQuery.mat')
end
end
I am then trying to figure out a way to extract the value within a specified field to use in a call back function such as this:
mergetables=[rmdData.SERIAL_NUMBER,rmdData.BIA_COF_0,rmdData.BIA_COF_1,rmdData.BIA_COF_2,rmdData.BIA_COF_3...
,rmdData.BIA_COF_4,rmdData.SF_COF_0,rmdData.SF_COF_1,rmdData.SF_COF_2,rmdData.SF_COF_3,rmdData.SF_COF_4];
mergetable1=array2table(mergetables);
This is suppose to creat an table using the values from the fields and the rmdData.x are the actual field names from the struct.
Any suggestions so that the call back function is able to identify the fields values from the struct?

Risposte (1)

Matt J
Matt J il 10 Lug 2020
The fieldnames command
Or, you could just do
mergetable1=struct2table(rmdData)

Categorie

Scopri di più su Structures in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by