• RSK
  • data : structure containing the data to be added


  • channel : name of the added channel, default is 'unknown'
  • unit : unit of the added channel, default is 'unknown'


  • RSK

This function adds a new channel with defined channel name and units. If the new channel already exists in the RSK structure, it will overwrite the old one.

The data for the new channel must be stored in a field of newChan called "values" (i.e., newChan.values).  If the data is arranged as profiles in the RSK structure, then newChan must be a 1xN array of structures of where N = length(

The code block below shows an example for using RSKaddchannel:

% In this example we compute Absolute Salinity and add it to the RSK structure
% using the TEOS-10 GSW function "gsw_SP_from_C".

p = getchannelindex(RSK,'sea pressure');
sp = getchannelindex(RSK,'salinity');
ncast = length(;
sa = repmat(struct('values',[]),1,ncast);

for k = 1:ncast,
	sa(k).values = gsw_SA_from_SP(,sp),,p),-150,49);

RSK = RSKaddchannel(RSK,'data',sa,'channel','Absolute Salinity','unit','g/kg');