Prev: mnrfit
Next: stop soundsc
From: Nik Wilkinson on
I have inherited some code from 2007 on a machine running 2009b and with the new version am experiencing an error when assigning a handle to an array. The code segment providing the error is:

hh(1,p) = imellipse(gca,[cb(p,1)-BIG,cb(p,2)-BIG,bigger,bigger]);
hh(2,p) = imellipse(gca,[cs(p,1)-SML,cs(p,2)-SML,smler,smler]);

The program locks up. Upon exiting I find the error:

??? Error using ==> iptSetPointerBehavior>parseInputs at 135
First input argument, h, contains one or more invalid handles.

This appears to be the source of the error but the error report gives me error starting at my first line of code:

Error in ==> programname at linenumber
hh(1,p) = imellipse(gca,[cb(p,1)-BIG,cb(p,2)-BIG,bigger,bigger]);

I found a technical solution which I thought may apply:
http://www.mathworks.com/support/solutions/en/data/1-7UVX3O/index.html?product=IP&solution=1-7UVX3O

I converted the code so instead of:
hh(1,p) = imellipse(gca,[cb(p,1)-BIG,cb(p,2)-BIG,bigger,bigger]);
hh(2,p) = imellipse(gca,[cs(p,1)-SML,cs(p,2)-SML,smler,smler]);

I have:
imellipse(gca,[cb(p,1)-BIG,cb(p,2)-BIG,bigger,bigger]);
temp_big = findobj(gcf,'type','hggroup');
hh(1,p) = getappdata(temp_big, 'roiObjectReference');
imellipse(gca,[cs(p,1)-SML,cs(p,2)-SML,smler,smler]);
temp_small = findobj(gcf,'type','hggroup');
hh(2,p) = getappdata(temp_small, 'roiObjectReference');

But receive an error at the line: 'hh(2,p) = ....' which states:

??? Error using ==> getappdata
Invalid object handle

Error in ==> wltest8bitnick3rev at 99
hh(2,p) = getappdata(temp_small, 'roiObjectReference');

I have not programmed image processing before but understand some object types changed between 2007 and 2009b versions. I do not understand how the fix didn't work (it appeared to work on the first assignment of the handle to a matrix but not the second). If anybody can provide help it would be greatly appreciated.

nik
From: ImageAnalyst on
What's the value of p?
 | 
Pages: 1
Prev: mnrfit
Next: stop soundsc