Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%% Introducir datos por el COM %%%
- %delete(instrfind({'Port'},{'COM3'})); % Se cierra por si en algun momento estaba abierto de antes
- %s = serial('COM3','BaudRate',19200,'Terminator','CR/LF');
- %warning('off','MATLAB:serial:fscanf:unsuccessfulRead');
- % Abrir puerto
- %fopen(s);
- % Eliminar posibles datos recibidos hasta ahora
- %flushinput(s)
- tmax=100; % Tiempo maximo lectura (segundos)
- tic
- %while <= tmax
- %t=toc
- data='19.2,20.8,120.5';
- C = strsplit(data,',');
- %for k=1:3
- % vector(k,:)=cell2mat(C(k))
- %end
- vector=cell2mat(C(1));
- S1=cell2mat(C(1));
- S2=cell2mat(C(2));
- %S3=cell2mat(C(3))
- vector(1,:)=S1;
- vector(2,:)=S2;
- a=vector(1,:)
- a=a+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement