11-21-2014 09:46 AM
Hello everyone , i need a help about to write for loop or may be some other logic as you know for
I have a 1D array [1 2 3 4 5 67 8 9 10]...now i want use for loop that reads 2 values as ([ 1 2]) and set these 2 values in first row of 2D array and again loop repeats read another next 2 values as ([3 4 ]) and set them 2 row of 2D array like that 3 row [5 6] in 2D array .....like that it write 5 rows in 2D array (2*5) from 1D array of (1*10)...you can say some other easy way as not exatcly to be for loop ...thanks alot for your help and suggestions ...waiting for your answers
Solved! Go to Solution.
11-21-2014 10:05 AM
Have you bothered to make some sort of attempt to program this?
11-21-2014 10:20 AM
The short answer is that you need to use the Reshape Array function.
The longer answer involves more questions. Do you always have the same size 1D array? If not, will it always have an even number of elements? If not, what do you want to do with the last element? If you keep it, what do you want to use to "pad" the extra element of the output array?
11-24-2014 08:10 AM
thanks alot jcarmody
the above idea working perfectly ...but i got one problems in same application ...i read so much data continuelsy from serial port(VISA ) but it read only till 504 data bits and then goes down 425 again it goes to 504 again down to 425 like that continuously up and down data bits ...i want to read data continuesly unlimitted
how to to do that setting to read continuously unlimitted data bits ? I am using VISA function to read from serial port
is there any other way to read data bits from serial port continuously unlimitted data bits after i leave running system continuously
thanks alot for your help ...waiting for a good sloution