What is this?
Hello,
I want to rewrite the following Matlab code to Maple
sum(Yp.*X(:,2))
and
si2(:,1)=1/2*(Y1(:,1)-Y2(:,1)).^2;
Could you help me please?
Thanks
Vladimir
For the first I think you want
LinearAlgebra:-DotProduct(Yp,X[1..-1,2],conjugate=false);
But I don't know whether Matlab routinely uses the conjugate. If so, then you could use the simpler (notationally):
Yp . X[1..-1,2];
In the second case I think you want
si2[1..-1,1] := 1/2*map(x->x^2, Y1[1..-1,1]-Y2[1..-1,1]);
Haven't actually tested these, so...
Comments
matlab to maple
For the first I think you want
But I don't know whether Matlab routinely uses the conjugate. If so, then you could use the simpler (notationally):
In the second case I think you want
Haven't actually tested these, so...