Thank you very much. It's worked.

However, I have another problem.

I want to plot the points without the image. So I need to create an 2D image using constant(0, row, col). The "row" and "col" parameter is the max value of the points array.

- Code: Select all
`array maxArr = max(points, 0);`

But I don't know how to convert the maxArr(0) and maxArr(1) into int as the constant 3rd and 4th parameters.

In summary, I don't know how to convert an array element into integer.I am look forward to hearing you.

Thank you.

P/s:

I found the following code to convert max value into int.

- Code: Select all
` cout << max<float>(points(span,0)) << endl;`

Is there any other way to convert any elements into int? For example, using template<T>

For example:

- Code: Select all
` int a = some_function<int>(points(10,1))`