How do I re-save a MDF file in a specified location?

조회 수: 3 (최근 30일)
Aikansh Sharma
Aikansh Sharma 2021년 7월 8일
편집: Harimurali 2024년 2월 11일
I am loading multiple MDF files and then removing a few rows in each file.
I wish to save the changes I made to this data back as an MDF format itself.
I have attached the code I am using.
As can be seen above, I am changing the data in one particular group per file. And my requirement is to save the updated file now back as MDF format.
Hope my query is made clear. :)

답변 (1개)

Harimurali
Harimurali 2024년 2월 11일
편집: Harimurali 2024년 2월 11일
Hi Aikansh,
The "mdfRead" and "mdfWrite" functions provided by MATLAB can be used to read and save the updated file back in MDF format. Here is an example MATLAB script that shows how to read an MDF file, change the data in a channel group of the MDF file, and write the changes back to the MDF file:
% read the channel group "idx" data
chanGrpData = mdfRead("/path/to/mdfFile.mf4", GroupNumber=idx, IncludeMetadata=true);
chanGrpTT = chanGrpData{1};
% make the required changes (like deleting rows from the timetable)
% make the mdf file writable
fileattrib("/path/to/mdfFile.mf4", "+w");
% write the updated data to the channel group "idx" of the mdf file
mdfWrite("/path/to/mdfFile.mf4", chanGrpTT, GroupNumber=idx);
Refer the documentation of the "mdfWrite" function for more information about the function and its limitations : https://www.mathworks.com/help/releases/R2023b/vnt/ug/mdfwrite.html
Refer the following documentation for more information about overwriting an MDF file in MATLAB: https://www.mathworks.com/help/releases/R2023b/vnt/ug/overwrite-channel-group-data-in-an-mdf-file.html

카테고리

Help CenterFile Exchange에서 Cardiology에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by