How to write multiple arrays of a excel sheet to different excel sheet using matlab -
How to write multiple arrays of a excel sheet to different excel sheet using matlab -
in excel sheet have info in a1:x1,a2:x2....a30:x30
. have values 120101
, 120102
in ad1:ad30
. want xlsread
read info of a1:x1
, , xlswrite
name nowadays in ad1
i.e 120201
. want arrays @ time , xlswrite
them @ time. here code used 5 array, (a1:x5
) , ad1:ad5
(i want code 30 rows or else should write 30 switch cases)
clc; clear all; format long a=xlsread('entiredata.xls',1,'a1:x5'); k=size(a) b= a.'; h=xlswrite('har.xls',b); q=xlsread('har.xls',1,'a1:e24'); fname=xlsread('entiredata.xls','ad1:ad5'); f=1:length(fname) d=fname(f) d k=num2str(fname(f)); if f<6 switch(f) case 1 f=q(1:24); case 2 f=q(25:48); case 3 f=q(49:72); case 4 f=q(73: 96); case 5 f=q(97:120); end end nname=xlswrite(k,f.'); end
1 row value (i.e 24 values)
27.69 27.41 27.4 27.4 27.41 27.41 27.43 27.43 27.44 27.44 27.44 27.44 27.47 27.47 27.51 27.51 27.55 27.55 27.61 27.61 27.65 27.65 27.69 27.69
i havent tried this, there no way run code without files, guess work.
what have done create loop each column have (n variable) , run code every column. alter create string reading each column number in each iteration. check it, , tell me if dont understand or doesnt work
clc; clear all; format long n=30; ii=1:n a=xlsread('entiredata.xls',strcat('a',num2str(ii),':x',num2str(1))); b= a.'; b k1=xlsread('entiredata.xls',strcat('ad',num2str(ii),':ad',num2str(1))); k=xlswrite(strct('data_',num2str(ii),'.xls'),b); end
excel matlab
Comments
Post a Comment