フィルターのクリア

Splitting one column into multiple arrays

1 回表示 (過去 30 日間)
Ali
Ali 2019 年 9 月 29 日
編集済み: Ali 2019 年 9 月 30 日
I have a table P= 22952x 48. The rows contains data of 25 houses (groups).
I want to split data of each specific group(house) into sperate arrays.
I tried 'splitapply' function but i gives an error.
The data(.CSV) is also attached.
For example:
Home_1= 730x 48
Home_2= 830x 48
.
.
.
.
.
Home_25=198x48
-----------------
Total = 22952 x 48
------------------
  2 件のコメント
dpb
dpb 2019 年 9 月 29 日
We don't know how to interpret the data in the file, sorry...what's what in all those rows and columns and what, specifically, are you trying to do?
Also, attach the code you did try and the error text...just paste into the Answer additional info or add as Comment...
Ali
Ali 2019 年 9 月 29 日
The first Coloumn represents the group ID. There are total 25 groups in first colomns.while the rows are showing their data.I want to split these group id seperately into new tables.
G = findgroups(data.id);

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

採用された回答

Ajay Kumar
Ajay Kumar 2019 年 9 月 29 日
z=xlsread('data.csv');
ids = unique(z(:,1),'stable');
houses = cell(length(ids),1);
house = struct();
for i = 1 : length(ids)
houses{i,1} = [ 'house' num2str(i) ];
house.houses{i,1} = z(find(z(:,1)==ids(i)),:);
end
The data of all houses are stored in struct house.
  3 件のコメント
Ajay Kumar
Ajay Kumar 2019 年 9 月 29 日
"all houses data in 1 table?"
You mean like in csv file?
Ali
Ali 2019 年 9 月 30 日
編集済み: Ali 2019 年 9 月 30 日
I want to arrange data in following way:
1). Group each categaries seprately and store in array/cell.
2).Generate artificial dates starting from
01-april-2012 00:00 % 30 minutes interval for 24hrs
to
31-March-2014 23:30
3). Store each house data in single column along the time series as shown in attached figure.
4.) Store all data in one table like:
% Form table
Col 1 Col 2 Col 3 ...................... Col 26
Date and time House A (data) House b (data).................... House z data

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by