A "plot" progression of points following a round course

1 次查看(过去 30 天)
Hi there,
Basically, I have these points on a plot but the thing is that I need to have the progression's shape to be round and not looking like a conglomerate of connected lines. I need something like in this picture from excel:
My actual plot looks like this at the moment:
Here's the code that I used, the values in the vectors mustn't be modified.
beta=[0 0.2 0.4 0.6 0.8 1 1.2];
randr=[0 84.25 89.97 91.38 91.60 91.32 90.81];
randrl=[0 79.08 86.38 88.23 88.51 88.15 87.48];
randrc=[0 76.24 84.33 86.41 86.74 86.33 85.57];
plot(beta,randr,'-d');
hold on;
plot(beta,randrl,'-d');
plot(beta,randrc,'-d');
xlabel('β');
ylabel('U2[V]');
grid on;
ylim([0 100]);

采纳的回答

Bora Eryilmaz
Bora Eryilmaz 2022-12-12
编辑:Bora Eryilmaz 2022-12-12
You can use a (cubic) spline for interpolation.
beta=[0 0.2 0.4 0.6 0.8 1 1.2];
randr=[0 84.25 89.97 91.38 91.60 91.32 90.81];
randrl=[0 79.08 86.38 88.23 88.51 88.15 87.48];
randrc=[0 76.24 84.33 86.41 86.74 86.33 85.57];
% Use cubic spline for interpolation
x = linspace(min(beta), max(beta), 100); % Create a finer grid of x-axis values.
r = spline(beta, randr, x); % Interpolate on the finer grid.
rl = spline(beta, randrl, x);
rc = spline(beta, randrc, x);
plot(x,r,'-');
hold on;
plot(x,rl,'-');
plot(x,rc,'-');
plot(beta,randr,'d');
plot(beta,randrl,'d');
plot(beta,randrc,'d');
xlabel('β');
ylabel('U2[V]');
grid on;
ylim([0 100]);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spline Postprocessing 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by