Diva matlab

From GHER

Revision as of 14:42, 27 March 2012 by Charles (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This set of Matlab functions are designed for helping the users to produce graphics based on the output obtained using DIVA. Note that they are basic and general examples of how graphics can be produced. In order to customize your figures, it will be necessary to modify the routines provided.

Contents

Installation

Download and extract the archives Diva_matlab.tar.gz and Diva_matlab_example.tar.gz

tar -xvf Diva_matlab.tar.gz
tar -xvf Diva_matlab_example.tar.gz

Prerequisites

In order to have the routines working properly, some installations have to be made:

Description

Routine Mandatory input(s) Optional input(s) Utility
diva_contour.m contourfile mmapflag Plot the contour
diva_mesh.m meshfile, meshtopofile mmapflag Plot the mesh
diva_data_positions.m datafile dotsize,mmapflag Plot the data locations
diva_data.m datafile dotsize,mmapflag Plot the data values
diva_analysis.m resultfile valex,mmapflag Plot the analyzed field

Usage

Open a matlab session and set the path to the directory containg the function:

addpath('path_to_functions')

Define the input files:

exampledir   = path_to_example_directory;
contourfile  = [exampledir,'/coast.cont'];
datafile     = [exampledir,'/data.dat'];
meshfile     = [exampledir,'/mesh.dat'];
meshtopofile = [exampledir,'/meshtopo.dat'];
resultfile   = [exampledir,'/results.nc'];

Execute the different commands:

Plot the contour:

diva_contour(contourfile);

Plot the finite-element mesh:

 diva_mesh(meshtopofile,meshfile);

Plot the data positions:

diva_data_positions(datafile);

Plot the data (with values):

diva_data(datafile);
colorbar;

Plot the analysis:

diva_analysis(resultfile);
colorbar;

The resulting figures are shown in the right-hand side of this page.



Personal tools