i've compiled following function into mama_1_0.dll:
function[Rend,Vola] = Rendite(X)
I = find(X); %Zeros
B = X(I(1):size(X)); %
C1 = B(1:size(B)-1);
C2 = B(2:size(B));
Erg = C2./C1-1; %Compute Returns
Rend = mean(Erg);
Vola = sqrt(var(Erg));
Now i want to use it in MS Access with DAO recordset like this:
Dim Matl As New Mama.Mama 'Matlab dll
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim vol As Double
Dim ret As Double
Set db = CurrentDb
Set rs = db.OpenRecordset("select Timeseries from 1", dbOpenSnapshot)
'1 is the table
Call Matl.rendite(2, ret, vol, rs)
MsgBox (vol & " " & ret)
set db = nothing
"rs" is a tabel with 1 field.
"ret" and "vol" are 2 variables for computed Rend and Vola.
I see following Error Message everytime: "Data conversion error:
Unable to copy array data from object".
I understand, i must convert data in my matlab function, but i dont
know how. Please help me (sorry i cant use DatafeedToolbox, since i
want to compile a standalone).