How do i store new data into an existing cell array?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Assuming i have a cell array:
myArray = {NaN, 'm', 'b', NaN};
And i have a while loop within which i call the function that produces a new result:
myArray = {NaN, NaN, NaN, 'n'};
How do i append the new result into the existing one such that i still have a 1x4 array with the cells as follows:
[{NaN, NaN}] [{'m', NaN}] [{b, NaN}] [{NaN, 'n'}]
Thank you in advance!.
0 comentarios
Respuestas (1)
ES
el 17 de Mzo. de 2017
once you have myArray = {NaN, 'm', 'b', NaN}; and myArray 1 = {NaN, NaN, NaN, 'n'};, you can run a for loop over them and concatenate.
for iloop=1:4
output{iloop,1} = myArray{iloop};
output{iloop,2} = myArray1{iloop};
end
0 comentarios
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!