Matlab数据处理

<pre name="code" class="plain">%%
close all;clear all;clc 


[a2,b2,c2,d2,e2,t2,h2] = textread('CornerData.txt');


q = [1. 0. 0. -3.5487332534790039e+002;...
    0. 1. 0. -2.3823274803161621e+002;...
    0. 0. 0. 1.4812876879989974e+003;...
    0. 0. 8.4546261176963473e-003 0;];    %输入数组


Disp = d2-t2;  %视差
x = d2;       
y = e2;




for i=1:88    
    tmp = q*[x(i),y(i),Disp(i),1]'; % j 是列数,i 是行数,分别对应公式中的 x 和 y  
    X(i,:) = tmp(1)/tmp(4);
    Y(i,:) = tmp(2)/tmp(4);
    Z(i,:) = tmp(3)/tmp(4);
end
Y = -Y;
figure
plot3(X,Y,Z,'*')





你可能感兴趣的:(matlab)