-3

I have a string:

str = Earth is round

How do i add a double quotes in the start and end of it? The result should be :

str = "Earth is round"

I'm using MATLAB 2013 version.

ibezito
  • 5,782
  • 2
  • 22
  • 46

1 Answers1

2

Solution

You can use the following syntax:

res = ['"' 'Earth is round' '"']

Result example

script

['"' 'Earth is round' '"']
'Earth is round'

output

ans = "Earth is round"
ans = Earth is round
ibezito
  • 5,782
  • 2
  • 22
  • 46