Sinan NourEddine
Sinan NourEddine

Reputation: 45

getpts MATLAB returns unrecognized function or variable 'getpts'

i'm trying to use getpts to choose points in the current figure using the mouse. However, when i run it, i'm getting the error "unrecognized function or variable 'getpts'."

Here's my code

for i=1:n
  im = imread([read_path 'IMG_' num2str(i+t) '.jpg']); %Get image 
  figure
  imshow(im)
  [x,y] = getpts; %returns error
end

Any idea why that's happening? Note: I'm using the free trial version of Matlab

I'd appreciate the help!

Upvotes: 2

Views: 1649

Answers (1)

Wolfie
Wolfie

Reputation: 30047

From the docs, getpts is in the image processing toolbox.

This isn't always obvious, you can infer it from the docs link itself:

mathworks.com/help/images/ref/getpts.html

(where a built-in would be something like mathworks.com/help/matlab/ref/sum.html)

You can also see it's nested under the image processing toolbox in the side-bar on that page.

docs menu

In your trial installation of MATLAB you likely don't have this toolbox. You might know from the install process, or you could check whether the toolbox folder exists in the installation directory, e.g.

install dir

Upvotes: 2

Related Questions