Sorting two waves simultaneously, a la Excel
patarroyo
Tue, 07/08/2008 - 01:02 pm
Sometimes, I want to curvefit data that comes from multiple waves. My solution has been to manually copy and paste each wave into a new, single wave for my x and y datasets, respectively. The problem that I have with this is that that while my plot looks pretty, I cannot curve fit a range of data. This is because the "merged" data is not numerically sequential. I believe that I can use "sort" to arrange one of the waves in a sequential manner, but if I did the same thing to the other axis' data, the data points will no longer properly match up.
So my question is, how can I sort data a la Excel? In particular, I am thinking of the Excel functionality to sort a column in ascending or descending order, and to expand that selection to include other columns. This sorts x-y pairs of data according to only one of the columns, preserving the pairs. Any ideas?
sort
operation. If you have two waves, xwave and ywave you would issue this command to sort them, using xwave as a key:Sort xwave,xwave,ywave
//now do a reverse sort (largest to smallest)
Sort/R xwave,xwave,ywave
July 8, 2008 at 03:44 pm - Permalink
Duplicate xdata, ydata1
Duplicate xdata, ydata2; ydata2 += 1
Display ydata1 vs xdata
Append/R/T ydata2 vs xdata
SetAxis left 0,6
SetAxis right 0,6
ModifyGraph rgb(ydata2)=(1,12815,52428)
Edit xdata, ydata1, ydata2
Sort xdata ydata1,ydata2,xdata // Sort ydata1,ydata2,xdata using xdata as key
July 8, 2008 at 03:52 pm - Permalink
July 9, 2008 at 01:42 pm - Permalink
Check out the Concatenate operation.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 9, 2008 at 05:39 pm - Permalink
July 10, 2008 at 08:40 am - Permalink
June 10, 2013 at 11:21 am - Permalink