Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to read .D2 files in matlab

Status
Not open for further replies.

vacikel

Junior Member level 1
Joined
Oct 8, 2007
Messages
18
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,283
Activity points
1,367
matlab importdata variable filename

I have datas taken from a spectrum analyzer they are in the form DATA.D2 and the question is how the files with D2 extantion read in matlab
 

open it in notepad you sould be able to read it, then you can analyze it.


MATLAB Function Reference
importdataLoad data from disk file

Syntax
importdata(filename)A = importdata(filename)A = importdata(filename,delimiter)A = importdata(filename,delimiter,headerline)[A D] = importdata(...)[A D H] = importdata(...)[...] = importdata('-pastespecial',
...)Descriptionimportdata(filename) loads data
from filename into the workspace. The filename input
is a string enclosed in single quotes.A = importdata(filename) loads
data from filename into structure A.A = importdata(filename,delimiter)
loads data from filename using delimiter as
the column separator. The delimiter argument must be a
string enclosed in single quotes. Use '\t' for tab. When
importing from an ASCII file, delimiter only separates
numeric data.A = importdata(filename,delimiter,headerline) where headerline is
a number that indicates on which line of the file the header text is located,
loads data from line headerline+1 to the end of the file.[A D] = importdata(...) returns
the output structure in A, and the delimiter character
in D.[A D H] = importdata(...) returns
the output structure in A, the delimiter character in D,
and the line number of the header in H.[...] = importdata('-pastespecial',
...) loads data from your computer's paste buffer rather than from
a file.Remarksimportdata looks at the file extension to determine
which helper function to use. If it can recognize the file extension, importdata calls
the appropriate helper function, specifying the maximum number of output arguments.
If it cannot recognize the file extension, importdata calls finfo to
determine which helper function to use. If no helper function is defined for
this file extension, importdata treats the file as delimited
text. importdata removes from the result empty outputs
returned from the helper function.ExamplesExample 1 — A Simple ImportImport data from file ding.wav:s = importdata('ding.wav')
s =

data: [11554x1 double]
fs: 22050Example 2 — Importing with Delimiter and HeaderUse importdata to read in a text file. The third
input argument is colheaders, which is the number of lines
that belong to the header:type 'myfile.txt'

Day1 Day2 Day3 Day4 Day5 Day6 Day7
95.01 76.21 61.54 40.57 5.79 20.28 1.53
23.11 45.65 79.19 93.55 35.29 19.87 74.68
60.68 1.85 92.18 91.69 81.32 60.38 44.51
48.60 82.14 73.82 41.03 0.99 27.22 93.18
89.13 44.47 17.63 89.36 13.89 19.88 46.60Import from the file, specifying the space character as the delimiter
and 1 row for the column header. Assign the output to variable M:M = importdata('myfile.txt', ' ', 1);Print out columns 3 and 5, including the header for those columns:for k=3:2:5
M.colheaders(1,k)
M.data:),k)
disp ' '
end

ans =
'Day3'
ans =
61.5400
79.1900
92.1800
73.8200
17.6300

ans =
'Day5'
ans =
5.7900
35.2900
81.3200
0.9900
13.8900
See Also
load
 

I've already open it in notpad and its format is disorganized.

also I found a way to get date thanks for your reply
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top