How to use the generated Neural Fitting Matlab function using "Deploy Solution"...

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

 Accepted Answer

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')

More Answers (1)

Thank you very much Sean. This was exactly the reason why it did not work! Another example of my blindness to certain obvious things together with my ignorance...
Cheers,
Hector

1 Comment

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!

Sign in to comment.

Categories

Find more on Deep 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!