How to convert a cell array to a structure matrix?
2 次查看(过去 30 天)
显示 更早的评论
I have a cell array ' col_names = {'Lp max '; 'G max'; ' G min'}.
I want to convert it into a structure array. I am not able to use the standard cell2mat command. As a final output I need col_names = [Lp max;Gmax;Gmin].
Please suggest a solution.
0 个评论
回答(1 个)
Azzi Abdelmalek
2014-6-20
col_names = {'Lp max '; 'G max'; 'G min'}
v=cell2struct(col_names,'names',numel(col_names))
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!