MATLAB Answers

0

How can I connect Matlab to Accelerometers?

I would like to use my Matlab to read the outputs of accelerometers. Are there products available that would allow me to use my usb port along with a function command like wavread?
Thanks.
Dave

  3 Comments

Unless your accelerometers have already saved the data they collected as .wav files, wavread won't work.
I have only used usb ports with a pulse-oximeter, configuring the usb port as a serial port object in core MATLAB. (I do not have the Instrument Control Toolbox.)
On a Windows 7 system, I plugged the device into the usb port, and had Windows find and install the driver for it. After that (and finding the online documentation for the usb interface the pulse oximeter used so I could configure MATLAB properly to communicate with it), it worked well. (It provided 4 channels of data. It took some experimenting to discover the data format, and then programming to edit and reshape the matrix every time I wanted to use the pulse oximeter. I could not analyse and display its data it in real time.)
After you've done all this with your accelerometers, it should be relatively easy to get data from them.
In any event, I suggest you do both MEX and online searches to see what others have done with MATLAB and your accelerometers. There might already be robust and reliable MATLAB code for them.
Thanks Star Strider, I was hoping to decide on what accelerometer to purchase based on answers obtained here._
If I'd known that, I'd have suggested Acquire Data From an Accelerometer in the Data Acquisition Toolbox examples. ‘This example uses a ceramic shear accelerometer model 352C22 from PCB Piezotronics is used with 9.22 mV per Gravity.’ (The example and interface boards are listed as being current with respect to 2012b but likely also applies to more recent previous releases.)

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 15 Sep 2012
 Accepted Answer

No, with usb connected instruments you connect via serial(), transfer chunks of data, and then need to interpret the data.
Are you using something like a Mindstorm device?

  0 Comments

Sign in to comment.