Hi,
In Origin C, vector support do calculation with operator +, -, *, /, ^. See the following example:
void calculate(vector& vx, vector& vy, double B, double C)
{
vy = B*vx - B*C*vx^2;
}
void testOK()
{
Worksheet wks;
wks.Create("origin");
Dataset dsX(wks, 0);
Dataset dsY(wks, 1);
dsX.Data(1, 10, 1); // set data from 1 to 10 with 1 increment
calculate(dsX, dsY, 0.5, 1);
GraphPage gp;
gp.Create("origin");
GraphLayer gl = gp.Layers(0);
gl.AddPlot(wks);
}
Iris