필터 지우기
필터 지우기

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')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by