Create a uniform empty cells between 2 data in excel file?

1 回表示 (過去 30 日間)
MUKESH KUMAR
MUKESH KUMAR 2019 年 3 月 12 日
コメント済み: Raghunandan V 2019 年 3 月 12 日
I had a excel file having data at 30min interval for a day , size (48*1). Now I want to create it at 1min time interval with same data and keeping at same postion and between 2 data , create 30 empty cells.
for example see the excel file.......In desired output I only filled upto 6 data, simillary how can we fill it by matlab?
thanks
  1 件のコメント
Alex Mcaulley
Alex Mcaulley 2019 年 3 月 12 日
what have you tried so far?

サインインしてコメントする。

回答 (1 件)

Raghunandan V
Raghunandan V 2019 年 3 月 12 日
Please check this out:
[num, as,ads] = xlsread('m.xlsx');
%take the required data
A = num(1:48, 1:2);
%initialize B
B = zeros(30*48,2);
%initialize time stamp of B
B(:,1) = [1:30*48]';
for k=1:48
B(((k-1)*30 +1):k*30,2) = A(k,2);
end
you can write the result B into the excel
  2 件のコメント
MUKESH KUMAR
MUKESH KUMAR 2019 年 3 月 12 日
If i had 30min interval data for full year then how to d this for 1 min time interval ?
Raghunandan V
Raghunandan V 2019 年 3 月 12 日
replace 48 by length(data)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by