Hi guys.

I wanna combine the scatters and curves in the same graph. However, I used spline function in curves. The graph twisted a lot. The expected graph is the capture1.

Codes:

figure(1) yyaxis right; data=load('OMOKOROA.txt'); time1=datenum(data(:,3),data(:,2),data(:,1),data(:,4),data(:,5),0); time=(time1-datenum(2018,12,12,0,0,0))*24; t=0:0.2:max(time); zz=data(:,6); z = spline(time,zz,t); hold on xticklabels(time1) figure(2) AA=1:23; dirOutput=dir(fullfile('region3','*.csv')); l={dirOutput.name}; % remmeber keep all the filenames unique!!! for j=1:23         t=dirOutput(j).name;         tint(j)=datenum(str2num(t(:,2:5)),str2num(t(:,6:7)),str2num(t(:,8:9)),str2num(t(:,11:12)),str2num(t(:,13:14)),str2num(t(:,15:16))); end yyaxis left; hold on for  i=1:length(l)      Z=csvread(l{i},9,13);      ZZ=mean(Z);      Data{i} =mean(Z); %      scatter(tint(1,1),ZZ(1,1),"r",'o'); %      pause(.1); %      hold on end for m=1:23     scatter(tint(1,m),(Data{1,m}(1,1)),"o") end

More Zhanchao Shao's questions See All
Similar questions and discussions