Page 1 of 1

n-dimensional array variables

Posted: Sat Aug 25, 2012 3:29 pm
by Mantas
Hello MM,

It was several times for me when I encountered limitations of Flowcode which allows to create only 1-dimensional array variable, like variable_array. I would love to be able to create a two or even three dimensional array variables for calculation which require matrices (for example Euler angle, or Quaternion calculations), like 2-dimensional variable_array[j]. Finally you are MATRIX multimedia :D I would find this to be very useful, and would expand flowcode capabilities. And I think it is not a very big change, programming wise.

Best regards,
Mantas

Re: n-dimensional array variables

Posted: Sat Aug 25, 2012 3:41 pm
by IVL
Hi,

You might be interested to take a look at this post :

http://www.matrixmultimedia.com/mmforum ... pic#p37105

Regards,
Ivan

Re: n-dimensional array variables

Posted: Sat Aug 25, 2012 4:07 pm
by Enamul
Hi Mantas,
I can make something using Sean's concept..
http://www.matrixmultimedia.com/mmforum ... ray#p35962
If you want...

Re: n-dimensional array variables

Posted: Sat Aug 25, 2012 5:59 pm
by Enamul
HI Mantas,
After spending 1 hour, I have manged to make 2D array without c code using the 1D array. you can use that as normal 2D array. In the example code, I have 2 macro for write to and read from array. I have to take pre-caution as array starts at 0 index. And need to consider problem in reading location like (1,2) and (2,1) are different..

In the beginning of the code you will see Array_row and Array_column which will determine your 1D array size and also 2D array indexes. So be-careful in using 2D array as I have declared the string (1D array) with size 40. So you can use row*column max 40 but you can edit that to increase. In the example, you can write data using row and column index (remember for 0 as start ) in the write macro and can retrieve that using the read macro..
Hope that will be useful..

Re: n-dimensional array variables

Posted: Sat Aug 25, 2012 8:41 pm
by Mantas
Hello Ivan and Enamul,

Also matrix and matrix manipulation features would be very useful.

Answer from Ben:
Agreed, I will think up a way to get this in.
This sounds promising, i think it would be great to get that in the 5.4 update for ARM.

Enamul, as you saw, I have already posted in Seans article, and it works, but only if you want to store constants, but then reaching them is a pain in the ass. I managed to finish my complex SPA project using 3 dimensional arrays, in the supplementary code, but I had in mind matrix manipulations, as quoted above. Yes your program works, but it is too much of a hassle, and if you wanted to make complex mathematical operations like matrix operations, you would put a huge burden on your shoulders, while trying to complete such calculations like for example the Eulers angles or quaternions. It would be nice to have a native support for matrices. Anyway, thanks for your input making this program, I think someone might find it useful :)

Best regards,
Mantas

Re: n-dimensional array variables

Posted: Sun Aug 26, 2012 8:20 pm
by Mantas
By the way, just wanted to add, that something like matrix operations in matlab would be very convenient.

Regards,
Mantas