Wavecom W-BitView V2.5.00 User Manual
Page 80
74
Custom Library
BitView Manual V2.5.00 WAVECOM W-BV
function [y, outpar1, outpar2, outpar3, outpar4, outpar5] = MatlabFunction(
x, inpar1, inpar2 )
%
%--------------------------------------------------------------------------
% Example of a function to be called from .Net environment, especially from
% a BitViewTool CustomLib function. This function declares different input
% and output parameters, to demonstrate how to access these parameters from
% a .Net environment.
%
% Inputs:
% -------
%
% x : should be a [n,1] input array containing the bit stream from the
% BitViewTool, the expected values must be 0 and 1
% inpar1, inpar2: these are parameters to control the function's behaviour
%
% Outputs:
% --------
%
% y : should be a [k,1] output array containing the bit stream as an
% output from this function, the type of y should be double or
logical.
% The values must be 0.0 and 1.0 if double.
% outpar1, outpar2, outpar3, outpat4, outpar5 : these are additional
calculation
% results from this function of type scalar or string depending on the
% function's behaviour. outpar5 is of type char array
%
%
%--------------------------------------------------------------------------
% After this function is debugged and tested, the MatLab deploytool has to be
% started with 'deploytool' in the Command Window
% In the deploytool create a new .net project, project type is .NET
% Component, enter a Component name, in the project settings under .NET set
the
% the Microsoft Framework to Version 2.0, the Assembly type to private.
% Then push the Build Project button in the Deployment toolbar.
% When finished copy the .dll and .ctf files from the function's
% project\distrib directory to the BitViewTool customlib directory
% C:\Documents and Settings\All Users\Documents\WAVECOM\BitViewTool\CustomLib
%
% Next step is to create a new WAVECOM CustomLib function from the template
% found in the new project wizzard in Visual Studio.
% Add a the reference in the Solution Explorer to the .dll just copied to to
% CustomLib directory. Add a reference in the C# CustomLib source under the
% 'using' region, the namespace to be used is the same used in the solution
% explorer.
%
%--------------------------------------------------------------------------
outpar1 = nargin; % for example : outpar1 returns number of input function
arguments
[m, n] = size( x ); % for example : outpar2 returns length of input array
x, i.e. number of rows
outpar2 = m;
outpar3 = n; % number of columns, should be 1 in our example
outpar4 = inpar1 * inpar2; % example of calculation for outpar4
y = ~x; % this is the only calculation for the input data, outpt
y is inverse(x)
% and converts y to type 'logical' !!!!
if (n ~= 1)
outpar5 = 'Function error: input data dimension [m,n] with n ~= 1';
else
outpar5 = 'Function called successfully';
end
-----------------------------------------------------------------------------
--------
*/
// we can now see 3 Input parameters and 6 output parameters
// x is the input data column vector, type is double
// y is the returned column vector, type can be double or logical,
// all other parameters are scalars, expected