| 6 | 1/1 | 返回列表 |
| 查看: 677 | 回復(fù): 5 | |||
[交流]
【求助】急求幫忙解決MATLAB 樣條差值求解微分代碼出現(xiàn)的問題,使代碼正常運(yù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 ] |
» 搶金幣啦!回帖就可以得到:
+2/100
+1/78
+1/35
+1/35
+1/28
+1/23
+2/22
+1/16
+1/13
+1/13
+2/10
+1/5
+1/5
+1/5
+1/4
+1/2
+1/2
+1/2
+1/2
+1/1
木蟲 (小有名氣)
|
具體太多代碼沒看...只是說說思路 離散數(shù)據(jù)的微分問題 既然你用的是樣條插值 那就說說這個(gè)方法 數(shù)據(jù)->csapi(x,y)->fnder(cs)->fnval(pp,x) |
木蟲 (小有名氣)
| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 085410人工智能專碩317求調(diào)劑(0854都可以) +3 | xbxudjdn 2026-03-18 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 【同濟(jì)軟件】軟件(085405)考研求調(diào)劑 +3 | 2026eternal 2026-03-18 | 3/150 |
|
|
[考研] 266求調(diào)劑 +5 | 陽陽哇塞 2026-03-14 | 9/450 |
|
|
[考研] 材料與化工一志愿南昌大學(xué)327求調(diào)劑推薦 +8 | Ncdx123456 2026-03-13 | 9/450 |
|
|
[考研] 304求調(diào)劑 +12 | 小熊joy 2026-03-14 | 13/650 |
|
|
[考研] 265求調(diào)劑 +3 | 梁梁校校 2026-03-17 | 3/150 |
|
|
[考研] 268求調(diào)劑 +6 | 簡(jiǎn)單點(diǎn)0 2026-03-17 | 6/300 |
|
|
[基金申請(qǐng)] 被我言中:新模板不強(qiáng)調(diào)格式了,假專家開始管格式了 +4 | beefly 2026-03-14 | 4/200 |
|
|
[考研] 考研求調(diào)劑 +3 | 橘頌. 2026-03-17 | 4/200 |
|
|
[考研] 085600材料與化工求調(diào)劑 +5 | 緒幸與子 2026-03-17 | 5/250 |
|
|
[考研] 一志愿南京大學(xué),080500材料科學(xué)與工程,調(diào)劑 +4 | Jy? 2026-03-16 | 4/200 |
|
|
[考研] 304求調(diào)劑 +5 | 素年祭語 2026-03-15 | 5/250 |
|
|
[考研] 321求調(diào)劑 +5 | 大米飯! 2026-03-15 | 5/250 |
|
|
[考研] 277材料科學(xué)與工程080500求調(diào)劑 +3 | 自由煎餅果子 2026-03-16 | 3/150 |
|
|
[考博] 東華理工大學(xué)化材專業(yè)26屆碩士博士申請(qǐng) +6 | zlingli 2026-03-13 | 6/300 |
|
|
[考研] 080500,材料學(xué)碩302分求調(diào)劑學(xué)校 +4 | 初識(shí)可樂 2026-03-14 | 5/250 |
|
|
[考研] 中科大材料與化工319求調(diào)劑 +3 | 孟鑫材料 2026-03-14 | 3/150 |
|
|
[考研] 304求調(diào)劑 +6 | Mochaaaa 2026-03-12 | 7/350 |
|
|
[考研] 材料與化工求調(diào)劑一志愿 985 總分 295 +8 | dream…… 2026-03-12 | 8/400 |
|
|
[考研] 307求調(diào)劑 +5 | 超級(jí)伊昂大王 2026-03-12 | 5/250 |
|