The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Compare 2 histograms, when "hist" is in a subplot
Replies: 2   Last Post: Jul 3, 2014 12:54 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 105
Registered: 7/24/10
Compare 2 histograms, when "hist" is in a subplot
Posted: Jun 30, 2014 4:01 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I plot 2 histogram *subplots*. I want to compare them, not just by eye. I want to plot hist(A) - hist(B). That is, they look similar. But I want to plot the difference of the histograms.

The Help tells me I can return the 'hist' values - ie the "qty" per "bin".

step 1: z(1)=hist(E(1,:),nbins);
step 2: z(2)=hist(E(2,:),nbins);
step 3: "plot something using z(1)-z(2)"

But I the first 2 histograms are in a subplot and that messes things up:

subplot(1,3,1), hist(E(1,:),nbin) - that works
subplot(1,3,1), z(1)=hist(E(1,:),nbin); - that doesn't work

Note: I don't want to subtract curve B from curve A and then "hist". I want to compare the 2 histograms.

Will appreciate any help.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.