concatenate all columns of a 2D wave into a 1D wave
J-E Petit
I'd like to concatenate all columns of a 2D wave (let's say of shape (200*720)) to a 1D wave (-> shape of (144000)).
I'm desperately trying with a "for" loop and concatenate function, but it doesn't work nicely... Is there a built-in function I could call to do the job?
Thanks for your help!
J-E
Function mx_col_conc()<br />
variable i, count=0<br />
wave mxT, zpolar<br />
for (i=0;i<numpnts(zpolar);i+=dimSize(mxT,0))<br />
zpolar[i,i+dimSize(mxT,0)-1]=mxT[p][count]<br />
count+=1<br />
endfor<br />
End Function<br />
</span>
February 10, 2015 at 10:56 pm - Permalink
from documentation:
Details
The waves must already exist. New points in waves that are extended are initialized to zero.
In general, Redimension does not move data from one dimension to another. For instance, if you have a 6x6 matrix wave, and you would like it to be 3x12, the rows have been shortened and the data for the last three rows is lost.
As a special case, if converting to or from a 1D wave, Redimension will leave the data in place while changing the dimensionality of the wave. For example, you can use Redimension to convert a 36-element 1D wave into a 6x6 matrix in which the elements in the first column (column 0) are the first 6 elements of the 1D wave, the elements of the second column are the next 6, etc. When redimensioning from a 1D wave, columns are filled first, then layers, followed by chunks.
February 10, 2015 at 04:13 pm - Permalink
unfortunatly, when I do Redimension/N=(144000,1) mxT, the first 200 rows are saved, but the following 143800 rows are still 0....
Do you know if there is a supplementary parameter to add in the cmd line?
February 10, 2015 at 11:03 pm - Permalink
February 11, 2015 at 12:43 am - Permalink
February 11, 2015 at 05:32 am - Permalink