How do I specify the cell array to indicate strings in double quotation?

1 vue (au cours des 30 derniers jours)
Leon
Leon le 12 Avr 2019
Commenté : Star Strider le 12 Avr 2019
I have an array of strings (pulled from Excel column headers).
For example,
A{1,1} = 'Station Number'
A{1,2} = 'Depth'
etc.
How do I specify the array, so that the output is (please note the double quotation)'
"Station Number"
"Depth"
etc.
The reason I want double quotation is to use the newline function.
Thank you.

Réponse acceptée

Star Strider
Star Strider le 12 Avr 2019
Use the string (link) function:
A{1,1} = 'Station Number'
A{1,2} = 'Depth'
A = string(A)
producing:
A =
1×2 cell array
{'Station Number'} {'Depth'}
A =
1×2 string array
"Station Number" "Depth"
So ‘A’ begins as a cell array and after the conversion becomes a string array.
Is that what you want to do?
  7 commentaires
Leon
Leon le 12 Avr 2019
After changing it to the below, it is working perfectly now. I really appreciate your help!
AA = [AA newline B{1,E(i)}];
Star Strider
Star Strider le 12 Avr 2019
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by