I'm trying to write a script that loads an excel file and writes 10 sub-file either into 10 separate file or separate sheets.Im new to MATLAB and I've been running into some trouble.
Need to figure a way to load the file and only access A1:B1000 on the excel file then write that information on a new excel file. Then load A1000:B2000, etc...
My idea and code is as follows:
i=1;
j=1000;
TenTimes=1;
master= 'Master.xlsx';
while TenTimes < 10
num = xlsread('File1.xlsx');
Time = num(:,1);
Current = num(:,2);
xlswrite(master,[Time Current]);
i == j;
j = j +1000;
TenTimes = TenTimes + 1;
end
I tired the following:
num=num = xlsread('File1.xlsx', 'Ai:Bj');
This crashed MATLAB and freezes my laptop.
num = xlsread('File1.xlsx');
Time = num('Ai:Aj',1);
Current = num('Bi:Bj",2);
This produces garbage
I'm also not sure how to encode the loop to produce separate files or separate sheets.
Any help would be most appreciated.