Category: Matlab

Matlab2tikz usage

example of matlab2tikz usage with relative path address and latex size command:

matlab2tikz('../../../Report4/immagini/source/ilvsd.tikz','width','0.8\columnwidth')

and you can also write axis label in latex mode, for example in MATLAB code you can write

%axes
xlabel('$d$')
ylabel('$\fs$')

and run matlab2tikz with this options

matlab2tikz('../../../Report4/immagini/source/familyfsild.tikz','width','0.8\columnwidth','parseStrings',false)

Arduino + Matlab serial connection

In the past days i had some issues while i’m trying to read some Arduino datas using Matlab. I made a simple Matlab script which should read a number from Arduino but when I open the serial port after a while i get this error:

Warning:A timeout occurred before the Terminator was reached.

after some search on web i find that  pressing reset button on Arduino board just after started Matlab script, it is able to read the data correctly. So, if you get the error shown above:

1) lunch Matlab script

2) press reset button on the Arduino board

3) you should be able to see the Tx led of Arduino blinking

Here there are 2 example of sampling. I was reading the output signal from a 433Mhz receiver.