Clear Filters
Clear Filters

Data in groups to new table

3 views (last 30 days)
Marek Drliciak
Marek Drliciak on 14 Jan 2023
Answered: Marek Drliciak on 15 Jan 2023
Hello,
I would like to ask for your advice. I have a Data.xlsx file. I would need to create a new "Table".
I'm just sending an example. The table "T15all" contains 2977 rows. New "Table" must have data from T15all in the first column. Next are the other columns (I assume "numel") from Data. The groups in the new "Table" will be created according to the variable "Data.ID15all".
I uploaded a new excel ("Result") where the results are processed in excel. I would need to import this procedure into Matlab. It will be a combination of "countif" and "vlookup".
Could you please help me?
I managed to use the "grpstat" command. I understand the error but I can't solve it.
well thank you

Answers (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 14 Jan 2023
Edited: Sulaymon Eshkabilov on 14 Jan 2023
(1) Import the data into MATLAB:
D = readmatrix('Data.xlsx');
(2) Convert to date time:
DTime = datetime(D(:,1), D(:,2), D(:,3), D(:,4), D(:,5), D(:,6), D(:,7));
(3) Convert to table:
Data = table(DTime);
Data = renamevars(Data, 'DTime', 'ID15all');

Marek Drliciak
Marek Drliciak on 15 Jan 2023
Thank you for your response. But this is not what I'm looking for. I uploaded a new excel where the results are processed in excel. I would need to import this procedure into Matlab. It will be a combination of "countif" and "vlookup".

Tags

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!