Save struct field to a file with save command

5 ビュー (過去 30 日間)
Elzbieta
Elzbieta 2024 年 1 月 22 日
回答済み: Voss 2024 年 1 月 22 日
I am trying to save to a file 1channel ECG signal from the file containing structure:
Accelerometer: [5183900×4 table]
Breathing: [1295975×2 table]
ECG: [12959750×2 table]
In order to do that I am using load command to a data variable and then save it with save function with the code:
data=load('dataexported_2023_12_17.mat');
[data] = [data.ECG.EcgWaveform];
save('D:\matlab-pliki\MAT2EDF\dataexported_2023_12_17.txt', 'data','-ascii','-tabs', '-double')
Unfortunately I cannot save teh variable data to a file since the variable type is not supported and I am obtaining empty file.
Could you please enlighten me how to fix the code to save ECG data to a file?
Regards
E

回答 (1 件)

Voss
Voss 2024 年 1 月 22 日
Since the variable you want to save is a table, you can use writetable.

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by