フィルターのクリア

how to draw contour error graph by using vector-like formation data

2 ビュー (過去 30 日間)
dayeon
dayeon 2024 年 3 月 9 日
コメント済み: Voss 2024 年 4 月 5 日
hi, i want to plot following graph by using 'contour' function in matlab.
here, i want to plot the cyclic coordinate optimizer's performance, which is used in align two images, shifting to x and y direction.
so in upper image, x is the x shift value, and y is y shift value, and z is error value.
and my x, y, z data is vector formation, so i don't know how to use matlab's 'contour' function by using these data.
how can i plot upper graph by using my vector data?
i appreciate all your help.
thanks a lot :))

採用された回答

Voss
Voss 2024 年 3 月 9 日
% plot the contour
f = @(x,y)5*x.^2-6*x.*y+5*y.^2;
[X,Y] = meshgrid(linspace(-1.5,1.5,100));
contour(X,Y,f(X,Y),linspace(0.5,5,6),'k','ShowText','on')
% I don't know what form your x,y is in, so I use this
xy0 = [-0.5 -1];
dxy = [0 0.6; 0.25 0; 0 0.2; 0.15 0; 0 0.15; 0.05 0; 0 0.03; 0.03 0; 0 0.02; 0.02 0];
xy = xy0+[0 0; cumsum(dxy,1)];
% plot the red line from x,y
hold on
plot(xy(:,1),xy(:,2),'r')
  2 件のコメント
dayeon
dayeon 2024 年 4 月 5 日
thank you so much! It really helped me!! :))
Voss
Voss 2024 年 4 月 5 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by