user3670233
user3670233

Reputation: 3

MATLAB: Converting numeric values to NaN

I'm trying to import an excel file containing latitude and longitude data into MATLAB. I'm using the 'Import Data' option. It is reading the latitude and longitude information just fine except that some of the longitude cells are being marked as unimportable and being replaced by NaN. They contain values like -119.253 etc. What could be the reason for this? I just want to keep the original information.

Below is a snapshot of a portion of my Excel spreadsheet:

Excel Sample

Upvotes: 0

Views: 461

Answers (1)

Daniel
Daniel

Reputation: 36710

The screenshot shows the Problem. All numbers that are left-alligned aren't real numbers, that is text. Numbers are alligned to the right.

Mark the column in excel and change the format to number.

Upvotes: 2

Related Questions