I want to calculate the data through matrix and convert the one vector to array for indicator show.
And it is found there is no output array function in matrix or vector. the "row" or "col" member only output vector.
https://www.mql5.com/en/docs/basis/types/matrix_vector
Is it necessary the get all elements through loop into array?
You can use the method Swap: m.Swap(a) or v.Swap(a) - where m is a matrix, v is a vector, and a is an array (of type double or float, which should match the type of the matrix/vector). After the call the original matrix or vector becomes empty, because it's data is transferred into the receiving array directly.
Unfortunately, this information is not explicitly stated in the documentation.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to calculate the data through matrix and convert the one vector to array for indicator show.
And it is found there is no output array function in matrix or vector. the "row" or "col" member only output vector.
https://www.mql5.com/en/docs/basis/types/matrix_vector
Is it necessary the get all elements through loop into array?