Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using find with a textread

Status
Not open for further replies.

nybelle

Computer
Joined
Mar 8, 2007
Messages
1
Location
US
I'm trying to simply find a certain value with a text file. The file has 4 columns.

First I read it in:
[a,b,c,d]=textread('6033.txt','%d %d %f %s',96);

Then I want to find every instance were d is not 'N':
>> F=find(d ~= 'N');

But I get:
??? Function 'ne' is not defined for values of class 'cell'.

Any ideas?
 
Hi,

use STRCMP here :

M={'A' 'B' 'C' 'D'}

find(~strcmp(M,'B'))

But most of the time, you don't need the FIND function.

M{~strcmp(M,'B')}

Jérôme
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top