How to use the generated Neural Fitting Matlab function using "Deploy Solution"...
1 view (last 30 days)
Show older comments
Hector Gomez
on 24 Apr 2015
Commented: Sean de Wolski
on 27 Apr 2015
Hi all, I am a newbie in Matlab so I am sorry if I am asking a silly question. The version I am using is R2014b. I have a matrix "input" (3 variables and 729 samples) and a matrix "target" (3 variables with the 729 values.) I have used the nftool and after several trials let's say I have found something that could be useful. In the "Deploy Solution" I have saved the "Application Deployment" Matlab Function. I thought that I could pass to the generated function the "input" matrix as an argument to generate the "output" and compare it to the "target". Something like:
output = Function(input);
but it does not work. I get the following error message:
" Error using bsxfun Non-singleton dimensions of the two input arrays must match each other.
Error in Function>mapminmax_apply (line 56) y = bsxfun(@minus,x,settings_xoffset);
Error in Function (line 40) xp1 = mapminmax_apply(x1,x1_step1_gain,x1_step1_xoffset,x1_step1_ymin); "
Can anyone help me with that? How can I pass the "input" matrix to the "Function"?
Thanks,
Hector
0 Comments
Accepted Answer
Sean de Wolski
on 24 Apr 2015
Edited: Sean de Wolski
on 24 Apr 2015
First, don't call it function because that's a keyword. Second, the most common reason I see that is because of a missing transpose:
output = nn_function(xinput')
0 Comments
More Answers (1)
Hector Gomez
on 27 Apr 2015
1 Comment
Sean de Wolski
on 27 Apr 2015
Well Neural Nets are the only thing in MATLAB that expect samples to be columns rather than rows. It's confusing and we all do this!
See Also
Categories
Find more on Get Started with Statistics and Machine Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!