matNMR 3 9 0
matNMR 3 9 0
matNMR 3 9 0
1 of 1
http://matnmr.sourceforge.net/pics/biglogo.gif
12/06/06 05:47 PM
1 of 3
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/navigate...
2 Installing matNMR
4 Processing in matNMR
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
02/28/07 05:48 PM
2 of 3
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/navigate...
7 Producing output
02/28/07 05:48 PM
3 of 3
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/navigate...
8 Script-based processing
02/28/07 05:48 PM
1 of 1
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/ManualInt...
02/28/07 05:28 PM
1 of 6
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Installati...
2.1.1 UNIX
To install matNMR for a single user only on a UNIX system one must first extract the downloaded code into any directory. Here I will use '/home/jabe/matlab/matNMR' as an
example. Then one must change or create the file ~/matlab/startup.m. Specifically, the PATH variable needs to be changed so that MATLAB looks in the directory in which you
have just extracted the source code. This is a possible syntax to change the path:
path('/home/jabe/matlab/matNMR', path);
No further actions should be needed.
To install matNMR globally (i.e. for all users) on a UNIX system it is easiest to add a directory called matNMR to the matlabroot/toolbox directory (note that one needs the
proper rights to do this, usually super user). Then extract the downloaded code into this directory. You then need to edit the matlabroot/toolbox/local/pathdef.m file. There you
should add the matlabroot/toolbox/matNMR directory to the list of standard directories.
In the matNMR directory there is a file called matnmroptions.mat and this is the configuration file for matNMR. If users have not copied this file into their personal matlab
directory ~user/matlab then these settings will be used by matNMR. Note that users usually don't have permission to overwrite this file and therefore not change their settings!
For more information on this see paragraph 2.2 "Setting up matNMR (Options)".
02/28/07 05:12 PM
2 of 6
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Installati...
The general options menu is used to set some general working parameters. These include:
02/28/07 05:12 PM
3 of 6
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Installati...
02/28/07 05:12 PM
4 of 6
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Installati...
This menu is used to define the colour scheme used in all matNMR windows. Several schemes have been pre-defined from which it is easy to make changes, if necessary.
After changing values the results button will change, although for a complete overview of the effect matNMR must unfortunately be restarted. You MUST save the colour scheme
02/28/07 05:12 PM
5 of 6
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Installati...
before restarting matNMR! Note that this manual only shows the classic colour scheme.
This menu is used to define the screen sizes of the three main matNMR windows and also the font size that is used for UIcontrols. The numbers denote the size of the windows
in relative units, i.e. they range from 0 to 1. Changes are applied immediately (just be sure to press "ENTER" after changing a value!).
The font list menu species the list of fonts that matNMR recognizes. The default list in the downloaded code is based on a UNIX system which means many Windows/Macintosh
fonts are not in this list! It is recommended to push the "import system fonts" button to create a list of fonts recognized on your system.
02/28/07 05:12 PM
6 of 6
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Installati...
The line properties hold for both the plots in the main window and the 2D/3D Viewer, i.e. for contour plots and 3D stack plots. This menu can but should not be used for
changing the appearance of single plots as all windows will be affected by this. For that the "Plot Manipulations" menu should be used instead.
The text properties hold for both the plots in the main window and the 2D/3D Viewer. This menu can but should not be used for changing the appearance of single plots as all
windows will be affected by this. For that the "Plot Manipulations" menu should be used instead.
02/28/07 05:12 PM
1 of 5
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/matNM...
02/28/07 05:29 PM
2 of 5
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/matNM...
Whenever an edit button is used, i.e. a button in which one can write (for more information of different types of UI-controls please read the MATLAB documentation), the
expression is evaluated afterwards using the MATLAB eval command. This means that any general function that produces a result that is correct for the given input question,
can be given as input. For example in the input window displayed above one can specify "Name" as:
a
(where a is a variable in the workspace)
or
a*10+4./b
(where a and b are variables in the workspace)
or
1:1024
or
diff((1.01).^(0:511))
(type "help diff" for more information on diff.m)
etc ...
This again gives a lot of flexibility as the input format is free as long as the result is correct.
Note that the "full width" button allows expansion of the input window to the full width of the screen. This can be useful when the text written in the edit buttons is very long.
Usage in matNMR
Spec1D
Axis1D
Size1D
SW1D
SF1D
Spec2D
02/28/07 05:29 PM
3 of 5
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/matNM...
Spec2Dhc
AxisTD2
AxisTD1
SizeTD2
SizeTD1
SWTD2
SWTD1
SFTD2
SFTD1
Dim
Fig
History
HistoryMacro
QFitResults
Results from the last peak fitting. These are not stored in the QmatNMR structure! For more information on the format of this variable see paragraph 5.3.1,
General appearance.
QSSAFitResults
Results from the last MAS CSA fitting. These are not stored in the QmatNMR structure!
QCSAFitResults
Results from the last static CSA fitting. These are not stored in the QmatNMR structure!
QQuadFitResults Results from the last quadrupolar-tensor fitting. These are not stored in the QmatNMR structure!
QDiffFitResults
Results from the last diffusion-curve fitting. These are not stored in the QmatNMR structure!
QT1FitResults
Results from the last relaxation-curve fitting. These are not stored in the QmatNMR structure!
As can be seen from the table there are different variables for 1D and 2D spectra. The distinction between working in 1D or in 2D mode is quite clear although it cannot be
seen directly while working with matNMR. This is explained in more detail in paragraph 4.2, "1D and 2D mode".
A comparable list can be given for the 2D/3D Viewer window:
Variable Name
Usage in matNMR
Spec2D3D
Axis2D3DTD2
Axis2D3DTD1
PeakList
History2D3D
Fig2D3D
AxisNR2D3D
02/28/07 05:29 PM
4 of 5
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/matNM...
frequency for a certain dimension have been supplied (either during loading of a binary FID or manually, then the default axis, see also paragraph 2.2.1 General Options, will
produce proper time and frequency axes (Hz or PPM). The reference for such frequency axes is always set to 0 and in the center of the spectrum. NOTE that by changing the
spectral width and/or spectral frequency the default axis will change immediately.
There are two ways of properly referencing spectra: 1) defining and axis for a particular spectrum directly OR 2) by applying an external reference.
1. Axis vectors can be defined from the (Plot Manipulations - ruler X-axis) menubar in the main window. The typical axes in PPM, Hz or time can be defined but also axes in
points or other less typical axes can easily be defined (for more information on how to change the axis vector see paragraph 5.2.5, "Plot manipulations"). As the spectrum is just
a numerical matrix it can be manipulated very easily during processing. The axis vectors are just used for plotting, but on the other hand:
NOTE: whenever there is an input concerning coordinates they must usually be given in the unit of the axis vector! (e.g. for extracting parts of a spectrum,
integrating, etc...)
2. An external reference may be loaded from external datasets, either as defined in a file on your spectrometer, or by using the reference as made in another variable in
matNMR. To use the values set on your spectrometer it is possible to import those values by using the "Import external reference" in the "Plot Manipulations" - "Ruler X-Axis" "External reference" menus. MatNMR will then try and extract the values from other datasets on disk. Alternatively, you may define a fixed axis for a certain spectrum in
matNMR, as described above. Either by saving the external reference directly, or by storing the spectrum in the workspace those values may serve as an external reference.
The "Apply external reference" item will ask for a variable containing an external reference, i.e. a spectrum OR a reference only, which may then be applied to the current
spectrum.
02/28/07 05:29 PM
5 of 5
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/matNM...
problems arise from the fact that the MATLAB command line parser is slower than the mouse pointer. When using functions like gcf, gca and gco (get current figure, get current
axis and get current object respectively) problems can occur because the current object is not the object that the code intended to work on. Therefore a word of caution must be
given: don't overdo it, don't try and be the fastest mouse-clicker on earth when working with MATLAB.
02/28/07 05:29 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
1 of 8
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
As a practical example is the easiest way to learn about matNMR, there are two datasets included in the matNMR distribution. These can be found in a subdirectory called "Examples", in
the directory where you have stored matNMR. The datasets are solid-NMR spectra generated with Spinsight. They are called "SpinsightExample1" and "SpinsightExample2".
Loading the data into the Matlab workspace:
In this case there are two ways of importing the two datasets into Matlab: separately or as a series. To load them separately go into the "files" menu and select "binary FID". Select the
file that contains the FID. For Spinsight data this file is always called "data". After selecting this file, an input window comes up. In this window the size of the data must be specified, the
name of the variable in the Matlab workspace must be defined, and the format of the data must be specified. When the standard parameter files are present (i.e. the full dataset and not just
the FID) then the sizes will be deduced from those files. The data format is in some cases recognized automatically. Finally, when the dataset should not only be stored in the workspace but
also loaded into matNMR directly then select the flag.
Since the two datasets are both Spinsight datasets and have a very similar name, they can also be loaded as a series of binary FIDs. Select the appropriate entry in the "files" menu.
Select the file that contains the FID. In the input window you can define as common part of the file name, e.g. "/home/jabe/matlab/matNMR/Examples/SpinsightExample$#$/data" and a
range "1:2". Here, the "$#$" is used as a code that is substituted once by All elements in the numerical range. Otherwise everything else is the same as above. Clicking OK will load both
datasets in one go.
Processing the 1D dataset, SpinsightExample1:
From the main window, press button "load 1D" in the 1D menu, or go to the "1D Processing" menu. Use the name of the variable in the workspace that contains the data for example 1.
Load the data as an FID. To process the spectrum use e.g.
Hamming apodization (phase factor 0).
Set the size to 2k points. Do a "complex FT", with or without multiplying the first point by 0.5.
Use the mouse to apply -2.1 degrees zeroth-order phase correction, or type -2.1 in the appropriate edit button (press or mouse mouse pointer out of window to activate).
To perform a baseline correction, go into the "1D Processing" menu and select "standard processing" and "baseline correction". Use "Define peaks" to exclude the area of the signal
from the baseline fit. (left-click=define, right-click=stop). A polynomial of order 0, 1, or 2 should be fine in this case.
Store the processed spectrum in the workspace by using the "Add to workspace" button.
Alternatively, you may only store the processing actions with the FID (for large 2D spectra often smaller than storing the spectrum. In that case go into the "History / Macro" menu and
select "Connect to FID". Supply the name that contains the example 1. For fun, reload the dataset, for example using the "reload last" button on the right of your screen. Go into the
"History / Macro" menu and select "reprocess from history". This should reproduce the spectrum.
Processing the 2D dataset, SpinsightExample2:
From the main window, press button "load 2D" in the 2D menu, or go to the "2D Processing" menu. Use the name of the variable in the workspace that contains the data for example 2.
Load the data as an FID. To process the spectrum use e.g.
2 of 8
This is a 2D dataset with STATES in the indirect dimension for phase sensitivity. The format is already as matNMR requires it to be. First the dataset in made into a hypercomplex set (2
complex matrices). Use the "Start STATES processing" in the "2D Processing" menu.
Add 40 Hz of Gaussian apodization. Make sure you use the "Apodize 2D" button to apply the apodization to the entire dataset!
Set the size to 1k points in TD2 using the "set sizes" button in the 2D menu.
Perform the FT in TD2. The FT mode should say STATES.
Set the phase properly using the buttons. The reference for the first-order phase correction can be defined by clicking the "Reference Ph1" button. Use the crosshair to indicate the
position. Using a "reference ph1" of 776 (assuming 1k points in TD2!), phase values of 51 and -227 degrees for the zeroth and first-order corrections should yield an in-phase spectrum
with 4 lines.
Check the position of the lines. These are useful for process the indirect dimension. Select the "Zoom" function and zoom into the left doublet. The use the "Get position" button to
extract the position. Push the left button and move the mouse to follow the lines. The "X index" is the number you want to remember. Click on "Done".
Repeat the previous for the right doublet in the spectrum. The indices should be e.g. 784 and 373.
Go to column 784 by typing the number in the appropriate edit button in the window
Because the pulse program did not conform to the default in Spinsight, the spectral width in TD1 could not be deduced. This was also shown in the Matlab command window (Please
look!), where it says that the dw2 parameter could not be found. Hence the spectral width must be supplied manually. Type 25 (kHz) in the edit button next to "Spectr. Width (kHz)".
Use Hamming apodization with phase factor 0. Make sure you use the "Apodize 2D" button to apply the apodization to the entire dataset!
Set the size to 1k points in TD1 using the "set sizes" button in the 2D menu.
Perform the FT in TD1. The FT mode should say STATES. This should show the same 4 lines as before, but reversed.
Because the STATES modulation in the pulse program was not of the correct sign, the spectrum in TD1 is reversed, compared to TD2. To correct this use the "Flip L/R" in the "2D
processing"+"standard processing" menu.
Now the phase correction can be perfected: select row 784. Set the zero-order phase correction on the most left peak. Set the reference for ph1 on this peak. Select row 373. Adjust the
first-order phase correction on the most right peak in the spectrum. Apply the phase to the entire spectrum ("Set Phase 2D"). Do the same in TD1.
Select row 784 and go into the "2D Processing" menu, "standard processing", and select "baseline correction". use the "define peaks" to exclude the 4 signals fromthe baseline fit and
use a first-order polynomial. Do the same for TD1.
Store the spectrum in the workspace by using the "Add to workspace" button.
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
View the spectrum using the 2D/3D viewer: push the appropriate button on the right side of the 2D menu. Make, for example, a contour plot by selecting relative contours.
3 of 8
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
Now in principle can every processing step be reprocessed afterwards. Everything except creating a non-linear axis vector! Most axes have linear increments and therefore only the axis
offset and increments are saved into the processing history macro. Non-linear axes are not stored into it. This also means they will not be reproduced when reprocessing. It wouldn't be
terribly difficult implementing this but it would increase the size of the macro considerably and is therefore not implemented currently.
More explanation on how to use the history can be found in paragraph 5.2.6, "History/Macro".
4 of 8
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
Gives
Exponential
The FID is multiplied with a pure exponential decay leading to pure Lorentzian linebroadening. The spectral width must be specified properly for this function else the
linebroadening will not correspond to the specified increase in Hz.
Cos^2
The FID is multiplied with a quarter period of a squared(cosine) ranging in intensity from 1 (cos^2(0)) to 0 (cos^2(pi/2)) if the phase factor is set to 0. Any other value for the
phase factor will lead to a different shape. Note that this does not give pure Lorentzian or Gaussian linebroadening.
Gaussian
The FID is multiplied with a Gaussian function leading to pure Gaussian linebroadening. The spectral width must be specified properly for this function else the
linebroadening will not correspond to the specified increase in Hz.
Hamming
Block +
Cos^2
The FID is multiplied with a function consisting of a block of intensity 1 (length of the block must be specified in points) and a Cos^2. Note that this does not give pure
Lorentzian or Gaussian linebroadening.
The FID is multiplied with a pure Gaussian function but the maximum of the gaussian is shifted for each TD1 increment. The amount of shifting depends on the respective
spectral widths in both dimensions, the Fourier mode (see also paragraph 4.8, "Fourier transform") and the shearing factor (this is defined by the NMR experiment type).
Shifting Gauss Furthermore the position of the echo maximum must in the first row be given. The direction of the shift depends on whether it is an echo or an anti-echo experiment. This
function can only be used for 2D FID's.
Exponential
(echo)
Performs an exponential linebroadening on FID's with a full echo in it. It is assumed that the "Swap whole echo" function (see also paragraph 5.2.3, "1D processing" or
paragraph 5.2.4, "2D processing") has been performed before applying this apodization.
Gaussian
(echo)
Performs a Gaussian linebroadening on FID's with a full echo in it. It is assumed that the "Swap whole echo" function (see also paragraph 5.2.3, "1D processing" or
paragraph 5.2.4, "2D processing") has been performed before applying this apodization.
Performs a shifting-Gauss linebroadening on FID's with a full echo in it. The amount of shifting depends on the respective spectral widths in both dimensions, the Fourier
Shifting Gauss mode (see also paragraph 4.8, "Fourier transform") and the shearing factor (this is defined by the NMR experiment type). Furthermore the position of the echo maximum
must in the first row be given. When the echo maximum is set to 0 (after the "swap whole echo") the apodization consists of two converging gaussian functions (in time)
(echo)
instead of diverging (the usual idea with echo-spectra). This function can only be used for 2D FID's.
5 of 8
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
The inverse FT can also be performed, but has to be accessed from the "Additional Features" item in either the "1D Processing" or "2D Processing" menus in the menubar.
Various types of Fourier transform modes corresponding to various types of NMR experiments are supported:
Type
Gives
Complex
Both the real and the imaginary parts of the FID are used.
Real
The imaginary parts of the FID are made 0 before doing the FFT.
States
2D Spectra recorded using the States scheme require this setting both in TD2 and TD1. A hypercomplex dataset will result from this.
TPPI
2D Spectra recorded using the TPPI scheme require this setting ONLY for the processing in TD1. In TD2 the complex FFT should be used. To use this setting in TD2 usually
means that the Redfield scheme (i.e. TPPI in 1D) was used and the data have been converted (Bruker qseq mode, see also paragraph 5.2.3, "1D processing" or paragraph
5.2.4, "2D processing").
In 2D FID's hypercomplex dataset will result from this. The spectral width is halved after the Fourier transform to account for the fact that half of the data is thrown away.
Note that for qseq data also the direct processing can be done (so without doing the above-mentioned conversion first.
Whole
Echo
2D Spectra with phase modulation instead of amplitude modulation (whole echo acquisition) require complex FFT in both dimensions. Using this setting for TD2 avoids having
to define the complex FFT for both dimensions.
States-TPPI 2D Spectra recorded using the States-TPPI scheme require this setting both in TD2 and in TD1. A hypercomplex dataset will result from this.
Bruker
qseq
This setting performs a similar transform as TPPI does except that it also inverst every second complex point. When the above-mentioned conversion step has been done TPPI
must be used and not this mode!
Sine FT
This setting performs a real Fourier transform whilst assuming that the FID is sine-modulated. A sine function will produce an anti-phase spectrum around the carrier. To obtain
an in-phase spectrum one half of the spectrum is inverted.
For processing States or States-TPPI spectra special care must be taken to provide matNMR with the proper format of the FID matrices. MatNMR uses the same format as Chemagnetics
does and so the FID-matrix should be built up like this :
|----------------> real part of the matrix
|RR
RI
|
|
|
|
------------------ imaginary part of the matrix
|IR
II
|
|
|
|
|
Here the RR part is the real part in t1 and t2. The RI is the imaginary part in t1 and the real part in t2, etc. (This gives the rather unnatural looking view of 2 FID's in the view) On Bruker and
Varian machines the imaginary parts in t1 will probably be alternated with the real parts in t1 :
(RR RI)1
(IR II)1
(RR RI)2
(IR II)2
etc.
After loading a Bruker or Varian States (or States-TPPI) FID into the workspace this first needs to be converted before starting the States processing. This is done from the corresponding
entries in the "2D processing" menu: "Convert Bruker States" or "Convert Varian States".
NOTE: Starting processing a States (or States-TPPI) spectrum can only be started by selecting the entry in the 2D Processing menu from the menubar!
This splits the matrix into the proper hypercomplex parts QFT1 and QFT2 and sets the proper flags.
6 of 8
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
or
For both the 1D and 2D baseline corrections the areas where peaks can be found in the spectrum must be identified before doing the fit. This can be done using the "Define Peaks" button.
Using the left mouse button, click both left and right of a peak region to define it. A red marking will appear over the area. Any mouse click outside the axis or using the right mouse button
cancels defining peaks.
For 2D spectra it is possible to have the projection onto the axis plotted in the window, to facilitate choosing the position of the peaks. The specified range in the 2D will be taken into
account here, i.e. the projection shows the signal from the area that needs baseline correcting only!
7 of 8
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Processi...
Next, the type of function that needs to be used for fitting the baseline must be specified. Currently one can choose from either a cosine series, a polynomial or a Bernstein polynomial.
These are defined as:
Polynomial of order 6: 'A + B*x + C*x.^2 + D*x.^3 + E*x.^4 + F*x.^5'
Cosine series of order 6: 'A + B*cos(x) + C*cos(2*x) + D*cos(3*x) + E*cos(4*x) + F*cos(5*x)'
Bernstein of order 6: 'A*(1-x).^5 + B*(x).*((1-x).^4) + C*(x.^2).*((1-x).^3) + D*(x.^3).*((1-x).^2) + E*(x.^4).*(1-x) + F*(x.^5)'
Sine: 'A + B * sin(C*x + D)'
Exponential: 'A + B * exp(C*x)'
where A-F are the coefficients to be fitted to the baseline and x the coordinate along the spectral axis. After choosing the order to which the fit should go, and pressing "Fit" the fit is
performed. Any order of fit is allowed but beware that a fit will become very bad when the order is too high.
The resulting 1D spectrum or row/column from the 2D will be shown in the view. For 1D baseline correction also the fitted baseline is shown in blue as a visual aid. To see the result of the
baseline correction for the whole 2D just step through the rows/columns.
Should the baseline be satisfactory then the "Accept Fit" button must be pressed and the fit is made final. If not, either press "Undo" to obtain the original spectrum back or "Reject Fit" to
reject the fit and stop the baseline correction routine while retaining the original spectrum.
8 of 8
11/23/07 06:01 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
1 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
There are five boxes shaded with a background box around it. Going from top-left to bottom-right they contain
1- a stop-button, a direct-printing button (prints to the default printer as defined in the $matlabroot/toolbox/local/printopt.m file) and some buttons to open the various menus
2- some often-used buttons for working with 1D spectra. More functions can be found in the menubar.
3- the phasing menu. (see also paragraph 4.9, "Phasing spectra")
4- some buttons for zooming in discrete steps or continously (zoom button). Furthermore there is the "reset figure" button which resets the current view (leaving nothing but the current 1D
spectrum Qspc2 in the view!) and the "get position" button allows to scan the lines in the plot using the mouse pointer. Upon pressing the left mouse button a crosshair will appear and
some buttons that show the coordinate and the intensity of the current trace. When more than one lines are in the plot a popup button will appear to choose which line the routine should
follow.
5- some often-used buttons for working with 2D spectra. More functions can be found in the menubar.
Then there are some buttons just above the box with zoom functions.
The "display mode" is for defining whether to show the real, imaginary or absolute value of a FID/ spectrum. Note that this is only a matter of displaying. MatNMR always works with complex
values.
The "fourier mode" defines what type of FFT is performed when the FFT-button is pressed (see also paragraph 4.8, "Fourier transform").
2 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The "apodization" button allows choosing an apodization function. Usually an input window will appear to ask for more information.
The "spectr. width" edit button allows to directly enter the spectral width belonging to the 1D FID/spectrum or 2D row/column. In case of a 2D mode the value will be connected to the
relevant spectral dimension. Changing the dimension (say from TD2 to TD1) and back will then give the previously entered value back again. The "spectr. freq." edit button allows to directly
enter the spectral frequency belonging to the 1D FID/spectrum or the current 2D row/column. In case of a 2D mode the value will be connected to the relevant spectral dimension. Changing
the dimension (say from TD2 to TD1) and back will then give the previously entered value back again.
Finally there are five buttons on the right on the plot. The top button calls the undo function. The second button shows the mode matNMR is in, either 1D or 2D. The third button specifies
whether the FID/ spectrum in the current plot is an FID or a spectrum. This determines the plotting direction (For non-NMR people: in NMR the convention is to plot a time-scale from
left-to-right, a PPM scale from right-to-left and a Hertz (Hz) scale depending on the gyromagnetic ratio of a nucleus).
The "Transfer Acq." button has a highly specific function: it uploads the variable QacqFID from the workspace and makes it the current spectrum (1D or 2D). This has been implemented
because some people wanted to use MATLAB for a spectrometer interface.
The "Reload Last" button reloads the last 1D or 2D FID/spectrum. It just evaluates the Qspct variable that is used by matNMR to denote the name of the last 1D/2D spectrum (for more
information on variables used by matNMR see paragraph 3.3, "Important variables").
5.2.2 Files
This menu deals with the importing of files into MATLAB:
Name
Function
External MATLAB
files
Opens a window which allows selecting the MATLAB file that needs to be uploaded into the workspace from disk.
Series of external
MATLAB files
Allows importing a series of similarly-named MATLAB files from disk into the workspace. The files should have a common name and a specific range attached to them.
For example the series j011101_1, j011101_2, ... , j011101_20 is imported by supplying 'j011101_$#$' as the name and '1:20' as the range.
Last series of
external MATLAB
files
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window.
Import
Binary FID's
Opens a window which allows selecting the FID file that needs to be oploaded into the workspace. After selecting the file a second input window
will ask for the sizes of the FID and a name for the new variable (in the workspace). If selected, the FID will be read into matNMR directly,
otherwise the variable will only be stored in the workspace and a "Load nD" must be executed to load it into matNMR.
The total number of points (real+imaginary!) in the FID file is indicated in this window. This number does not hold for the VNMR (Varian) format
as this routine only divides the binary file size by 4 (floating point format uses 4 bytes per number). The structure of the VNMR FID files prevents
displaying the correct size.
Currently the formats for XWinNMR, UXNMR, winNMR (Bruker), Spinsight (Chemagnetics), VNMR (Varian) NTNMR (TecMag), MacNMR (TecMag),
Bruker Aspect 2000/3000 and JEOL Generic format are recognized. Limited support for the SMIS format is also implemented.
Depending on which format is chosen the time domain sizes must be specified. Whenever it is not necessary to do this the corresponding
uicontrols are disabled.
3 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
It is also possible to use the standard spectrometer parameter files to specify all the necessary parameters. This is particularly useful in
connection with the default axes, see also paragraph 3.4 Where is the NMR and paragraph 5.2.5 Plot manipulations.
Then for all Bruker formats the files "acqu" and "acqu2" are used, for Chemagnetics the "acq" file, for VNMR the "procpars" and for JEOL Generic
format the ".hdr" file.
It is important to note that the following assumptions are made when using the standard parameter files:
only the standard files can be used
if the sizes in the parameter files do not match the size of the FID an error is given
For 2D spectra the values for the spectral width and spectrometer frequency are not generally reliable unless the FID has been recorded
following the standard pulse programming style for that spectrometer and using the corresponding standard variables.
Even then the following limitations apply:
For Bruker SWH and SFO1 are read from acqu2 for the indirect dimension
For Chemagnetics dw and dw2 to calculate SWH by SWH=1/dw (i.e. States is assumed in the indirect dimension!). Arrays are read
without problems but the SWH is set to 1 in the indirect dimension. The spectrometer frequency in TD1 is taken to be the same as in
TD2.
For VNMR sw and sfrq are read for TD2 and sw1 for TD1. The spectrometer frequency in TD1 is set to the same value as for TD2.
For JEOL x_curr_points, x_freq and x_sweep are used for TD2 and y_curr_points, y_freq and y_sweep for TD1.
NOTE: IF YOU WANT TO IMPROVE THIS OVERSIMPLIFIED SCHEME PLEASE LET ME KNOW!!
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
Get last binary FID (for faster uploading of equal sized spectra). If selected, the FID will be read into matNMR directly, otherwise the variable will only be stored in
the workspace and a "Load nD" must be executed to load it into matNMR.
4 of 42
Series of binary
FIDs
Allows importing a series of similar binary FIDs into the workspace. They should have a common name and a specific range attached to them.
For example the series j011101_1, j011101_2, ... , j011101_20 is imported by supplying 'j011101_$#$' as the name and '1:20' as the range.
Last series of
binary FIDs
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
(for faster uploading of equal sized spectra).
Bruker Spectrum
opens a window which allows selecting the Bruker spectrum file that needs to be oploaded into the workspace. After selecting a second input
window will ask for size and name of the new variable. Most of these parameters can be avoided by using the option of reading standard
parameter files, which will look for the original parameter file and extract the necessary parameters. Alternatively, they may be entered by hand:
The blocking factor is a feature that is used by XWinNMR sometimes (mainly older versions) to save a spectrum in blocks. The number that must
be specified here is the XDIM parameter that is written in the procs and proc2s files, in the directory of the dataset. If 0 is entered then no
blocking factor is taken.
The byte ordering determines how XWinNMR has stored the data. Taking the wrong type will typically result in meaningless noise. This
information is in fact stored in the procs file but it's just as fast to select it yourself, than it is to select a file on disk. If the data has been
processed on SGI then the byte ordering should be big endian, else it is most likely little endian.
The imaginary and hypercomplex parts may be loaded automatically by selecting the option in the input window. This assumes that all file
names are standard, i.e. that a standard Bruker dataset is presented.
Finally, if selected, the spectrum will be read into matNMR directly, otherwise the variable will only be stored in the workspace and a "Load nD"
must be executed to load it into matNMR.
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
(for faster uploading of equal sized spectra). If selected, the spectrum will be read into matNMR directly, otherwise the variable will only be
stored in the workspace and a "Load nD" must be executed to load it into matNMR.
Series of Bruker
spectra
Allows importing a series of similar Bruker spectra into the workspace. They should have a common name and a specific range attached to them.
For example the series j011101_1, j011101_2, ... , j011101_20 is imported by supplying 'j011101_$#$' as the name and '1:20' as the range.
Last series of
Bruker spectra
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
(for faster uploading of equal sized spectra).
Chemagnetics
Spectrum
opens a window which allows selecting the Chemagnetics spectrum file that needs to be oploaded into the workspace. After selecting a second
input window will ask for size and name of the new variable. Most of these parameters can be avoided by using the option of reading standard
parameter files, which will look for the original parameter file and extract the necessary parameters. If selected, the spectrum will be read into
matNMR directly, otherwise the variable will only be stored in the workspace and a "Load nD" must be executed to load it into matNMR.
Get last
Chemagnetics
Spectrum
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
(for faster uploading of equal sized spectra). If selected, the spectrum will be read into matNMR directly, otherwise the variable will only be
stored in the workspace and a "Load nD" must be executed to load it into matNMR.
Series of
Chemagnetics
spectra
Allows importing a series of similar Chemagnetics spectra into the workspace. They should have a common name and a specific range attached
to them. For example the series j011101_1, j011101_2, ... , j011101_20 is imported by supplying 'j011101_$#$' as the name and '1:20' as the
range.
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Last series of
Chemagnetics
spectra
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
(for faster uploading of equal sized spectra).
SIMPSON ASCII
opens a window which allows selecting the SIMPSON ASCII file that needs to be oploaded into the workspace. After selecting a second input
window will ask for the name of the new variable. If selected, the spectrum will be read into matNMR directly, otherwise the variable will only be
stored in the workspace and a "Load nD" must be executed to load it into matNMR.
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
(for faster uploading of similarly named spectra). If selected, the spectrum will be read into matNMR directly, otherwise the variable will only be
stored in the workspace and a "Load nD" must be executed to load it into matNMR.
Allows importing a series of similarly-named SIMPSON ASCII files into the workspace. They should have a common name and a specific range
Series of SIMPSON attached to them. For example the series j011101_1, j011101_2, ... , j011101_20 is imported by supplying 'j011101_$#$' as the name and '1:20'
ASCII
as the range.
Last series of
SIMPSON ASCII
As the previous function but takes the file name to be the same as the previously-chosen file and immediately goes to the second input window
(for faster uploading of equal sized spectra).
Save as SIMPSON ASCII opens a window which allows selecting a file thatis used to store the current 1D or 2D on disk in SIMPSON ASCII format.
Export
These functions allow all sorts of actions to be done on a series of variables in the workspace, which have common names and a specific range attached to them. For
example the series j011101_1, j011101_2, ... , j011101_20 can be addressed by supplying 'j011101_$#$' as the name and '1:20' as the range. The following functions
have been defined currently.
Add series of variables
Allows adding a series of variables.
Series Trickery
Concatenate series of
variables
Allows concatenating a series of variables in the workspace, which have a common name and a specific range attached to them.
Normalize series of
variables
Allows normalizing a series of variables in the workspace, which have a common name and a specific range attached to them, to either
the same maximum or the same integral.
Change directory
Sets the search profile for binary FID's / Bruker spectra / SIMPSON ASCII files
Edit Workspace
Editor/Debugger
5.2.3 1D Processing
This menu deals with everything concerning working with 1D spectra:
Name
Function
Load 1D
Gets a new 1D spectrum. An axis vector may be specified and also whether the variable is an FID or a spectrum (see also button information in paragraph 5.1, "General
appearance").
Add Spectrum
to Workspace
Saves the current 1D spectrum to the workspace. Depending on whether the history and/or axis vector must be included a matNMR structure will be created (also see
paragraph 3.5, "matNMR format for spectra").
Save Spectrum As the previous function but saves the variable to disk. In case more than one variable names are given in the input window it will save the variables without doing
to Disk
anything with the current 1D spectrum!
Dual display
Adds an additional line to the view. If no axis vector is specified then the current axis vector Qtempvec1d will be used. Note that the new spectrum must have the same
size then. If a spectrum of different size is given then an axis vector MUST be specified. Spectra that are added to the view using "dual plot" do not influence any
processing steps. Every time the plot is refreshed by matNMR (or by applying the "reset figure" button, see paragraph 5.1, "General appearance") they will be removed.
Various plot types are supported by the dual plot routine: normal plots, horizontal stack plots, vertical stack plots, 1D bar plots and errorbar plots. This will affect the
input window that will pop up when selecting this function.
Convert Bruker The Bruker qseq acquisition mode is basically TPPI in 1D. This in principle should be a real vector but when loading a binary the FID is in fact complex. This function
converts the FID into a real vector with all real and imaginary points concatenated and every second complex point inverted:
qseq
R I R I R I R I R I R I R I...
5 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
This function does not need to be used as the qseq mode for FT allows direct processing but is recommended. Direct processing in principal does not allow further
manipulation (e.g. apodization is ever so slightly wrong when applying it to the complex vector).
Standard
Processing
Additional
Features
Remove Bruker
digital filter
Removes the effects of the Bruker digital filter. This filter performs a time-shift on the FID of n points which can be corrected by giving a 360*n degree
first order phase correction to the spectrum. This routine does an FFT, 360*n degree first order phase correction and then an IFFT to obtain the FID
back. Now apodization can be done as usual.
Shifts the FID (or spectrum) by a certain number of points. The FID is kept at the same length by adding the same number of zeros to the end. A
positive number will shift the FID left (n+1 -> n), a negative number right (n -> n+1).
Performs a data shift such that the maximum of a FID with an echo in it, will appear at the first point afterwards. All points before the maximum are
added to the end of the FID. After this the FID can be apodized (see also paragraph 4.7, "Apodizing FID's").
DC offset
correction
Performs an offset correction. A signal-free part of the FID is asked for after which the real and imaginary parts of the FID are corrected independently
by substracting the mean of the specified region.
Solvent
Suppression
Performs a solvent deconvolution as was proposed by Marion, Ikura and Bax, JMR, 84, 425-430 (1989). Either a Gaussian, Sine-Bell or Rectangular
window' function may be used with a width a (2*K + 1). The jump size M denotes which point to use for the extrapolation of the first and last K points.
Set size
Changes the size of the current spectrum. A size smaller than the current size will lead to cutting away the end of the spectrum, a bigger size will leed
to zeros being added to the end of the spectrum.
FT
Performs a Fourier transform on the current FID. The type of Fourier transform is defined by the corresponding button in the main window (see
paragraph 5.1, "General appearance"). For more information on the differences between the various modes see paragraph 4.8, "Fourier transform".
FFTshift
Performs a FFTshift on the current spectrum, i.e. a shift of the zero-point of the spectrum to the center (see MATLAB documentation for more
information on fftshift).
Flip L/R
Flips the current spectrum from left to right. Necessary in case the spectrum is flipped (different receiver rotation).
Baseline
correction
Does a 1D baseline correction on the current spectrum (see also paragraph 4.10, "Baseline correction").
Concatenate
Matrix
Allows concatenation of the current 1D spectrum into a longer 1D or a 2D with all slices the same.
Extract from
1D
Extracts part of the current 1D spectrum and makes it the new 1D spectrum. The range that must be specified must be given in the unit of the axis
vector. The new axis vector remains in the units of the original vector.
Integrate
Shows the integral of an area in the current 1D spectrum. Specify a region by clicking left and right of this region. Very basic.
Inverse FT
Performs the inverse Fourier transform to the current dimension of the 2D. The exact workings depend on the Fourier mode selected, and some of the
possible Fourier modes do not allow inverse FT. A notice is given when this is the case.
Linear
prediction
Performs a forward or backward linear prediction. Two methods for linear prediction (back- and forward) are implemented in matNMR: LPSVD and ITMPM.
They are described in the following paper: Y.-Y. Lin, P. Hodgkinson, M. Ernst and A. Pines, JMR, 128, 30-41 (1997). Please refer to this paper for
the explanation of the methods.
To properly predict points: Cut the FID such that all points that remain are good (so take away the initial bad points or the noise at the end of the FID).
Select the method that you want to use and specify the number of points that need to be predicted, the number of frequencies that are assumed in the
signal and the S/N-ratio. The ITMPM-method allows the algorithm to determine the number of signals. For that choose either -1 or -2 (different methods).
Noise filling
This option changes the size of the FID bit instead of appending zeroes, Gaussian noise is appended.
Regrid
Spectrum
Interpolates the current spectrum to a new axis. Different interpolation algorithms may be used to optimize for speed or quality.
S/N
Very basic routine for determining the signal to noise ratio of a spectrum. Asks for a peak-free region of the spectrum to calculate S/N as the maximum
divided by the standard deviation of the noise.
Fits a tensor to the MAS sideband intensities. For a complete discription of this routine see paragraph 5.5, "Fitting of CSA tensors from the MAS
CSA tensors MAS sideband manifold".
CSA tensors
Static
Fitting
6 of 42
Fits tensors to a static powder pattern. For a complete discription of this routine see paragraph 5.5, "Fitting of static CSA tensors".
Diffusion Curves
(Multi-)exponential fit of diffusion curves. For a complete discription of this routine see paragraph 5.5, "Fitting of Diffusion Curves".
Peak
Deconvolution
Fits mixed Gaussian/Lorentzian oeaks to the current spectrum. To reduce the number of data points that the peak-fitting routine has to take into
account, first zoom into the region of interest. For a complete discription of this routine see paragraph 5.6, "Spectral Deconvolution").
Quadrupolar
Tensors
Fits a quadrupolar tensor to a MAS spectrum. For a complete discription of this routine see paragraph 5.8, "Fitting of Quadrupolar Tensors under MAS"
).
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
(Multi-)exponential fit of relaxation curves. For a complete discription of this routine see paragraph 5.8, "Fitting of Relaxation Curves" ).
5.2.4 2D Processing
This menu deals with everything concerning working with 2D spectra:
Name
Function
Load 2D
Gets a new 2D spectrum. Axis vectors may be specified and also whether the variable is an FID or a spectrum (see also button information in paragraph 5.1, "General
appearance").
Load 3D
Gets a new 3D spectrum (For more information on 3D support see paragraph 4.2, "1D, 2D and 3D mode". Axis vectors may be specified and also whether the variable is
an FID or a spectrum (see also button information in paragraph 5.1, "General appearance").
Transpose
Transpose the current 2D spectrum. May be needed to convert spectra that were saved with different conventions than used by matNMR.
Add Spectrum to Saves the current 2D spectrum to the workspace. Depending on whether the history and/or axis vector must be included a matNMR structure will be created (also see
Workspace
paragraph 3.5, "matNMR format for spectra").
Save Spectrum
to Disk
As the previous function but saves the variable to disk. In case more than one variable names are given in the input window it will save the variables without doing
anything with the current 2D spectrum!
Convert Bruker
qseq
The Bruker qseq acquisition mode is basically TPPI in 1D. This in principle gives a real vector but when loading a binary it the spectrum is assumed to be complex. This
function converts the FID into a real vector with all real and imaginary points concatenated and every second complex point inverted:
R I R I R I R I R I R I R I...
This function does not need to be used as the qseq mode for FT allows direct processing but is recommended. Direct processing in principal does not allow further
manipulation (e.g. apodization is ever so slightly wrong when applying it to the complex vector).
Convert
Bruker/Varian
States
Converts the standard Bruker/Varian way of saving States spectra into the matNMR format (Chemagnetics format). For more information on the format see paragraph
4.8, "Fourier transform".
Echo / Anti-Echo Converts an echo and an anti-echo experiment into a States-type experiment. The matrix must be in the same format as a States experiment. For more information on
to States
the format see paragraph 4.8, "Fourier transform".
Start States
processing
Splits the States FID into its proper hypercomplex parts and sets all necessary flags for States processing (see also paragraph 4.8, "Fourier transform").
Remove Bruker
digital filter
Removes the effects of the Bruker digital filter from all rows/columns of the current 2D FID (depending on the current dimension). This filter performs
a time-shift on the FID of n points which can be corrected by giving a 360*n degree first order phase correction to the spectrum. This routine does an
FFT, 360*n degree first order phase correction and then an IFFT to obtain the FID back. Now apodization can be done as usual.
Shifts all rows/columns of the current 2D FID (depending on the current dimension) by a certain number of points. Each row/column is kept at the
Shift data points same length by adding the same number of zeros to the end. A positive number will shift the FID left (n+1 -> n), a negative number right (n -> n+1).
Performs a data shift on all rows/columns of the current 2D FID (depending on the current dimension) such that the maximum of a FID with an echo in
Swap whole echo it, will appear at the first point afterwards. All points before the maximum are added to the end of the FID. After this the FID can be apodized (see also
paragraph 4.7, "Apodizing FID's").
Full matrix
manipulations
7 of 42
DC offset
correction
Performs an offset correction on all rows/columns of the current 2D FID (depending on the current dimension). A signal-free part of the FID is asked for
after which the real and imaginary parts of each row/column are corrected independently by substracting the mean of the specified region in each
row/column.
Solvent
Suppression
Performs a solvent deconvolution as was proposed by Marion, Ikura and Bax, JMR, 84, 425-430 (1989). Either a Gaussian, Sine-Bell or Rectangular
window' function may be used with a width a (2*K + 1). The jump size M denotes which point to use for the extrapolation of the first and last K points.
Apodize
Performs the currently selected apodization mode on all rows/columns of the current 2D FID (depending on the current dimension). See paragraph 4.7,
"Apodizing FID's" for more information on apodizing.
Set size
Changes the size of the current 2D spectrum. A size smaller in any dimension than the current size will lead to cutting away the end of the dimension,
a bigger size will leed to zeros being added to the end of the dimension.
Zero part of 2D
Sets entire rows and columns of the current 2D matrix to 0. NOTE: input of the ranges is in points! For example: '1:20'. Leaving an input line empty
means not zeroing any rows or columns.
FT
Performs a Fourier transform on all rows/columns of the current 2D FID (depending on the current dimension). The type of Fourier transform is defined
by the corresponding button in the main window (see paragraph 5.1, "General appearance"). For more information on the differences between the
various modes see paragraph 4.8, "Fourier transform".
11/23/07 06:02 PM
Single Slice
Manipulations
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
FFTshift
Performs a FFTshift on all rows/columns of the current 2D FID (depending on the current dimension), i.e. a shift of the zero-point of the row/columns to
the center (see MATLAB documentation for more information on fftshift).
Flip L/R
Flips all rows/columns of the current 2D spectrum (depending on the current dimension) from left to right. Necessary in case the spectrum is flipped
(different receiver rotation).
Set Phase
Performs the currently selected phase correction on all rows/columns of the current 2D FID (depending on the current dimension). See paragraph 4.9,
"Phasing spectra" for more information on phase correction.
Baseline
correction
Does a 2D baseline correction on the current spectrum (see also paragraph 4.10, "Baseline correction" ).
This submenu allows the manipulations of the current row/column of the current 2D, without the rest of the matrix being affected. Look at the entries for the regular
functions to see what they do.
Concatenate
Matrix
Allows concatenation of the current 2D spectrum into a bigger 2D spectrum. Concatenation can be done in both directions.
Extracts part of the current 2D spectrum and makes it the new 2D spectrum. The range that must be specified must be given in the unit of the axis
Extract from 2D vector. The new axis vectors remain in the units of the original vectors.
Integrate Fixed
range
Calculates the integral of a part of a spectrum by selecting a region of the current 2D spectrum (in units of the axis vectors) and adding all intensities.
The output is a variable in the workspace with the intensities, the axis in the current dimension and the position of the maximum signal in units of its
original axis.
Shows the integral of an area in the current 1D spectrum. This routine searches in each slice in the 2D for the maximum signal in a user-specified
Integrate around range and integrates with a user-specified range around that maximum. This allows integration of peaks with variable positions and possibly
overlapping other peaks. The output is a variable in the workspace with the intensities, the axis in the current dimension and the position of the
Max
maximum signal in units of its original axis.
Inverse FT
Additional
Features
Performs the inverse Fourier transform to the current dimension of the 2D. The exact workings depend on the Fourier mode selected, and some of the
possible Fourier modes do not allow inverse FT. A notice is given when this is the case.
Performs a forward or backward linear prediction on all rows/columns of the current 2D spectrum (depending on the current dimension). Two methods
for linear prediction (back- and forward) are implemented in matNMR: LPSVD and ITMPM. They are described in the following paper: Y.-Y. Lin, P.
Hodgkinson, M. Ernst and A. Pines, JMR, 128, 30-41 (1997). Please refer to this paper for the explanation of the methods.
Linear prediction To properly predict points: Cut the FID such that all points that remain are good (so take away the initial bad points or the noise at the end of the FID).
Select the method that you want to use and specify the number of points that need to be predicted, the number of frequencies that are assumed in the
signal and the S/N-ratio. The ITMPM-method allows the algorithm to determine the number of signals. For that choose either -1 or -2 (different
methods).
Noise filling
This option changes the size of the FID bit instead of appending zeroes, Gaussian noise is appended.
Regrid Spectrum Interpolates the current spectrum to a new axis. Different interpolation algorithms may be used to optimize for speed or quality.
Fitting
Set integral
Sets the integral of the spectrum by selecting a region of the current 2D spectrum (in units of the axis vectors) and assigning a value to this.
Shearing
transformation
Performs a shearing transformation on the current 2D spectrum (i.e. frequency domain shearing) or FID (i.e. time domain shearing). In either case the
shearing factor (as determined by the NMR experiment) and the spectral widths in both TD1 and TD2 must be specified in the input window. For the
frequency domain version also the direction of shearing can be specified (vertical or horizontal). In general a vertical shearing is needed for NMR
spectra but the horizontal shearing may have a general use. The frequency domain shearing uses a spline interpolation scheme, i.e. this is not as
accurate as the time domain shearing, which is just a TD1-dependent first order phase correction to the matrix after FT in TD2 is done.
NOTE:When shearing in frequency domain the imaginary parts are set to zero, i.e. no phase correction will be possible afterwards!
Symmetrize
Symmetrizes the current 2D spectrum along the diagonal either by averaging the intensities on both sides of the diagonal or by taking the highest
value of the two sides. Note that the spectrum must be square to be able to do this.
Peak
deconvolution
Diagonal:
Various Views
8 of 42
Performs a (absorptive) peak fit on peaks in the current dimension of the 2D spectrum. To reduce the number of data points that the peak-fitting routine
has to take into account, first zoom into the region of interest. The difference with the "Peak fitting" entry in the "1D Processing" menu is that now the
full 2D matrix is supplied to the peak fitting routine which allows fitting series of 1D spectra consecutively. For a complete discription of this routine see
paragraph 5.6, "Peak fitting").
Extracts the diagonal of the spectrum. The axis vector belonging to the resulting spectrum is in points.
Anti-diagonal:
Extracts the anti-diagonal of the spectrum. The axis vector belonging to the resulting spectrum is in points.
Sum TD1:
Extracts the sum over all columns of the spectrum. The range of columns to take into account for this function can be specified in the unit of the axis.
The axis vector belonging to the resulting spectrum is the same as the original axis.
Sum TD2:
Extracts the sum over all rows of the spectrum. The range of rows to take into account for this function can be specified in the unit of the axis. The axis
vector belonging to the resulting spectrum is the same as the original axis.
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Extracts a skyline projection of the 2D spectrum at a specified angle. For a direct view of Td2 set the angle to 0, for a direct view of TD1 set it to 90.
Currently only the angles of 45 and 135 degrees are allowed besides 0 and 90. The axis vector belonging to the resulting spectrum is equal to the
original vector for angles of 0 and 90, else in points.
Skyline:
Creates a horizontal stack plot from all rows/columns of the current 2D matrix (depending on the current dimension). The zoom limits of the current
Horizontal Stack view are taken into account when creating the 1D stack plot.
plot:
NOTE: this is a special plot type and will not persist when pushing the "reset figure" button.
Creates a vertical stack plot from all rows/columns of the current 2D matrix (depending on the current dimension). The zoom limits of the current view
are taken into account when creating the stack plot. Also, the vertical displacement factor may be changed to create the optimum plot.
NOTE: this is a special plot type and will not persist when pushing the "reset figure" button.
Vertical Stack
plot:
2D/3D Viewer
Shortcut to the 2D/3D Viewer window. The current name of the input variable for this routine is set to QFT1, i.e. the current 2D matrix in the main window.
Function
This routine provides a means of adding legends to a plot. A window will appear looking like:
Legend
from which the labels, the text properties and all individual line properties can be specified. The routine checks the number of lines currently in the plot automatically and
provides sufficient input boxes. Line properties can be changed separately or in groups: select the desired lines by clicking on the check buttons in front of each line.
If there already is a legend present in the plot it is best to remove it first before adding a new one as it may be that the routine does not find the previous legend properly.The
resulting legend will be plotted on top of the existing plot in the main window. It can be moved however by keeping the left mouse button pressed over the legend and then
moving the mouse.
This submenu provides a means of changing the axis to a plot. For more information see also paragraph 3.4, "Where is the NMR"
Use Default Switches between the default axis and a fixed axis. A check flag shows when the default axis is on. The unit of the axis is defined by the current settings and
Axis
whether the current spectrum is an FID or a spectrum.
Ruler x-axis
Reset
Default Axis Resets the values for spectral reference, which makes the center of the spectrum 0 ppm/Hz or kHz.
Change
Default
Changes the current settings of the units for the default axis for either FID or spectrum mode.
Name
External
Reference
9 of 42
Allows the application of a spectral reference, as stored in the workspace either as a spectrum or as a reference variable, to the current
Apply External spectrum. For 2D spectra the reference values may be entered differently for both dimensions by entering two values for each parameter. If
Reference
only one value is specified then both dimensions are taken to be the same.
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Define External Allows manual definition of a spectral reference. For 2D spectra the reference values may be entered differently for both dimensions by
Reference
entering two values for each parameter. If only one value is specified then both dimensions are taken to be the same.
Import
External
Reference
Allows importing of a spectral reference from an external dataset. This requires the default axis mode is on AND that all spectral parameters
for the current dataset have been set correctly. Especially the sign of gamma (magnetogyric ratio) is important as this will determine the sign
of a frequency axis. NOTE that both XWinNMR and Spinsight do not handle this correctly and that the sign may therefore be different.
Currently this only works for the XWinNMR, VNMR and Spinsight formats but should be implemented for other formats as well at some point
(kick me to speed up this process!)
The rest of the menu allows direct access to axes in time, gradient, points or a user-defined vector, but also to the menu-based option "ruler X-axis". A window
will appear looking like:
Other
from which the type of axis vector (PPM, kHz, Hz, time, gradient, points, user-defined) can be chosen. The spectral width must be specified for PPM and Hz axes
and for a PPM axis also the carrier frequency. For an axis in Hz also the sign of the gyromagnetic ratio of the nucleus that corresponds to the current spectrum
must be specified.
NOTE: Gradient axes are defined in T/m and NOT in G/cm. This means you may have to divide the gradient values from your software by 100
to obtain the proper values!!
Pressing the "Continue" button proceeds the routine and one is asked for a reference value. After that the reference peak can be specified by using the
crosshair mouse pounter and clicking on the desired reference peak (This may seem strange but is necessary because of a MATLAB bug. Specifying the
reference peak before asking its value leads to a mess with the main and input window). If a name is given for the new axis vector then it will be saved in the
workspace after calculating it.
This routine provides a means of changing the title and axes labels of a plot. A window will appear looking like:
Title/axis
labels
Pressing the "Apply" button will update all labels immediately. The "Refresh" is used for updating the text labels currently written in this window to the labels in the current
plot (useful when having this window opened continously). The "full width" button expands the window to the full width of the screen to give wider edit buttons. This is useful
for long texts as they can become inaccessible because the scrolling doesn't work perfectly.
10 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Function
1D Bar Plot
a function to create a 1D bar plot from the current view. The current axis is taken and the user may select the various properties of the bars from the input
window.
NOTE: this is a special plot type and will not persist when pushing the "reset figure" button.
Errorbar Plot
a function to create a errorbar plot from the current view. The current axis is taken and the user must provide a vector with standard deviations (or similar).
NOTE: this is a special plot type and will not persist when pushing the "reset figure" button.
Show
Sidebands
a simple function to indicate MAS sidebands in the spectrum. This requires specifying the central line and the MAS frequency, and various parameters that
change the appearance of the markers. The markers can be removed by pressing the "reset figure" button.
The rest of this menu consists of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
Various axis changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
properties
functions only affect the current plot and not the general matNMR settings.
5.2.6 History/Macro
This menu deals with the processing history and working with macro's (see also paragraphs 4.3, "Using the processing history" and 4.4, "Using macro's") :
Name
Function
This routine shows the processing history for the current spectrum (either 1D or 2D). A window will appear looking like:
Show History
The "Print" button allows to print the history to a printer or to disk. A separate window will be opened in which the history is plotted as graphical text (Unfortunatelt this
is necessary because it is much more difficult to print text in UI-controls than graphical text in MATLAB).
Connect history to This routine connects the current processing history macro to a FID variable in the workspace. If the variable is not a matNMR structure yet (see also paragraph 3.5,
FID
"matNMR format for spectra") it will make a structure out of it. If the variable already is a matNMR structure then only the HistoryMacro field will be changed.
Save history as
macro
This routine saves the current processing history macro as a variable in the workspace. It may then at any time bu run as a macro.
Convert history
macro to script
This routine converts the current processing history macro to an independent processing script on disk. The script can then be applied to any dataset. The script
contains many comments as to what the syntax of the matNMR processing scripts is. This option serves as an alternative to storing the processing history with the FID.
(See also Chapter 8, Script-based processing with matNMR)
Reprocess from
history
Reprocess from
history stepwise
This routine reprocesses the processing history macro that is connected to the current FID. Note that this only works when done directly after loading a FID into
matNMR because else the history macro will be overwritten by the new processing steps. (see also paragraph 4.4, "Using macro's")
Same as above but now the reprocessing can be done stepwise. A window is opened in which the information of the current and the four next steps is displayed.
11 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Clear History
Steps can be performed and skipped. Furthermore the "perform all steps" button performs all next steps without confirmation. The "New Macro" button loads a new
macro and displays its processing steps. (see also paragraph 4.4, "Using macro's")
Clears the current processing history, i.e. the QmatNMR.History variable.
Start recording
macro
Starts the recording of a new macro. An input will appear to ask whether only processing, only plotting or all actions must be stored in the macro. Recording continues
until the stop command is given (see below). Note that for user-commands, i.e. commands that are usually executed from the MATLAB command line, to be put into
the macro the "execute user-command" function (see below) must be used! (see also paragraph 4.4, "Using macro's")
Stop recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph 4.4, "Using
macro's")
Execute
user-command
This function is used to enter user-commands to a macro (and thus also to the processing history macro!). An input window will appear to ask for the command. The
resulting string is evaluted using the MATLAB eval command (see the MATLAB documentation for more information about eval) and stored in the history macro in a
numeric format. (see also paragraph 4.4, "Using macro's")
Execute macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
Function
Printing
Menu
The printing menu is a general feature available from all matNMR windows that is used for printing. Using a separate window the MATLAB print command (see the MATLAB
documentation for more information on print) can be executed. More information on the printing menu is given in paragraph 7.1, "Printing menu".
Save
figure to
disk
This function will store the current window as a binary figure on disk as an executable m-file. This will allow the user to recall the exact figure by retyping the name of the
m-file on the command line. This uses the Matlab mfig data format. See the Matlab manual for more information on the "saveas" command
Copy
figure
12 of 42
This function will copy the current view of the main window into a separate window, but without the UI-controls. This will give something like:
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the possibility to
change axis properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the menubar are the MATLAB zoom and
rotate3D functions, the matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the printing menu (for more information see paragraph 7.1,
"Printing menu").
5.2.8 Options
This menu allows changing all default settings of matNMR as is described in detail in paragraph 2.2, "Setting up matNMR (options)".
5.2.9 Help
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the $matlabroot/toolbox/local/docopt.m
file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and docopt commands). As the manual is included in the
matNMR distribution reading the manual should be faster than using the matNMR website.
5.2.10 Goodies
Name
Function
Undo
This function undoes the last processing step which may be 1D or 2D mode. There is also an undo button in the main window which does exactly the same. By pressing
CTRL-Z in the window the function may also be called.
The total number of processing steps that may be undone can be set in the general options menu. Beware though of the extra memory usage especially for the 2D
mode! A full copy of the hypercomplex matrices is stored for each step which for a 1024x1024 spectrum already means 32Mb per undo step!
Clear Functions
this performs the MATLAB clear functions command. All compiled functions are deleted from memory forcing MATLAB to recompile each function again upon running it.
This is useful when working with your own m-files (or changing the matNMR code) to force MATLAB to use the altered function (See the MATLAB documentation for more
information on the MATLAB clear command). Furthermore the mouse pointer is set to an arrow head.
this performs almost the same as the clear functions command, but also recreates the axis. This is sometimes useful when the view is distorted after an error has
Reset after Error appeared (typically a MATLAB error).
Select matNMR
Distribution
13 of 42
Allows switching of matNMR distribution. This is only useful if you have multiple versions of matNMR stored on disk and you wish to use another version than the one you
are currently using. The path variable is changed in order to make sure the new distribution is used exclusively and matNMR is restarted. No safety is built in so
information may be lost. Aftert restarting Matlab, the path variable will be the same as usual
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
14 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The routine can be operated using the UI-controls in the figure window. The functions of these will be explained in paragraph 5.3.2 just below. The auxilary functions in the menubar are
described in paragraph 5.3.3 below.
Upon starting the routine the current 1D spectrum (main window) is taken and plotted. It is assumed that the current spectrum is a set of sideband integrals and that the axis ruler has
been changed to indicate the sideband number deviation from the centerband (=0). Sideband number -3 means that the frequency of the peak is at omega_0 - 3*omega_r. This is
independent of the sign of the gyromagnetic ratio!
15 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
To best way to obtain the sideband amplitudes is to use the deconvolution routine, paragraph 5.6 to fit the lineshapes of the individual sidebands, and take the values for the integrals and
use them for the fit of the sideband amplitudes. This is more accurate than taking only the intensity of the line at a multiple of the spinning speed, since spinning speed instabilities will
hardly affect the centerband but the increasingly affect the line for higher sideband numbers. The integral of the line should not be affected. After fitting the 1D spectrum, the results are
stored in a structure and one of the fields is called "Integrals". These contain the values for the peaks. Add the correct axis for the sideband numbers, taking care that the sign of the
gyromagnetic ratio is correct. Otherwise the sign of the anisotropy delta will invert.
To fit the sideband manifold, the Larmor frequency must be entered in MHz and the magic-angle spinning frequency in kHz. The isotropic shift in ppm may also be entered if tensor values
sigma_11, sigma_22 and sigma_33 are required. The routine itself only fits the anisotropy "delta" and the asymmetry "eta", and an intensity. The sideband manifold is calculated using a
gammaCOMPUTE-based algorithm which uses an analytical expression for the frequency of a crystallite. Through powder averaging the complete sideband manifold can be calculated.
As holds for all non-linear fits a good initial estimate of the parameters is required for an efficient fit convergence. To facilitate finding such an estimate the "Simulate" button may be
used. After having defined the initial guesses the fit can be started with the "Fit" button. Should a parameter not be fitted but kept constant at its current value, then this can be done by
selecting the check button (with the square block in it) belonging to the parameter.
Two algorithms may be used for fitting: SIMPLEX and a gradient algorithm. Typically the SIMPLEX algorithm is used for coarse optimization and is followed by a gradient minimization to
finish off the analysis. The quality of the simulation of the sideband manifold can be determined for both algorithms separately. The simulation uses a gammaCOMPUTE-based calculation
with a two-angle ZCW scheme for angles alpha and beta, and a separate number of angles gamma, which can be selected in the appropriate UIcontrol. By choosing a higher number of
powder-averaging angles the quality of the simulation will improve. By default 610 powder-averaging angles are selected for SIMPLEX and none for the gradient algorithm. The value of 610
angles, combined with 50 values for angle gamma seems to provide a stable and fast result for a wide number of conditions (say up to 10 sidebands at least). When more sidebands are
required it is important to test the stability of the fit by increasing the number of averaging points.
When the fit has finished by default the results are written into the variable QSSAFitResults which can be read out by hand by the user (Note that this variable will be deleted when
matNMR is stopped! This means it must be renamed, if it has to be kept in the workspace for later use, before stopping matNMR). Alternatively, from the "View Fit Results" entry in the
menubar a new name for putting the results in can be defined. To be able to access this variable the user must make the variable global by typing "global VariableName" at the MATLAB
prompt. A message is written to make sure the user doesn't forget this.
The format of the parameters is as follows:
- delta
- eta
- intensity
- Error
- Carrier
- Spinning Speed
- isotropic shift
All these numbers are put in a single row. This variable is combined with the original data, the axis to the data, the fitted spectrum and the error value into a structure variable. The fields in
this variable are "Parameters", "Fit", "Data", "Axis" and "Error".
5.3.2 Buttons
Name
Zoom
Function
Switches the zoom function on or off.
Verbose
Determines the level of output generated by the fitting algorithms. This can either be never, after every iteration or only after finishing the fit.
Tolerance
Defines whether the plot should be updated after each iteration or only after the fit has finished.
Noise level
In order for the calculated error to be a chi^2 the standard deviation of the noise must be entered here. This can be taken from the 1D spectrum. A proper value for the
noise level should ideally result in an error of 1 for a perfect fit, i.e. the residual is nothing more than the standard deviation of the noise then.
SIMPLEX
quality
Number of powder-averaging points for the SIMPLEX algorithm. A two-angle ZCW grid is used during the simulation. Selecting "OFF" will result in the algorithm not being
used. Increase this value for a more accurate result.
Gradient
quality
Number of powder-averaging points for the gradient algorithm. A two-angle ZCW grid is used during the simulation. Selecting "OFF" will result in the algorithm not being
used. Increase this value for a more accurate result.
# gamma
angles
Defines the number of angles gamma for the powder averaging. This should be larger than the maximum sideband number that needs to be extracted. 50 seems to be a
good value for most practical cases (up to +- 10 sidebands) as it results in a stable simulation. Increase this value for a more accurate result.
Prints the current figure window to the the default printer as defined in the $matlabroot/toolbox/local/printopt.m file. No UI-controls are printed as the parameter values are
put into the plot as white text. The resulting plot can be rather ugly as sometimes the text is right on top of the fitted spectrum.
Refresh
Uploads the current 1D spectrum from the main window into the fitting routine.
16 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Simulate
Performs a simulation of a sideband manifold based on the parameters given in the UIcontrols. This allows finding a good initial estimate of the parameters, which is vital for
any non-linear fitting algorithm.
Fit
Close
Closes the figure window. No variables are deleted so they can always be accessed afterwards.
Carrier
Carrier frequency of the spectrum from which the sidebands were taken. This value is not fitted and should be taken over from the main window.
Spinning
speed
The spinning frequency for the spectrum from which the sidebands were taken. This is not a fit parameter.
Sigma_iso
The isotropic shift in ppm. This is not a fit parameter and is only needed to calculate the principal components sigma_11, sigma_22 and sigma_33.
delta
eta
Intensity
5.3.3 Menubar
Name
Load
parameters
Function
Loads a variable, with the same format as the QSSAFitResults, from the workspace and puts its values into the UI-controls. Please see paragraph 5.3.1, "General
Appearance" for more information on the format.
Takes a variable from the workspace, with the same format as the QSSAFitResults, and outputs the fitting results to the MATLAB command window. Furthermore, the
View fit results parameters are written into the UIcontrols in the window and the data and fit are shown graphically. Please see paragraph 5.3.1, "General Appearance" for more
information on the format.
Plot
manipulations
This menu allows changing of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
functions only affect the current plot and not the general matNMR settings.
Name
Create Output
Printing
Menu
The printing menu is a general feature available from all matNMR windows that is used for printing. Using a separate window the MATLAB print command
(see the MATLAB documentation for more information on print) can be executed. More information on the printing menu is given in paragraph 7.1, "Printing
menu".
Save
figure to
disk
This function will store the current window as a binary figure on disk as an executable m-file. This will allow the user to recall the exact figure by retyping the
name of the m-file on the command line. This uses the Matlab mfig data format. See the Matlab manual for more information on the "saveas" command
Copy
figure
17 of 42
Function
This function will copy the current view of the main window into a separate window, but without the UI-controls. This will give something like:
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the
possibility to change axis properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the
menubar are the MATLAB zoom and rotate3D functions, the matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the
printing menu (for more information see paragraph 7.1, "Printing menu").
Name
Macro
Help?
Function
Start
recording
macro
Starts the recording of a new macro. An input will appear to ask whether only processing, only plotting or all actions must be stored in the macro.
Recording continues until the stop command is given (see below). Note that for user-commands, i.e. commands that are usually executed from the
MATLAB command line, to be put into the macro the "execute user-command" function (see below) must be used! (see also paragraph 4.4, "Using
macro's")
Stop
recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph
4.4, "Using macro's")
Execute
macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute
macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the
$matlabroot/toolbox/local/docopt.m file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and
docopt commands). As the manual is included in the matNMR distribution reading the manual should be faster than using the matNMR website.
This performs the MATLAB "clear functions" command. All compiled functions are deleted from memory forcing MATLAB to recompile each function again upon running it.
Clear functions This is useful when working with your own m-files (or changing the matNMR code) to force MATLAB to use the altered function (See the MATLAB documentation for more
information on the MATLAB clear command). Furthermore the mouse pointer is set to an arrow head.
18 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
19 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The routine can be operated using the UI-controls in the figure window. The functions of these will be explained in paragraph 5.4.2 just below. The auxilary functions in the menubar are
described in paragraph 5.4.3 below.
Upon starting the routine the current 1D spectrum (main window) is taken and plotted. It is assumed that the unit of the axis has been set to ppm.
To fit the powder pattern only three principal components are required, an intensity factor and the degree of linebroadening. The routine then calculates the spectrum using the analytical
20 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
5.4.2 Buttons
Name
Zoom
Function
Switches the zoom function on or off.
Verbose
Determines the level of output generated by the fitting algorithms. This can either be never, after every iteration or only after finishing the fit.
Tolerance
Update display Defines whether the plot should be updated after each iteration or only after the fit has finished.
Noise level
In order for the calculated error to be a chi^2 the standard deviation of the noise must be entered here. This can be taken from the 1D spectrum. A proper value for the
noise level should ideally result in an error of 1 for a perfect fit, i.e. the residual is nothing more than the standard deviation of the noise then.
SIMPLEX
algorithm
Selects whether the SIMPLEX algorithm should be used for the fit.
Gradient
algorithm
Selects whether the Gradient algorithm should be used for the fit.
Prints the current figure window to the the default printer as defined in the $matlabroot/toolbox/local/printopt.m file. No UI-controls are printed as the parameter values are
put into the plot as white text. The resulting plot can be rather ugly as sometimes the text is right on top of the fitted spectrum.
Refresh
Uploads the current 1D spectrum from the main window into the fitting routine.
Simulate
Performs a simulation of a sideband manifold based on the parameters given in the UIcontrols. This allows finding a good initial estimate of the parameters, which is vital
for any non-linear fitting algorithm.
Fit
Close
Closes the figure window. No variables are deleted so they can always be accessed afterwards.
Background
Slope
Symm?
Sigma11
Sigma22
21 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Gaussian LB
Lorentzian LB
Intensity
5.4.3 Menubar
Name
Load
parameters
Function
Loads a variable, with the same format as the QCSAFitResults, from the workspace and puts its values into the UI-controls. Please see paragraph 5.4.1, "General
Appearance" for more information on the format.
Takes a variable from the workspace, with the same format as the QCSAFitResults, and outputs the fitting results to the MATLAB command window. Furthermore, the
View fit results parameters are written into the UIcontrols in the window and the data and fit are shown graphically. Please see paragraph 5.4.1, "General Appearance" for more
information on the format.
Plot
manipulations
This menu allows changing of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
functions only affect the current plot and not the general matNMR settings.
Name
Function
Printing
Menu
The printing menu is a general feature available from all matNMR windows that is used for printing. Using a separate window the MATLAB print command
(see the MATLAB documentation for more information on print) can be executed. More information on the printing menu is given in paragraph 7.1, "Printing
menu".
Save
figure to
disk
This function will store the current window as a binary figure on disk as an executable m-file. This will allow the user to recall the exact figure by retyping the
name of the m-file on the command line. This uses the Matlab mfig data format. See the Matlab manual for more information on the "saveas" command
This function will copy the current view of the main window into a separate window, but without the UI-controls. This will give something like:
Create Output
Copy
figure
22 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the
possibility to change axis properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the
menubar are the MATLAB zoom and rotate3D functions, the matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the
printing menu (for more information see paragraph 7.1, "Printing menu").
Name
Macro
Help?
Function
Start
recording
macro
Starts the recording of a new macro. An input will appear to ask whether only processing, only plotting or all actions must be stored in the macro.
Recording continues until the stop command is given (see below). Note that for user-commands, i.e. commands that are usually executed from the
MATLAB command line, to be put into the macro the "execute user-command" function (see below) must be used! (see also paragraph 4.4, "Using
macro's")
Stop
recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph
4.4, "Using macro's")
Execute
macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute
macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the
$matlabroot/toolbox/local/docopt.m file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and
docopt commands). As the manual is included in the matNMR distribution reading the manual should be faster than using the matNMR website.
This performs the MATLAB "clear functions" command. All compiled functions are deleted from memory forcing MATLAB to recompile each function again upon running it.
Clear functions This is useful when working with your own m-files (or changing the matNMR code) to force MATLAB to use the altered function (See the MATLAB documentation for more
information on the MATLAB clear command). Furthermore the mouse pointer is set to an arrow head.
23 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The routine can be operated using the UI-controls in the figure window. The functions of these will be explained in paragraph 5.5.2 just below. The auxilary functions in the menubar are
described in paragraph 5.5.3 below.
Upon starting the routine the current 1D spectrum (main window) is taken and plotted. It is assumed that the axis ruler has been changed to a gradient axis, see paragraph 5.2.5.
NOTE: Gradient axes are defined in T/m and NOT in G/cm. This means you may have to divide the gradient values from your software by 100 to obtain the proper
values!!
24 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
For a more convenient view on exponentials the vertical axis is plotted on a logarithmic scale. This can easily be changed using the "scaling types" item in the "plot manipulations" menu on
the menubar.
To fit a (multi-)exponential diffusion curve one first has to provide proper values for the three constants: the gyromagnetic ratio, the gradient spacing and the gradient duration. By
pushing the "Def. Pars." button an input window will be shown where the values can be given.
The next step is to make an initial guess for all exponential functions that need to be fitted to it. This can be done by typing the coefficient and the diffusion constant (D) for each fraction
by hand into the corresponding UI-controls in the window. Also the overall amplitude and a constant may be defined. The routine will include a fraction into the fit if a coefficient value is
specified. Note that all parameters are given in the unit of the axis vector belonging to the current 1D spectrum. This means that the axis vector has to be defined before starting the
peak-fitting routine! A total of 4 exponentials can be fitted simultaneously.
After having defined the initial guesses the fit can be started with the "Fit" button. Should a parameter not be fitted but kept constant at its current value, then this can be done by
selecting the check button (with the square block in it) belonging to the parameter.
When the fit has finished by default the results are written into the variable QDiffFitResults which can be read out by hand by the user (Note that this variable will be deleted when
matNMR is stopped! This means it must be renamed, if it has to be kept in the workspace for later use, before stopping matNMR). Alternatively, from the "View Fit Results" entry in the
menubar a new name for putting the results in can be defined. To be able to access this variable the user must make the variable global by typing "global VariableName" at the MATLAB
prompt. A message is written to make sure the user doesn't forget this.
The format of the parameters is as follows:
- nr of iterations
- chi2 for this column
- fit parameters :
- for each exponential:
- Coefficient
- Diffusion constant (D)
- constant
- amplitude
All these numbers are put in a single row. This variable is combined with the original data, the axis to the data, the fitted spectrum and the error value into a structure variable. The fields in
this variable are "Parameters", "Fit", "Data", "Axis" and "Error".
Last, in case the initial parameters are very far off the "Simplex prefit" check button may be activated. This makes matNMR use a SIMPLEX algorithm first before the gradient algorithm. By
default this option is active.
5.5.2 Buttons
Name
Function
log plot
Def. Pars.
Allows entering the gyromagnetic ratio, the gradient spacing and the gradient duration and optionally the length of the delay used in a bipolar gradient experiment to allow
for the switching of the gradients, all of which are needed for the fit. An input window will appear in which these parameters can be entered.
Alternatively, if the data have been recorded on a Bruker spectrometer using the diff script provided for setting up diffusion experiments, instead of typing the values for the
gradient spacing and the gradient duration one may select "READ Bruker" in the input window. Gamma still needs to be entered by hand though!
NOTE that this only works from XWinNMR 3.0 since before 3.0 the diff script was different. Also, it may mean that this will change at some point.
MatNMR will then ask for the corresponding "acqus" file for the data, from which the parameters d20, p17 and p18 are read. d20 corresponds to big DELTA. p17 is the
gradient rise time and p18 the length of time at which the gradient is constant.
Fit
Refresh
Uploads the current 1D spectrum from the main window into the fitting routine.
Close
Closes the figure window. No variables are deleted so they can always be accessed afterwards.
Prints the current figure window to the the default printer as defined in the $matlabroot/toolbox/local/printopt.m file. No UI-controls are printed as the parameter values are
put into the plot as white text. The resulting plot can be rather ugly as sometimes the text is right on top of the fitted spectrum.
Redisplay
no.
Defines after how many iterations the plot must be redrawn. Set this to a high value to save time.
Max. Nr.
Iter.
Tolerance
Sigma
Measure for the noise in the data. When properly defined the error should become a true chi^2.
25 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Ext. Output
Flag for whether an extended output should be given. A detailed error analysis is presented. NOTE: the basic fitting routine has not been programmed by me and I
have never checked the accuracy of the error analysis!
SIMPLEX
prefit
Flag for whether the fit should use a SIMPLEX algorithm before the gradient algorithm. This reduces the common problem that the gradient algorithm doesn't find a proper
minimum when the parameters are too far off.
Amplitude
Constant
A constant.
Coefficient
5.5.3 Menubar
Name
Load
parameters
Function
Loads a variable, with the same format as the QDiffFitResults, from the workspace and puts its values into the UI-controls. Please see paragraph 5.5.1, "General
Appearance" for more information on the format.
Takes a variable from the workspace, with the same format as the QDiffFitResults, and outputs the fitting results to the MATLAB command window. Furthermore, the
View fit results parameters are written into the UIcontrols in the window and the data and fit are shown graphically. Please see paragraph 5.5.1, "General Appearance" for more
information on the format.
Plot
manipulations
This menu allows changing of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
functions only affect the current plot and not the general matNMR settings.
Name
Create Output
Printing
Menu
The printing menu is a general feature available from all matNMR windows that is used for printing. Using a separate window the MATLAB print command
(see the MATLAB documentation for more information on print) can be executed. More information on the printing menu is given in paragraph 7.1, "Printing
menu".
Save
figure to
disk
This function will store the current window as a binary figure on disk as an executable m-file. This will allow the user to recall the exact figure by retyping the
name of the m-file on the command line. This uses the Matlab mfig data format. See the Matlab manual for more information on the "saveas" command
Copy
figure
26 of 42
Function
This function will copy the current view of the main window into a separate window, but without the UI-controls. This will give something like:
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the
possibility to change axis properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the
menubar are the MATLAB zoom and rotate3D functions, the matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the
printing menu (for more information see paragraph 7.1, "Printing menu").
Name
Macro
Help?
Function
Start
recording
macro
Starts the recording of a new macro. An input will appear to ask whether only processing, only plotting or all actions must be stored in the macro.
Recording continues until the stop command is given (see below). Note that for user-commands, i.e. commands that are usually executed from the
MATLAB command line, to be put into the macro the "execute user-command" function (see below) must be used! (see also paragraph 4.4, "Using
macro's")
Stop
recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph
4.4, "Using macro's")
Execute
macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute
macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the
$matlabroot/toolbox/local/docopt.m file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and
docopt commands). As the manual is included in the matNMR distribution reading the manual should be faster than using the matNMR website.
This performs the MATLAB "clear functions" command. All compiled functions are deleted from memory forcing MATLAB to recompile each function again upon running it.
Clear functions This is useful when working with your own m-files (or changing the matNMR code) to force MATLAB to use the altered function (See the MATLAB documentation for more
information on the MATLAB clear command). Furthermore the mouse pointer is set to an arrow head.
27 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
28 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The routine can be operated using the UI-controls in the figure window. The functions of these will be explained in paragraph 5.6.2 just below. The auxilary functions in the menubar are
described in paragraph 5.6.3 below.
To fit peaks one first has to make an initial guess for the peak parameters for all peaks that need to be fitted. This can be done in two ways: 1) typing the peak center, its amplitude and
width and the fraction of Lorentzian contribution to the Voigt lineshape by hand into the corresponding UI-controls in the window or 2) by using the "Cursor" button. This latter function is
described in paragraph 5.6.2 below. In any case the routine will think that a peak is a peak if there is a value written into the "peak width" button. Note that the peak parameters are given
29 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
in the unit of the axis vector belonging to the current 1D spectrum. This means that the axis vector has to be defined before starting the peak-fitting routine! A total of 36 peaks can be
fitted simultaneouly (for more UI-controls press the "More Peaks" button). In case the baseline is slightly distorted a baseline offset and linear slope may be included in the fit. In case the
baseline is strongly distorted it is advised to first perform a baseline correction.
After having defined the initial guesses the fit can be started with the "Fit" button. Should a parameter not be fitted but kep constant at its current value, then this can be done by
selecting the check button (with the square block in it) belonging to the parameter.
When the fit has finished the results are written into the variable QFitResults which can be read out by hand by the user (Note that this variable will be deleted when matNMR is stopped!
This means it must be renamed, if it has to be kepped in the workspace for later use, before stopping matNMR). Alternatively, from the "View Fit Results" entry in the menubar a new name
for putting the results in can be defined. To be able to access this variable the user must make the variable global by typing "global VariableName" at the MATLAB prompt. A message is
written to make sure the user doesn't forget this.
The format of the parameters is as follows:
- fit parameters :
- for each peak:
- Center of peak
- Amplitude of peak
- Width of peak
- Fraction of Lorentzian contribution to the Voigt lineshape
- background
- slope
All these numbers are put in a single row. This variable is combined with the original data, the axis to the data, the fitted spectrum and the error value into a structure variable. The fields in
this variable are "Parameters", "Fit", Integrals, "Data", "Axis" and "Error".
In case of a 2D being fitted, the structure variable is an array of structures of the same layout.
There is a distinct difference between starting the peak-fitting routine from the "1D Processing" or from the "2D Processing" entry in the menubar: the 1D version will only take the current
1D spectrum or row/column from the 2D into the peak-fitting routine. The 2D version will take the whole 2D in which allows fitting a series of 1D spectra automatically.
Last, as peak fitting can be quite time consuming it is important to reduce the number of points in the spectrum. Therefore be sure to zoom into the region of interest properly before
starting the peak-fitting routine. The peak-fitting routine takes the current zoom limits into account when reading the spectrum into the routine. A further reduction in time can be made by
reducing the screen output. This can be done by selecting a lower refresh rate using the "redisplay no." button.
5.6.2 Buttons
Name
Function
Specify the range of spectra from the current 2D (i.e. series of 1D) spectrum that need to be fitted. Numbers can be entered by hand or by clicking the "-" and "+" buttons. Only
Min / Max defined for 2D spectra.
View
Specifies which row/column of the current 2D (i.e. series of 1D) spectrum must be plotted in the figure window. Select a row/column that allows defining the peaks easily. The fit
will still start at the row/column as defined by the "Min" button. Only defined for 2D spectra.
Noise
level
May be used to obtain a proper chi^2. Define a signal-free range in the spectrum (preferably without a baseline distortion!) by clicking left and right of the range in the plot. The
standard deviation of the use will be used to normalize the chi^2.
Zoom
Allows zooming into the plot which can be useful for defining the peaks. This uses the standard MATLAB zoom routine.
Ext.
Output
Flag for whether an extended output should be given. A detailed error analysis is presented. NOTE: the basic peak-fitting routine has not been programmed by me and
I have never checked the accuracy of the error analysis!
Re-use
pars.
Flag whether to start each fit of a 2D spectrum with the same initial parameters. If not selected each new row/column will start with the parameters from the last row/column.
More
peaks
Opens an additional window with UI-controls for defining peaks. Up to 24 peaks can be fitted simultaneously.
Cursor
Allows defining the peaks using the mouse. Before starting be sure to select the proper radio button (with the diamond in it) belonging to the parameter that needs to be
defined. The peak center and amplitudes are defined by a single mouse click (left button). The peak width at half height is defined by two further mouse clicks, one left and one
right of the peak center. After a parameter is defined the next radio button is activated. Should another parameter be changed just change the radio button (it is not necessary
to stop the "cursor" routine for this!). When all parameters have been defined properly the routine must be stopped by clicking outside the axis or by using the right or middle
mouse button.
Prints the current figure window to the the default printer as defined in the $matlabroot/toolbox/local/printopt.m file. No UI-controls are printed except the parameter buttons.
The resulting plot can be rather ugly as the UI-controls don't print nicely.
30 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Refresh
Uploads the current 1D or 2D spectrum from the main window into the peak-fitting routine. Note that this function only checks the current dimension QmatNMR.Dim for
determining whether to upload a 1D or 2D spectrum. It does not check whether the previous fitting mode was 1D or 2D. In case only the current row/column of the current 2D
spectrum in the main window must be uploaded, use the "Peak fitting" entry from the "1D Processing" menu in the main window.
Fit
Close
Closes the figure window. No variables are deleted so they can always be accessed afterwards.
Redisplay
Defines after how many iterations the plot must be redrawn. Set this to a high value to save time.
no.
Max. Nr.
Iter.
Slope
Xpos
Ampl
Amplitude of a peak.
Width
Full width at half height (FWHH) of a peak in the unit of the axis vector.
Frac. Lor.
5.6.3 Menubar
Name
Load
parameters
Function
Loads a variable, with the same format as the QFitResults, from the workspace and puts its values into the UI-controls. Please see paragraph 5.6.1, "General Appearance"
for more information on the format.
Takes a variable from the workspace, with the same format as the QFitResults, and outputs the fitting results to the MATLAB command window. Furthermore, the
View fit results parameters are written into the UIcontrols in the window and the data and fit are shown graphically. Please see paragraph 5.6.1, "General Appearance" for more
information on the format.
Plot
manipulations
This menu allows changing of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
functions only affect the current plot and not the general matNMR settings.
Name
Create Output
Printing
Menu
The printing menu is a general feature available from all matNMR windows that is used for printing. Using a separate window the MATLAB print command
(see the MATLAB documentation for more information on print) can be executed. More information on the printing menu is given in paragraph 7.1, "Printing
menu".
Save
figure to
disk
This function will store the current window as a binary figure on disk as an executable m-file. This will allow the user to recall the exact figure by retyping the
name of the m-file on the command line. This uses the Matlab mfig data format. See the Matlab manual for more information on the "saveas" command
Copy
figure
31 of 42
Function
This function will copy the current view of the main window into a separate window, but without the UI-controls. This will give something like:
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the
possibility to change axis properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the
menubar are the MATLAB zoom and rotate3D functions, the matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the
printing menu (for more information see paragraph 7.1, "Printing menu").
Name
Macro
Help?
Function
Start
recording
macro
Starts the recording of a new macro. An input will appear to ask whether only processing, only plotting or all actions must be stored in the macro.
Recording continues until the stop command is given (see below). Note that for user-commands, i.e. commands that are usually executed from the
MATLAB command line, to be put into the macro the "execute user-command" function (see below) must be used! (see also paragraph 4.4, "Using
macro's")
Stop
recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph
4.4, "Using macro's")
Execute
macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute
macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the
$matlabroot/toolbox/local/docopt.m file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and
docopt commands). As the manual is included in the matNMR distribution reading the manual should be faster than using the matNMR website.
This performs the MATLAB "clear functions" command. All compiled functions are deleted from memory forcing MATLAB to recompile each function again upon running it.
Clear functions This is useful when working with your own m-files (or changing the matNMR code) to force MATLAB to use the altered function (See the MATLAB documentation for more
information on the MATLAB clear command). Furthermore the mouse pointer is set to an arrow head.
32 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
33 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The routine can be operated using the UI-controls in the figure window. The functions of these will be explained in paragraph 5.7.2 just below. The auxilary functions in the menubar are
described in paragraph 5.7.3 below.
Upon starting the routine the current 1D spectrum (main window) is taken and plotted. It is assumed that the unit of the axis has been set to ppm.
To fit the isotropic shift, the Cq and and asymmetry eta, the carrier frequency and the spin quantum number are required. The routine then performs a powder averaging of an analytical
34 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
expression of the frequency of a crystallite, assuming an infinite MAS spinning frequency. After adding linebroadening, either Lorentizian or Gaussian (for heterogeneous broadening), and
multiplication by an intensity factor the simulation is ready. Note that the simulation is a frequency-space simulation with a fixed resolution. Up to 4 lines can be fit simultaneously.
As holds for all non-linear fits a good initial estimate of the parameters is required for an efficient fit convergence. To facilitate finding such an estimate the "Simulate" button may be
used. After having defined the initial guesses the fit can be started with the "Fit" button. Should a parameter not be fitted but kept constant at its current value, then this can be done by
selecting the check button (with the square block in it) belonging to the parameter.
Two algorithms may be used for fitting: SIMPLEX and a gradient algorithm. Typically the SIMPLEX algorithm is used for coarse optimization and is followed by a gradient minimization to
finish off the analysis. The quality of the simulation of the sideband manifold can be determined for both algorithms separately. By choosing a higher number of powder-averaging angles
the quality of the simulation will improve. By default 610 powder-averaging angles are selected for SIMPLEX and none for the gradient algorithm. Increasing the number of averaging points
will improve the accuracy of the analysis.
Two algorithms may be used for fitting: SIMPLEX and a gradient algorithm. Typically the SIMPLEX algorithm is used for coarse optimization and is followed by a gradient minimization to
finish off the analysis.
When the fit has finished by default the results are written into the variable QQuadFitResults which can be read out by hand by the user (Note that this variable will be deleted when
matNMR is stopped! This means it must be renamed, if it has to be kept in the workspace for later use, before stopping matNMR). Alternatively, from the "View Fit Results" entry in the
menubar a new name for putting the results in can be defined. To be able to access this variable the user must make the variable global by typing "global VariableName" at the MATLAB
prompt. A message is written to make sure the user doesn't forget this.
The format of the parameters is as follows:
- for each site in the spectrum:
- sigma_iso
- Cq
- eta
- Gaussian LB
- Lorentzian LB
- Intensity
- background
- slope
All these numbers are put in a single row. This variable is combined with the original data, the axis to the data, the fitted spectrum and the error value into a structure variable. The fields in
this variable are "Parameters", "Fit", "AxisFit", "Data", "AxisData" and "Error".
Note that the simulated spectrum has a different axis than the experimental spectrum!
5.7.2 Buttons
Name
Zoom
Function
Switches the zoom function on or off.
Verbose
Determines the level of output generated by the fitting algorithms. This can either be never, after every iteration or only after finishing the fit.
Tolerance
Defines whether the plot should be updated after each iteration or only after the fit has finished.
Noise level
In order for the calculated error to be a chi^2 the standard deviation of the noise must be entered here. This can be taken from the 1D spectrum. A proper value for the
noise level should ideally result in an error of 1 for a perfect fit, i.e. the residual is nothing more than the standard deviation of the noise then.
SIMPLEX
quality
Number of powder-averaging points for the SIMPLEX algorithm. A two-angle ZCW grid is used during the simulation. Selecting "OFF" will result in the algorithm not being
used. Increase this value for a more accurate result.
Gradient
quality
Number of powder-averaging points for the gradient algorithm. A two-angle ZCW grid is used during the simulation. Selecting "OFF" will result in the algorithm not being
used. Increase this value for a more accurate result.
Prints the current figure window to the the default printer as defined in the $matlabroot/toolbox/local/printopt.m file. No UI-controls are printed as the parameter values are
put into the plot as white text. The resulting plot can be rather ugly as sometimes the text is right on top of the fitted spectrum.
Refresh
Uploads the current 1D spectrum from the main window into the fitting routine.
Simulate
Performs a simulation of a sideband manifold based on the parameters given in the UIcontrols. This allows finding a good initial estimate of the parameters, which is vital for
any non-linear fitting algorithm.
Fit
Close
Closes the figure window. No variables are deleted so they can always be accessed afterwards.
35 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Quantum NR
Carrier
The carrier frequency for the spectrum must be provided, although this is usually imported from the main window when loading the spectrum into the fitting routine. This is
not a fit parameter.
Background
Slope
Sigma_iso
The isotropic chemical shift for each site. Typically, a good initial estimate of this parameter is the left (downfield) edge of the second-order quadrupolar pattern.
Cq
eta
Gaussian LB
5.7.3 Menubar
Name
Load
parameters
Function
Loads a variable, with the same format as the QQuadFitResults, from the workspace and puts its values into the UI-controls. Please see paragraph 5.7.1, "General
Appearance" for more information on the format.
Takes a variable from the workspace, with the same format as the QQuadFitResults, and outputs the fitting results to the MATLAB command window. Furthermore, the
View fit results parameters are written into the UIcontrols in the window and the data and fit are shown graphically. Please see paragraph 5.7.1, "General Appearance" for more
information on the format.
Plot
manipulations
This menu allows changing of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
functions only affect the current plot and not the general matNMR settings.
Name
Create Output
Printing
Menu
The printing menu is a general feature available from all matNMR windows that is used for printing. Using a separate window the MATLAB print command
(see the MATLAB documentation for more information on print) can be executed. More information on the printing menu is given in paragraph 7.1, "Printing
menu".
Save
figure to
disk
This function will store the current window as a binary figure on disk as an executable m-file. This will allow the user to recall the exact figure by retyping the
name of the m-file on the command line. This uses the Matlab mfig data format. See the Matlab manual for more information on the "saveas" command
Copy
figure
36 of 42
Function
This function will copy the current view of the main window into a separate window, but without the UI-controls. This will give something like:
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the
possibility to change axis properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the
menubar are the MATLAB zoom and rotate3D functions, the matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the
printing menu (for more information see paragraph 7.1, "Printing menu").
Name
Macro
Help?
Function
Start
recording
macro
Starts the recording of a new macro. An input will appear to ask whether only processing, only plotting or all actions must be stored in the macro.
Recording continues until the stop command is given (see below). Note that for user-commands, i.e. commands that are usually executed from the
MATLAB command line, to be put into the macro the "execute user-command" function (see below) must be used! (see also paragraph 4.4, "Using
macro's")
Stop
recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph
4.4, "Using macro's")
Execute
macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute
macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the
$matlabroot/toolbox/local/docopt.m file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and
docopt commands). As the manual is included in the matNMR distribution reading the manual should be faster than using the matNMR website.
This performs the MATLAB "clear functions" command. All compiled functions are deleted from memory forcing MATLAB to recompile each function again upon running it.
Clear functions This is useful when working with your own m-files (or changing the matNMR code) to force MATLAB to use the altered function (See the MATLAB documentation for more
information on the MATLAB clear command). Furthermore the mouse pointer is set to an arrow head.
37 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
38 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
The routine can be operated using the UI-controls in the figure window. The functions of these will be explained in paragraph 5.8.2 just below. The auxilary functions in the menubar are
39 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
5.8.2 Buttons
Name
Fit
Function
Starts the fit.
Refresh
Uploads the current 1D spectrum from the main window into the T1-fitting routine.
Close
Closes the figure window. No variables are deleted so they can always be accessed afterwards.
Prints the current figure window to the the default printer as defined in the $matlabroot/toolbox/local/printopt.m file. No UI-controls are printed as the parameter values are
put into the plot as white text. The resulting plot can be rather ugly as sometimes the text is right on top of the fitted spectrum.
Redisplay
no.
Defines after how many iterations the plot must be redrawn. Set this to a high value to save time.
Max. Nr.
Iter.
Tolerance
Sigma
Measure for the noise in the data. When properly defined the error should become a true chi^2.
Ext. Output
Flag for whether an extended output should be given. A detailed error analysis is presented. NOTE: the basic fitting routine has not been programmed by me and I
have never checked the accuracy of the error analysis!
SIMPLEX
prefit
Flag for whether the fit should use a SIMPLEX algorithm before the gradient algorithm. This reduces the common problem that the gradient algorithm doesn't find a proper
minimum when the parameters are too far off.
Amplitude
Constant
A constant.
Coefficient
T1
40 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Function
Loads a variable, with the same format as the QT1FitResults, from the workspace and puts its values into the UI-controls. Please see paragraph 5.8.1, "General
Appearance" for more information on the format.
Takes a variable from the workspace, with the same format as the QT1FitResults, and outputs the fitting results to the MATLAB command window. Furthermore, the
View fit results parameters are written into the UIcontrols in the window and the data and fit are shown graphically. Please see paragraph 5.8.1, "General Appearance" for more
information on the format.
Plot
manipulations
This menu allows changing of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
functions only affect the current plot and not the general matNMR settings.
Name
Function
Printing
Menu
The printing menu is a general feature available from all matNMR windows that is used for printing. Using a separate window the MATLAB print command
(see the MATLAB documentation for more information on print) can be executed. More information on the printing menu is given in paragraph 7.1, "Printing
menu".
Save
figure to
disk
This function will store the current window as a binary figure on disk as an executable m-file. This will allow the user to recall the exact figure by retyping the
name of the m-file on the command line. This uses the Matlab mfig data format. See the Matlab manual for more information on the "saveas" command
This function will copy the current view of the main window into a separate window, but without the UI-controls. This will give something like:
Create Output
Copy
figure
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the
possibility to change axis properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the
menubar are the MATLAB zoom and rotate3D functions, the matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the
printing menu (for more information see paragraph 7.1, "Printing menu").
41 of 42
11/23/07 06:02 PM
Macro
Help?
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/MainWi...
Function
Start
recording
macro
Starts the recording of a new macro. An input will appear to ask whether only processing, only plotting or all actions must be stored in the macro.
Recording continues until the stop command is given (see below). Note that for user-commands, i.e. commands that are usually executed from the
MATLAB command line, to be put into the macro the "execute user-command" function (see below) must be used! (see also paragraph 4.4, "Using
macro's")
Stop
recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph
4.4, "Using macro's")
Execute
macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute
macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the
$matlabroot/toolbox/local/docopt.m file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and
docopt commands). As the manual is included in the matNMR distribution reading the manual should be faster than using the matNMR website.
This performs the MATLAB "clear functions" command. All compiled functions are deleted from memory forcing MATLAB to recompile each function again upon running it.
Clear functions This is useful when working with your own m-files (or changing the matNMR code) to force MATLAB to use the altered function (See the MATLAB documentation for more
information on the MATLAB clear command). Furthermore the mouse pointer is set to an arrow head.
42 of 42
11/23/07 06:02 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
1 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
2 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
The 2D/3D Viewer is a multi-window multi-plot routine: an arbitrary number of windows can be opened (simultaneously) and they can all have an arbitrary number of subplots (only limited
by the number of pre-defined subplot configurations matNMR allows). All data windows are controlled from the panel window. Any function executed from here will apply to the current axis
in the current 2D/3D Viewer window. The current axis is always marked by a box around it. The current figure though is not always so clearly recognizable. In general the current figure will
be pulled in front before executing a plotting command, making it clear what the current figure window is. In general it is NOT sufficient to pull the window in front if one wants to make a
figure the current figure! The preferred way of selecting a window therefore is to click on the "Select" button in the top left corner of the window, or alternatively inside the window (Not on
the menubar!).
Although this routine is multi-window multi-plot only one set of variables is kept in memory (for more information on memory usage see also paragraph 3.7, "Memory usage"). This means
that only the matrix (and axis vectors etc.) belonging to the last plotted spectrum is stored. This is important to realize because it affects certain routines that use the matrix for
extracting spectral intensities like Integrate, peak picking, get position, etc. These only function properly for the last plotted spectrum. And although they may not produce any errors, the
result may still be wrong! Some plot parameters are stored into the figure window and they contain some information on each specific plot in the figure:
-name
-axis vectors: extracting axis coordinates will work properly even when the plot does not belong to the last plotted spectrum!
-processing history
Furthermore certain properties of the current figure are saved:
-number of subplots
-axis handles
-colorbar flags for each axis
-colorbar handles
-zoom flag
-rotate3D flag
All these parameters are stored into the userdata property of the figure (for more information on properties of graphics objects see the MATLAB documentation). Extracting this property
(e.g. QTEMP= get(gcf, 'userdata')) will result in a structure variable. Users can add fields to it (in principle the userdata property is free to be manipulated in any way and can therefore be
useful for various things) but shouldn't removed the fields that matNMR has created sofar as this will produce errors. .
The functions panel window will be explained in paragraph 6.2, just below and the menubar in the data windows in paragraph 6.3, "The menubar".
6.2.1 Contours
3 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Function
Popup button for selecting the type of contour plot. Currently supported are the three MATLAB contour routines contour (normal contours), contourf (filled contours) and
contour3 (contours plotted at their corresponding z-level). See the MATLAB documentation for more information on these routines.
Popup button for selecting whether to plot the real, the imaginary or the absolute value of a matrix.
This function allows plotting relative contours, i.e. the contour levels are specified as a percentage of the maximum intensity of a matrix. The following input window will
appear:
Relative
Contours
4 of 20
Function
Name
Spectrum
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR structure (see also
paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that were saved into it. If axis vectors
are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors as saved in the structure.
Lower
contour
limit
Defines the lower contour limit as a percentage of the maximum intensity of the matrix.
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Upper
contour
limit
Defines the upper contour limit as a percentage of the maximum intensity of the matrix.
Multiplier
A number that specifies the non-linearity of the increment between contour levels. If (Multiplier = 1) then the increment between contour levels is the same for all
contour levels. If (0 < Multiplier < 1) then more contours are drawn towards the high end of the range as defined by the lower and upper limits. If (Multiplier > 1)
then more contour levels are drawn towards the lower end of the range.
Number of
contours
The total number of contour levels in the plot. When both positive and negative contours are asked for then a vector of two numbers may be given to denote
different numbers of contours for positive and negative intensities. If only one number is specified then both positive and negative intensities have the same
number of contours.
Type of
contours
This determines how the contour levels will be calculated. This can either be a) positive contours (i.e. relative to the positive maximum), (b) negative contours
(i.e. relative to the negative maximum), c) both positive and negative contours (relative to the respective positive and negative maxima), d) both positive and
negative contours but relative to the positive maximum or e) both positive and negative contours but relative to the negative maximum of the spectrum. Note
that for the last three options the number of contours is doubled (if a contour level is set at 0, the number of contours is doubled minus 1). A special colormap will
be generated when printing both positive and negative contours.
Vector for
TD2-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Vector for
TD1-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Linespec
Leaving this empty will plot the contours as a MATLAB patch (for more information on this see the MATLAB documentation), meaning it will use a colormap.
Specifying the linespec causes MATLAB to plot the contours as line plots. See the MATLAB documentation for more information on colormaps and linespec
properties.
Plotting
Macro
Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using macro's".
This function allows plotting absolute contours, i.e. the contour levels are specified directly by the user. The following input window will appear:
Absolute
Contours
5 of 20
Function
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR structure (see
also paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that were saved into it. If axis
vectors are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors as saved in the structure.
Vector with
contour levels A variable in the workspace containing the contour level intensities.
Vector for
TD2-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Vector for
TD1-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Linespec
Leaving this empty will plot the contours as a MATLAB patch (for more information on this see the MATLAB documentation), meaning it will use a colormap.
Specifying the linespec causes MATLAB to plot the contours as line plots. See the MATLAB documentation for more information on colormaps and linespec
properties.
Plotting Macro Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using macro's".
6.2.2 Mesh 3D
Button
Mesh
Function
Popup button for selecting the type of surface plot. Currently supported are the eight MATLAB routines mesh (normal mesh), meshc (mesh + contours underneith), meshz (mesh
with curtain), surf (normal surface), surfc (surface with a contour plot underneith), surfl (surface with lichting effects), pcolor (pseudo-color plot, i.e. a top-projection of the
surface) and waterfall (a waterfall plot). See the MATLAB documentation for more information on these routines. A word of caution must be made for using the waterfall plot as it
has proven be not so stable in the past! Sometimes it used to take ages to finish.
Real
Popup button for selecting whether to plot the real, the imaginary or the absolute value of a matrix.
Both
Defines whether to draw mesh grid lines in both matrix dimensions or just along the rows (TD2) or columns (TD1). This property only affects mesh plots, not surface plots.
This function allows plotting mesh and surface plots. The following input window will appear:
Mesh 3D
Plot
6 of 20
Function
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Name
Spectrum
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR structure (see also
paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that were saved into it. If axis vectors
are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors as saved in the structure.
Azimuthal
Defines the azimuth angle or better the horizontal rotation angle for the resulting view (see MATLAB documentation for more information on view). The view can
always be changed by using the Rotate3D function in the Tools section (described below).
Elevation
Defines the elevation angle or better the vertical rotation angle for the resulting view (see MATLAB documentation for more information on view). The view can
always be changed by using the Rotate3D function in the Tools section (described below).
Vector for
TD2-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Vector for
TD1-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Plotting
Macro
Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using macro's".
6.2.3 Stack 3D
3D Stack plots are plots in which, along one dimension of the matrix, the lines are stacked such that a spatial view is obtained. This can be very useful for watching decays etc.
Button
Function
Lower
z-limit
Defines the lower zlimit for the plot. If not defined before plotting a new matrix then matNMR will set it to the default axis settings after plotting the matrix.
Upper
z-limit
Defines the upper zlimit for the plot. If not defined before plotting a new matrix then matNMR will set it to the default axis settings after plotting the matrix.
Real
Popup button for selecting whether to plot the real, the imaginary or the absolute value of a matrix.
Y-dir
default
Defines the default axis direction for the plot. Usually this is set to right-to-left for NMR spectra but this is not necessarily what is needed for a plot.
Stack 3D
7 of 20
This function allows plotting 3D stack plots. The following input window will appear:
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Function
Name
Spectrum
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR structure (see
also paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that were saved into it. If axis
vectors are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors as saved in the structure.
Dimension
along x-axis
Determines which matrix dimension to put along the x-axis, i.e. in which direction to stack the rows/columns.
Azimuthal
Defines the azimuth angle or better the horizontal rotation angle for the resulting view (see MATLAB documentation for more information on view). The view can
always be changed by using the Rotate3D function in the Tools section (described below).
Elevation
Defines the elevation angle or better the vertical rotation angle for the resulting view (see MATLAB documentation for more information on view). The view can
always be changed by using the Rotate3D function in the Tools section (described below).
Vector for
TD2-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Vector for
TD1-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Plotting Macro Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using macro's".
z-axis
y-tick
Allows switching the tickmarks along the y-axis on or off from displaying.
6.2.4 Raster 2D
The raster plot can be used for making quick low-resolution pictures of big spectra by undersampling the matrix. The matrix is divided in blocks as big as the sampling size and the
intensity over the block is integrated.
8 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Function
Sampling Defines the sampling size (in points) for the current spectrum. Note that setting a value into this edit button immediately takes effect on the current matrix.
Real
Popup button for selecting whether to plot the real, the imaginary or the absolute value of a matrix.
This function allows plotting 2D raster plots. The following input window will appear:
Raster
2D
The following fields must be specified:
Field
Function
Name
Spectrum
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR structure (see
also paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that were saved into it. If axis
vectors are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors as saved in the structure.
Dimension
along x-axis
Determines which matrix dimension to put along the x-axis, i.e. in which direction to stack the rows/columns.
Azimuthal
Defines the azimuth angle or better the horizontal rotation angle for the resulting view (see MATLAB documentation for more information on view). The view can
always be changed by using the Rotate3D function in the Tools section (described below).
Elevation
Defines the elevation angle or better the vertical rotation angle for the resulting view (see MATLAB documentation for more information on view). The view can
always be changed by using the Rotate3D function in the Tools section (described below).
Vector for
TD2-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Vector for
TD1-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name Spectrum" is a
matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Plotting Macro Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using macro's".
z-axis
y-tick
Allows switching the tickmarks along the y-axis on or off from displaying.
6.2.5 Tools
The Tools section contains a few functions that are often needed while working with the 2D/3D Viewer. All of them can also be found in the "Plot manipulations" entry in the menubar (for
more information on the plot manipulations see paragraph 6.3.2, "Plot manipulations").
Button
9 of 20
Function
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
This function allows to make a slice-plot of a 2D spectrum by defining strips of frequencies in both dimenions. A new variable "QmatNMR.Spec2D3DCutSpectrum" will be
created which contains these blocks of the spectrum. This variable may then be called by any of the plotting routines and the blocks will be shown separated by a dotted line.
After pushing this button use the mouse to define the strips. Afterwards an input window will be openened and the coordinates can be specified more accurately. NOTE that
using the corresponding function in the menubar avoids having to define the coordinates by mouse again!
It is often most efficient to make a low-quality plot of a spectrum, zoom into the region of interest and then replot it in high quality. This function allows to do so, by creating a
Define plot new variable "QmatNMR.Spec2D3DDefinePlot" with the zoomed-in part of the spectrum and the axes. This variable may then be used as input for the subsequent plotting
action.
Get
Position
Like the "Get Position" routine in the main window (see paragraph 5.1, "General Appearance") this routine provides a means of scanning the matrix. The coordinates in both
dimensions for the position of the crosshair and the intensity is shown on screen. Note that the intensity is only valid for the last plotted spectrum. The coordinates should
always be correct though!
This allows changing the axis vectors for the current matrix. Similar to the way it is done in the main window (see paragraph 5.2.5, "Plot manipulations") the axis vectors can
be set to either PPM, Hz, time, points or to a user- defined vector. The following window is opened:
Axis rulers
Title/labels
10 of 20
First the type of axis vector (PPM, Hz, time, points, user-defined) can be chosen. The spectral width must be specified for PPM and Hz axes and for a PPM axis also the carrier
frequency. For axes in Hz also the signs of the gyromagnetic ratios of the nuclei that correspond to the respective dimensions of the spectrum must be specified.
The button labeled "Connect to variable?" can be checked if the new axes must be connected to the spectrum. If the spectrum wasn't yet a matNMR structure then it will be
made into one in order to be able to allow the connection.
Pressing the "Continue" button proceeds the routine and one is asked for the reference values. After that the reference peak can be specified by using the crosshair mouse
pounter and clicking on the desired reference peak (This may seem strange but is necessary because of a MATLAB bug. Specifying the reference peak before asking its value
leads to a mess with the main and input window). If a name is given for the new axis vector(s) then it/they will be saved in the workspace after calculating it.
This routine provides a means of changing the title and axes labels of the current axis. A window will appear looking like:
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Pressing the "Apply" button will update all labels immediately. The "Refresh" is used for updating the text labels currently written in this window to the labels in the current axis
(useful when having this window opened continously).
Prints the current 2D/3D Viewer window to the default printer as defined in the $matlabroot/toolbox/local/printopt.m file.
Hold
Switches the hold flag for the current axis. Upon activating this, every consecutive plot is superposed on the existing plots. (see the MATLAB documentation for more
information on the hold command).
Zoom
Switches the zoom flag for the current window. Upon activating this, the rotate3D flag is switched off and the standard MATLAB zoom is activated (see the MATLAB
documentation for more information on the zoom command). Zooming in can be done using the left mouse button (either by clicking or by dragging a box around the desired
area) whereas the right button zooms out.
Rotate3D
Switches the rotate3D flag for the current window. Upon activating this the zoom flag is switched off and the standard MATLAB rotate3d command is activated (see the
MATLAB documentation for more information on the rotate3d command). The plot can be rotated by moving the mouse while having the left mouse button pressed in the
desired axis.
Colorbar
Colormap
Allows changing of the colormap for the current 2D/3D Viewer window. Beware that colormaps are a figure property and therefore different axes cannot have different color
maps. This popup button contains a few of the standard MATLAB colormaps and some others. The QPosNeg colormaps are altered upon plotting a contour plot with both
positive and negative contours, such that the cental colour always denotes the zero-level. Selecting these in any other case will show the full colormap. To adjust those
colormaps according to the degree of positive and negative intensities in the spectrum, select "Adjust PosNeg".
All colormaps may be inverted by selecting the corresponding item from the list.
Shading
Sets the shading property (for more information see the MATLAB documentation).
11 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
This menu contains all kinds of functions to change the appearance of the current axis and/or the current 2D/3D Viewer window.
Name
Function
New window
This will open a new 2D/3D Viewer window and make it the current figure window. The number of subplots are the same as in the window from which this function was
started. The zoom/rotate3D state is also kept. The colormap and colorbar settings are set back to default however.
Subplots
This changes the subplot configuration in the current window. An extensive set of subplot configurations are allowed. To efficiently work with subplots please refer to the
support of 3D matrices, paragraph 4.2, "1D, 2D and 3D mode", and the use of plotting macros, paragraph 4.4, "Using macro's".
Zoom
Switches the zoom flag for the current figure window. If the zoom is activated then the rotate3D is deactivated. This uses the MATLAB zoom function. Please see the
MATLAB documentation for more information.
Rotate3D
Switches the rotate3D flag for the current figure window. If the rotate3D is activated then the zoom is deactivated. This uses the MATLAB rotate3d function. Please see the
MATLAB documentation for more information.
This contains all plotting routines supported by matNMR and not just those presented in the panel window.
Name
Function
Creates a 2D bar plot. The following input window will appear:
Plotting
Functions
Bar 2D
Bar 3D
12 of 20
Function
Name
Spectrum
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR
structure (see also paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that
were saved into it. If axis vectors are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors
as saved in the structure.
Vector for
x-axis
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name
Spectrum" is a matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Linespec
Leaving this empty will plot the bars as done using the standard bar plotting routine in Matlab (for more information on this see the MATLAB
documentation) , meaning it will use a colormap. Specifying the linespec causes MATLAB to plot the bars as line plots. See the MATLAB
documentation for more information on colormaps and linespec properties.
Plotting
Macro
Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using
macro's".
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Function
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR
structure (see also paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc)
that were saved into it. If axis vectors are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis
vectors as saved in the structure.
Azimuth
Elevation
The type of
Whether square bars are wanted or cylinders.
object
13 of 20
Vector for
TD2
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name
Spectrum" is a matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Vector for
TD1
A variable in the workspace corresponding to the axis vector for this dimension. Leaving this empty will give an axis in points unless the "Name
Spectrum" is a matNMR structure (see "Name Spectrum"). Specifying an axis vector will overrule any axis vector saved in the variable structure.
Plotting
Macro
Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using
macro's".
Contours
(abs)
Contours
(rel)
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
This function creates a line plot of the 1D spectrum that it requires as input. In case a 2D matrix is given then this results in a series of line plots distributed
over the available subplots.
The following input window will appear:
Line plot
Function
Name
Spectrum
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR
structure (see also paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that
were saved into it. If axis vectors are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors
as saved in the structure.
axis
Whether or not to print an axis system around the polar plot. Only limited control is available over the axis system currently.
Linespec
Leaving this empty will plot the bars as done using the standard line plotting routine in Matlab (for more information on this see the MATLAB
documentation). Specifying the linespec may result in different colours and markers and such. See the MATLAB documentation for more
information on linespec properties.
Plotting
Macro
Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using
macro's".
This function creates a polar plot using a stereographic projection. A 2D matrix where the dimensions correspond to two polar angles is assumed.
Polar plot The following input window will appear:
14 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Function
Name
Spectrum
This must be either a name of a matrix variable in the workspace or a function generating a matrix as output. In case the variable is a matNMR
structure (see also paragraph 3.5, "matNMR format for spectra") then the routine will extract the corresponding axis vectors (and history etc) that
were saved into it. If axis vectors are specified in this input window (see below) for Td2 and/or TD1 then these are used and not the axis vectors
as saved in the structure.
axis
Whether or not to print an axis system around the polar plot. Only limited control is available over the axis system currently.
plot type
This determines whether to print it as a surface (pcolor) or as a contour plot. If the pcolor is chosen then no other options must be given. If
absolute contours are asked for then only the vector with contour levels must be given. For relative contours all but the vector of contour levels
must be given. Please see the corresponding sections for more details on contour plots and surface plots.
Plotting
Macro
Allows for a plotting macro to be executed immediately after the plot is made, in order to reduce rendering time. See also paragraph 4.4, "Using
macro's".
Raster 2D More details can be found in the section of the panel window.
Surface
15 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Axis rulers
Features
First the type of axis vector (PPM, Hz, time, points, user-defined) can be chosen. The spectral width must be specified for PPM and Hz axes and for a PPM axis
also the carrier frequency. For axes in Hz also the signs of the gyromagnetic ratios of the nuclei that correspond to the respective dimensions of the spectrum
must be specified.
The button labeled "Connect to variable?" can be checked if the new axes must be connected to the spectrum. If the spectrum wasn't yet a matNMR structure
then it will be made into one in order to be able to allow the connection.
Pressing the "Continue" button proceeds the routine and one is asked for the reference values. After that the reference peak can be specified by using the
crosshair mouse pounter and clicking on the desired reference peak (This may seem strange but is necessary because of a MATLAB bug. Specifying the
reference peak before asking its value leads to a mess with the main and input window). If a name is given for the new axis vector(s) then it/they will be saved
in the workspace after calculating it.
Color Bar
Adds or removes a colorbar from the current axis. If the colorbar must be printable in MIF format then select the corresponding button in the input window. The
colorbar will then be plotted as 150 filled contours instead of the default image.
Color
Mapping
(caxis)
This allows setting the colormapping for the current axis, i.e. what range of values the colormap should cover. The minimum and maximum specified here are
connected to the first and last color in the colormap. This uses the MATLAB command caxis. See the MATLAB documentation for more information.
Prints the current 2D/3D Viewer window to the default printer as defined in the $matlabroot/toolbox/local/printopt.m file.
Allows writing a line of text into the super-title axis. This axis is invisible and cannot be accessed directly. A text of certain font size and rotation angle will be
Super title written into the axis which by default is put in the top of the figure. The position of the text can be changed by dragging the mouse while clicking on the text
with the left button. Clicking the right mouse over the text will bring up a menu to change the text properties.
Title/axis This routine provides a means of changing the title and axes labels of a plot. A window will appear looking like:
labels
16 of 20
11/23/07 06:03 PM
Extract
area
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Pressing the "Apply" button will update all labels immediately. The "Refresh" is used for updating the text labels currently written in this window to the labels in
the current plot (useful when having this window opened continously).
Allows extracting part of the current spectrum by mouse selection. Dragging a box using the mouse will define the limits. A window will appear for
confirmation. Input is done in the unit of the axis vectors.
This function is used to make a contour plot of the current spectrum while cutting away certain areas. An input window will appear looking like:
Define cut
limits
Ranges in both TD1 and TD2 must be specified in pairs of coordinates in the unit of the axis vectors, defining the beginning and end of a range. A new variable
"QmatNMR.Spec2D3DCutSpectrum" will be generated, which can then be used as input to any of the various plot types.
In total this determines the ranges in both dimensions of the spectrum. A new matrix will be generated, using the current matrix, consisting only of the desired
areas. An arbitrary number of ranges may be specified for each dimension. In the plot separation lines will be plotted which look is depending on the linespec
that can be given in the input window. By default a dotted white line is drawn. Tickmarks can also be specified for each dimension separately.
It is often most efficient to make a low-quality plot of a spectrum, zoom into the region of interest and then replot it in high quality. This function allows to do
Define
so, by creating a new variable "QmatNMR.Spec2D3DDefinePlot" with the zoomed-in part of the spectrum and the axes. This variable may then be used as input
plot limits for the subsequent plotting action.
17 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
Get
position
Like the "Get Position" routine in the main window (see paragraph 5.1, "General Appearance") this routine provides a means of scanning the matrix. The
coordinates in both dimensions for the position of the crosshair and the intensity is shown on screen. Note that the intensity is only valid for the last plotted
spectrum. The coordinates should always be correct though!
Get
integral
Allows for getting the absolute integral of a designated part of the spectrum. The range must be specified using the mouse (drag a box using the left mouse
button). The sum intensity over the specified region of the spectrum is given in the MATLAB main window (MATLAB prompt).
Set
integral
Allows for setting the absolute integral of the entire spectrum. A range must be specified using either the mouse (drag a box using the left mouse button) or
the input window. Input of the coordinate ranges is given in the unit of the axis vectors. The sum intensity over the specified region of the spectrum is set to
the integral value given in the input window.
Create
CPMs
Allows the creation of Conditional Probability Matrices (CPMs) from crosspeaks in 2D NMR spectra. For a description of the idea please see the paper JACS 127
(2005), 4466-4475. By selecting the area of a crosspeak, using the left mouse button, the CPMs are defined in a new window. The new window will show the
selected area, the projections onto both axes and the corresponding CPMs. Before starting one must define a lower threshold and the number of contours used
in the plots of the CPMs. For best results use a low threshold, e.g. 1%, and many contours, e.g. 25.
NOTE 1: the inherent numerical instability of CPMs makes it necessary to limit the selected region to fit closely around the peak. Areas that contain much noise
will invariably produce lots of artefacts in the CPMs.
NOTE 2: should the routine fail to produce nice plots, typically caused by numerical instabilities, then it is foreseen that the CPMs are replotted manually.
Directly after making a CPM, click on the corresponding axis that needs to be replotted. Then make a plot in the normal way, for CPMs typically a relative
contour plot. The axis vectors for the CPMs are called QmatNMR.CPMvec1 (TD2) and QmatNMR.CPMvec2 (TD1), whilst the CPMs themselves are called
QmatNMR.CPM1 and QmatNMR.CPM2. Thus the plots can be redrawn at will.
NOTE 3: the super title that is drawn in the window by default can, as usual, be edited by right-clicking on it!
Peak
picking
MatNMR offers a simple (but limited) peak picking routine. Basically peaks can be specified and the coordinates and intensities belonging to these peaks are
stored in a list. The variable used by matNMR is QmatNMR.PeakList. Peak lists are saved in the structure (for more information see paragraph 3.5, "matNMR
format for spectra") that contains either a spectrum or an FID. When redrawing a spectrum matNMR will detect the peak list and redraw the lines between and
labels for all peaks. Lines can be deleted at any point by clicking the left mouse button on them. Text labels can be changed by clicking the left mouse button
on them.
There are two peak picking modes: one which just detects the peaks and puts a text label near the peak and one in which also lines are drawn between
consecutive peaks. Whether or not a line must be drawn between two peaks is also stored in the list. Peaks are selected by dragging a box, using the left
mouse button, over a region in the spectrum in which the peak is situated. Depending on the search specifications a peak is detected and added to the list.
Clicking the middle mouse button will remove the last entry of the peak list. Using the "clear list" entry from the menubar will delete the entire list. Peak picking
will stay active until it is stopped by clicking the right mouse button. It can be activated again at any time and new peaks will just be appended to the list.
The peak list can be connected to either a structure variable in the workspace (note that if the designated variable is not already a structure it will be turned
into one) or an ASCII file on disk.
Peak picking also works after the "Cut contour plot" function has been executed. Furthermore when a contour plot contained a peak list at the time that the
"Cut contour plot" was executed, it will be redrawn into the sliced plot properly. Changing the axis vectors, using the "Axis rulers" option will also not affect the
peak list as long as axis vectors with linear increments are used. The coordinates in the peak list will be transformed to the corresponding coordinates in the
units of the new axis vectors.
The rest of this menu consists of various axis properties. More explanation concerning these can be found in the MATLAB documentation. Note the difference between
Direct
changing plot properties using this menu and by changing the properties using the options menu (see also paragraph 2.2, "Setting up matNMR"): changes made with these
Manipulations functions only affect the current plot and not the general matNMR settings.
18 of 20
Function
This routine shows the processing history for the current spectrum (either 1D or 2D). A window will appear looking like:
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
The "Print" button allows to print the history to a printer or to disk. A separate window will be opened in which the history is plotted as graphical text (Unfortunatelt this is
necessary because it is much more difficult to print text in UI-controls than graphical text in MATLAB).
Start recording
macro
Starts the recording of a new plotting macro (see also paragraph 4.4, "Using macro's").
Stop recording
macro
Stop the recording of a macro. An input window will appear to ask for a name of a variable in the workspace to store the new macro in. (see also paragraph 4.4, "Using
macro's")
Execute macro
This routine executes a macro. (see also paragraph 4.4, "Using macro's")
Execute macro
stepwise
This routine executes a macro stepwise. The same window as used for "Reprocess from history stepwise" (see above) will appear .
19 of 20
11/23/07 06:03 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/2D3DVi...
The menubar of this new window contains the standard MATLAB menubar which has some useful features for printing and saving the figure. It also offers the possibility to change axis
properties and stuff (More information on this menubar can be found in the MATLAB documentation). Additional features in the menubar are the MATLAB zoom and rotate3D functions, the
matNMR "Get Position" (for more information see paragraph 5.1, "General appearance") and the printing menu (for more information see paragraph 7.1, "Printing menu").
6.3.6 Options
This menu contains a subset of matNMR properties that can be changed as for the 2D/3D Viewer not all menus are needed. Please use the menu in the main window for changing all other
options. This menu allows changing the default settings of the screen settings and the text properties in matNMR as is described in detail in paragraph 2.2, "Setting up matNMR (options)".
6.3.7 Help
Besides the simple "About matNMR" and "Copyright" notices this contains a direct link to this manual from inside MATLAB. The browser, defined in the $matlabroot/toolbox/local/docopt.m
file, will be opened and the matNMR manual will appear (See the MATLAB documentation for more information on the MATLAB web and docopt commands). As the manual is included in the
matNMR distribution reading the manual should be faster than using the matNMR website.
20 of 20
11/23/07 06:03 PM
1 of 2
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/matNMR...
Selection of the appropriate output device and, optionally, other features will change the command line that is displayed in the bottom of the figure window. After the
appropriate selection usually a file name is required and this must be written at the end of the print command, separated by a blanc space. Only when using then "-P" option, for
direct printing to a printer under UNIX, must the name of the printer device be attached, e.g. -Pvpp_phaser750. Note that any text that is typed into the print command line will
be removed again when changing a selection (using the UI-controls).
02/28/07 05:45 PM
2 of 2
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/matNMR...
The specified paper type and orientation override any current setting for the window that needs to be printed. Plots from default matNMR windows should be centered on the
printed page. The button "enforce WYSIWYG" tries to obtain what-you-see-is-what-you-get behaviour, i.e. make a plot that looks exactly like the window looks on the screen. In
case the absolute size of the window is bigger than the paper size the window will be resized before plotting. As this does not work perfectly in all cases a warning message will
be issued. This states that it is better to resize the window by the given amount yourself. Printing the smaller window should then be really WYSIWYG (at least as far as MATLAB
allows). For more information see paragraph 3.8, MATLAB and WYSIWIG.
When the print command line is as desired press the "Print" button to execute the command. The figure window is moved into the background and will appear back
unchanged when starting the printing menu again.
This menu can also be called from the MATLAB command line by typing "matprint". The routine will assume the current figure as the one to be printed so be sure to make the
figure of interest the current figure (for more information on the MATLAB figure command see the MATLAB documentation).
02/28/07 05:45 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Offline.h...
matNMRReadBinaryFID
matNMRReadBrukerSpectra
matNMRReadSIMPSONASCII
matNMRTranspose
1D Processing
matNMRApodize1D
matNMRBaselineCorrection1D
matNMRConcatenate1D
matNMRConvertBrukerqseq1D
matNMRDCcorr1D
matNMRExtract1D
matNMRFlip1D
matNMRFT1D
matNMRLeftShift1D
matNMRLP1D
matNMRRegridSpectrum1D
matNMRRemoveBrukerDigitalFilter1D
matNMRSetPhase1D
matNMRSetSize1D
matNMRSolventSuppression1D
matNMRSwapEcho1D
2D Processing
matNMRApodize2D
matNMRConcatenate2D
matNMRConvertBrukerqseq2D
matNMRConvertEAE2D
matNMRConvertStates2D
matNMRDCcorr2D
matNMRExtract2D
matNMRFlip2D
matNMRFT2D
matNMRLeftShift2D
matNMRLP2D
matNMRRegridSpectrum2D
matNMRRemoveBrukerDigitalFilter2D
matNMRSetPhase2D
matNMRSetSize2D
matNMRShearingTransformationFD
matNMRShearingTransformationTD
matNMRSolventSuppression2D
matNMRSymmetrize2D
matNMRSwapEcho2D
The names should be self-explanatory in terms of what the functions do. The syntax for each function can be obtained by typing help "Name Function" in the Matlab command
window. This should provide ample information. All the above-mentioned routines operate on matrices only and not on (matNMR) structures! In most cases, processing of hypercomplex
matrices is not supported in the sense that both matrices cannot be entered at the same time, but must be called sequentially from the user-defined script.
It is possible to convert macros to scripts directly from the GUI. This currently only works for 1D actions but this will soon be extended to 2D actions as well.
Note that although most things can be done this way, baseline correction is not (yet) supported as this requires input of peak positions in matNMR. Furthermore, no spectral information is
maintained by these functions.
Finally, an additional way of using matNMR in user-defined scripts is to record processing and/or plotting macro's, which can then be called by the function matNMRRunMacro. Again, the
syntax to this function can be called by typing help matNMRRunMacro in the Matlab command window. This function does require matNMR windows to be open but doesn't rely on
user input whilst processing, i.e. even though changes are made to the matNMR windows they may be hidden from view. This function can be used to either process a spectrum using a
macro, OR to execute a plotting macro on the current window.
Here's an example of how one could use matNMRRunMacro in a script:
%
%example how to use matNMRRunMacro:
%
%This file loads all files from the current directory with names Epsilon$#$ where $#$ is a range from 0 to 90.
%The FIDs are then processed by macro "m" which was saved in file "Macro.mat". The output variable is called "Spec".
%
1 of 2
MacroFile = 'Macro';
MacroName = 'm';
Range = 0:90;
11/23/07 06:04 PM
file:///home3/jabe/matlab/matNMRSourceCode/WebPages/manual/Offline.h...
2 of 2
11/23/07 06:04 PM