0

This is simple example for intro to Neural Network toolbox. However, I cannot run it without error. Do you have any suggestions?

Note: I have Neural Network toolbox and I can see inside the newlin function by edit!

>> P1 = {0 -1 1 1 0 -1 1 0 0 1};
>> T1 = {0 -1 0 2 1 -1 0 1 0 1};
>> net = newlin(P1,T1,[0 1],0.01);
??? Undefined function or method 'newlin' for input arguments of type 'cell'.
ozturkib
  • 1,493
  • 16
  • 28
  • Maybe clean your environment first in case newlin is defined somewhere else? `close all; clear all; path(pathdef); clc;`. Then explicitly add to your path `newlin.m`. – Franck Dernoncourt Apr 12 '13 at 14:42
  • I already have done it before asking this question here like this : – ozturkib Apr 12 '13 at 14:46
  • close all;clear all;path(pathdef); clc; P1 = {0 -1 1 1 0 -1 1 0 0 1}; T1 = {0 -1 0 2 1 -1 0 1 0 1}; net = newlin(P1,T1,[0 1],0.01); – ozturkib Apr 12 '13 at 14:47
  • If you do `newlin()` what does it return? – Franck Dernoncourt Apr 12 '13 at 14:48
  • Do I need to add explicitly newlin.m because when i wrote on command prompt >edit newlin i can see the inside of function! – ozturkib Apr 12 '13 at 14:49
  • >> newlin() ??? Undefined function or variable 'newlin'. – ozturkib Apr 12 '13 at 14:50
  • ok so it doesn't see `newlin.m`, otherwise the error message would have been `Error using newlin (line 92). Not enough input arguments.`. Try adding `newlin.m` manually. – Franck Dernoncourt Apr 12 '13 at 14:52
  • Franck I know to add folder directory by edit pathdef however how can i add .m file to folder ? (Note the folder which newlin is inside is already in the pathdef.m, I saw it!) – ozturkib Apr 12 '13 at 15:01
  • Yep sorry I meant adding the folder indeed. To make sure the path is set when you run the script, you can use `addpath` at the beginning of it. How about adding a `testme.m` file along with `newlin.m` and try calling `testme`? – Franck Dernoncourt Apr 12 '13 at 15:44
  • I think we are going on the wrong path :( Because i have tried this license checkout Neural_Network_Toolbox and there isnot license probably this is the reason i think however i have a license for my entire matlab version – ozturkib Apr 12 '13 at 15:49
  • Read my edit, newlin does not accept cell inputs. – Oleg Apr 12 '13 at 15:51
  • Yep maybe there is a conflict with http://www.mathworks.com/help/nnet/ug/adaptive-linear-network-architecture.html indeed. The documentation seems to be self-contradictory. – Franck Dernoncourt Apr 12 '13 at 15:51
  • Also i have tried your way like this i changed current folder to newlin directory as C:\Program Files\MATLAB\R2010a\toolbox\nnet\nnet\nnnetwork. Still cannot run this function and the same problems. So i think it isnot related with path problem. Are u agree with me ? – ozturkib Apr 12 '13 at 15:52
  • Yep agree, now the only thing I can think of is what Oleg said in his answer. – Franck Dernoncourt Apr 12 '13 at 15:53
  • When you changed current folder to newlin directory as C:\Program Files\MATLAB\R2010a\toolbox\nnet\nnet\nnnetwork, what does newlin() return? – Franck Dernoncourt Apr 12 '13 at 15:54
  • No because i have found Oleg's suggestion before and i have tried it before asking this question here! – ozturkib Apr 12 '13 at 15:56
  • I think it is related with license but i cannot be sure. >> license checkout Neural_Network_Toolbox License checkout failed. License Manager Error -101 All licenses are reserved for others. The system administrator has reserved all the licenses for others. Reservations are made in the options file. The license server system must be restarted for options file changes to take effect. Troubleshoot this issue by visiting: http://www.mathworks.com/support/lme/R2010a/101 Diagnostic Information: Feature: Neural_Network_Toolbox – ozturkib Apr 12 '13 at 15:57

1 Answers1

0

Check that you have the Neural Network Toolbox installed with:

ver nnet

EDIT

I see now, newlin() does NOT accept cell array inputs, i.e. curly braces { }, use square brackets for concatenation, i.e. [ ], to get vectors of type double:

 P1 = [0 -1 1 1 0 -1 1 0 0 1];
 T1 = [0 -1 0 2 1 -1 0 1 0 1];
Oleg
  • 10,406
  • 3
  • 29
  • 57
  • Read Note insdie the question! – ozturkib Apr 12 '13 at 14:59
  • Yes, but does the command return the version or not? If not, it might be license problems and you would need to edit the configs with FLEXnet lm. – Oleg Apr 12 '13 at 15:03
  • >> ver nnet ------------------------------------------------------------------------------------- MATLAB Version 7.10.0.499 (R2010a) MATLAB License Number: 186994 Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1) Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode ------------------------------------------------------------------------------------- Neural Network Toolbox Version 6.0.4 (R2010a) – ozturkib Apr 12 '13 at 15:04
  • I have tried this before already this is not the case! >> P1 = [0 -1 1 1 0 -1 1 0 0 1]; >> T1 = [0 -1 0 2 1 -1 0 1 0 1]; >> net = newlin([-1 1],1,[0 1]); ??? Undefined function or method 'newlin' for input arguments of type 'double'. – ozturkib Apr 12 '13 at 15:54
  • Try to run `which newlin -all`, what do you get? – Oleg Apr 12 '13 at 15:57
  • yeah exactly there is no license :( C:\Program Files\MATLAB\R2010a\toolbox\nnet\nnet\nnnetwork\newlin.m % Has no license available – ozturkib Apr 12 '13 at 16:00
  • Try to run `rehash toolboxcache` then `which newlin -all`. Also, do you happen to have other newlins? Or, did you add files to the NN toolbox? – Oleg Apr 12 '13 at 16:09
  • >> rehash toolboxcache >> newlin -all ??? Undefined function or method 'newlin' for input arguments of type 'char'. – ozturkib Apr 12 '13 at 16:37
  • What you mean other newlins? I didnt add any files or any lines to NN because it is my first example in NN toolbox. – ozturkib Apr 12 '13 at 16:38