ResearchOS / Biomech-Analysis-Platform-MATLAB

A GUI-based operating system framework to facilitate biomechanical data analysis. This platform attempts to manage the non-scientific part of coding without restricting the direction or method of scientific analysis.
MIT License
4 stars 0 forks source link

Change loading settings variables to not occur one at a time. #145

Closed mtillman14 closed 1 year ago

mtillman14 commented 2 years ago

Here's code to show why this is important: iMax=1000; for i=1:iMax a=zeros(1000,100); eval(['a' num2str(i) '=a;']); end

save('TestLoad.mat','-v6');

% Test loading one variable at a time tic; for i=1:iMax load('TestLoad.mat',['a' num2str(i)]); end toc;

cw; for i=1:iMax names{1,i}=['a' num2str(i)]; end

% Test loading all specified variables at once. tic; load('TestLoad.mat',names{:}); toc;

% Test loading all variables at once. tic; load('TestLoad.mat'); toc;

settingsPath='C:\Users\Mitchell\Desktop\Matlab Code\GitRepos\Spr22-Role-of-Each-Gait-Phase\Settings_Spr22RoleOfEachGaitPhase.mat'; tic; load(settingsPath); toc;

mtillman14 commented 2 years ago

By far the most efficient way is just to load the entire file (brought down load times from ~10 seconds to ~3.5 seconds).

mtillman14 commented 2 years ago

141 Related

mtillman14 commented 1 year ago

Using SQL now