steffi
Posts:
5
Registered:
4/27/12


Re: plotting and crosscorrelation
Posted:
May 8, 2012 6:03 AM


"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 20002009 (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.

