Replace elements of a cell
显示 更早的评论
I wrote the following code:
testcell={'R1(2)' 'R1(1)' 'R1(0)'};
vfinal = cell(4,10);
vfinal(1:3) = testcell
I was expecting that the result was:
vfinal =
'R1(2)' 'R1(1)' 'R1(0)' [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] [] []
But the result was:
vfinal =
'R1(2)' [] [] [] [] [] [] [] [] []
'R1(1)' [] [] [] [] [] [] [] [] []
'R1(0)' [] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] [] []
Any tips?
Thank you.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!