Argument to dynamic structure reference must evaluate to a valid field name Error occurs when using properties
조회 수: 8 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Bora Eryilmaz
2023년 2월 2일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!