Conditional histogram plotting help
12 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!