Grouping data to reduce number of columns in a table

6 ビュー (過去 30 日間)
Youssif Youssif
Youssif Youssif 2022 年 11 月 20 日
回答済み: the cyclist 2022 年 11 月 20 日
Hello,
For the table I included, does anyone know how to reduce the number of columns by summarizing the rows. For example the first row can be summarized to have "20390-20400" in cell 1,1. Then on cell 2,1 of the table, the next row is summarozed to say "22578-22588".The data to be summarized comes from a 18x11 variable called TenSecResult.

回答 (1 件)

the cyclist
the cyclist 2022 年 11 月 20 日
% Some pretend data
TenSecResult = magic(3);
% The output you want
output = string(TenSecResult(:,1)) + "-" + string(TenSecResult(:,end))
output = 3×1 string array
"8-6" "3-7" "4-2"

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by