Error only in 2012 version
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
I'm trying to use some code to play a video but I keep hitting an error. The error says "Attempt to reference field of non-structure array"
while ishandle(hFig) && ~bKillAll
set(hText,'String',['frame ' num2str(fr) '/' num2str(macroDat.nofFrames) ' target FPS: ' num2str(curTargetFrameRate)]);
switch behavior(startFr)
case 0, hText.String = [hText.String ' SLEEPING'];
case 5, hText.String = [hText.String ' EXPLORATION'];
end
and the other place in the code where hText shows up at all is here:
hText = title(axHandle,['frame ' num2str(macroDat.fileReadPointer-1) '/' num2str(macroDat.nofFrames) ' target FPS: ' num2str(macroDat.targetFramerate)]);
However this error does not exist in the 2019 version of Matlab, but we need it to run on our 2012 version. I was told it might have something to do with handles, but I'm not sure about that. Any advice?
0 个评论
回答(1 个)
Steven Lord
2019-6-18
0 个投票
The ability to set property on Handle Graphics objects using the syntax hText.String was introduced in release R2014b as a part of the major graphics system update. For older releases you will need to use the set function to set properties on your Handle Graphics objects. This will work both in releases before the update (release R2012a and R2012b) as well as releases after the update (release R2019a.)
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!