Arduino Support package for MATLAB R2014a

I recntly tried to connect my arduino Uno with MATLAB R2014a. In mathworks.com they suggest the use of the following new package Arduino Support from MATLAB - Hardware Support - MATLAB & Simulink
Now it seems that many commands that existed in previous versions are no longer supported (e.g. analogRead is now readVoltage)
My problem is that the communication between MATLAB and Arduino is VERY slow. I timed a readVoltage() command and it takes about 25-35 ms to read the voltage of an analog pin. Is that as fast as it can get? I hope not! But what am I missing here?

You can see what I mean in the attempted real time plot that I'm trying to do below...

a=arduino();
interv=50;
elapsed_time=0;
figure
initial_time=tic;
while(elapsed_time<interv)
    elapsed_time=toc(initial_time);
    b=readVoltage(a,0);
    plot(elapsed_time,b)
    hold on
end
clear a

What code is running on the Arduino? What baud rate are you using?

You should try getting help here:

Pete

PaulS:
What code is running on the Arduino? What baud rate are you using?

This MATLAB code runs without me writing any code in the arduino... (except for the first time I ran it that it took a few seconds to connect and update a server driver) Must I add one?

Have you loaded the Matlab support package into the Arduino?

Pete

el_supremo:
Have you loaded the Matlab support package into the Arduino?

Pete

I think yes during the installation of the package... I don't think there would be any communication bewtween MATLAB and Arduino if I hadn't loaded it. My problem is that the communication is slow,not non-existent

You probably need to increase the baud rate between Arduino and Matlab. I'm guessing that you're using 9600. Try increasing that to 57600 or 115200.

Pete

el_supremo:
You probably need to increase the baud rate between Arduino and Matlab. I'm guessing that you're using 9600. Try increasing that to 57600 or 115200.

Pete

Well first of all thanks for keeping on answering... I checked the arduino.m file and it seems that the initial setup for the serial communication is 115200. Whichever other number I try, I get

Updating server code on Arduino Uno (COM3). Please wait.
Error using arduino_real_time_plotter (line 1)
Internal error: The initialization of the server code is
incorrect.

I think that this number must be probably changed in another file too (and that's why MATLAB complains),but I couldn't find where...

There's no need to change it if it is already at 115200. At that speed you can transfer nearly 300 characters in 25ms. Either the Matlab protocol is really wasteful or something else is slowing things down.
I think you're going to have to ask here:

Pete