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

 채택된 답변

Sean de Wolski
Sean de Wolski 2015년 4월 24일
편집: Sean de Wolski 2015년 4월 24일
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')

추가 답변 (1개)

Hector Gomez
Hector Gomez 2015년 4월 27일
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

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!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

질문:

2015년 4월 24일

댓글:

2015년 4월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by