i m 寻求解决两个病媒的有限组成部分,我试图解释。
我知道:数字载体和数字的G(z)矢量。
融合的极限为zmin和zmax。
I should to calculate: Integral between zmin,zmax of [G(z) * z^(7/6)] dz
我能否用以下法典解决?
For i = zmin:zmax
myresult = G(z(i))*z(i)^(7/6)
end
i m 寻求解决两个病媒的有限组成部分,我试图解释。
我知道:数字载体和数字的G(z)矢量。
融合的极限为zmin和zmax。
I should to calculate: Integral between zmin,zmax of [G(z) * z^(7/6)] dz
我能否用以下法典解决?
For i = zmin:zmax
myresult = G(z(i))*z(i)^(7/6)
end
(前)
Define G(z) as a function handle, and the function to be integrated as another one. You can find an example in my other answer.
因此,你的目标是计算<代码>[G(z) * z^(7/6)] * dz,其中G(z)
和z
为预估数字矢量,dz
为小增量值。
dz = (zmax - zmin) / length(G(z));
S = G * z * dz;
<代码>S应为结果。 让我解释一下。
G(z)
previously (apologize for that). You have already evaluated (partially) the function to integrate, namely G(z)
and z
. G(z)
and z
are number arrays. Arrays are indexed by integer, starting from 1. So G(z(i))
may not be a valid expression, as z(i)
haven t been guaranteed to be integers. The code above only works correctly if you have defined G(z)
in this way - G(i) = some_function (z(i));
. By so each element of the same index in two arrays have a meaningful relation. for
loop works, but is inefficient. G * z
is the way to calc vector dot product. Previously I would always have thought a Vector was good to use for non-descript objects when length was unknown. As far as I was aware I thought it was thread-safe too What would change that Vector ...
The questions I have are NOT homework questions, but I am considering using these concepts in my assignment. The context, if it helps, is like this: I need to keep track of several union instances and ...
based on the contents of a vector(IDs), i m trying to create the corresponding no. of buttons but I m having problems doing that. I was wondering if anyone could help? Below is the code that i m ...
Consider the following example code: class Foo { }; class Bar : public Foo { }; class FooCollection { protected: vector<shared_ptr<Foo> > d_foos; }; class BarCollection : public ...
#include <array> template <typename T> class Vector4<T> { std::array<T, 4> _a; // or T _a[4]; ? }; template <typename T> class Matrix4<T> { std::array<...
I have setup a small shooter game as a tutorial for myself in SDL. I have a struct of a projectile struct projectile { SDL_Surface* surface; int x; int y; }; And I put that into a vector....
How do I sort the below code by name, age and score... all three fields #include <string> #include <vector> #include <algorithm> struct student_t { std::string name; ...
I ve been trying all night, and talk of maps, arrays, vectors and hash_maps have filled my head. im just confused now. i posted a previous question here: C++ map really slow? problem was fixed but it ...