Questions tagged [matlab]

MATLAB is a programming language used primarily for numerical computations. Use this tag for questions regarding communicating or using MATLAB with Arduino. Also consider using other tags such as [programming].

MATLAB is a programming language used primarily for numerical computations. It can also be used to connect to other programming languages, plot data, or implement algorithms.

Use this tag for questions regarding communicating or using MATLAB with Arduino.

Also consider using other programming related tags such as or .

56 questions
11
votes
2 answers

How to pause Arduino for 1 millisecond through MATLAB?

I have been able to connect MATLAB to my Uno with this line of code: a = arduino('COM4'); through this package: Matlab support package for Arduino. Right now, MATLAB is my main script that will synchronize all the components [like the Arduino]. I am…
8
votes
4 answers

How can I communicate from Arduino to MATLAB

I want to use sensors on an Arduino to control values in a MATLAB program. What are my options for communicating? I've used Processing to receive data sent via the serial cable, and that strategy has worked pretty well. Is there something similar I…
Bill Nace
  • 224
  • 1
  • 2
  • 4
6
votes
3 answers

Binary serial transmission order of data

I'm implementing a filter for my IMU Sensor and thus I want close to real time data visualized on the computer. I use binary serial communication to facilitate the sending part for the arduino (as far as I know the serial.print is pretty slow). So I…
mike
  • 347
  • 6
  • 20
5
votes
4 answers

Employing C++ code for Arduino

I have Googled quite a lot regarding using a C++ program for uploading to Arduino and related, however I am confused now. Right, my problem is this: I have written a C++ program which imports RGB data of a 24 bit bitmap (which was generated using…
panda_the_great
  • 97
  • 2
  • 10
4
votes
0 answers

ArduinoDue - Matlab: SerialUSB.write() sends ASCII?

I'm trying to get some binary data from an Arduino Due to Matlab. Basically this is the setup: Due: byte usbMsg[33]= {0}; // filled with dummy as example usbMsg[1] = '00000001';// in[3]; usbMsg[2] = '00000001';//in[4]; usbMsg[3] =…
Chuchaki
  • 141
  • 1
3
votes
0 answers

Sending binary data to Matlab via serial

I would like to exchange data via Xbee. I've set up a communication based on strings between the Arduino and a Matlab software. Unfortunately this kind of communication isn't enough robust and sometimes messages aren't delivered correctly. So I…
UserK
  • 559
  • 1
  • 11
  • 24
3
votes
4 answers

GUI interface with microcontroller to control a device through SPI

I am trying to develop a GUI to control a device hooked up on the Arduino. The Arduino communicates with the device through SPI. I have developed a GUI on MATLAB to visualize read by the Arduino. For this, I made Arduino write data from the MISO…
3
votes
4 answers

Communicating between a computer and multiple Arduinos

I am designing a experiment of controlling 6 small wind turbines wirelessly. For each wind turbine, I need to measure power time series (or voltage or current time series) from the generator, and control blade pitch angle, yaw angle, and generator…
Jinkyoo Park
  • 81
  • 1
  • 5
3
votes
2 answers

MATLAB - Read from 2 SPI inputs synchronously

I am using the MATLAB Arduino Support Package to create a setup where I can read force data from a load cell and positional data from an incremental encoder - then plot them on MATLAB. It must be done at the same time in order to produce a material…
rtkilian
  • 31
  • 1
2
votes
0 answers

Problem reading HMC5843 - Magnetometer in Simulink

I'm having a SparkFun 9 DoF sensor stick including the following components: ADLX345 - Accelerometer ITG3200 Gyroscope HMC5843 - Magnetometer Im currently working on a project in which I need to calculate the yaw angle, I tried using the…
Carl
  • 21
  • 1
2
votes
0 answers

Simulink resets arduino

I am working on servo motors control through serial communication protocol, I am sending data from Simulink to arduino and vice versa, The problem I am getting is that once I open Simulink Servo motors start turning while no command is sent or…
HDne
  • 21
  • 2
2
votes
2 answers

How to program an Arduino Uno to collect data using a timer interrupt and analyze that data in matlab?

I working on a project where I want to collect sensor data (from a sensor) and I want to analyze the first 20 data sample (e.g., find the range, trendline e.t.c.). I know how to compile a timer interrupt in Arduino IDE (using an ISR timer), but how…
2
votes
1 answer

The analog read is not giving the correct waveform as that of an oscilloscope

I have code that fetches analog input values from terminals A0, A1 and A2 of an Arduino Mega 2560. When I plot the data, it does not give the desired waveform. The desired waveform is also measured with a the digital storage oscilloscope. I was…
2
votes
2 answers

Interfacing MPU6050 with Arduino through Simulink S-function

I am interfacing MPU6050 with Arduino using Simulink S-function builder. I'm implementing MPU6050_DMP6 code in Simulink s-function builder by following this video. By following this tutorial I implemented the S-function as: I set sample time 0.05 in…
Danish_Anwar
  • 31
  • 1
  • 5
2
votes
1 answer

Arduino Mega 2650 + Matlab/Simulink - Serial decimation

I am performing a control analysis on an Arduino board. As such, I want to minimize the board cycle duration. (Faster board = faster controller). Introduction: I use Mathworks Matlab/Simulink to program the board. I created a model in Simulink, and…
kando
  • 141
  • 7
1
2 3 4