社区
C++ Builder
帖子详情
求教各位大神,怎么用c++ builder 2010 实现 一组数据的一维线性插值?
huxuedong12345
2014-09-03 12:43:02
最好能写出代码,各位帮帮忙呀
...全文
293
4
打赏
收藏
求教各位大神,怎么用c++ builder 2010 实现 一组数据的一维线性插值?
最好能写出代码,各位帮帮忙呀
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
toobug19
2014-09-06
打赏
举报
回复
实现的代码贴不上了。另外,你可以使用GNU下的GLS数学库进行计算。或者用matlab进行计算。
toobug19
2014-09-06
打赏
举报
回复
[code=c][//--------------------------------------------------------------------------- #ifndef linera_interpolationH #define linera_interpolationH //--------------------------------------------------------------------------- #include <vector> typedef struct{ double dbl_x; double dbl_y; }DataPoint; class LinearInter { public: /* 传递原始数据数组 */ void InputData(const DataPoint* pDataPoint, unsigned int n); /* 传递单一数据对象 */ void InputData(const DataPoint& dataPoint); /* 删除单一数据对象 */ bool DeleteData(const DataPoint& dataPoint); bool DeleteData(unsigned n); /* 给定x值,计算出y值 */ const DataPoint OutputData(const double x) const; DataPoint* OutputData(const double* x_array, unsigned int n, DataPoint* pDataPoint) const; /* 清空原始数据成员 */ void ClearData(); /* 返回当前原始数据大小 */ unsigned int GetRowDataSize() const; /* 返回当前原始数据,数组可变 */ DataPoint* GetRowData(unsigned int n, DataPoint* pDataPoint) const; public: LinearInter(); ~LinearInter(); private: void Interpolate(); // 计算插值 private: std::vector<DataPoint> m_DataList; // 存储原始数据 double m_Slope; // double m_Constant; // y = k*x + c }; #endif/code]
huxuedong12345
2014-09-03
打赏
举报
回复
如果数据太多用最小二乘法就太麻烦了
toobug19
2014-09-03
打赏
举报
回复
先线性拟合,一般用最小二乘法,算出函数,再代入你要的插值不就计算出来了吗?
C++
builder
运行while不卡界面怎么
实现
?
编写的程序界面老卡掉,测了一下是
C++
builder
进入while之后程序界面就不能拖动的原因?跳出while之后程序就正常了。 这个怎么解决呢? 测试用button void __fastcall TForm1::Button1Click(TObject *Sender) { ...
求教
各位
大神
如何更改光猫的MAC地址
求教
各位
大神
如何更改光猫的MAC.如成功必有酬谢!
C++
Builder
问题
求教
其次,就是如何对ComboBox的下拉显示进行不同的查询,如下拉显示为“号码”和“时间”,然后在Edit编辑框里输入
数据
,对“号码”进行精确查询,而对“时间”进行模糊查询。 最后,就是如何利用Timer组件来进行...
线性系数matlab,新手
求教
,已知
数据
,关系为线性,求系数
新手
求教
,已知
数据
,关系为线性,求系数 已知公式的关系为线性, 假设a*x + b*y +c*z = t已知x,y,z,t的
数据
(
数据
量大),比如x=[29 30 35 34 28 24 14 21 0 255 114 123 117 119 12229 30 31 28 20 16 14 21 0 255 ...
本人小白一枚,
求教
各位
大神
教我NanoPi M1怎么
实现
图像采集和局域网访问
本人毕业设计选的用NanoPi M1
实现
图像采集与局域网访问,现在打算用USb摄像头采集图像视频,通过MJPG-streamer视频流...现有开发板,打算使用Debian系统操作 求各位
大神
教我怎么用 急急急!!! 事后重谢!!!...
C++ Builder
13,824
社区成员
102,679
社区内容
发帖
与我相关
我的任务
C++ Builder
C++ Builder相关内容讨论区
复制链接
扫一扫
分享
社区描述
C++ Builder相关内容讨论区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章