is it possible to convert iddata to cellstr
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
Star Strider
2019 年 10 月 29 日
Another approach:
data = iddata(rand(1,10)', (0:9)', 0.1); % Create ‘iddata’ Object
y = data.OutputData; % Get ‘OutputData’ As Double Array
ycs = cellstr(num2str(y)); % Convert To Cell Array Of Strings
8 件のコメント
Star Strider
2019 年 10 月 29 日
@Ill ch — As always, my pleasure.
You can (and it is best to) leave them as numeric if you want to save them as a .csv file. The problem now is that saving them as strings to your .csv file creates the additional problem of converting them back to numeric data later, when the .csv file is read.
@Daniel M — Ill ch did not create the class. This is the nature of the output that the System Identification Toolbox iddata function produces.
その他の回答 (2 件)
Rajiv Singh
2019 年 11 月 5 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Transfer Function Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!