Compares two textwaves and determines unique values not shared by both

Function uniqueadditions(buf1, buf2)
        Wave/t buf1, buf2

        make/n=(numpnts(buf1) + numpnts(buf2))/free/t total
        total[] = buf1[p]
        total[numpnts(buf1), numpnts(total)-1] = buf2[p - numpnts(buf1)]

        sort/A total, total
        make/n=(numpnts(total))/I/free sorter
        redimension/n=(numpnts(total) + 1) total
        sorter = selectnumber(stringmatch(total[p], total[p+1]), 0, 1)
        redimension/n=(numpnts(total) -1) total
        duplicate/free sorter, sorter2

        sorter2 = sorter[p -1] == 1? 1:sorter(p)

        sort sorter2, sorter2, total
        findvalue/I=1/z sorter2
        deletepoints V_value, numpnts(total), total
        duplicate/O total, retwave
End

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More