splitting 2 rows of excel using matlab
1 次查看(过去 30 天)
显示 更早的评论
I have 121 rows with data in excel - data for 120 subjects
The first row is the heading coloumn
I want that if Matlab can split each of the 2 rows - heading row and one other row - to be spilit into new excel sheet
So I want Matlab to split the data into 120 excel files with the heading row constant in them combined with another row
Can anyone help ??
2 个评论
dpb
2021-6-12
That's not clear to me what you want, but MATLAB can write whatever you want however you want it; you just have to have an algorithm by which to generate the file names and pick which data you want for each...
回答(1 个)
KSSV
2021-6-15
T = readtable(myfile) ; % excel file with extension
n = height(T) ;
for i = 1:n
fname = strcat('row',num2str(i),'.xlsx') ;
writetable(T(i,:),fname)
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!