outStr = export(obj,Name,Value)


export(obj,Name,Value) exports different types of spinw object data.

outStr = export(obj,Name,Value) returns a string instead of writing the data into a file.


In this example the crystal structure is imported from the test.cif file, and the atomic positions are saved into the test.pcr file for FullProf refinement (the pcr file needs additional text to work with FullProf).

cryst = sw('test.cif');

Input arguments

spinw object.

Name-Value Pair Arguments

Determines the output data and file type. The supported file formats are:
  • 'pcr' Creates part of a .pcr file used by FullProf. It exports the atomic positions.
  • 'MC' Exports data into a custom file format for Monte Carlo simulations.
Path to a file into which the data will be exported, out will be true if the file succesfully saved, otherwise false.
File identifier that is already opened in Matlab using the fileid = fopen(...) command. Don’t forget to close the file afterwards.

File format dependent options:

'perm' (pcr)
Permutation of the \(xyz\) atomic positions, default value is [1 2 3].
'boundary' (MC)
Boundary conditions of the extended unit cell. Default value is {'per' 'per' 'per'}. The following strings are accepted:
  • 'free' Free, interactions between extedned unit cells are omitted.
  • 'per' Periodic, interactions between extended unit cells are retained.