MATLAB Import Data

From EVOCD
Revision as of 14:14, 8 November 2011 by Dzhuk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Abstract

This example shows how to import the date from data file to MATLAB. The file with information about positions of the atoms is given and the objective is to extract all useful information from the data file and omit the unneeded information. In this tutorial shown how to use such MATLAB functions as fgetl, textscan, fopen, fprintf and others.

Author(s): Mark A. Tschopp, Dmitry I. Zhuk

MATLAB Input

File of some formatting is given and the objective is to get a certain data from it, discharging all the other information. The first 20 lines of the example is shown below.

 ITEM: TIMESTEP
           1
 ITEM: NUMBER OF ATOMS
        5828
 ITEM: BOX BOUNDS
  0.000000000000000E+000   109.424979441872     
  0.000000000000000E+000   218.533081144200     
  0.000000000000000E+000   4.05000019073486     
 ITEM: ATOMS
       1   1     53.069549      5.989693      2.024924     -3.319741      0.153287
       2   1     52.569822      2.273330      2.024912     -3.141638     13.948742
       3   1      1.577682     42.407913      4.050134     -3.359999      0.000006
       4   1      3.599188     42.331114      2.025135     -3.360004      0.000006
       5   1      1.432760     38.355783      4.050126     -3.359985      0.000016
       6   1      3.525962     40.304560      4.050129     -3.360000      0.000010
       7   1      1.504881     40.382048      2.025129     -3.359994      0.000010
       8   1      3.453345     38.277394      2.025125     -3.359991      0.000016
       9   1      1.291089     34.301725      4.050119     -3.359945      0.000038
      10   1      3.381448     36.249498      4.050122     -3.359977      0.000024
      11   1      1.361451     36.329039      2.025123     -3.359969      0.000024

Go Back

Personal tools
Namespaces

Variants
Actions
home
Materials
Material Models
Design
Resources
Projects
Education
Toolbox