aligni to the center character string in array cells
Mostrar comentarios más antiguos
I have a character array. I would like to alligne to the center of cells with a simple funcion or so on.
Thanks
3 comentarios
Stephen23
el 18 de Sept. de 2023
"aligni to the center character string in array cells... I have a character array."
A character array is not the same thing as a cell array of character vectors.
A character array is an array of characters, and has nothing to do with cell arrays.
Dyuman Joshi
el 19 de Sept. de 2023
@antonio, you have not attached the file, just a screenshot.
Please attach the file you are working with.
Respuestas (3)
C1 = {'Euler ';
'Fibonacci';
' Gauss'}
C2 = strjust(C1,'center')
If this is not what you wanted to do, please attach the data and code you are working with and specify what you want do.
1 comentario
N/A
el 19 de Sept. de 2023
So it's either a string array or a cellchar. In either case it has some unknown amount of whitespace on at least one side. It's hard to tell because of the variable-width font. For all we know, it's already padded to the center and this complaint is entirely about the display in the variable browser.
So that's my guess. If this is all about the display in the variable browser, then no, as far as I know there isn't a "center" option (at least not in my older version). However, if the array is already padded with whitespace, it won't display as centered unless you're using a monospace font in the variable browser.



Again, that only solves the display issue of strings/chars that are already padded. It doesn't add the padding to the array.
1 comentario
N/A
el 18 de Sept. de 2023
N/A
el 18 de Sept. de 2023
0 votos
Categorías
Más información sobre Data Type Identification en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
