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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1228392/image.png)
My actual plot looks like this at the moment:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1228397/image.png)
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 个评论
采纳的回答
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!