Argument to dynamic structure reference must evaluate to a valid field name Error occurs when using properties
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to use transfer my functional script into App Designer to make it function as a GUI. First thing I did was define all the variables in properties that are going to be used and modified between callbacks:
properties (Access = private)
RTD = cell(5,3);TC = cell(5,3);
end
In my script each cell of RTD is a 5999x9 table, and I am able to referrence the following without errors:
RTD{1,1}.(1)
RTD{1,1}.(1)(1)
But since I made RTD a property in App Designer this causes the error message: "Argument to dynamic structure reference must evaluate to a valid field name":
app.RTD{1,1}.(1)
app.RTD{1,1}.(1)(1)
In the App Designer, I must reference the property RTD as app.RTD.
Does anyone know why this happens and how I could fix it? My only idea would be to make a local variable equal to RTD within the function callback that I need to use RTD in, and then once I am done modifying it, make app.RTD equal to the local variable.
0 commentaires
Réponses (1)
Bora Eryilmaz
le 2 Fév 2023
Looks like you might be trying to access the content of RTD before populating its cells with the right table content first.
% This works OK.
RTD = cell(5,3);
RTD{1,1} = array2table(rand(10,3));
RTD{1,1}.(1)
% Errors out since the table content is not assigned into the cell array.
RTD = cell(5,3);
RTD{1,1}.(1)
0 commentaires
Voir également
Catégories
En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!