Using load with partial name

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*))

回答(0 个)

类别

帮助中心File Exchange 中查找有关 File Operations 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by