Labelling columns of large array in a searchable way?
Show older comments
I'm working for some advice on working with large datasets.
I am trying to label individual strips of continous data in a way that the label can then be used to group/sort by a specific tag: 1, 2 or 3.
Currently for each dataset I am reshaping into an array (800x43200), generating variable names containing tag (1x43200 cell), making a table and saving as a txt.
Then I need if I need all the 1 tags from all datasets, I have to read each table, use a for-loop and str2num on the variable name, parse out the tag and use that to gather correct columns.
This doesn't seem like the best way of doing it, I thought perhaps I should be using tabularText datastores or tall tables but these don't seem to help with my sorting/averaging of specific tags.
Any advice you can offer to point me in the right direction will be greatly appreciated.
3 Comments
Jan
on 20 Mar 2021
Text files are useful, if a human reads or edits them. For huge arrays, the conversion of binary data to text and back to binary data is a waste of time only.
What are "individual strips of continous data"? What does "generating variable names containing tag (1x43200 cell), making a table and saving as a txt" mean? "read each table, use a for-loop and str2num on the variable name, parse out the tag and use that to gather correct columns"? Describing by text what your code does, is less useful than posting the code. "need all the 1 tags from all datasets" is not clear also.
Your input is a matrix of size 800x43200. So what do you want to do with it?
Perhaps I don't quite get your naming scheme, but with a table, if you know the variable name you want to load, you shouldn't have to use a for loop and str2num to get it. See how to access data in tables. Syntax depends on if you want a table returned or an array, but there are various ways you can use the variable name as is to return either.
load patients.mat
T = table(Age,Smoker,Height,Weight,Systolic,Diastolic);
T.Height
T(:,["Height","Weight"])
Accepted Answer
More Answers (1)
Categories
Find more on Numeric Types 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!