creating an empty cell
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jason
el 4 de Abr. de 2011
Comentada: Zeeshan Ahmad Khalil
el 28 de Mzo. de 2018
I have two matrix:
A = [1 2 3]
B = [4 5 6 7; 9 8 7 6; 5 4 3 2]
I want to combine these two matrice into:
C = [ 1 2 3; 4 5 6 7; 9 8 7 6; 5 4 3 2]
I want the top left corner to be an empty cell because in the end I want to write matrix C to a csv file so I would like to have that cell empty. I tried playing around with vertcat and horzcat but I keep getting dimensions are not consistent error.
1 comentario
Respuesta aceptada
Sean de Wolski
el 4 de Abr. de 2011
Fill it with a Nan:
C = [[A, nan];B];
2 comentarios
Zeeshan Ahmad Khalil
el 28 de Mzo. de 2018
i also want to keep a cell blank so that when i concatenate it with the other cells it will be removed automatically.
Más respuestas (1)
Andrew Newell
el 4 de Abr. de 2011
dlmwrite('myfile.csv',A,'coffset',1)
dlmwrite('myfile.csv',B,'-append')
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!