Skip to content

motion-workshop/shadow-fileio-matlab

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Shadow File IO for Matlab

Build Status

Introduction

Matlab module to read a Shadow take.

Quick Start

A really quick start.

% Find your most recent take and plot all of the data at once
plot(shadow.takeread());

OK, that was too much. Pick one channel at random.

% Read back the data stream and the header so we can show the time axis for
% one randomly selected channel
[A, header] = shadow.takeread();

% Number of samples, one per row
n = size(A, 1);

% Create a time axis in seconds
x = [0:n-1] * header.h;

% Select a channel, one column
y = A(:, randi(n));

% Plot one channel over time
plot(x, y);

Great! Now pick a particular measurement and make a better report.

% Pick the gyroscope channel from the Hips node and create a nicer plot
[A, header] = shadow.takeread();

% Node key 5 is the Hips in Shadow full body take
key = 5;
name = shadow.header.name();

% Find the gyroscope measurement channel
g_range = shadow.header.range(header, key, name.g);
if isempty(g_range)
  error('no gyroscope measurement for the Hips node');
end

% Number of samples, one per row
n = size(A, 1);

% Create a time axis in seconds
x = [0:n-1] * header.h;

% Plot gyroscope data, x-y-z order in deg/s
plot(x, A(:, g_range));
title('Gyroscope measurements for Hips');
xlabel('Time (s)');
ylabel('Angular rate (deg/s)');
legend('Hips.gx', 'Hips.gy', 'Hips.gz');

License

This project is distributed under a permissive BSD License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages