From: Judas Magnus on
[num txt raw] = xlsread('c:\dummy.xls'); %Read the excel file and loads into matlab


Just wondering if there was a simple way to accomplish this,

I have to find the number of entries that have one blank field.

So I was thinking that hey If I do raw, I see all the num, txt and other information.

So i type in

raw

I get the list from the excel file into matlab, and I see NaN "not a number"

So I was wondering on how to count those "NaN' and put the entries with "NaN' fields into another array..


I hope someone can help me please ^_^
From: ImageAnalyst on
You can use the isnan() function. Then use the sum() function to
count the number of nan's by summing the results of the isnan
function. Copy those nan's to another array just using regular
logical indexing as usual. Write back if you can't figure out the
details.
From: Judas Magnus on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <31a2f506-efcc-45a3-b125-e45d470ff8a0(a)x38g2000vbx.googlegroups.com>...
> You can use the isnan() function. Then use the sum() function to
> count the number of nan's by summing the results of the isnan
> function. Copy those nan's to another array just using regular
> logical indexing as usual. Write back if you can't figure out the
> details.


The xls file has 312 rows and 4 columns by the way

When I use isnan() function :

for example, I do

isnan(raw), i get

??? Undefined function or method 'isnan' for
input arguments of type 'cell'.

So how do I make isnan work with it...
From: ImageAnalyst on
Well I guess then you have to pass each cell to it one at a time
For example:
isnan(raw{1});
and so on for all the cells in the cell array called "raw".
From: Judas Magnus on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <557e04c7-fd74-4dbb-8eef-32069131b2ed(a)v14g2000yqb.googlegroups.com>...
> Well I guess then you have to pass each cell to it one at a time
> For example:
> isnan(raw{1});
> and so on for all the cells in the cell array called "raw".


hmm that would be not worth it i guess..

perhaps we have to do a for loop to go through each line and say

if isnan raw to the end of the raw cell is true then put them in a new variable?