This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_L3GD20_U.h> | |
// Assign a unique ID to this sensor at the same time | |
Adafruit_L3GD20_Unified gyro = Adafruit_L3GD20_Unified(20); | |
int THRESHOLD = 4000; // likely needs adjustment | |
int FLAG = 0; | |
unsigned long stepCount = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function handle = drawCell(POSITION, LENGTH, WIDTH, ANGLE, COLOR, varargin) | |
% drawCell - plots a filled bacteria cell with a given length, width, position, angle, and color | |
% | |
% Inputs: | |
% POSITION - coordinates of the cell centroid [x y] | |
% LENGTH - length of the cell (um) | |
% WIDTH - width of the cell (um) | |
% ANGLE - orientation of the cell in radians | |
% COLOR - color of the cell (rgb triplet) | |
% varargin - used to input the current axis hangle if given |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
figure | |
% define the first axis | |
ax1 = axes('Position',[0.1 0.1 0.8 0.8], 'Box','off'); | |
% read the image file | |
I = imread('dog.jpeg'); | |
% display the image | |
img = imshow(I); | |
% create the arbitrary data | |
xData = [1000, 2000, 3000]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function multinucleatedDetect() | |
% Detects multinucleated cells | |
% prompts user for input file and then detects any multinucleated cell | |
% sets and output an image with those cells highlighted and a csv file | |
% with the number of cells and estimated size of multinucleated cell | |
close all | |
% approximately 267 based on my counting from main image | |
% prompt the user for the filename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% create the x y and z axis values | |
x = zeros(1,50)+0.5; | |
y = zeros(1,50)+0.5; | |
z = [0:0.02:1]; | |
% create the figure | |
figure | |
hold on | |
grid on | |
zlim([0 max(z)]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function plotSelectionExample( ) | |
% Demonstration to show how to make an interactive selection gui in MATLAB | |
% Andrew Woodward Fall 2018 | |
f1 = figure; % create the figure | |
set(f1, 'WindowButtonUpFcn', @mouseUpCallback); % create a click up listener | |
hold on | |
% create 3 random plots | |
for i=1:3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% A simple priority queue that takes arrays as inputs and uses a specific | |
% column of the 1xN arrays to sort by the minimum value. | |
% | |
% Utilizes a minheap to ensure quick operation even with queues with | |
% > 100,000 elements | |
% | |
% Andrew Woodward - Fall 2018 | |
% | |
% Example uses: | |
% q = PriorityQueue(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
// define the two I2C addresses | |
const int MPU1 = 0x68; | |
const int MPU2 = 0x69; | |
void setup() { | |
// Setup the two IMUs | |
Wire.begin(); | |
Wire.beginTransmission(MPU1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% randomly generate five axis values | |
x = rand(1,5); | |
y = rand(1,5); | |
z = rand(1,5); | |
% create the figure without shadows | |
figure | |
grid on | |
zmax([0 max(z)]) % set the z-axis limit |