Error using vertcat Dimensions of arrays being concatenated are not consistent.
Mostra commenti meno recenti
Hi,
I'm trying to read mpu6050 and emg data from serial port simultaneously via esp32. But it gives and error '' Error using vertcat ,dimensions of arrays being concatenated are not consistent.'' Matlab sometimes gives 4 , sometimes 3 datas and it interrupts the code. How can i make sure that 4 datas read from serial port ?
Any ideas??
a=serial('COM3','BaudRate',115200);
fopen(a);
D=zeros(1000,4);
for t=1:1000
data = fscanf(a,'%d');
D = [D;data'];
D = D(2:end,:);
plot(D);
pause(0.1)
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Matrix Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!