Using load with partial name
Show older comments
I have daily data with similar parameters but each vector can have a different suffix depending on the logging rate e.g. Time_1Hz, Temperature_1Hz, .... or Time_5Hz, Temperature_5Hz, ....
to load these all and analyse together i have been using
all = dir('*.mat');
for a=1:length(all)
load (all(a).name, 'Time_1Hz', 'Temp_1Hz', 'Time_5Hz', 'Temp_5Hz')
and then analysing them separately like below
if exist ('Time_1Hz') == 1
Script_1Hz
else if exist ('Time_5Hz') == 1
Script_5Hz
end
end
end
I wonder if there is a more sophisticated way to run this using a who command
something like
load (all(a).name, who(Time*, who(Temp*))
Answers (0)
Categories
Find more on File Operations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!