How send Matlab (.mat file) output to a webpage
조회 수: 1 (최근 30일)
이전 댓글 표시
We have a trained neural network mat file. Now, I want to display its output on the webpage. We use this command in the Matlab to retrieve the results: sim(net,[A;B;C])
I tried to use donetbuilder, but I could not make it with .mat file. It needs a .m file to attach to a class!?
Moreover, I could not find any related codes about deploying .mat files on the web in the Mathworks?
Thank you!
댓글 수: 0
답변 (2개)
Walter Roberson
2013년 1월 1일
Net-Builder cannot be used to package Simulink functions. You would need Simulink Coder, and I am not sure at the moment whether it would support the neural network functions.
댓글 수: 7
Walter Roberson
2013년 1월 3일
I misread the code earlier and replied that Simulink functions cannot be used for Net-Builder. While that is true, you are using Neural Network instead of Simulink.
Neural Network Toolbox is supported for MATLAB Compiler, and so is also supported for NET Builder and Java Builder.
So let us start again: what happens when you tried to load from a .mat file?
If your .net (or Java) calls upon a MATLAB function that does a load() of a saved network, then in that MATLAB function, include the line
%#function network
That will allow the builder to know that the network class needs to be included in the created executable.
owr
2013년 1월 4일
Last I checked (2 years ago), you can compile a call to the Neural Network Toolbox "sim" function. You cant compile any type of training functions (train, adapt, etc.), but simulating a pre-trained network shouldnt be an issue.
Looking at your code snippet above, if I had to guess, I'd say you're running into a problem with your call to "load". The compiled function may not be running in the active directory where "SIMdata.mat" is located. Try using a full path just in case that is that is the issue? You cna always revise later once you have a solution working.
Also, I would try using the form of load that captures an output:
out = load('SIMdata.mat')
T2 = sim(out.net,[W1;T1;RH1;S1]);
Ive run into issues in the past with this as the compiler doesnt know exactly which version of "sim" to include in the package without being able to sope the run time type of "net".
Hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!