Skip to content

Getting Started

R-Broadley edited this page Jul 6, 2017 · 7 revisions

activpal_utils package

All code is contained in the activpal_utils package. The advantage of this is that it creates a separate namespace which prevents clashes with other function or variable names.

There are two methods to call functions contained within activpal_utils:

activpal_utils.func();

or

import activpal_utils.func;
func();

For more information on packages in Matlab see Matlab Packages.

Opening your first file

Use the following code to open your first activpal™ raw data file:

[fileName, fileDir] = uigetfile( ...
    {'*.datx; *.dat', 'activPAL Files (*.dat, *.datx)'}, ...
    'Select an activPAL data file' );

filePath = fullfile(fileDir, fileName);
Data = activpal_utils.load_datx(filePath);

uigetfile will open a GUI interface to select a file to open.
filePath = fullfile(fileDir, fileName) simply merges the result from uigetfile into a single path string.
Data = activpal_utils.load_datx(filePath) opens the chosen file and stores the contents in Data.

Contents Next
Clone this wiki locally