![]() ![]() If the number of observations is unknown at compile time, you can also specify the input as variable-size by using coder.typeof (MATLAB Coder). Use coder.Constant (MATLAB Coder) for the names of name-value pair arguments. To specify the data type and exact input array size, pass a MATLAB® expression that represents the set of values with a certain data type and array size. Because C and C++ are statically typed languages, you must determine the properties of all variables in the entry-point function at compile time. Generate code for the entry-point function using codegen (MATLAB Coder). This folder includes the entry-point function file. Note: If you click the button located in the upper-right section of this example and open the example in MATLAB®, then MATLAB opens the example folder. ![]() Adding this directive instructs the MATLAB Code Analyzer to help you diagnose and fix violations that would result in errors during code generation. = predict(CompactMdl,x,varargin) Īdd the %#codegen compiler directive (or pragma) to the entry-point function after the function signature to indicate that you intend to generate code for the MATLAB algorithm. MYPREDICTQLM % also returns confidence interval bounds for the predictions in the % n-by-2 vector ci.ĬompactMdl = loadLearnerForCoder( 'QLMMdl') Function = mypredictQLM(x,varargin) %#codegen %MYPREDICTQLM Predict response using linear model % MYPREDICTQLM predicts responses for the n observations in the n-by-1 % vector x using the linear model stored in the MAT-file QLMMdl.mat, and % then returns the predictions in the n-by-1 vector yhat.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |