添付したファイルについて統計処理を行い,ファイル(out.csv)にまとめて出力したいのですが,いい方法がなかなかできません。
教えていただけますでしょうか。
やりたいこと
L01.csvの1列目のデータの最大,最小,平均,標準偏差の値を,タイトル付き(1行目)でout.csvの2行目に,2列目を3行目,…,22列目を23行目に出力。

 採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 12 月 13 日

0 投票

Read the data using readmatrix, calculate the quantities using max, min, mean and std.
Store the results in a table with an appropriate title and use writetable to write the data into out.csv

3 件のコメント

Atsushi Ueno
Atsushi Ueno 2023 年 12 月 13 日
> L01.csvの1列目のデータの最大,最小,平均,標準偏差の値を,タイトル付き(1行目)でout.csvの2行目に,2列目を3行目,…,22列目を23行目に出力
→ Below is a sample code following @Dyuman Joshi's advice
% Read the data using readmatrix,
A = readmatrix('L01.csv');
% calculate the quantities using max, min, mean and std.
% Store the results in a table with an appropriate title
T = table(max(A,[],1)', min(A,[],1)', mean(A,1)', std(A,0,1)' ...
,'VariableNames',{'最大';'最小';'平均';'標準偏差'});
% and use writetable to write the data into out.csv
writetable(T,'out.csv');
Dyuman Joshi
Dyuman Joshi 2023 年 12 月 14 日
Thank you @Atsushi Ueno
かお
かお 2023 年 12 月 14 日
移動済み: Dyuman Joshi 2023 年 12 月 14 日
皆様
ありがとうございます。
T = table(max(A,[],1)', min(A,[],1)', mean(A,1)', std(A,0,1)' ...
,'VariableNames',{'最大';'最小';'平均';'標準偏差'});
この部分の書き方がわかっていませんでした。
助かりました。

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchangetable についてさらに検索

製品

リリース

R2023a

質問済み:

2023 年 12 月 13 日

移動済み:

2023 年 12 月 14 日

Community Treasure Hunt

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

Start Hunting!