Creating a spline (curve) parallel to an existing spline (curve)

3 visualizaciones (últimos 30 días)
Kanchan
Kanchan el 29 de Ag. de 2022
Editada: Torsten el 29 de Ag. de 2022
Hi,
I have attached an I_chart. This is a discrete dataset.
If I have a different starting values (intial values) for d and i, how do I create a new plot (line or curve) parallel to the existing dataset.
I tried curve fitting, it didn't work if the fit is not good for the existing dataset.
In short, I want to create mutiple splines (from different initial values) parallel to the existing spline, and read their values.
Thanks for your help.
Cheers!
KD

Respuestas (1)

Image Analyst
Image Analyst el 29 de Ag. de 2022
What exactly does "parallel" mean to you? Do you just want to shift it up or down by some amount, like this?
data = readmatrix('I_chart.xlsx');
x = data(:, 1);
y = data(:, 2);
plot(x, y, 'b.-')
grid on;
y2 = y + 0.1;
hold on;
plot(x, y2, 'r.-')
legend('Original', 'Shifted')
  4 comentarios
Torsten
Torsten el 29 de Ag. de 2022
Editada: Torsten el 29 de Ag. de 2022
s1(x) = s0(x-(d1-d0)) + I1-I0
(d0,I0) = (0.1, 0.9185)
(d1,I1) = (0.2, 1.2)
Kanchan
Kanchan el 29 de Ag. de 2022
Editada: Kanchan el 29 de Ag. de 2022
An update:
I think I did it; a very crude way
by calculating slope and delta-x at each x. I am calculating delta-x also because the increment is not uniform.
Then, use slope values, delta-x values, new x0, and y0 calculate a new set of x and y.
The graph looks like this (I used log-log plot). The original plot is the thick black line.

Iniciar sesión para comentar.

Categorías

Más información sobre Splines en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by