0
我已經試過這樣:MATLAB中的ezplot,如何使用函數句柄繪圖?
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]);
aa
,ba
,ca
都是已知值(列向量)。 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
我很感激幫助,但是這給了我同樣的錯誤。 – 2015-03-03 06:23:58
你確定添加了'。*'嗎?如果我從我的答案複製示例代碼,它工作正常。 – hbaderts 2015-03-03 06:32:17
我沒有完全按照你寫的那樣複製它;我在我的代碼中嘗試過。看我的編輯。 – 2015-03-03 06:41:34