View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Oommf vector data file to Matlab array

Be the first to rate this file! 15 Downloads (last 30 days) File Size: 185 KB File ID: #44187 Version: 1.3
image thumbnail

Oommf vector data file to Matlab array



06 Nov 2013 (Updated )

Imports Oommf vector data files saved as text into Matlab

| Watch this File

File Information

This is a function to import vector file archives from oommf into Matlab

Oommf vector files must be written with the output Specifications "text %g"
instead of the default "binary 4" option. And the type of grid must be

Vector files will be imported into the object "data" which will have this
   field: current applied magnetic field
   xmin: minimum x value
   xnodes: number of nodes used along x
   xmax: maximum x value
   ymin: minimum y value
   ynodes: number of nodes used along y
   ymax: maximum y value
   zmin: minimum z value
   znodes: number of nodes used along z
   zmax: maximum z value
   datax: component x of vector on data file
   datay: component y of vector on data file
   dataz: component z of vector on data file
   positionx: x positions of vectors
   positiony: y positions of vectors
   positionz: z positions of vectors

We have created with Oommf the archive test.omf (included on the zip). To open it into "data"


       Now we can make a 2D vector field


or calculate the divergence and plot it

shading flat
colormap bone

For more examples, you can see my blog (look for Oommf, to be updated shortly):

[1] Oommf Micromagnetic simulator at NIST,

This function was written by :
Héctor Corte
B.Sc. in physics 2010
M.Sc. in Complex physics systems 2012
Ph.D Student between NPL (National Physical Laboratory) and Royal Holloway University of London
United kingdom.

Required Products MATLAB
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
06 Nov 2013 Héctor Corte

I wrote a few lines about exporting data on Oommf in my blog here:

Comment only
08 Nov 2013 1.1

An updated version is now available. The older version scan line by line for the data and took 30 s to upload the test.omf file into Matlab, this version uses textscan()and takes only about 0.17 s.

18 Nov 2013 1.3

There was a problem with 3D data files that now is solved.

Contact us