Demo entry 2842045

linearmenteseparaveis

   

Submitted by Pedro A.A de Castro. on Oct 11, 2015 at 15:53
Language: Matlab. Code size: 1.2 kB.

load('dados_resumidos.mat')

j = i + 1;

n = 3226;

parfor i=1:n
   
	for j=1:n

		  x = braca1(:,i);
            y = braca2(:,j);

        		e = mse(x,y);

		data = horzcat(x,y);
		data = [data ones(size(data,1),1)];

		b1 = ones(3,1);
		b2 = -ones(3,1);

		b = vertcat(b1,b2);

		z = lsqlin(data,b);

		yy = -z(3)/z(2) - (z(1)/z(2))*data;
        % m1 = -z(3)+ 1/z(2) - (z(1)/z(2))*data;
        % m2 = -z(3)- 1/z(2) - (z(1)/z(2))*data;
        %abline((b+1)/w[2],-w[1]/w[2],lty=2)
        %abline((b-1)/w[2],-w[1]/w[2],lty=2)
		xspace = linspace(2.5,0.10,6);

		xspace = xspace';

		yspace = linspace(2.5,0.10,6);

		yspace = yspace';

		% Create figure

		fig=figure('Color',[1 1 1]);
		colormap('copper');

		plot(xspace, x,'bo','LineWidth',2);
		hold on;
		plot(xspace,y,'gx','LineWidth',2);
		hold on;
		plot(data, yy,'r--','LineWidth',2);
        
		title(['MSE = ', num2str(e)],'EdgeColor',[1 1 1],'FontWeight','bold','FontSize',14,'FontName','Courier New');
		xlabel(['Gene  ', Genes{i,1}])
		ylabel(['Gene  ', Genes{j,1}])
		legend('Braca1','Braca2')

		saveas(fig, [ Genes{i,1} ,'_' ,Genes{j,1}], 'tif');
        %clear all;
        %close all;
	end
end
%close all

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).