SerPIC = serial('COM1'); %<--change this appropriately
set(SerPIC,'BaudRate', 9600, 'DataBits', 8, 'Parity', 'none','StopBits', 1, 'FlowControl', 'none');
fopen(SerPIC); %--open the serial port to the PIC
% fprintf(SerPIC, '%s', '003');%--send a _three_ digit string to the PIC with no terminator ('%s')
int8y = fread (SerPIC,'003','int8'); %-- 003 = 00000011 in binary, so first two LEDs of PIC will light
t = 1:10;
plot (y);
fclose(SerPIC); %--close the serial port when done
delete(SerPIC);
clear SerPIC
this is the code i have entered . it keeps on returning the error, that fread should have a double value . but if i type
y = fread(SerPIC,'003')
y is not filled with any value - i checked it in the variable editor.
my actual problem i guess is to intake a 'double' array so that i can plot a graph . please help me with the input part . i guess i can do the plotting and other things