Graphical Interface
As an alternative to the cd
function, use the Current Directory field in the MATLAB desktop toolbar.
Syntax
Description
cd
displays the current working directory.
w = cd
assigns the current working directory to w
.
cd('directory')
sets the current working directory to directory
. Use the full pathname for directory
. On UNIX platforms, the character ~ is interpreted as the user's root directory.
cd('..')
changes the current working directory to the directory above it.
cd directory or cd ..
is the unquoted form of the syntax.
Examples
changes the current working directory to demos
.
changes the current working directory to demos
. Then typing
changes the current working directory to matlab
.
Convert complex diagonal form to real block diagonal form
Syntax
Description
If the eigensystem [V,D] = eig(X)
has complex eigenvalues appearing in complex-conjugate pairs, cdf2rdf
transforms the system so D
is in real diagonal form, with 2-by-2 real blocks along the diagonal replacing the complex pairs originally there. The eigenvectors are transformed so that
continues to hold. The individual columns of V
are no longer eigenvectors, but each pair of vectors associated with a 2-by-2 block in D
spans the corresponding invariant vectors.
Examples
has a pair of complex eigenvalues.
[V,D] = eig(X)
V =
1.0000 -0.0191 - 0.4002i -0.0191 + 0.4002i
0 0 - 0.6479i 0 + 0.6479i
0 0.6479 0.6479
D =
1.0000 0 0
0 4.0000 + 5.0000i 0
0 0 4.0000 - 5.0000i
Converting this to real block diagonal form produces
[V,D] = cdf2rdf(V,D)
V =
1.0000 -0.0191 -0.4002
0 0 -0.6479
0 0.6479 0
D =
1.0000 0 0
0 4.0000 5.0000
0 -5.0000 4.0000
Algorithm
The real diagonal form for the eigenvalues is obtained from the complex form using a specially constructed similarity transformation.
Construct a cdfepoch
object for Common Data Format (CDF) export
Syntax
Description
E = cdfepoch(date)
constructs a cdfepoch
object, where date
is a valid string (datestr
), a number (datenum
) representing a date, or a cdfepoch
object.
When writing data to a CDF using cdfwrite
, use cdfepoch
to convert MATLAB formatted dates to CDF formatted dates. The MATLAB cdfepoch
object simulates the CDFEPOCH
datatype in CDF files
datenums
are the number of days since 0-Jan-0000.cdfinfo
Return information about a CDF file
Syntax
Description
info = cdfinfo(file)
returns information about the Common Data Format (CDF) file specified in the string, file
. The function returns a structure, info
, that contains the fields shown in the following table.
The GlobalAttributes and VariableAttributes Fields
GlobalAttributes
and VariableAttributes
are structure arrays that each contain one field for each global or variable attribute respectively. The name of the field corresponds to the name of an attribute. The data in that field, contained in a cell array, represents the entry values for that attribute.
For VariableAttributes
, the attribute data resides in an N-by-2 cell array, where N is the number of variables. The first column of this cell array contains the variable names associated with the entries. The second column contains the entry values.
The Variables Field
The Variables
field of the returned info
structure is an N-by-6 cell array, where N is the number of variables. The six columns of the cell array contain the following information.
Column No. | Description | Return Type |
1 | Name of the variable | String |
2 | Dimensions of the variable, as returned by the size function | Double array |
3 | Number of records assigned for the variable | Double |
4 | Data type of the variable, as stored in the CDF file | String |
5 | Record and dimension variance settings for the variable. The single | String |
6 | Sparsity of the variable's records. This is a string holding one of three possible values: | String |
Examples
info = cdfinfo('example.cdf')
info =
Filename: 'example.cdf'
FileModDate: '29-Jun-1995 05:51:58'
FileSize: 230513
Format: 'CDF'
FormatVersion: '2.4.8'
FileSettings: [1x1 struct]
Subfiles: {}
Variables: {7x6 cell}
GlobalAttributes: [1x1 struct]
VariableAttributes: [1x1 struct]
info.Variables
ans =
'L_gse' [1x2 double] [ 1] 'char' 'F/T' 'Full'
'Status%C1' [1x2 double] [7493] 'uint8' 'T/T' 'Full'
'B_gse%C1' [1x2 double] [7493] 'single' 'T/T' 'Full'
'B_nsigma%C1' [1x2 double] [7493] 'single' 'T/' 'Full'
No comments:
Post a Comment