Filter löschen
Filter löschen

A "plot" progression of points following a round course

1 Ansicht (letzte 30 Tage)
fie.minion
fie.minion am 12 Dez. 2022
Kommentiert: fie.minion am 12 Dez. 2022
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]);

Akzeptierte Antwort

Bora Eryilmaz
Bora Eryilmaz am 12 Dez. 2022
Bearbeitet: Bora Eryilmaz am 12 Dez. 2022
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]);

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by