You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: DEMO_Jansen_linkage_animation_01.m
    path of file: ./repos/GIBBON/docs
    
    the code of the file until where you have to start completion: %% DEMO_Jansen_linkage_animation_01
% Below is a demonstration for:
%
% * Creating/running an animation for the Jansen linkage. 

%% Keywords
%
% * Jansen linkage
% * Linkage
% * anim8

%% References
% 
% * https://en.wikipedia.org/wiki/Jansen%27s_linkage

%
    
function [V]=getxyval(a1,E,V)

g5_34=vecAngle(V(3,:)-V(5,:),V(4,:)-V(5,:));
g7_68=vecAngle(V(6,:)-V(7,:),V(8,:)-V(7,:));


%Compute all lengths
L=patchEdgeLengths(E,V);    

%Update coordinate for P2
V(2,1)=cosd(a1)*L(1)+V(1,1);
V(2,2)=sind(a1)*L(1)+V(1,2);

%Distance between P2 and P5
d25=sqrt(sum((V(2,:)-V(5,:)).^2,2)); 
a25=vecAngle(V(2,:)-V(5,:),[1 0 0]);
g5_23=acosd((L(2)^2-d25^2-L(4)^2)./(-2*d25*L(4)));

%Flip sign of angle when needed
% a4=atand(R41(2)/R41(1));
if dot(V(2,:)-V(5,:),[0 1 0])<0 %&& (a1-a4)<360
    a25=-a25;
end