How can I find the difference between two plots with a dimensional mismatch ?
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 5 Aug 2015
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)
2 Comments
See Also
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!