24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 3140  |  回复: 10
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

17_李赏

新虫 (初入文坛)

[求助] matlab曲线拟合及修正 已有2人参与

本人新手,还未对matlab进行深入学习,紧急求助~
已知:x=[8.9 11.7 13.2 13.4 14 14.2 14 10.7 21.671 23.487 20.902 16.507];
    y=[17.698 17.698 27.365 27.365 37.031 37.031 27.365 17.698 66.03 75.696 56.364 37.031]。
请问该如何用matlab拟合出多项式方程y=f(x),然后如何对方程进行修正?
回复此楼

» 收录本帖的淘帖专辑推荐

程序

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

阿兵将心

木虫 (正式写手)

清虫

引用回帖:
3楼: Originally posted by 17_李赏 at 2014-06-27 17:13:33
您好!谢谢您关注我的帖子,拟合函数求出来以后,应该怎么进行修正,您知道吗?...

我还没有仔细看过这方面的东西,有文献资料吗?为何要修正呢,拟合不就是修正吗

[ 发自小木虫客户端 ]
学术离我遥远吗
4楼2014-06-27 20:36:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 11 个回答

阿兵将心

木虫 (正式写手)

清虫

matlab里面有选项来拟合的,高斯拟合,多项式拟合什么的都有,你百度就可以看到的。

[ 发自小木虫客户端 ]
学术离我遥远吗
2楼2014-06-27 15:56:00
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

17_李赏

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by 阿兵将心 at 2014-06-27 15:56:00
matlab里面有选项来拟合的,高斯拟合,多项式拟合什么的都有,你百度就可以看到的。

您好!谢谢您关注我的帖子,拟合函数求出来以后,应该怎么进行修正,您知道吗?
3楼2014-06-27 17:13:33
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cooooldog

铁杆木虫 (著名写手)

ส็็็

【答案】应助回帖


感谢参与,应助指数 +1
17_李赏: 金币+1, 有帮助 2014-06-29 14:03:46
Matlab不是很熟,我用gnuplot+CTeX拟合了一下,凑合着看看吧:

代码:
CODE:
\documentclass[border=10pt]{standalone}
\usepackage{siunitx}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{pgfplotstable}
\usepackage{filecontents}
\begin{filecontents*}{myData.dat}
X     Y
8.900        17.698
11.700        17.698
13.200        27.365
13.400        27.365
14.000        37.031
14.200        37.031
14.000        27.365
10.700        17.698
21.671        66.030
23.487        75.696
20.902        56.364
16.507        37.031
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{
width=10cm,
legend style={font=\scriptsize}
}
\begin{axis}[%
xlabel=$x$,
ylabel=$y$,
ymin=0,
xmin=0,
scaled y ticks=base 10:0,
legend cell align = left,
legend pos = north west
]
\addplot[only marks] table {mydata.dat};
\addlegendentry{scatter plot};
\addplot+[no markers,red] table [y={create col/linear regression={y=Y}}]{myData.dat};
\addlegendentry{%
Linear regression:  $y=\pgfmathprintnumber{\pgfplotstableregressiona} x
\pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$};
% polynomial fit
\addplot [no markers, blue] gnuplot [raw gnuplot] { % allows arbitrary gnuplot commands
f(x) = a*x**2+b*x+c;     % Define the function to fit
a=10;b=10; c=10;         % Set reasonable starting values here
fit f(x) 'myData.dat' u 1:2 via a,b,c; % Select the file, starts at col 1 and two variables
plot [x=0:28] f(x);    % Specify the range to plot
set print "parameters.dat";  % Open a file to save the parameters
print a, b, c;                  % Write the parameters to file
};
\addlegendentry{\pgfplotstableread{parameters.dat}\parameters % Open the file Gnuplot wrote
\pgfplotstablegetelem{0}{0}\of\parameters \pgfmathsetmacro\paramA{\pgfplotsretval} % Get first element, save into \paramA
\pgfplotstablegetelem{0}{1}\of\parameters \pgfmathsetmacro\paramB{\pgfplotsretval}
\pgfplotstablegetelem{0}{2}\of\parameters \pgfmathsetmacro\paramC{\pgfplotsretval}
polynomial:$y=\pgfmathprintnumber{\paramA} x^2 \pgfmathprintnumber[print sign]{\paramB} x \pgfmathprintnumber[print sign]{\paramC}$
}
\end{axis}
\end{tikzpicture}
\end{document}

matlab曲线拟合及修正
2014-06-27_21-50-07.png

ส็็็็็็็็็็็็็็็็็็็็
5楼2014-06-27 21:50:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 081700化学工程与技术 一志愿中海洋 323 求调剂学校 +18 披星河 2026-04-03 18/900 2026-04-06 13:55 by BruceLiu320
[考研] 348求调剂 +3 车厘子zzz 2026-04-05 3/150 2026-04-05 20:30 by 啵啵啵0119
[考研] 一志愿9材料学硕297已过六级求调剂推荐 +11 adaie 2026-04-04 12/600 2026-04-05 19:04 by 蓝云思雨
[考研] 调剂 +3 好好读书。 2026-04-02 3/150 2026-04-05 13:02 by arrow8852
[考研] 电子信息调剂交叉学科有推荐吗 +6 jhtfeybgj 2026-04-01 9/450 2026-04-05 11:13 by 猪会飞
[考研] 材料与化工363求推荐 +7 zh096 2026-04-04 7/350 2026-04-05 09:11 by 陌秋26
[考研] 285求调剂 +11 哦呦呼o 2026-04-04 11/550 2026-04-05 08:15 by 544594351
[考研] 278求调剂 +14 范婷娜 2026-04-04 15/750 2026-04-04 22:15 by lqwchd
[考研] 环境285分,过六级,求调剂 +10 xhr12 2026-04-02 10/500 2026-04-04 21:53 by bn53987
[考研] 316求调剂 +9 墨辰_Orion926 2026-04-04 9/450 2026-04-04 21:35 by lbsjt
[考研] 311求调剂 +11 勇敢的小吴 2026-04-02 11/550 2026-04-03 21:46 by qlm5820
[考研] 285求调剂 +5 AZMK 2026-04-03 8/400 2026-04-03 18:17 by AZMK
[考研] 274求调剂 +9 顺理成张 2026-04-03 10/500 2026-04-03 15:10 by 啊俊!
[考研] 生物学硕341求调剂 +4 你笑起来像云朵 2026-04-03 4/200 2026-04-03 10:32 by macy2011
[考研] 一志愿厦门大学材料工程专硕354找调剂!!! +8 贝呗钡钡 2026-03-30 8/400 2026-04-03 09:41 by hypershenger
[考研] 材料340分调剂 +7 夏夜晚风_long 2026-04-02 9/450 2026-04-02 21:20 by dongzh2009
[考研] 一志愿北京科技材料科学与工程288分,求调剂 +14 是辰啊 2026-04-02 14/700 2026-04-02 21:10 by dongzh2009
[考研] 0710生物学,325求调剂 +3 mkkkkkl 2026-04-01 3/150 2026-04-02 09:48 by Jaylen.
[考研] 085602化学工程268分蹲调剂 +8 月照花林。 2026-04-01 8/400 2026-04-01 22:08 by 无际的草原
[考研] 085600 一志愿9 总分351 求调剂学校 +7 czhcz 2026-03-31 9/450 2026-04-01 19:24 by 无际的草原
信息提示
请填处理意见