![]() |
Forum Index : Microcontroller and PC projects : Array manipulation PicoMIte
Author | Message | ||||
Bleep Guru ![]() Joined: 09/01/2022 Location: United KingdomPosts: 633 |
Hi, does anyone know if it's possible to add or multiply one single dimension array by a second single dimension array with a single command, similar to the MATH function. So for example add each of the array elements 0 1 2 3 4...etc to elements 0 1 2 3 4...etc of another array & put the results in to elements 0 1 2 3 4...etc of a third array (or one of the input arrays), similar for multiply. As far as I can see the MATH_M_MULT only works on 2D arrays for example, This is purely for speed, I realise I can do a For loop, but the MATH functions are much more optimised. Thanks Kevin. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5090 |
Hi Bleeb, The math functions are in picomite, even MATH FFT See manual Volhout Edited 2022-07-25 10:16 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1234 |
by calling a Sub or a Function you can move a complete array into another array Dim aa(20,20) For f=1 To 20 For n=1 To 20 aa(f,n)=Int(Rnd*255) Next n Next f show aa() Sub show bb() For f=1 To 20 For n=1 To 20 Print bb(f,n);","; Next n Next f End Sub 'no comment |
||||
Bleep Guru ![]() Joined: 09/01/2022 Location: United KingdomPosts: 633 |
HI, Yes, as I said I've been all through the MATH functions, they don't seem to work on 1D arrays, that was why I am asking if anyone knows of anything else; Similarly, as I stated I know I can do this using For loops, but built in functions are always going to be much quicker. I am adding and multiplying several 192 element 1D arrays, which are then being used to draw on the screen using the Polygon command, so they need to be 1D and they need to be fast. Regards, Kevin. Edited 2022-07-25 20:15 by Bleep |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |