Intersections between two discretised functions
Hi Everybody, I have the following problem:
I have two vectors:
v1 = list of values representing a discretised non monotonic function
v2 = list of values representing a constant and horizontal line
v1 has no analytical model. It’s just a vector containing the values a function assumes in a given interval.
To make everything clearer, let’s consider the following case:
v1 = list of 100 values representing a parabola: y= x^2, with x=linspace(-5, +5, 100)
v2 = ones(1,100)
f = @(x) x.^2;
values = linspace(-5, 5, 100);
v1 = f(values);
v2 = ones(1,100);
Clearly, the intersection points are two, for x1=-1 and x2=+1.
Now let’s forget about the fact that we had the analytical expression for v1 and let’s just consider the vector itself.
How can I implement this on Matalb for a generical vector v1 which is not monotonic and is supposed to have two intersection points with v2? I tried doing something with interp1 but couldn’t figure it out.
Thanks a lot to whoever will help me!Hi Everybody, I have the following problem:
I have two vectors:
v1 = list of values representing a discretised non monotonic function
v2 = list of values representing a constant and horizontal line
v1 has no analytical model. It’s just a vector containing the values a function assumes in a given interval.
To make everything clearer, let’s consider the following case:
v1 = list of 100 values representing a parabola: y= x^2, with x=linspace(-5, +5, 100)
v2 = ones(1,100)
f = @(x) x.^2;
values = linspace(-5, 5, 100);
v1 = f(values);
v2 = ones(1,100);
Clearly, the intersection points are two, for x1=-1 and x2=+1.
Now let’s forget about the fact that we had the analytical expression for v1 and let’s just consider the vector itself.
How can I implement this on Matalb for a generical vector v1 which is not monotonic and is supposed to have two intersection points with v2? I tried doing something with interp1 but couldn’t figure it out.
Thanks a lot to whoever will help me! Hi Everybody, I have the following problem:
I have two vectors:
v1 = list of values representing a discretised non monotonic function
v2 = list of values representing a constant and horizontal line
v1 has no analytical model. It’s just a vector containing the values a function assumes in a given interval.
To make everything clearer, let’s consider the following case:
v1 = list of 100 values representing a parabola: y= x^2, with x=linspace(-5, +5, 100)
v2 = ones(1,100)
f = @(x) x.^2;
values = linspace(-5, 5, 100);
v1 = f(values);
v2 = ones(1,100);
Clearly, the intersection points are two, for x1=-1 and x2=+1.
Now let’s forget about the fact that we had the analytical expression for v1 and let’s just consider the vector itself.
How can I implement this on Matalb for a generical vector v1 which is not monotonic and is supposed to have two intersection points with v2? I tried doing something with interp1 but couldn’t figure it out.
Thanks a lot to whoever will help me! interpolation, intersection, function, numerical MATLAB Answers — New Questions