Can we create submatrices of similar elements of matrix.
2 次查看(过去 30 天)
显示 更早的评论
I have matrix {'v1' 'e1' 'v2' 'e3' 'v3' 'e4' 'v3' 'e5' 'v4'} and I want to create sub matrices where all vs should go into one matrix and all es should go into another matrix.
Like V = {'v1' 'v2' 'v3' 'v3' 'v4'} and E = {'e1' 'e3' 'e4' 'e5'}
Thanks in advance
0 个评论
采纳的回答
Stephen23
2022-12-31
VS = {'v1','e1','v2','e3','v3','e4','v3','e5','v4'};
E = VS(startsWith(VS,'e'))
V = VS(startsWith(VS,'v'))
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!