How can I find the difference between two plots with a dimensional mismatch ?
2 次查看(过去 30 天)
显示 更早的评论
Hello all,
I have a question that I don't know if there is a solution off the bat.
Here it goes,
I have two data sets, that I have plotted on the same figure. I need to find their difference, simple so far... the problem arises in the fact that say matrix A has 1000 data points while the second (matrix B) has 580 data points. How will i be able to find the difference between the two graphs since their is a dimensional miss match between the two figures.
One way that I thought of is artificially inflating matrix B to 1000 data points, but the trend of the plot will remain the same. Would this be possible? and if yes how?
0 个评论
回答(1 个)
Walter Roberson
2015-8-5
all_x = unique([x_from_A(:); x_from_B(:)]);
refined_A = interp1(x_from_A, A, all_x);
refined_B = interp1(x_from_B, B, all_x);
plot(all_x, refined_B - refined_A)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axes Appearance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!