i have encoutered a problem MException with properties: identifier: 'MATLAB:no​​nExistent​F​ield'

Message is MException with properties:
identifier: 'MATLAB:nonExistentField'
message: 'Reference to non-existent field 'looseBorderWidth'.'
cause: {}
stack: [497x1 struct]
I have attached my codes below:
clc;
try
%str1='100';
if(m<=8)
%if (strcmp(ard,idn)==1);
flushinput(s);
img =getsnapshot(cam);
imshow(img);
fid='C:\Users\sai\Documents\MATLAB\captured.tif';
imwrite(img,fid,'WriteMode','append','Compression','none');
IRdetection_29082017;
%set(0,'RecursionLimit',1500)
else if(m>=8)
fclose(s);% To disconnect the serial port object from the serial port.
delete(instrfind);
delete(cam);% delete videoinput object:
end
%end
end
catch errors
disp (errors)
end %end code

1 Comment

Which line is this erroring at? It's probably easiest to just allow the error to propagate out (or rethrow it inside the catch) to see which line is causing the issue.

Sign in to comment.

 Accepted Answer

looseBorderWidth is assigned in the internal function toolbox/matlab/images/+images/+internal/figparams.m which calculates some figure layout parameters once per MATLAB session. The function is called by imshow() to retrieve the value.
I do not know why it would not find the value. My speculation would be along the lines of perhaps your function IRdetection_29082017 contains a "clear all"
The work-around for the moment would be to use image() instead of imshow()

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!