How to send arduino output in serial monitor to matlab

I'm having a problem with sending arduino output in serial monitor to matlab. Is there a way doing it?? Can give me some example or guidance?? Does arduino and matlab using the same port??

I'm having a problem with sending arduino output in serial monitor to matlab.

You can have the Serial Monitor attached to the serial port OR matleb. Not both.

What problem are you having?

calvinong:
I'm having a problem with sending arduino output in serial monitor to matlab. Is there a way doing it?? Can give me some example or guidance?? Does arduino and matlab using the same port??

In times past I think I've seen virtual com port programs that provided for software com ports on a single pc. Google and you might find something.

can give me some simple example of arduino output that send it to matlab with the code??

If you want/need to use the serial monitor at the same time as a serial connection to matlab, which is useful for debugging

#include <SoftwareSerial.h>
SoftwareSerial matlabSerial(10, 11);
// Rx is digital pin 10 (connect to Tx of matlab)
// Tx is digital pin 11 (connect to Rx of matlab)

void setup()
{
  Serial.begin(9600);
  matlabSerial.begin(9600);
  Serial.println("Hello Serial monitor");
  matlabSerial.println("Hello matlab");
}

void loop()
{
}

If you want/need to use the serial monitor at the same time as a serial connection to matlab, which is useful for debugging

Since matlab is a connected to a virtual com port on the PC, it seems unlikely that the OP will be able to connect matlab to pins 10 and 11.

Sorry. My misunderstanding as to how Matlab works.
How should it be connected then ?

How should it be connected then ?

Using the normal USB cable. But, the Serial Monitor MUST be closed, so that matlab is the only application trying to use the serial port.

The Serial Monitor is useful, to see that the Arduino is sending the data that the user expects. Once that is determined, then it is up to the matlab user to consume (correctly) the known data being sent. And that is a matlab issue, not an Arduino issue.

Got it.
Thanks Paul

ok, now i’m having these values in my arduino’s serial monitor as shown in the attachment. How can i transfer these values to matlab? Means that how do the matlab display the same value in the arduino’s serial monitor??

Capture.PNG

calvinong:
How can i transfer these values to matlab?

Close the serial monitor and have Matlab open the serial port, then arrange for the data to be sent again.

calvinong:
Means that how do the matlab display the same value in the arduino's serial monitor??

What happens inside Matlab after it has received the serial data is somebody else's problem.

wad kind of code i need to write in matlab to display out the value??

calvinong:
wad kind of code i need to write in matlab to display out the value??

As has been pointed out, that is NOT an Arduino question.

PaulS:

calvinong:
wad kind of code i need to write in matlab to display out the value??

As has been pointed out, that is NOT an Arduino question.

matlab can link with arduino. it means that its part of arduino =)

it means that its part of arduino =)

No, it doesn't. You'd get more help if you ask your question in the Interfacing with software on the computer forum or on a Matlab forum, since your problem has to do with how to use matlab, not how to use the Arduino.

wad kind of code i need to write in matlab to display out the value??

The below may have some matlab answers for you.

https://www.google.com/search?as_q=matlab&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=http%3A%2F%2Fforum.arduino.cc%2Findex&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=&gws_rd=ssl