Check Existence of String
Mostrar comentarios más antiguos
I have a data as follows: This is the sampled data order from serial port which going to come using fgets(): line by line
% date:2016-08-05, time:10:05:23, t1:82.55,h1:85.60,t2:62.55,h2:65.60,
% date:2016-08-05, time:10:05:24, p1:20,p2:35,
% date:2016-08-05, time:10:05:25, p1:35,p2:21,
% date:2016-08-05, time:10:05:26, t1:45,h1:65.60,t2:75.55,h2:65.60,
rdstr='date:2016-08-05,time:10:05:23,t1:82.55,h1:85.60,t2:62.55,h2:65.60,'
Now, I would like to get the data to matrix var1 and var2.
var1= [datetime t1 t2;
datetime t1 t2]...
var2= [datetime h1 h2;
datetime h1 h2]
var3= [datetime p1 p2;
datetime p1 p2]...
Note: The readstr is a serial data received reading one line at a time. the var1 datetime must be at their particular sampling times.
6 comentarios
Geoff Hayes
el 13 de Mzo. de 2016
Mahesh - what is the data type for readstr? Is it a char or cell? Is it an array of strings or a single string? How do parse each element or have you yet to do that?
Mahesh
el 13 de Mzo. de 2016
Geoff Hayes
el 13 de Mzo. de 2016
Mahesh - you have changed the format of your string and have removed the "rules" that you had before when creating/updating the other variables. Please clarify what the new algorithm is.
Mahesh
el 13 de Mzo. de 2016
Geoff Hayes
el 13 de Mzo. de 2016
Mahesh - Please clarify what the new algorithm is. Use an example if necessary.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!