% Dibuja

function [x,fx]=dibuja_GM(K,Pk,mu,v);   

x=(-2:.01:2).';
T=length(x);
fx=zeros(size(x));
for k=1:K    
  fk_por_Pk(1:T,k)=Pk(k)*1/(sqrt(2*pi*v(k)))*exp(-(x-mu(k)).^2/(2*v(k)));
  fx=fx+fk_por_Pk(:,k);
end;
subplot(211);plot(x,fx);
subplot(212);plot(x,fk_por_Pk,'--');
