Convert structure to vector
117 次查看(过去 30 天)
显示 更早的评论
Hello all,
I'm working with data in a structure type. For example:
M(1).vector=[0.3966;0.0829]
M(2).vector=0.87537
M(3).vector=0.64707
M(4).vector=[0.50874;0.04913;0.39537;0.27546;0.5889;0.61199;0.61578;0.78747;0.75151]
The Data for each row within the structure are small vectors as shown (Actually my structure has more than 1000 rows). I have this information separated like this because to each row I needed to apply different calculations. But now that all the calculations are done, I want to have this data as a 1 column vector. I have tried using something like cell2mat(struct2cell(M)) but I get errors.
The result that I'm looking for should look like this:
Result=[0.3966;0.0829;0.87537;0.64707;0.50874;0.04913;0.39537;0.27546;0.5889;0.61199;0.61578;0.78747;0.75151]
Any suggestions?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!