3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MatlabでデータをCSVに書き出す

Last updated at Posted at 2021-02-28

目的

Matlabで計算したデータをCSVに書き出す方法の記載

実行コード

%保存データの作成

Time(:,1) = 0:0.2:0.8;
Data(:,1) = 1:2:10;
Data2(:,1) = (1:2:10)*4;


%csvで保存
CSVFileName = 'test.csv';

Output = [Time,Data,Data2]; %配列形式に編集

csvwrite(CSVFileName,Output); %csvで書き出し

%R2019a 以降ならwritematrixを推奨 下記は実際に動かして試していない。
% Output2.Time = Time;
% Output2.Data = Data;
% Output2.Data2 = Data2;
% 
% writematrix(Output,CSVFileName)

実行結果

test.csvがm-fileと同じフォルダにできる。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?