| 6 | 1/1 | 返回列表 |
| 查看: 681 | 回復(fù): 5 | |||
[交流]
【求助】急求幫忙解決MATLAB 樣條差值求解微分代碼出現(xiàn)的問題,使代碼正常運行
|
|
function y0=hillsplines3(x0,x,y) if size(x,1)~=1 x=x'; end if size(y,1)~=1 y=y'; end [a,t]=hillsplinex(x,y);a=a';t=t'; for i=1:length(t)-4 phi(i)=powerplus3(x0,t(i:i+4)); end y0=sum(a.*phi); function [ax,tx]=hillsplinex(t,y) h=diff(t);delta=diff(y)./h;n=length(h)+1 d1=pchipendpoint(h(1),h(2),delta(1),delta(2)); dn=pchipendpoint(h(n-1),h(n-2),delta(n-1),delta(n-2)); r=[d1;y';dn]; tx=[t(1)-[1:3]*h(1),t,t(length(t)+[1:3])*h(length(h))]; a=zeros(length(tx)-4,length(tx)-4); for i=1:3 a(1,i)=depowerplus3(t(1),tx(i:i+4)); end for i=length(tx)-6:length(tx)-4 a(length(tx)-4,i)=depowerplus3(t(length(t)),tx(i:i+4)); end for j=2:length(tx)-5 for i=j-1:j+1 a(j,i)=powerplus3(t(j-1),tx(i:i+4)); end end ax=a\r;tx=tx'; function y=powerplus3(x,t) c=t; for i=1:5 c(i)=[]; beta(i)=24/prod(t(i)-c); c=t; end powerplus=abs(x-t).^3; y=0.5*sum(beta.*powerplus); function y=depowerplus3(x,t) c=t; for i=1:5 c(i)=[]; beta(i)=24/prod(t(i)-c); c=t; end powerplus=3*sign(x-t).*(x-t).^2; y=0.5*sum(beta.*powerplus); function d=pchipendpoint(h1,h2,del1,del2) d=((2*h1+h2)*del1-h1*del2)/(h1+h2); if sign(d)~=sign(del1) d=0; elseif(sign(del1)~=sign(del2))&(abs(d)>abs(3*del1)) d=3*del1; end [ Last edited by huameitang05 on 2011-1-4 at 17:21 ] |
» 搶金幣啦!回帖就可以得到:
+5/770
+2/428
+5/250
+1/182
+2/100
+1/63
+2/46
+1/36
+1/35
+2/30
+1/25
+1/24
+1/15
+1/10
+2/8
+1/7
+1/5
+1/4
+1/4
+1/3
| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 求調(diào)劑院校信息 +4 | CX 330 2026-03-21 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 085600材料與化工306 +4 | z1z2z3879 2026-03-21 | 4/200 |
|
|
[考研] 材料學(xué)碩301分求調(diào)劑 +7 | Liyouyumairs 2026-03-21 | 7/350 |
|
|
[考研] 材料 271求調(diào)劑 +5 | 展信悅_ 2026-03-21 | 5/250 |
|
|
[考研] 336求調(diào)劑 +5 | rmc8866 2026-03-21 | 5/250 |
|
|
[考研] 277材料科學(xué)與工程080500求調(diào)劑 +6 | 自由煎餅果子 2026-03-16 | 6/300 |
|
|
[考研] 266求調(diào)劑 +3 | 哇呼哼呼哼 2026-03-20 | 3/150 |
|
|
[考研] 能源材料化學(xué)課題組招收碩士研究生8-10名 +5 | 脫穎而出 2026-03-16 | 15/750 |
|
|
[考研] 303求調(diào)劑 +5 | 睿08 2026-03-17 | 7/350 |
|
|
[考研] 一志愿中國石油大學(xué)(華東) 本科齊魯工業(yè)大學(xué) +3 | 石能偉 2026-03-17 | 3/150 |
|
|
[考研] 332求調(diào)劑 +4 | ydfyh 2026-03-17 | 4/200 |
|
|
[考研] 一志愿中海洋材料工程專碩330分求調(diào)劑 +8 | 小材化本科 2026-03-18 | 8/400 |
|
|
[考研] 考研調(diào)劑求學(xué)校推薦 +3 | 伯樂29 2026-03-18 | 5/250 |
|
|
[考研]
|
簡木ChuFront 2026-03-19 | 8/400 |
|
|
[考研] 295材料求調(diào)劑,一志愿武漢理工085601專碩 +5 | Charlieyq 2026-03-19 | 5/250 |
|
|
[考研] 312求調(diào)劑 +8 | 陌宸希 2026-03-16 | 9/450 |
|
|
[考博] 26申博 +4 | 八6八68 2026-03-16 | 4/200 |
|
|
[論文投稿] 有沒有大佬發(fā)小論文能帶我個二作 +3 | 增銳漏人 2026-03-17 | 4/200 |
|
|
[考研] 318求調(diào)劑 +3 | Yanyali 2026-03-15 | 3/150 |
|
|
[考研] 327求調(diào)劑 +6 | 拾光任染 2026-03-15 | 11/550 |
|