Extract the X and data value of an histogram...

Hello everybody !!

I have a very small question.

I have a bunch of waves.
I build the histogram for everyone of them.
I want to put all the histograms in a single matrix.

Then I want to save this matrix in a text file.

Basically I tryed to do like this :

wave IntensityHisto1, NTrueNHisto1, TrueBHisto1, fit_TrueBHisto1

Make/O/N=(DimSize(TrueBHisto1,0),8) Histograms1

    For (i=0;i<(DimSize(TrueBHisto1,0));i+=1)
        Histograms1[i][0] = IntensityHisto1.x[i]
        Histograms1[i][1] = IntensityHisto1.d[i]
        Histograms1[i][2] = TrueNHisto1.x[i]
        Histograms1[i][3] = TrueBHisto1.d[i]
        Histograms1[i][4] = TrueBHisto1.x[i]
        Histograms1[i][5] = TrueBHisto1.d[i]
        Histograms1[i][6] = fit_TrueBHisto1.x[i]
        Histograms1[i][7] = fit_TrueBHisto1.d[i]
    Endfor


But I can't extract the ".x" and the ".d" of the waves ...

It's probably very easy to do but I didn't find a way to do it automatically by coding...

Thank you in adavance :)
For the ".x" part you need pnt2x().

For the ".d" part, just use a wave assignment:
Histograms1[i][1] = IntensityHisto1[i]

But you don't even need the loop:
        Histograms1[][0] = pnt2x(IntensityHisto1, p)
        Histograms1[][1] = IntensityHisto1[p]
... etc.

Since you need the X values, you can't use Concatenate to simply pasted all your waves into a single matrix.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com