## Simulation of Dealer Commissions with Matlab

As demonstrated in an earlier article dealer or sales commissions can easily be calculated with the .NET Calculation Engine finaquant® calcs.

This article demonstrates how changes in commission amounts can be simulated by varying selected table-valued inputs. In example presented here, the math software Matlab is connnected with the Calculation Engine implemented with finaquant® calcs in order to:

1. Control the variation of selected inputs; Sales and Commission Scales.
2. Reporting: Visualize the resultant total commissions with plot diagrams.

## Finaquant’s Matrix and Vector Functions

Both of our .NET libraries finaquant® protos (non-commercial) and finaquant® calcs (commercial) contain Matrix and Vector functions in addition to Table Functions. In fact, table functions are higher level constructs that are based on matrix and vector functions of the library.

You may find examples for Matrix and Vector functions in the Visual Studio file FinaquantCalcsStarter (or FinaquantProtosStarter) that you can download at the corresponding product page (see related downloads).

Parallel to field types of tables (text attribute, numeric attribute, key figure) there are three types of matrices and vectors:

1. KeyMatrix/KeyVector (double)
2. NumMatrix/NumVector (integer)
3. TextMatrix/TextVector (string)

Here are some examples for creating matrices, and making operations with them: Continue reading

## Table Function Demo with Microsoft Excel

As mentioned earlier in a related article Table Functions of the .NET libraries finaquant® calcs (commercial) or finaquant® protos (non-commercial) can be called from an excel sheet.

Following example demonstrates:

• How Table Functions can be called from excel macros (VBA)
• Generally, excel-.NET integration: How C#/.NET methods can be called from within excel macros (VBA)
• How data tables in excel worksheets can be read and written by C#/.NET methods
• How simple parameters (string, integer, double) can be passed from excel macros to C#/.NET

In order to run the demo with excel:

1. Download and install finaquant® calcs, Calculation Engine based on Table Functions (.net library).
3. Build (or rebuild if you have already built) the VS project (ensure “Register for COM interop” is checked as build option under Project Properties).
4. Open the excel file named CalcsExcelDemo (double click) under the folder named Resources in VS project CalcsExcelIntegration.