Using hold to generate scatter-histogram in for loop
Afficher commentaires plus anciens
I'm attempting to combine multiple scatter-histograms into one figure. I have randomly assigned y-values for each x-value. I've tried adding 'hold' and 'hold on' before and within the for loop. Matlab keeps outputting individual figures. Any help would be great!
a=1; b=10;
for i=1:MiceNumb
xData=0;
yData=0;
xData = xDataCellArray{i};
r=(b-a).*rand(5000,1) + a;
yData=r(1:size(xData));
figure
if genotype(1,i)==1
scatterhist(xData,yData,'Kernel','on','LineStyle',{'-'},'Marker','.');
end
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!