nucspinkeep

Removes nuclear spins from a spin system.

Syntax
NewSys = nucspinkeep(Sys,keepidx)
Description

This function removes one or more nuclear spins from the spin system Sys and returns the resulting spin system in NewSys.

keepidx specifies the indices of the nuclei to keep. All other nuclei are removed. E.g., keepidx=3 indicates to keep the third nucleus and remove all others, and keepidx=[2 4] indicates to keep the second and the fourth nuclei.

Examples

First we define a spin system with 4 nuclei

Sys = struct('S',1/2,'g',[2 2 2.2]);
Sys.Nucs = '1H,1H,13C,13C';
Sys.A = [5 6 12; 4 4 2; 1 0.6 1.4; -0.3 0.5 0.1];

The following keeps only the protons and removes the 13C nuclei:

Sys = nucspinkeep(Sys,[1 2])
See also

spin system structures, nucspinadd, nucspinrmv