M=pmsm_estim_mex('Mz_mx.cfg');

figure(1)
subplot(2,1,1);
plot(M.x(:,3));

subplot(2,1,2);
hold off
plot(M.crbz(:,4));
hold on
plot(M.crb(:,4),'r');

figure(2)
hold off
plot(M.crbz(:,3));
hold on
plot(M.crb(:,3),'r');

ind=100:size(M.crb,1)-100;
[min(M.crb(ind,3)), max(M.crb(ind,3))]
[min(M.crbz(ind,3)), max(M.crbz(ind,3))]
