Conditional histogram plotting help
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I'm trying to figure out how to plot only certain output data if certain conditions are met.
I have a 10000x207 matrix. Each column representing one of the 207 participants in a study, who were subject to 10k monte carlo (MC) iterations of a health analysis. I use the following to plot a histogram of all the MC iterations for all the participants:
figure
h = histogram(MCExpoStart);
xlabel('Start of PFHxS Exposure')
ylabel('Count')
title('Histogram of start of exposure for all study participants')
I'd like to then selectively plot participant data from this original matrix based on certain conditions being met in another matrix. For example, I have another matrix (98x207) that represents where the 207 participants lived over 98 sequential time intervals. This is a matrix made up of numbers 1 through 10, which represent 10 different municipalities. So for example, if a participant has a 1 at a given time, it means that the person lived in town X, but if there is a 2 at an interval the person lived in town Y, 3 = town Z, etc. I'd like to make a histogram of the original MCExpoStart data, but only for the people that lived in towns X and Y at any point in time. I imagine the code would be something like this, but this isn't working... Any suggestions out there? Many thanks in advance!!
figure
if (town(t,column)==1) && (town(t,column)==2) %t=time interval
h = histogram(MCExpoStart(i,column)); %i=monte carlo iteration, column=participant in study
xlabel('Start of PFAS Exposure')
ylabel('Count')
title('Histogram of start of exposure for all X and Y residents')
else
end
4 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!