Error using extractfield in app designer
3 次查看(过去 30 天)
显示 更早的评论
I am attempting to extract the values from specific fields of a structure in app designer.
I first added a private property(app.Mystruct) and a function which loads the struct from a mat file.
properties (Access = private)
Mystruct % Description
end
properties (Access = public)
end
methods (Access = private)
function Start(app)
Mystruct=load('AccelQuery.mat')
end
end
In the call back function I used:
rmdData=app.Mystruct;
rmdData.SERIAL_NUMBER=extractfield(rmdData,'SERIAL_NUMBER');
In an effort to extract the values from that field('SERIAL_NUMBER').
I then receive this error:
Error using extractfield
Expected input number 1, S, to be one of these types:
struct
Instead its type was double.
Error in extractfield (line 39)
validateattributes(S, {'struct'}, {'vector'}, fcnname, 'S', 1)
Any suggestions to correct this error?
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!