A bit of background~(adsbygoogle = window.adsbygoogle || []).push({});

I'm using a wii mote to collect accelerometer data, and have the data exported to an excel document.

This data is then imported into matlab using :

a = xlsread(fileName); %reads in file name

x = a(:, xColNum); %time

y1 = a(:, y1ColNum); %accel value x

y2 = a(:, y2ColNum); %accel value y

y3 = a(:, y3ColNum); %accel value z

what i'd like to do next is then set a threshold check so that if any of the values within each of the sets is greater than a decided value a trigger can be set.

I'm not sure how to run the initial check on the y1, y2 ,y3 values. My first thoughts are to run a for loop on the sets and then have if statements that execute when the given values are reached. My only problem is i'm not quite sure how to code this within the m file. Also should it be part of a seperate function of just below the above code.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab - checks on imported data

Loading...

Similar Threads - Matlab checks imported | Date |
---|---|

How to program this in Matlab | Feb 28, 2018 |

Matlab Making a short test for self-adjointness | Feb 23, 2018 |

Check computer speed in Matlab | Feb 5, 2015 |

Could you check (if statment block) in my MATLAB code please? | Dec 1, 2014 |

**Physics Forums - The Fusion of Science and Community**