Dialog box for grouping samples
Mostrar comentarios más antiguos
Hi all,
I tried to look for this topic on the web but I'm not able to properly formulate the question.
My problem is the following. I have a huge database in excel with a lot of column. After import it and do some adjustments I have some columns that are common for all my samples (e.g. temperature, atmospheric pressure, bla bla) and then the specific results for each samples (they can be from 10 to 1000: it's not relevant the number). Among these samples there are some of them that are blank samples but each of them related to only a small group. For example, the first blank is related to a group of 10 samples, the second blank is related to 12 samples,....
Since I want that the script ask to me which are the blanks and which samples related to a specific blank, I'd like to create a dialog box that can "link" a blank to a group of samples...
Here what I've written up to know.
"Data" is my database in a table-format (for example: 4519x136 table)
"SampNames" is the name list that contains the blanks and the samples names (which are all in one table)
"SAMPNAME" is the same name list but I substitute some letter in order to obtain some nicer labels at the end of the script (for some graphs).
"indSampBlank" is a variable which contains only the column number of the blanks.
%% Blank reference choice
[indx,tf] = listdlg('PromptString',{'Mandatory: select the reference Blank'},'ListString',SampNames); %choose reference blank
if isempty(indx) %in case no choice was done, the reference blank is the last sample blank
msgbox(strcat(['Reference blank chosen by default:',SampNames(indSampBlank(end))]));
RefBlankCol=indSampBlank(end);
else
for i=1:size(indx,2)
RefBlankCol(1,i)=find(contains(Data.Properties.VariableNames,string(SAMPNAME(indx(1,i)))) & contains(Data.Properties.VariableNames,'Area'));
end
end
What these lines do is this:

As you can see, I can just select the blanks (even more than one) but I cannot assign for example Blank-DA4809-15 to samples from DA4809 to DA4815 only and to assign Blank-DA4816-22 to samples from DA4816 to DA4822.
Am I clear?
Do you have any suggestions?
Thanks in advance.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!