A "plot" progression of points following a round course
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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]);
0 Kommentare
Akzeptierte Antwort
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)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!