Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: plotting and cross-correlation
Replies: 4   Last Post: Feb 25, 2013 1:19 PM

Advanced Search

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

Posts: 5
Registered: 4/27/12
Re: plotting and cross-correlation
Posted: May 8, 2012 6:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Matt J" wrote in message <joafug$qib$1@newscl01ah.mathworks.com>...
> "shaula nataya" <swl100789@gmail.com> wrote in message <joa78v$nqu$1@newscl01ah.mathworks.com>...
> > Hello,
> > I have thickness thermocline data (meter) and Ocean Dipole Index (IOD) from 2000-2009 (the data are monthly). I want to draw the plot and calculate the correlation between the two data and show the correlation value on the plot. Can you guys help me with this?

> ==============
>
> Why isn't as simple as using the PLOT command?
>
>

> > And I don't have any idea about what formula that have to be used on the correlation.
> ===============
>
> Why isn't it as simple as using XCORR or CONV?

===========================================
I already do with plot command and corrcoef but I got confused with it and I can't show the correlation value on the plot.

below are the script :
y1 = xlsread('upper.xlsx', 'upper - IOD', 'F26:F37'); %upper
y2 = xlsread('upper.xlsx', 'upper- IOD', 'G26:G37'); %IOD
x = xlsread('upper.xlsx', 'upper - IOD', 'B26:B37'); %time

%plot
[ax,h1,h2] = plotyy(x,y1,x,y2,'plot');

set(get(ax(1),'ylabel'),'string','Depth (m)')
set(get(ax(2),'ylabel'),'string','IOD')
xlabel('month')
title('Upper Layer - IOD Tahun 2002')
set(h1,'linestyle',':')
set(h2,'linestyle','-.')
legend('Upper Layer','IOD')

%korelasi
C=corrcoef(y1,y2);
r = C(2,1);

cheers.



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.