is it possible to convert iddata to cellstr
Mostrar comentarios más antiguos
Dear matlab users,
Is it possible to convert iddata to cellstr? i tried following code but it dont works.
cellstr(num2str(data.y(:,1)))]; %
%data.y(:,1) has this form 1×1 cell array {500×1 double}
500×1 char array
'0.0833333'
' 0.166667'
' 0.25'
' 0.333333'
' 0.416667'
' 0.5'
' 0.583333'
' 0.666667'
' 0.75'
.........
in this format i want vector
Thank you very much
Respuesta aceptada
Más respuestas (2)
Close, but you need to access the contents of the cell array, not the entire cell array itself.
data.y(:,1) = {rand(500,1)};
output = cellstr(num2str(data.y{:,1}));
4 comentarios
Ill ch
el 23 de Oct. de 2019
Daniel M
el 29 de Oct. de 2019
If it's not working for you, can you say why? (Is there a specific error?) Could you also upload your data, I can take a look.
Ill ch
el 29 de Oct. de 2019
Daniel M
el 29 de Oct. de 2019
500x1x0 means your arrays are empty. You don't have any data.
Rajiv Singh
el 5 de Nov. de 2019
From iddata object "data", you can fetch the data arrays as cells using:
y = pvget(data,'OutputData');
In your latest query, y is a cell array of iddata objects. Thus x1 = y{1} will return one iddata object. Then pvget(x1,'OutputData') will return the value of its "OutputData" property as a cell array.
Note that size of 500x1x0 for an iddata object means that the data has 500 samples, 1 output and no inputs signals. The size() operator is specialized (overridden) for iddata objects.
Categorías
Más información sobre Transform Data 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!