How to make a reference to multiple subelements of a cell without for loop (to create a plot)
1 次查看(过去 30 天)
显示 更早的评论
lets say I have a axb cell , each cell contains a 1xn double I want to make a plot like this plot({1,:}(1,end)) , i.e. for the first row of this cell I want to plot each cells last datapoint. I know this syntax doesn't work for cells, and it gives me the error "Incorrect cell or structure reference involving "end". Most likely cause is a reference to multiple elements of a cell or structure followed by additional subscript or structure references."
But how would you do this seemingly simple task?
0 个评论
采纳的回答
更多回答(1 个)
Harshit
2012-11-6
Hi Felix, You have to use cell2mat. It converts your code to matrix. You have knowledge about n so pick up every nth element. It can be done easily.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!