Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: How to use imported text?
Posted:
Mar 16, 2013 6:10 PM


On Sunday, March 17, 2013 11:06:08 AM UTC+13, Mark wrote: > I imported an Excel file with text. I named this data data_with_text. When I use > > >> word1=data_with_text(1,1) > > I get: > > word1 = 'ABC' > > > > > > Ideally I could run something like this: > > >> if word1=='ABC' > > x=1 > > else > > x=0 > > end > > > > However, this does not work and I get this error, > > Undefined function 'eq' for input arguments of type 'cell'. > > which I presume comes from the apostrophes because word1='ABC' and not plain ABC without the apostophes > > > > Is there any way around this?
Use curly brackets word1=data_with_text{1,1}; but == won't work either. You need to use: help strcmp



