Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

csvread (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the support class.

Syntax

m = csvread(file)

m = csvread(file, range)

m = csvread(file, row, col)

Description

Reads a file of values that are separated by commas and returns these values as a matrix.

Examples

Inputs

Name Description
file Specifies the file you want to read. The data in the file must be organized as a matrix. file is a string.
range Specifies the range of the data you want to read. range is a four-element vector or a string. If range is a four-element vector, each element represents a row or column coordinate. The first two coordinates specify the row and column where the data begins, and the last two coordinates specify the row and column where the data ends. If range is a string, use spreadsheet notation to specify where the data begins and ends, for instance 'A1..B3'.
row, col Specify the location at which you want to start reading the data. row and col are zero-based.

Outputs

Name Description
m Returns the matrix of values.

Examples

In the following example, LabVIEW creates test.csv in the LabVIEW Data directory. LabVIEW then reads the values in test.csv and returns these values as a matrix.

csvwrite('test', magic(5), 2, 2);
a = csvread('test', 'A2..C3')

Related Topics

csvwrite
dlmread
dlmwrite
str2rng


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit