Question on subtracting two graph(surface)

54 views (last 30 days)
Young Chan Jung
Young Chan Jung ungefär 21 timmar ago
Commented: Young Chan Jung ungefär 20 timmar ago
Hello,
Say I have line 'A' that has coordinate (0,0) , (1,1) and line 'B' that has coordinate (0.5, 0.5) , (1.5, 1.5)
this can be two lines, or parts of two different surfaces.
I want to subtract these two, and the result should give horizontal line at y=0 between x = 0.5~1, right?
However, the only way I can think of subracting is by cooridnates.
I have many data points, so interpolating each line won't work.
Is there a way to subtract the whole line instead of subtracting coordinate by coordinate?
Thank you
  2 Comments
Sandeep Mishra
Sandeep Mishra ungefär 20 timmar ago
Based on the data points for lines 'A' and 'B', it seems they both lie on the line y = x.
Could you clarify what you mean by subtracting these two lines? What result are you expecting?
Young Chan Jung
Young Chan Jung ungefär 20 timmar ago
Thank you for the answer.
I have surface data, before and after the wear test. there is some parts that were not worn, which should match to each other's profle. Well, at least should be within certain error.
However, The resolution of each points were not close enough that the points were collected in different places.
Just for example, there is surface asperity profile data that has the slope of y=x. Say the total length of this asperity slop was from x = 0 to x = 1.5.
The problem is, the two data set gave me the cooridnate points that are offsetted, measuing at x=0, x=1 for data 'A' and x=0.5 x=1.5 for data 'B'. In other words, points are separated by 1, but 'A' and 'B' collected by the offset of 0.5.
I cannot just shift B by -0.5, because the profile itself are alinged. just measured points were offsetted
In this case if the lines between the points can be subtracted, it should give y=x for x=0~0.5, 1~1.5, and y=0 for x=0.5~1. I am assuming straight line interpolation between the points.
I cannot find a way to do this, but only choice I have is subtracting point by point, say shift 'B' data by x=-0.5 and subtract each point. This will give y=0 for x= 0~1, which is not what I want.
I heard of using somekind of mesh to kinda interpolate, but not sure how to do it
Thank you

Sign in to comment.

Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!