File: MakeItS.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (29 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function S = MakeItS(wls)
% S = MakeItS(wls)
%
% If argument is a [start delta n] description, it is
% left alone.
%
% If passed length is not a [start delta n] description,
% convert it to one.  Formats handled are a list of evenly
% spaced wavelengths or a struct with fields start, step, numberSamples.
%
% Format error checking could be more agressive.
%
% 7/26/02  dhb  Allow struct format too.

% Force passed description to S format.
[m,n] = size(wls);
if (isstruct(wls))
	S = [wls.start wls.step wls.numberSamples];
elseif (m == 1 && n == 3)
  if (wls(1) >= 0 && wls(3) > 0)
    S = wls;
  else
    error('Passed wls is not interpretable');
  end
else
  S = WlsToS(wls);
end