I found the answer that, I am trying to assume j
as incremental value.
But, base on trial and error based, when I set j
as 0
I am getting all the 100
graph values which applied based on the MathGL
formula 0.4*y+0.1+sin(6*pi*x)
.
So the assumption of the function mgl_create_data_size
is
If the data is set using 100,1,0
which is nx,ny,nz
nx
= 100
- Total number of X axis values
ny
= 1
- is only one Y value for each X value
nz
= 0
- is assumed as 0, there is no z axis
the function which can get each graph value is
mgl_data_get_value(y,i,0,0)
Example of 10
values for the same formula
var y1 = mgl_create_data_size(10,1,0)
mgl_data_modify(y1,"0.4*y+0.1+sin(6*pi*x)",0)
for(i in 0..10-1) {
println(mgl_data_get_value(y1,i,0,0))
}
The output is
0.1
0.9660254037844387
-0.7660254037844384
0.09999999999999976
0.9660254037844391
-0.7660254037844387
0.09999999999999952
0.9660254037844401
-0.7660254037844377
0.09999999999999927
The graph in Excel for the above values is

This is very help full to use MathGL in applied mathematics in data generation as one of the light weight libraries