0

I would like to execute the following command in MATLAB R2012a:

tform = affine2d([0.92387953 -0.38268343 0; 0.38268343 0.92387953 0; 2 3 1]);

I keep getting the following error :

Undefined function 'affine2d' for input arguments of type 'double'.

It seems to expect it to be a function while actually it is a class.

Can someone please help me with this error?

4
  • You need to have the Image Processing Toolbox to use that function because the code is correct. So I guess you don't have it. What do you get when you type which affine2d in the Command Window? Commented Apr 9, 2015 at 0:58
  • Undefined function or variable 'affine2d'. how do I go about installing Image Processing Toolbox? Commented Apr 9, 2015 at 1:06
  • 1
    Visit this page to get the details. You can get a trial version before purchasing it. Good luck! Commented Apr 9, 2015 at 1:36
  • @Benoit_11 - affine2d was released as of R2013a. Even if the OP installs the toolbox, his/her version of MATLAB won't have it. Sucks... but that's how they make money :( lol. Commented Apr 9, 2015 at 2:44

1 Answer 1

1

affine2d was released as of MATLAB R2013a and is part of the Image Processing Toolbox. See the release notes here for more details and look under the R2013a section: http://www.mathworks.com/help/images/release-notes.html

Though you may have the Image Processing Toolbox, your version does not have affine2d as you are using R2012a. The best equivalent is to use maketform and its ilk. maketform was replaced with affine2d in R2013a as it is more robust and stable.

You either need to use maketform or upgrade your version of MATLAB to at least R2013a or higher.

Good luck!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.