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?
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
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