![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249503/A72A93A6-52B9-4B06-9B72-583328DDF568.png)
I am trying to plot my spline with clamped conditions and I am not sure why it is not letting me plot
5 次查看(过去 30 天)
显示 更早的评论
%% clamped boundary conditions -0.5 to 0.5
t = [160 180 195 225 250 280 300].';
y = [ 78.3 81.4 84.5 85.1 89.3 91.7 94.8].';
cs = spline(t,[-0.5 y 0.5]);
xx = linspace(160,300,50);
plot(t,y,'o',xx,ppval(cs,xx),'-');
0 个评论
采纳的回答
Joe Vinciguerra
2019-11-22
%%clamped boundary conditions -0.5 to 0.5
t = [160 180 195 225 250 280 300];
y = [78.3 81.4 84.5 85.1 89.3 91.7 94.8];
cs = spline(t,[-0.5 y 0.5]);
xx = linspace(160,300,50);
plot(t,y,'o',xx,ppval(cs,xx),'-');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249503/A72A93A6-52B9-4B06-9B72-583328DDF568.png)
0 个评论
更多回答(1 个)
Walter Roberson
2019-11-22
%% clamped boundary conditions -0.5 to 0.5
t = [160 180 195 225 250 280 300].';
y = [ 78.3 81.4 84.5 85.1 89.3 91.7 94.8].';
cs = spline(t,[-0.5; y; 0.5]); %changed because y is column vector
xx = linspace(160,300,50);
plot(t,y,'o',xx,ppval(cs,xx),'-');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Splines 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!