Remove quotation marks from a text string
17 次查看(过去 30 天)
显示 更早的评论
I have an Excel table that I load into Matlab, containing a lookup string, and the name of the cell array (within Matlab) wherein I will find the string. For instance, a row in this table may be:
MSWXAUL saaDataTitles
MSWXAUL will be the contents of one of the cells in saaDataTitles.
What I want to do is determine the location of the lookup string within the cell array. I'm using find(strcmp( )) to do so, which seems to work fine. My issue is that when I load the Excel table, the entries acquire quotation marks, thus:
'MSWXAUL' 'saaDataTitles'
That's fine for the lookup value; but it means that Matlab doesn't recognise the array name as an array name rather than a text string. It's my understanding that it needs to read saaDataTitles rather than 'saaDataTitles'.
How can I get this to work? I'm open to any approach - trimming the first and last characters to get rid of the quotation marks, extracting anything that isn't a quotation mark, changing the nature of the string, loading it via a different method in the first place, whatever else might work - but can't figure out how to do it.
2 个评论
Yao Li
2013-4-8
Your purpose is to find out the header name of the column or row. Am I right? So I think it's OK if Matlab returns an array rather than a text string. Why you just need a text string without quotation marks?
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!