- Create separate variables or data structures to store data from each group.
- Process each group independently based on its frequency.
Error using ConvertTDMS (v10)
4 views (last 30 days)
Show older comments
ConvertTDMS code for processing tdms files has issues. This code is not working if TDMS file has 2 groups with different frequencies. But It is working good if both groups has 50Hz frequency
For me I have 2 groups; Group 1 is 50 HZ and Group 2 is 1000 Hz then but the same code is working good if both the groups are 50Hz.
Unable to perform assignment because the left and right sides have a different number of elements.
Error in convertTDMS>postProcess (line 1360)
Value(c)=index.(cname).(cfield).value;
Error in convertTDMS (line 322)
[ConvertedData(fnum).data,CurrGroupNames]=postProcess(ob,channelinfo);
0 Comments
Answers (1)
Rishav
on 11 Sep 2023
Hi Waseem,
I understand that you are facing an issue when the TDMS file has two groups with different frequencies.
The workaround here is to process both the groups separately:
Here's an example:
% Load the TDMS file using the appropriate library or function.
% Replace 'your_tdms_file.tdms' with the actual file path.
tdmsFile = tdmsread('your_tdms_file.tdms');
% Identify the groups and their properties
groupNames = fieldnames(tdmsFile.groups);
numGroups = numel(groupNames);
% Process each group separately
for i = 1:numGroups
groupName = groupNames{i};
groupData = tdmsFile.groups.(groupName);
% Check the frequency of the group and process accordingly
if groupData.Frequency == 50
% Process data for a 50Hz group
% You may have specific code here for 50Hz data
elseif groupData.Frequency == 1000
% Process data for a 1000Hz group
% You may have specific code here for 1000Hz data
end
end
Here in this code, we iterate through each group in TDMS file, check its frequency and process the data accordingly.
Thank you,
Rishav Saha
0 Comments
See Also
Categories
Find more on TDMS Format Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!