Why does converting a string array to a char array add a third dimension?

e.g.

`>> char(["0" "0" "0"]) 1×1×3 char arrayans(:,:,1) = '0'ans(:,:,2) = '0'ans(:,:,3) = '0'`

I expect something more like

`ans = '000'`

Skip to content# MATLAB: Does converting a string array to a char array add a third dimension

###### Related Question

MATLAB

Why does converting a string array to a char array add a third dimension?

e.g.

`>> char(["0" "0" "0"]) 1×1×3 char arrayans(:,:,1) = '0'ans(:,:,2) = '0'ans(:,:,3) = '0'`

I expect something more like

`ans = '000'`

- How to concatenate two newline characters together
- How to use custom date labels for the x-axis in MATLAB plots
- Using a ‘listbox’ in MATLAB R2015b, why do I receive the warning ‘Multiple-selection ‘listbox’ control requires that ‘Value’ be an integer within String range’
- How to create a pictogram in MATLAB
- How to obtain the coordinates of the mouse on the screen displayed somewhere in the figure window
- How to change the axis limit when I have 2 axes in the figure
- Does ‘varfun’ exclude rows with an empty cell
- How to treat space in a text file as leading zeros
- Contains() does not recognize the second string as a valid
- Is implementing the “fft” formula in documentation giving me opposite sign for imaginary part

## Best Answer