Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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 :))

Akzeptierte Antwort

Voss
Voss am 9 Mär. 2024
% 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')

Weitere Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by