0

私はこれを試しました:

linefunca = @(xa,ya) aa*xa + ba*ya + ca;

figure(1)
imshow(Pica);
hold on;
ezplot(linefunca,[1,1072,1,712]);

しかし、私はこのエラーで返されます:

 In an assignment  A(I) = B, the number of elements in B and I must be the same.

Error in ezplotfeval/applyfun (line 80)
       z(i) = feval(f,x(i),y(i));

Error in ezplotfeval (line 65)
    z = applyfun(x,y);

Error in ezplot>ezimplicit (line 257)
u = ezplotfeval(f, X, Y);

Error in ezplot (line 153)
            hp = ezimplicit(cax, f{1}, vars, labels, args{:});

Error in ps3 (line 313)
ezplot(linefunca,[1,1072,1,712]);

aabacaはすべて既知の値 (列ベクトル) です。x と y の制限は、私が作業している画像のサイズです。一連のエピポーラ線をプロットしようとしています。助言がありますか?

編集:

lt = length(aa);
linefunca = @(x,y,t) aa.*x(t) + ba.*y(t) + ca(t);
figure(1)
imshow(Pica);
hold on;

for t=1:lt
    ezplot(@(x,y,t) linefunca(x,y,t),[1,lt]);
end
4

1 に答える 1

1

私の知る限り、ezplotのような一連の線をプロットすることはできませんplot。これを回避する方法kは、現在の行を選択するために使用される無名関数にパラメーターを追加することです。次に、for ループ内のすべての行を調べて、1 つずつプロットできます。

さらに:ezplotヘルプページに記載されているように、配列関数を使用する必要がある.*ため、ベクトルを使用して関数を評価できます。./.^ezplot

N = 5;
aa = rand(N,1); ba = rand(N,1); ca = rand(N,1);
linefunca = @(xa,ya,k) aa(k).*xa + ba(k).*ya + ca(k);

hold on
for k=1:N
    ezplot(@(x,y)linefunca(x,y,k),[-5,5,-5,5]);
end
hold off
于 2015-03-03T06:11:02.803 に答える