Counting the number of empty cells per 30 cells in excel with various lenght of data

3 次查看(过去 30 天)
I want to compare multiple data sets, that have different lengts. I want to extract from an excel file how many rows (with a step of 30 cells) in a single column contains text. My current code for this:
k=30;
n=29;
x2 = ending(:,a);
[num,txt,raw] = xlsread(filename,sheet,'M2:M5710');
f_1 = 1;
for ii=1:k:x2;
No_empty(:,f_1)=sum(~cellfun(@isempty,txt(ii:ii+n)),1);
f_1 = f_1 + 1;
end
Here starts the problem, the x2 is different for different excel files. So I cannot store the data in a matrix.
And no I cannot add 0 to the shorter data, I use the numbers for further calculations.
I tried with cell arrays, but then I got stuck in doing further calculations and plotting. So any hint is helpful at this point.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by