Shif factors in X and y directions
2 次查看(过去 30 天)
显示 更早的评论
Hi all, I have to find the x and y shift factor of the curves. I started as follows however coudnt know how to proceed further. Here is the code objective. Let me have two data sets {t1, E1} and {t2, E2} and so on. Lets consider only two data sets for time being.
where
E1'
ans =
-1.6817 -1.6806 -1.6796 -1.6788 -1.6775 -1.6766 -1.6758 -1.6751 -1.6748 -1.6737 -1.6731
>> t1'
ans =
-0.7782 -0.9823 -1.1761 -1.3802 -1.5775 -1.7782 -1.9823 -2.1761 -2.2553 -2.5775 -2.7782
>> E2'
ans =
-1.6820 -1.6811 -1.6803 -1.6795 -1.6785 -1.6777 -1.6769 -1.6762 -1.6759 -1.6749 -1.6742
>> t2'
ans =
-0.7782 -0.9823 -1.1761 -1.3802 -1.5775 -1.7782 -1.9823 -2.1761 -2.2553 -2.5775 -2.7782
polynomials were fitted as
p1 =polyfit(t1, E1 , 2); p2 =polyfit(t2, E2 , 2)
I plotted the data as follows for graphical visualization:
plot(t1,E1,'o', t2,E2,'+')
hold on
plot(t1, polyval(p1, t1), t2, polyval(p2, t2) )
Aim is to shift the E2-t2 data in x and y directions to minimize the error such that I can find the shifts in x and y directions. (I have found a similar procedure in this paper, Figure 4: http://www.eng.uc.edu/~beaucag/Classes/Characterization/DMA%20Lab/IF1.1%20Fukushima.pdf)
Please let me know suitable commands to do this. Appreciate your time. Thanks!
3 个评论
SK
2014-9-30
What is your meaning of "error". Is it sum of squares of differences in the y values?
I notice that t1 and t2 have the same starting and ending point. So if we use the above definition, no x-shift can be done, only y shift.
Also do you want to just shift or rescale each graph non-linearly along the x-axis? Need more details.
回答(2 个)
Stephen23
2014-9-30
编辑:Stephen23
2014-9-30
Sounds like homework.
Assuming that the curves are not rotated, repeated, mirrored, dilated, nor sheared, and match for some unique combination of x and y offsets, then this should be do-able.
Some hints:
- define functions that calculate the residual distance between two vectors, with x and y shift factors as variables.
- create vectors for both the x and y shift, containing the range that you would like to consider.
- apply the functions to each combination of x and y offsets...
- find the minimum.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surrogate Optimization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!