How to generate a binary executable file for my matlab functions so that other users can just compile this binary file and use it without looking at matlab code?
Show older comments
Hi, I got a question here. I wrote a function in matlab. This function needs multiple inputs. Inside the function, it also to read two .txt files for parameterization. I am trying to compile this function and these two parameter files into one binary file, so for others who want to use this function, they only need to upload this binary file into their matlab library, and then compile it and use it, without looking at the original code. Does anybody have any idea about how to do this? Thank you very much! Here is some code about my function:
%input data array: sst, Rrs412, Rrs443, Rrs488,Rrs55, Rrs667
%output data array:SSS
%function begins
function SSS...
= sss_MODIS_aNN(sst,Rrs412,Rrs443,Rrs488,Rrs555,Rrs667,I)
%import parameter files (totally there are 4 files)
Bias_In_I=importdata('b1_br_gom.mat');
Bias_Out_I=importdata('b2_br_gom.mat');
Weight_In_I=importdata('matlab_nn/w1_br_gom.mat');
Weight_Out_I=importdata('w2_br_gom.mat');
%make the input data array ready
Input_I=[nsst,nRrs412,nRrs443,nRrs488,nRrs555,nRrs667]';
%now calculate the output
n_I=Weight_In_I*Input_I+Bias_In_I*ones(1,length(Input_I(1,:)));
activation_function_I=2./(1+exp(-2.*n_I))-1;
output_I=Weight_Out_I*activation_function_I+Bias_Out_I*ones(1,length(Input_I(1,:)));
out_I_a=(Sigma_Out_I(1)*(output_I)+Mean_Out_I(1));
SSS=out_I_a(1,:);
%output has been derived
Accepted Answer
More Answers (0)
Categories
Find more on Troubleshooting in MATLAB Compiler SDK in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!