clc; close all; clear all % y=randn(1,5000) % hist(y,40) % x=zeros(1,5000) % for i=1:1000 % % g=rand(1,5000); % h=(g<0.5)*2-1 % x=x+h % end % hist(x,40) % x=rand(1,50) % % hist(x,6) % b=6 % a=4 % y=(b-a)*x+a; % hist(y,6) % x=1:10; % x=(x>5)+1 % plot(x) % axis([0 10 0 3]) %A*X=B A=[3 2 -1; 2 -2 4; -1 0.5 -1] B=[1; -2; 0] InA=A^-1; InA2=inv(A); X=InA*B X=InA2*B