How to list compared values from compared datasets
Mostrar comentarios más antiguos
Hi board,
I am trying to automatically evaluate experimental mass spectra datasets (one column, 10'000's of rows) for matching values of simulated spectra datasets (10's of columns, 100's rows, 10's to 1000's of tables/arrays/dimensions depending on the complexity of the experiment). There is a slight allowed deviation of experimental and simulated datapoints based on a fraction of each datapoint. After finding values that (inside the given tolerance) show up in both datasets, I need the position of each value, as it is directly related to information I need to get from the experiment. I know, I can in principle get a list of matching common values using
CommonValues = ismembertol(experimental,simulated,tolerance)
I also now, I can get the position of each common value by
[col,row] = find(CommonValues==1)
and aligning them via
AssignedData = table(CommonValues,col,row)
But this only gives me the values and their position in the simulated spectra. I still do not know what exact actual values in the experimental spectra they were matched to. So I already have all the "numbers" but I can not list them so I can use the data I get from the calculation. I can not simply align them again using the above method, as they will contain vastly different numbers of rows - the simulated data will have datapoints that are either present in multiple columns/rows/dimensions yet are still needed for evaluation or multiple datapoints inside the allowed deviation margins.
The final output I would need would be a table or array, that shows
expDatapoint1 simDatapoint1.1 Deviation1.1 allowedMaxDeviation1 simulatedCol simulatedRow
expDatapoint1 simDatapoint1.2 Deviation1.2 allowedMaxDeviation1 simulatedCol simulatedRow
expDatapoint1 simDatapoint1.3 Deviation1.3 allowedMaxDeviation1 simulatedCol simulatedRow
expDatapoint2 simDatapoint2.1 Deviation2.1 allowedMaxDeviation2 simulatedCol simulatedRow
expDatapoint2 simDatapoint2.2 Deviation2.2 allowedMaxDeviation2 simulatedCol simulatedRow
and so forth.
As you might be able to tell I'm a chemist, not a programmer and really new to MatLab. I tried searching for solutions for a few days and already worked through most of the "getting started" parts of the help pages but do not actually know WHAT to look for. I used to do the above task manually by creating simulated hughe datasets in Excel and going through each and every datapoint from my spectra via the highlighting function and then putting together the above table by hand - which works for for very small and simple experiments only. Any help is highly appreciated!
Matthias
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!