MS Access recordset with Matlab dll


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));

% end

Now i want to use it in MS Access with DAO recordset like this:

Sub try()
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
End Sub

"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).
7/8/2004 10:22:43 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies

Similar Articles

[PageSpeed] 15