Create char Cell Array with same string, multiple times
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jeongsoo Bae
el 15 de Feb. de 2018
Respondida: Jeongsoo Bae
el 15 de Feb. de 2018
Hello,
I would like to write matlab command/code to make the program produce a char cell array, like,
'A'
'A'
'A'
'A'
'A'
'B'
'B'
.
.
.
and so on
but since I'm handling with few millions of dataset, I eagerly want to make the matlab do the job itself. The bottom is the command I tried, but there was no luck in middle way.
v=char( zeros(size(simpledata,1) + size(complexdata,1) , 1) ); %Create empty CHAR array, in total length of 2 LONG data -WAS OK
v(1:size(simpledata,1)) = "A" ; %This is where I stopped
2 comentarios
James Tursa
el 15 de Feb. de 2018
Editada: James Tursa
el 15 de Feb. de 2018
Your question is unclear. You are using the single quotes ' ' to indicate char class, and also using the double quotes " " to indicate string class, and then your title and text mention cell array. So what is it exactly that you want? A cell array of char strings, a cell array of string class variables, a string array, a char matrix, or what? How are you going to use this downstream in your code?
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Cell 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!
