Greetings!
I am not successful in calling a user defined function inside a Matlab Script Node.
The path has been added to Matlab, but the Matlab script node is not calling my function.
I am calling it as follows:
a= fcd(b,c);
and the fcd.m file is calculating the 'first central difference' - works in Matlab, but not in LabVIEW:
function MtxOut=fcd(MtxIn,dt)
%MtxOut=fcd(MtxIn,dt)
%first central difference method of finding instantaneous
%first derivatives
%
%MtxIn = MxN matrix of inputs
%dt = time change between inputs
%MtxOut = MxN matrix of first derivatives of inputs
r=size(MtxIn,1);
c=size(MtxIn,2);
MtxOut(1,:)=(MtxIn(2,:)-MtxIn(1,:))/dt;
MtxOut(r,:)=(MtxIn(r,:)-MtxIn(r-1,:))/dt;
for i=2:r-1
for j=1:c
MtxOut(i,j)=(MtxIn(i+1,j)-MtxIn(i-1,j))/(2*dt);
end
end