Conversion from struct type to array
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fahim Feroje
el 6 de Feb. de 2015
Comentada: karima neffati
el 16 de Jul. de 2019
Hey I have a .mat file which contains ECG data.Where aa contains struct type [15x10000 double]. How can I convert aa into [somethingx1 double] so that I can calculate length of ECG signal ?
aa=load('ff.mat');
aa
4 comentarios
karima neffati
el 16 de Jul. de 2019
fahim ,please what code you apply to find the 2D representtaion of your ecg signle, i have the same issue
Respuesta aceptada
Stephen23
el 7 de Feb. de 2015
Editada: Stephen23
el 7 de Feb. de 2015
load('ff.mat')
It turns out that this .mat file contains no structure, only a single variable named val, which is of class double, and has size 15x10000. You request "I want to store this in array", but it already is an array, and a very convenient double array at that. You want a numeric array of data, and you already have one single perfect array of numeric data within that .mat file.
Your statement "I can not understand what value contains in row or column such like time or voltage" is possibly quite true, but do suppose that anyone here on MATLAB Answers can magically know how your data is arranged? To know exactly what the data contains you will have to ask the person who created it, or read their documentation, or perhaps engage in a little bit of reverse engineering of the function that saved that data.
For a start it seems likely that the second dimension is time, although personally I could not find any strictly monotonically increasing values in any one row:
>> all(diff(val)>0,2)
ans =
0
0
0
0
0
0
0
0
0
0
0
0
0
0
So it seems that some kind of time variable is not included in this data. In any case, I would highly recommend that you work through these tutorials:
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!