How do I run a function from an older version of MATLAB?

Hello, I need to run this function which was written on an older version of MATLAB. My current version is 2011 and I think the function was written on 2006. Any feedback will be appreciated.

5 Comments

You forgot to tell us the function. Which function no longer runs? If it's the whole mytansig, then at least tell us what line in it does not run anymore.
The function that I am trying to run is mytansig. When I run it there is an error saying "Unrecognized code".
How are you running the code?
The code uses an internal routine of the neural network toolbox that was replaced in R2010b, but it should have continued to work with your R2011 release. And the problem you are encountering does not appear to be related to that.
I want to use mytansig as a transfer function for my neural network. The whole idea is to create an analog neural network with matlab, and in order to do so I need to use mytansig as a function. I've attached the file with the neural network I am using. Any and all feedback will be appreciated!
Emil,
In current versions you would need to replace the use of newff(); see https://www.mathworks.com/matlabcentral/answers/77741-newff-create-a-feed-forward-backpropagation-network-obsoleted-in-r2010b-nnet-7-0 which suggests newpr() for pattern recognition.
The mytansig code makes reference to 'dtansig' when called with the 'deriv' parameter, but dtansig no longer exists: since R2006a you have needed to instead call tansig with 'dn' as the first parameter.
This is probably something that you would find implicitly addressed if you were to follow the templates mentioned in the custom function information. It is not clear to me that the derivative of mytansig should be dtansig .

Sign in to comment.

Answers (0)

Asked:

on 4 Dec 2016

Commented:

on 13 Aug 2017

Community Treasure Hunt

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

Start Hunting!