I have two hist3 figure as:
Ctr = {1.5:0.5:4.5 0.1:0.1:0.9};
hist3([[1;2.7; 3.6], [0.25;.36;.84]],'Ctrs',Ctr);
hist3([[1.2;1.7; 2.6], [0.17;.46;.94]],'Ctrs',Ctr);
I want two have the addition of these two histograms, how is it possible?

댓글 수: 8

dpb
dpb 2018년 9월 7일
By "addition" you mean
A=[[1;2.7; 3.6], [0.25;.36;.84]];
B=[[1;2.7; 3.6], [0.25;.36;.84]];
>> figure
>> hist3([A;B],'Ctrs',Ctr);
?
Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018년 9월 8일
No. A and B are different matrices, you have changed the problem statement. Please notice the question.
jonas
jonas 2018년 9월 8일
"I want two have the addition of these two histograms, how is it possible?"
The problem statement is ambiguous. Take some time to clarify.
dpb
dpb 2018년 9월 8일
I haven't "changed" anything -- I took a guess as to what the problem actually might be; I "noticed" the Q?; what I didn't notice was anything that actually described what was meant.
Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018년 9월 8일
Let's say at each iteration we have different xi and yi as the observed data. When we plot them using hist3 we can see the density of points at grid. When xi+1 and yi+1 come out the density at each point of grid changes, i.e., the density is hist3 for all previous untill xi and yi plus xi+1 and yi+1. Simply we can say that at each iteration hist3 including all past data must be summed by the new observed data.
jonas
jonas 2018년 9월 8일
Sorry if I still don't understand but perhaps this is related to your older question that I replied to about an hour ago?
Basically, my take on this is the following. You have two iterations over some range of x-data, say
x1=[1;2;3;4]
x2=[1;2;3;4]
and
y1=[1;2;3;4]
y2=[2;2;3;3]
If you want to show both iterations in the same hist3 plot, then you need to concatenate the data:
yt = [y1;y2]
xt = [x1;x2]
hist3([xt,yt])
I believe this is exactly what dsp said, so perhaps this is not what you want?
Seyyed Mohammad Saeed Damadi
Seyyed Mohammad Saeed Damadi 2018년 9월 8일
Thank you. I misunderstood. It is exactly what I want.
jonas
jonas 2018년 9월 8일
My pleasure, happy to help!

댓글을 달려면 로그인하십시오.

답변 (0개)

댓글:

2018년 9월 8일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by