由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 大家看看怎么把这几行matlab 代码译成c
相关主题
Switch from Matlab to C(C++)?我的Visual C++ .net是不是有问题?
问个matlab的问题Help! Read random number of lines in a input file.
[求教]high dimensional vector visulization一种新型的推测编程
困扰多时的MATLAB crash问题web党对于别人介绍dart新技术感到很愤怒
MATLAB求助how to look the values in a vector in VC.NET
包子求助matlab编程问题随机数发生器问题请教
Remove elements from multiple vectors in C++关于正交向量(orthogonal vectors)的算法
能帮我看看Ruby的这道题吗?using namespace std; 比 using std::vector; 效率低么?thx
相关话题的讨论汇总
话题: vector话题: matlab话题: poly话题: end话题: tmp
进入Programming版参与讨论
1 (共1页)
H*****8
发帖数: 222
1
在matlab poly.m 文件中,assume x is a vector. the code is:
function c = poly(x)
....
n = length(x);
c = [1 zeros(1,n)];
e=x;
for j=1:n
c(2:(j+1)) = c(2:(j+1)) - e(j).*c(1:j);
end
..
呵呵。
H*****8
发帖数: 222
2
Seems no one interested. What I did is following:
// The class Vector is done before.
// Vector.addVector(double a, Vector b, double c) will return a*self+c*b
Vector * UnivariateDecomposition::Poly(Vector *x)
{
/* first step translate matlab into another format.
for j=1:n

for k=2:j+1
c(k) = c1(k) - e(j)*c1(k-1);
end

c1 = c;
end
*/
//then translate into c. tmp is class wide member.
int n = x->Size();
if (tmp ==0) {
tmp = new Vector(n+1);
}


【在 H*****8 的大作中提到】
: 在matlab poly.m 文件中,assume x is a vector. the code is:
: function c = poly(x)
: ....
: n = length(x);
: c = [1 zeros(1,n)];
: e=x;
: for j=1:n
: c(2:(j+1)) = c(2:(j+1)) - e(j).*c(1:j);
: end
: ..

1 (共1页)
进入Programming版参与讨论
相关主题
using namespace std; 比 using std::vector; 效率低么?thxMATLAB求助
STL vector的clear如何强制归还系统?包子求助matlab编程问题
请教:vector size in RRemove elements from multiple vectors in C++
问一个C++的问题能帮我看看Ruby的这道题吗?
Switch from Matlab to C(C++)?我的Visual C++ .net是不是有问题?
问个matlab的问题Help! Read random number of lines in a input file.
[求教]high dimensional vector visulization一种新型的推测编程
困扰多时的MATLAB crash问题web党对于别人介绍dart新技术感到很愤怒
相关话题的讨论汇总
话题: vector话题: matlab话题: poly话题: end话题: tmp