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.

 Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 25 de Nov. de 2015

0 votos

testcell={'R1(2)' 'R1(1)' 'R1(0)'};
vfinal = cell(4,10);
vfinal(1,1:3) = testcell

Más respuestas (0)

Categorías

Más información sobre Entering Commands en Centro de ayuda y File Exchange.

Preguntada:

el 25 de Nov. de 2015

Respondida:

el 25 de Nov. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by