×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Using find with a textread

Using find with a textread

Using find with a textread

(OP)
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?

RE: Using find with a textread

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources