Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • 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
Mar 8, 2007
1
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?
 
Replies continue below

Recommended for you

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