I am trying to plot my spline with clamped conditions and I am not sure why it is not letting me plot

%% 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),'-');

 採用された回答

%%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),'-');

その他の回答 (1 件)

%% 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),'-');

カテゴリ

ヘルプ センター および File Exchange で Spline Postprocessing についてさらに検索

製品

リリース

R2019b

質問済み:

2019 年 11 月 22 日

回答済み:

2019 年 11 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by