[namafile,direktori]=uigetfile({'*.xls;*.xlsx','file excel(*.xls,*.xlsx)';'*.*','semua file(*.*)'},'buka file excell');
path=fullfile(direktori,namafile);
[A0,B,C]=xlsread(path);%A0=96x8
bar=size(C,1);%97x9
col=size(C,2);%9
kolomA=size(A0,2);%8
if kolomA==8
data=C(2:bar,3:col);%TGL JAM..... 96x7
gjam = datetime(A0(:,1), 'ConvertFrom','excel', 'Format','HH:mm');%96x1 datetime
gtanggal=C(2:bar,1);%96x1 12794 cell
data=[gtanggal, cellstr(gjam), data];% datanew 96x9 cell
judul=C(1,:);
judul2=[C(1,1:2),C(1,4),C(1,5)];% 'Waktu' 'JAM' 'Current (A)' 'Daya Aktif (Watt)'
A=(A0);%no 1 3 5, lost 4 2976x14
minX1=min(A(:,4));
maxX1=max(A(:,4));
minX2=min(A(:,3));
maxX2=max(A(:,3));
sel1=maxX1-minX1;
sel2=maxX2-minX2;
normalize={};
for i=1:bar-1
v1=((A(i,2))-minX1)/(maxX1-minX1);
v2=((A(i,3))-minX2)/(maxX2-minX2);
gab=[v1,v2];
normalize(i,1)={v1};
normalize(i,2)={v2};
end
data2=[gtanggal, cellstr(gjam), normalize];
normalize=data2;
nom=linspace(1,bar-1,bar-1);
set(handles.uitable1,'data',data,'ColumnName',judul,'RowName',nom);
set(handles.uitable1,'Userdata',data);
var1=['Dimensi DataSet ' num2str(bar-1) ' x ' num2str(col) ' BK'];
set(handles.txt1,'String',var1);
baris={'Min','Max','Sel'};
judulMinMax={'Current (A)','Daya Aktif (Watt)'};
dataminmax=[minX1,minX2;
maxX1,maxX2;
sel1,sel2
];
set(handles.uitable2,'data',dataminmax,'ColumnName',judulMinMax,'RowName',baris);
set(handles.uitable2,'Userdata',dataminmax);
save data.mat data;
save dataminmax.mat dataminmax;
save normalize.mat normalize;
graph=cell2mat(data(:,5));
axes(handles.axes_grafik);
plot(graph);
Tidak ada komentar:
Posting Komentar