accessing a .csv file

  1. Opened a .csv file in Excel
  2. num = xlsread (filename.csv)
  3. The required data is listed in the command window (790 rows and 6 columns)
  4. When I try to use the array of data in the following function call I receive an error: Undefined function or variable 'num'.
  5. run dataSplitter(num, integer1, integer2, integer3)
what am I doing wrong?

2 Kommentare

Wouter
Wouter am 20 Mär. 2013
Bearbeitet: Image Analyst am 20 Mär. 2013
the variable
num
does apparently not exist; what happens if you type:
whos num
after step 2?
Bob Matthews
Bob Matthews am 20 Mär. 2013
Name Size Bytes Class Attributes
num 790x6 37920 double

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 20 Mär. 2013

0 Stimmen

Even though num is not null after step 2, it apparently is not defined by the time you get to step 5. Is step 5 in the same function as step 2? If not, see the FAQ for info on how to make the function that calls step 5 see the num from step 2.

3 Kommentare

Bob Matthews
Bob Matthews am 20 Mär. 2013
I do not understand your question ?
I tried the following without success..........
save(fullMATdiffSet, 'num.csv') Undefined function or variable 'fullMATdiffSet'.
Image Analyst
Image Analyst am 20 Mär. 2013
Please watch this: debugging tutorial so you know how to check the values of variables. You will see that the variables you are trying to pass do not exist yet, at least not in that function. Each function has its own private workspace. Variables are not global by default. Set a breakpoint there and examine fullMATdiffSet when it stops at the breakpoint.
Bob Matthews
Bob Matthews am 20 Mär. 2013
thank you

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Variables finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 20 Mär. 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by