100+ results for 'Inputfile: lang:MATLAB'

Not the results you expected?

legend.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 200 lines

80 ## * rebuild help message

81 ## 2003-06-12 Quentin Spencer

82 ## * add support for input in cell array format

83 ## 2005-01-11 Teemu Ikonen

84 ## * modify to support Grace

ft_datatype_freq.m (http://open-realtime-fmri.googlecode.com/svn/trunk/) MATLAB · 98 lines

71 % $Id: ft_datatype_freq.m 3029 2011-03-01 20:54:20Z roboos $

72

73 % get the optional input arguments, which should be specified as key-value pairs

74 version = keyval('version', varargin); if isempty(version), version = 'latest'; end

75

testCalCC.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 112 lines

16 spd = nan(101, size(requested,1));

17 CMCheckInit(1, 'USA19H')

18 input('Press <Enter> to continue');

19

20 %set up the monitor

subplot.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 186 lines

24 ## given by index (there are @var{cols} by @var{rows} subwindows).

25 ##

26 ## Input:

27 ##

28 ## @table @var

98

99 if (! (isscalar (rows) && rows >= 0))

100 error ("subplot: input rcn has to be a positive scalar");

101 endif

102

dXPMDHID.m (http://dotsx.googlecode.com/svn/trunk/) MATLAB · 1 lines

1 function [p_, attributes_, batchMethods_] = dXPMDHID(num_objects) % function [p_, attributes_, batchMethods_] = dXPMDHID(num_objects) % % Constructor method for class dXPMDHID % works with PMD-1208FS/USB-1208FS USB/HID digital-analog converter box % % Input: % num_objects ... ignored -- always creates just one % % Output: % p_ ... created object % attributes_ ... default object attributes % batchMethods_ ... methods that can be run in a batch (e.g., draw) % dependencies_ ... not used % Copyright 2005 by Joshua I. Gold % University of Pennsylvania global ROOT_STRUCT % look for mex function available = exist('HIDx'); % return empty matrix if not available, which % will automatically remove PMDHID devices from the ui queue % if called from rInit if isfield(ROOT_STRUCT, 'dXPMDHID') || ~available p_ = []; attributes_ = []; batchMethods_ = []; return end % how to find compatible device % the master device of the PMD-1208FS/USB-1208FS composite device HIDCriteria.manufacturer = 'MCC'; HIDCriteria.vendorID = 2523; HIDCriteria.productID = 130; HIDCriteria.totalElements = 89; % default channelizer: make one useless channel HIDChannelizer.gain = 1; HIDChannelizer.offset = 0; HIDChannelizer.high = nan; HIDChannelizer.low = nan; HIDChannelizer.delta = 0; HIDChannelizer.freq = 1; [resetReport, resetID] = formatPMDReport('Reset'); % default object attributes attributes = { ... % name type ranges(?) default 'available', 'boolean', [], available; ... 'active', 'boolean', [], false; ... 'FIRAdataType', 'string', [], 'PMDHIDData'; ... 'HIDClass', 'string', [], 'dXPMDHID'; ... 'HIDCriteria', 'struct', [], HIDCriteria; ... 'HIDChannelizer','struct', [], HIDChannelizer; ... 'HIDIndex', 'scalar', [], nan; ... 'HIDDeviceInfo','struct', [], []; ... 'HIDElementsInfo','struct', [], []; ... 'resetID', 'scalar', [], resetID; ... 'resetReport', 'uint8', [], resetReport;... 'loadID', 'scalar', [], []; ... 'loadReport', 'uint8', [], []; ... 'startID', 'scalar', [], []; ... 'startReport', 'uint8', [], []; ... 'stopID', 'scalar', [], []; ... 'stopReport', 'uint8', [], []; ... 'mappings', 'cell', [], []; ... 'startScanTime','auto', [], 0; ... 'offsetTime', 'auto', [], 0; ... 'default', 'auto', [], []; ... 'other', 'auto', [], []; ... 'checkList', 'auto', [], []; ... 'checkRet', 'auto', [], []; ... 'values', 'auto', [], []; ... 'recentVal', 'auto', [], 1}; % make an array of objects from structs made from the attributes p_ = class(cell2struct(attributes(:,4), attributes(:,1), 1), 'dXPMDHID'); % return the attributes, if necessary if nargout > 1 attributes_ = attributes; end % return list of batch methods if nargout > 2 batchMethods_ = {'reset', 'saveToFIRA', 'root', 'getJump'}; end

curlyh.m (http://slac-lucretia.googlecode.com/svn/trunk/) MATLAB · 40 lines

6 % SLAC-PUB-1193, "Evaluation of Synchrotron Radiation Integrals"

7 %

8 % Inputs:

9 %

10 % b = beta at entrance of magnet [meter]

gui_active.m (http://slac-lucretia.googlecode.com/svn/trunk/) MATLAB · 39 lines

1 function ret = gui_active(optional_input)

2 %

3 % gui_active - used to implement an abort function in a GUI

19

20 if (nargin > 0)

21 if (optional_input == -1)

22 drawnow;

23 if (~is_active)

26 else

27 prev_is_active = is_active;

28 is_active = optional_input;

29 if ((prev_is_active > 0) & (is_active == 0))

30 disp('operation aborted');

changeP.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 95 lines

37 return % 'on' and 'off' are no-ops in simulation mode

38 end

39 % for simulation case, change input beam momentum (dp required)

40 if (debug)

41 if (twoargs)

help_coord.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 74 lines

8 %

9 % HELP_COORD('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in HELP_COORD.M with the given input arguments.

11 %

12 % HELP_COORD('Property','Value',...) creates a new HELP_COORD or raises the

14 % applied to the GUI before help_coord_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to help_coord_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

zp2sos.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 137 lines

19 %% Convert filter poles and zeros to second-order sections.

20 %%

21 %% INPUTS:@*

22 %% @itemize

23 %% @item

irsa_jitsp.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 125 lines

22 ## @var{rfunc}

23 ##

24 ## Input:

25 ##

26 ## @var{Tm} : Scalar -- mean sampling period

model.m (https://code.google.com/p/bionetgen/) MATLAB · 273 lines

12 % = model( timepoints, species_init, parameters, suppress_plot )

13 %

14 % INPUTS:

15 % -------

16 % species_init : row vector of 10 initial species populations.

19 % suppress_plot : 0 if a plot is desired (default), 1 if plot is suppressed.

20 %

21 % Note: to specify default value for an input argument, pass the empty array.

22 %

23 % OUTPUTS:

34

35

36 %% Process input arguments

37

38 % define any missing arguments

test_nc_varput.m (http://m--pack.googlecode.com/svn/trunk/) MATLAB · 635 lines

296 input_data = [1:24];

297 input_data = reshape(input_data,6,4);

298 status = nc_varput ( ncfile, 'test_2D', input_data );

320 input_data = [1:20];

321 input_data = reshape(input_data,5,4);

322 status = nc_varput ( ncfile, 'test_2D', input_data, [0 0], [5 4] );

344 input_data = [1:20] - 5;

345 input_data = reshape(input_data,5,4);

346 status = nc_varput ( ncfile, 'test_2D', input_data, [1 0], [5 4] );

368 input_data = [1:6];

369 input_data = reshape(input_data,3,2);

370 status = nc_varput ( ncfile, 'test_2D', input_data, [0 0], [3 2], [2 2] );

393 input_data = [1:28];

394 input_data = reshape(input_data,7,4);

395 status = nc_varput ( ncfile, 'test_2D', input_data );

test_get_var_bad_param_datatype.m (http://m--pack.googlecode.com/svn/trunk/) MATLAB · 2459 lines

198 input_data = [1:1:len_y*len_x];

199 input_data = reshape ( input_data, len_y, len_x );

200

201 status = mexnc ( 'put_var_double', ncid, varid, input_data' );

test_put_var_bad_param_datatype.m (http://m--pack.googlecode.com/svn/trunk/) MATLAB · 2462 lines

198 input_data = [1:1:len_y*len_x];

199 input_data = reshape ( input_data, len_y, len_x );

200

201 status = mexnc ( 'put_var_double', ncid, varid, input_data' );

213 testid = 'Test 1';

214 try

215 [status] = mexnc ( 'put_var1_double', 'ncid', varid, [0 0], input_data' );

216 error_condition = 1;

217 end

229 testid = 'Test 2';

230 try

231 [status] = mexnc ( 'put_var1_float', 'ncid', varid, [0 0], input_data' );

232 error_condition = 1;

233 end

245 testid = 'Test 3';

246 try

247 [status] = mexnc ( 'put_var1_int', 'ncid', varid, [0 0], input_data' );

248 error_condition = 1;

249 end

AnalisisRegresion.m (http://tesis-matlab-estanques.googlecode.com/svn/trunk/) MATLAB · 813 lines

8 %

9 % ANALISISREGRESION('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in ANALISISREGRESION.M with the given input arguments.

11 %

12 % ANALISISREGRESION('Property','Value',...) creates a new ANALISISREGRESION or raises the

14 % applied to the GUI before AnalisisRegresion_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to AnalisisRegresion_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

plx_ad.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 135 lines

4 % [adfreq, n, ts, fn, ad] = plx_ad(filename, ch)

5 %

6 % INPUT:

7 % filename - if empty string, will use File Open dialog

8 % channel - 0 - based channel number

19

20 if(nargin ~= 2)

21 disp('2 input arguments are required')

22 return

23 end

whip_eig.m (git://github.com/moorepants/PhysicalParameters.git) MATLAB · 88 lines

69 z(519) = G*MG;

70 % Calculate the A matrix in x'' = Ax + Bu, the state vector is

71 % [q4 q7 u4 u7]' and the input vector is u=[T4 T7]'

72 A(1,1) = 0;

73 A(1,2) = 0;

wiremeasGui.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 656 lines

8 %

9 % WIREMEASGUI('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in WIREMEASGUI.M with the given input arguments.

11 %

12 % WIREMEASGUI('Property','Value',...) creates a new WIREMEASGUI or raises the

14 % applied to the GUI before wiremeasGui_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to wiremeasGui_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

reference_voltages.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 821 lines

8 %

9 % REFERENCE_VOLTAGES('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in REFERENCE_VOLTAGES.M with the given input arguments.

11 %

12 % REFERENCE_VOLTAGES('Property','Value',...) creates a new REFERENCE_VOLTAGES or raises the

14 % applied to the GUI before reference_voltages_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to reference_voltages_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

95 if isnan(temp)

96 set(hObject, 'String', 0);

97 errordlg('Input must be a number','Error');

98 end

99 handles.rv(1,3) = temp;

cal_settings.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 723 lines

8 %

9 % CAL_SETTINGS('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in CAL_SETTINGS.M with the given input arguments.

11 %

12 % CAL_SETTINGS('Property','Value',...) creates a new CAL_SETTINGS or raises the

14 % applied to the GUI before cal_settings_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to cal_settings_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

102 if isnan(temp)

103 set(hObject, 'String', 0);

104 errordlg('Input must be a number','Error');

105 end

106 handles.cal(1,2) = temp;

extDispersion_bpmSel.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 462 lines

8 %

9 % EXTDISPERSION_BPMSEL('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in EXTDISPERSION_BPMSEL.M with the given input arguments.

11 %

12 % EXTDISPERSION_BPMSEL('Property','Value',...) creates a new EXTDISPERSION_BPMSEL or raises the

14 % applied to the GUI before extDispersion_bpmSel_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to extDispersion_bpmSel_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

MonmerGUI.m (http://du-chem.googlecode.com/svn/trunk/) MATLAB · 1617 lines

8 %

9 % MONMERGUI('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in MONMERGUI.M with the given input arguments.

11 %

12 % MONMERGUI('Property','Value',...) creates a new MONMERGUI or raises the

14 % applied to the GUI before MonmerGUI_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to MonmerGUI_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

selenium-remoterunner.js (http://datanucleus-appengine.googlecode.com/svn/trunk/) JavaScript · 694 lines ✨ Summary

This JavaScript code is part of a Selenium WebDriver implementation, used to automate web browsers. It provides methods for simulating user interactions, such as keyboard and mouse events, and interacting with the browser’s native operating system. The code allows users to control the browser’s behavior, including key presses, releases, and movements, without directly manipulating HTML elements.

440 loggingForm.action = url;

441 loggingForm.target = "seleniumLoggingFrame";

442 var postedDataInput = document.createElement("input");

443 postedDataInput.type = "hidden";

444 postedDataInput.name = "postedData";

445 postedDataInput.value = dataToBePosted;

446 loggingForm.appendChild(postedDataInput);

447 document.body.appendChild(loggingForm);

448 loggingForm.submit();

583 Selenium.prototype.doAttachFile = function(fieldLocator,fileLocator) {

584 /**

585 * Sets a file input (upload) field to the file listed in fileLocator

586 *

587 * @param fieldLocator an <a href="#locators">element locator</a>

zielfunktionen.m (http://bohreroptimierung.googlecode.com/svn/trunk/) MATLAB · 411 lines

8 %

9 % ZIELFUNKTIONEN('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in ZIELFUNKTIONEN.M with the given input arguments.

11 %

12 % ZIELFUNKTIONEN('Property','Value',...) creates a new ZIELFUNKTIONEN or raises the

14 % applied to the GUI before zielfunktionen_OpeningFunction gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to zielfunktionen_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

gpibproto.m (https://code.google.com/p/ni-gpib-matlab-wrappers/) MATLAB · 180 lines

48 % extern int _stdcall ibdma ( int ud , int v );

49 fcns.name{fcnNum}='ibdma'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='int32'; fcns.RHS{fcnNum}={'int32', 'int32'};fcnNum=fcnNum+1;

50 % extern int _stdcall ibexpert ( int ud , int option , void * Input , void * Output );

51 fcns.name{fcnNum}='ibexpert'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='int32'; fcns.RHS{fcnNum}={'int32', 'int32', 'voidPtr', 'voidPtr'};fcnNum=fcnNum+1;

52 % extern int _stdcall ibeos ( int ud , int v );

Options.xaml.cs (https://htchome.svn.codeplex.com/svn) C# · 170 lines ✨ Summary

This C# code is for a Windows application’s options window, allowing users to configure settings such as autostart, enable glass, and language. It retrieves locale codes from a localization directory, updates registry values, and writes configuration files. The application also loads widget names into a list when the user clicks “Apply”.

7 using System.Windows.Data;

8 using System.Windows.Documents;

9 using System.Windows.Input;

10 using System.Windows.Media;

11 using System.Windows.Media.Imaging;

mdctv.m (http://aac-codec-matlab.googlecode.com/svn/) MATLAB · 49 lines

9 % matrix (N) of coefs is: yf = [y;-flipud(y)];

10 %

11 % x: input signal (can be either a column or frame per column)

12 % y: MDCT of x

13 %

t2r.m (http://slac-lucretia.googlecode.com/svn/trunk/) MATLAB · 56 lines

6 % (NOTE: Pn=[psix,betax,alphax,etax,etapx,psiy,betay,alphay,etay,etapy])

7 %

8 % INPUTs:

9 %

10 % E1 = energy at point 1 (GeV)

ellipse.m (http://slac-lucretia.googlecode.com/svn/trunk/) MATLAB · 56 lines

6 % 2x2 symmetric matrix "X", centered at the point (p,q).

7 %

8 % INPUTS:

9 %

10 % X: a 2x2 symmetric matrix which describes the ellipse as follows:

gXCMDnolevers_hardware.m (http://dotsx.googlecode.com/svn/trunk/) MATLAB · 121 lines

11 %

12 % The simple_demo task also uses the dXkbHID hardware device for checking

13 % keyboard inputs, but that device is automatically activated and

14 % configured by rInit.

15 %

55 arg_dXsound = { ...

56 'mute', mute, ...

57 'rawSound', {'Coin.wav', 'AOL_Hurt.wav'}, ...% scan 4 analog inputs (vs. ground) at 1000Hz

58 'gain', {.5, 2}};

59

61 %%%FOR USING LEVERS

62

63 % scan 4 analog inputs (vs. ground) at 1000Hz

64 % % mode = 1 means +/-10V

65 % chans = 8:11;

rgbplot.m (https://plplot.svn.sourceforge.net/svnroot/plplot) MATLAB · 34 lines

17 ## Plot color map.

18 ## rgbplot(MAP) plots a color map, i.e. an m-by-3 matrix which

19 ## is appropriate input for COLORMAP. The three columns of the

20 ## colormap matrix are plotted in red, green, and blue lines.

21

Temperature.m (http://freesteamplus.googlecode.com/svn/trunk/) MATLAB · 742 lines

236 error(nargchk(4, 7, nargin, 'struct'))

237 if ((nargin > 4) && (nargin < 7))

238 error('Therm:nargchk:improperNumberOfInputs','Improper number of input arguments.')

239 end

240 if strcmpi(prop1,'t')

308 error(nargchk(4, 7, nargin, 'struct'))

309 if ((nargin > 4) && (nargin < 7))

310 error('Therm:nargchk:improperNumberOfInputs','Improper number of input arguments.')

311 end

312 if strcmpi(prop1,'t')

380 error(nargchk(4, 7, nargin, 'struct'))

381 if ((nargin > 4) && (nargin < 7))

382 error('Therm:nargchk:improperNumberOfInputs','Improper number of input arguments.')

383 end

384 if strcmpi(prop1,'t')

squareform.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 96 lines

42 else

43 error ("squareform: cannot deal with a nonsquare, nonvector \

44 input");

45 endif

46 endif

MLP9_2_1.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 126 lines

72 mInput(:,1:nTestSets) = [];

73 mOutput(:,1:nTestSets) = [];

74 mTrainInput = mInput(:,1:nTrainSets);

75 mTrainOutput = mOutput(:,1:nTrainSets);

76

77 [mTrainInputN,cMeanInput,cStdInput] = prestd(mTrainInput);# standardize inputs

78

79 ## comments: there is no reason to standardize the outputs because we have only

82 # define the max and min inputs for each row

83 mMinMaxElements = min_max(mTrainInputN); % input matrix with (R x 2)...

84

85 ## define network

118 # % standardise input & output test data

119 [mTestInputN] = trastd(mTestInput,cMeanInput,cStdInput);

120 # % [mTestOutputN] = trastd(mTestOutput,cMeanOutput,cStdOutput);

121 # % define unused parameters to get E-variable of simulation

get_DR_corrs.m (http://slac-lucretia.googlecode.com/svn/trunk/) MATLAB · 165 lines

9 % Compute DR corrector currents (KL=BL/brho) from kicks

10 %

11 % INPUTs (opCode=1):

12 %

13 % opCode = 1 (I to KL conversion)

16 % fflag = (optional) if present and nonzero, fudge factors will be used

17 %

18 % INPUTs (opCode=2):

19 %

20 % opCode = 2 (KL to I conversion)

46 Ncorr=101;

47

48 % check input args

49

50 if (~exist('opCode','var'))

rc2ar.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 92 lines

5 % function [MX,PE] = rc2ar(RC);

6 %

7 % INPUT:

8 % RC reflection coefficients

9 %

16 % rc =MX(:,(1:K).*(2:K+1)/2);

17 %

18 % All input and output parameters are organized in rows, one row

19 % corresponds to the parameters of one channel

20 %

bspderiv.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 68 lines

22 % [dc,dk] = bspderiv(d,c,k)

23 %

24 % INPUT:

25 %

26 % d - degree of the B-Spline

dbget.pro (git://github.com/charleshull6/c_soft.git) Prolog · 104 lines ✨ Summary

The DBGET function searches a database for entries containing specified values of a given item. It takes an item name, values to search for, and optional parameters such as listin, SILENT, and FULLSTRING. The function returns a vector of entry numbers where the desired item values are found, along with the number of matches.

The DBGET function searches a database for entries containing specified values of a given item. It takes an item name, values to search for, and optional parameters such as listin, SILENT, and FULLSTRING. The function returns a vector of entry numbers where the desired item values are found, along with the number of matches.

13 ; list = dbget( item, values, [ listin ], /SILENT, /FULLSTRING )

14 ;

15 ; INPUTS:

16 ; item - Item name or number

17 ; values - scalar or vector containing item values to search for.

18 ;

19 ; OPTIONAL INPUTS:

20 ; listin - list of entries to be searched. If not supplied, or

21 ; set to -1, then all entries are searched

27 ; or many times in the database. Use the function DBMATCH if a

28 ; one to one correspondence is desired between VALUES and LIST.

29 ; OPTIONAL INPUT KEYWORDS:

30 ; /SILENT - If this keyword is set, then DBGET will not display

31 ; the number of entries found

inmcreator.m (git://pkgs.fedoraproject.org/apbs) MATLAB · 670 lines

8 %

9 % INMCREATOR('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in INMCREATOR.M with the given input arguments.

11 %

12 % INMCREATOR('Property','Value',...) creates a new INMCREATOR or raises the

14 % applied to the GUI before inmcreator_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to inmcreator_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

650 end

651 if strcmp(handles.bc, 'focusname.inm')==1

652 warndlg('The inputfile.inm was generated. Please type now the corresponding values for the coarse grid calculation and then press Generate Input Files again','!! Warning, Focus Boundary Condition !!')

653 handles.filename='focusname.inm';

654 guidata(hObject, handles);

savesurfpoly.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 228 lines

8 % date: 2007/11/21

9 %

10 % input:

11 % v: input, surface node list, dimension (nn,3)

12 % if v has 4 columns, the last column specifies mesh density near each node

13 % f: input, surface face element list, dimension (be,3)

14 % holelist: list of holes, each hole is represented by an internal point

15 % regionlist: list of regions, similar to holelist

circ_otest.m (http://sqwang-matlab.googlecode.com/svn/trunk/) MATLAB · 82 lines

10 % met, the latter is more powerful.

11 %

12 % Input:

13 % alpha sample of angles in radians

14 % [sz step size for evaluating distribution, default 1 degree

43 else

44 if length(alpha)~=length(w)

45 error('Input length does not match.')

46 end

47 w =w(:);

LogInDetails.m (http://stock-shock-source.googlecode.com/svn/trunk/) MATLAB · 151 lines

8 %

9 % LOGINDETAILS('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in LOGINDETAILS.M with the given input arguments.

11 %

12 % LOGINDETAILS('Property','Value',...) creates a new LOGINDETAILS or raises the

14 % applied to the GUI before LogInDetails_OpeningFunction gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to LogInDetails_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

ft_datatype_mvar.m (http://brainstream.googlecode.com/svn/trunk/) MATLAB · 107 lines

72 % $Id: ft_datatype_mvar.m 4715 2011-11-10 15:50:03Z roboos $

73

74 % get the optional input arguments, which should be specified as key-value pairs

75 version = ft_getopt(varargin, 'version', 'latest');

76

gacreationuniform.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 53 lines

18 ## Create a random initial population with a uniform distribution.

19 ##

20 ## @strong{Inputs}

21 ## @table @var

22 ## @item GenomeLength

bwarea.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 58 lines

38

39 if (!isbw(bw))

40 error("input image muste be either binary or gray scale.\n");

41 endif

42

odeexamples.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 54 lines

34 ' (4) Open the DDE examples menu\n', ...

35 '\n']);

36 vfam = input ('Please choose a number from above or press <Enter> to return: ');

37 switch (vfam)

38 case 1

cheb1ord.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 150 lines

48 T = 2;

49

50 ## returned frequency is the same as the input frequency

51 Wc = Wp;

52

random.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 172 lines

110

111 function retval = random(name, varargin)

112 ## General input checking

113 if (nargin < 2)

114 print_usage();

115 endif

116 if (!ischar(name))

117 error("random: first input argument must be a string");

118 endif

119

TimeCourse.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 117 lines

9 disp('Turn on Photometer and hit <return>');

10 disp('Then focus on white square and hit <return> again');

11 input('');

12 PR650init(1,0);

13

20 Screen('Flip',window);

21

22 input('');

23 pause(2);

24 Rspd = []; Gspd = []; Bspd = []; Whitespd = []; timevect = [];

ccdPowerInstruction.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 78 lines

8 %

9 % CCDPOWERINSTRUCTION('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in CCDPOWERINSTRUCTION.M with the given input arguments.

11 %

12 % CCDPOWERINSTRUCTION('Property','Value',...) creates a new CCDPOWERINSTRUCTION or raises the

14 % applied to the GUI before ccdPowerInstruction_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to ccdPowerInstruction_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

ft_datatype_source.m (http://open-realtime-fmri.googlecode.com/svn/trunk/) MATLAB · 170 lines

73 % was really in 2007

74

75 % get the optional input arguments, which should be specified as key-value pairs

76 version = keyval('version', varargin); if isempty(version), version = 'latest'; end

77

filter_remove_color.m (http://twenties-video-filter.googlecode.com/svn/trunk/) MATLAB · 88 lines

9 % VIDEO = FILTER_REMOVE_COLOR(VIDEO, MODE) returns the original video structure

10 % with the updated current video.frame(1).filtered. Each filter takes

11 % video.frame(1).filtered as input and writes the result back to this array.

12 %

13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

StepDos.m (http://dccn-lab.googlecode.com/svn/trunk/) MATLAB · 169 lines

88 % http://www.mathworks.com/matlabcentral/newsreader/view_original/292759

89

90 set(SD.serobj, 'InputBufferSize', 1); % set read buffBuffer for read

91 set(SD.serobj, 'FlowControl', 'none'); %

92

aubt_getRWaves.m (http://siento.googlecode.com/svn/trunk/) MATLAB · 32 lines

1 function data_ = aubt_getRWaves (data, hz)

2 % Expects an ecg-signal as input and looks for

3 % its r-waves. The output is a pulse signal

4 % with 1 indicating a r-wave and 0 otherwise.

9 % data_ = aubt_getRWaves (data, hz)

10 %

11 % input:

12 % data: an ecg-signal

13 % hz: sample rate

filter_highcontrast.m (http://twenties-video-filter.googlecode.com/svn/trunk/) MATLAB · 58 lines

10 % VIDEO = FILTER_HIGHCONTRAST(VIDEO, DX, DY) returns the original video

11 % structure with the updated current video.frame(1).filtered. Each filter

12 % takes video.frame(1).filtered as input and writes the result back to this

13 % array.

14 %

sphfit.m (git://github.com/yuval-harpaz/ft_BIU.git) MATLAB · 116 lines

3 % usage: [center,radius]=sphfit(vc,Ni,stopth)

4 %

5 % input:

6 % vc nx3 matrix, where each row represents the location

7 % of one surface point. vc can have more than 3 columns

17 % written by Guido Nolte

18 % updated by Christophe Phillips, 2009/1/19

19 % - add the number of iterations as input, use 5 as default

20 % - add a stopping criteria based on the relative difference between 2

21 % successive estimates of the radius.

disperror.m (http://research-code-base-animesh.googlecode.com/svn/trunk/) MATLAB · 92 lines

3 % DISPERROR(DATA,CLASSF,ERROR,STD,FID)

4 %

5 % INPUT

6 % DATA Cell array of M datasets or dataset names (strings)

7 % CLASSF Cell array of N mappings or mapping names (strings)

history_subject1.m (git://github.com/yuval-harpaz/ft_BIU.git) MATLAB · 496 lines

15 S.saveorigheader = 0;

16 S.conditionlabel = {'Undefined'};

17 S.inputformat = [];

18 S.continuous = true;

19 D = spm_eeg_convert(S);

462 S.fsample = 200;

463 S.timeonset = 0;

464 S.inputformat = [];

465 S.pretrig = -100;

466 S.posttrig = 400;

Volume.m (http://freesteamplus.googlecode.com/svn/trunk/) MATLAB · 319 lines

149 error(nargchk(4, 7, nargin, 'struct'))

150 if ((nargin > 4) && (nargin < 7))

151 error('Therm:nargchk:improperNumberOfInputs','Improper number of input arguments.')

152 end

153 if strcmpi(prop1,'v')

173 error(nargchk(4, 7, nargin, 'struct'))

174 if ((nargin > 4) && (nargin < 7))

175 error('Therm:nargchk:improperNumberOfInputs','Improper number of input arguments.')

176 end

177 if strcmpi(prop1,'v')

197 error(nargchk(4, 7, nargin, 'struct'))

198 if ((nargin > 4) && (nargin < 7))

199 error('Therm:nargchk:improperNumberOfInputs','Improper number of input arguments.')

200 end

201 if strcmpi(prop1,'v')

mu2lin.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 85 lines

32 ## Adapted-By: jwe

33 ## Paul Kienzle <pkienzle@kienzle.powernet.co.uk>

34 ## handle [-1,1] input range

35

36 function y = mu2lin (x, bit)

panel_sound_devices.xml (https://bitbucket.org/lindenlab/viewer-beta/) XML · 26 lines

10 Dispositivo padrгo do sistema

11 </string>

12 <text name="Input">

13 Entrada

14 </text>

adjacency.m (http://uppsala-university.googlecode.com/svn/trunk/) MATLAB · 36 lines

1 function A=adjacency(I,n,k1)

2 %function A=adjacency(I,n,k1)

3 % Input: image (used for size only), n=L1 distance of neighbourhood, k1=distance decline factor

4 %

5 % Compute adjacency according to (2.8) in Udupa '96

quickT4_fit.m (http://dotsx.googlecode.com/svn/trunk/) MATLAB · 1 lines

1 function [fits_,sems_,stats_,preds_,resids_] = quickT4_fit(data,guess,lapse) % function [fits_,sems_,stats_,preds_,resids_] = quickT4_fit(data,guess,lapse) % % QUICKT4_FIT fits a weibull function to psychometric data using % maximum likelihood maximization. It uses quickT4_err for % error calculation. % % Input values are: % data, in 4 columns... % data(1) = coh (0 .. 99.9%) % data(2) = time (seconds) % data(3) = dot dir: left (-1) / right (1) % data(4) = correct (1) / error (0) % % Return values are: % fits_ ... see quickT3_val for details % fits_(1) ... A (coh scale) % fits_(2) ... n (coh exponent) % fits_(3) ... B (time scale) % fits_(4) ... m (time exponent) % fits_(5) ... guess (guess bias) % fits_(6) ... lapse ("lapse") % sems_ ... Standard errors of the fits. Approximated using the % numerical HESSIAN returned by fmincon (default) % stats_ ... [fitLLR Deviance p] % fitLLR is the log likelihood of obtaining the % data given the fit (returned by quick_err) % Deviance is 2(dataLLR - fitLLR) % p is probability from chi^2 pdf with df = #blocks-3 % preds_ ... A vector of the probability of making a correct choice given % the fit % resids_ ... col 1: log diff between model and actual outcomes % col 2: log diff between model and actual choices (see below) % Created by jig 9/14/05 if nargin < 1 || isempty(data) return end global Data Data = data; if nargin < 2 guess = []; end if nargin < 3 lapse = []; end %% do the fit if isempty(guess) && isempty(lapse) % fit both guess and lapse [fits_,f,e,o,l,g,H] = fmincon('quickT4_err', ... [ 0.05 0.5 2 0.1 0.0 0.0 ]', [], [], [], [], ... [ 0.001 0 0.01 0 -0.4 0.0 ]', ... [ 5 3 5 3 0.4 0.5 ]', [], ... optimset('LargeScale', 'off', 'Display', 'off', 'Diagnostics', 'off')); elseif isempty(guess) % fit both guess and lapse [fits,f,e,o,l,g,H] = fmincon('quickT4_err', ... [ 0.05 0.5 2 0.1 0.0 ]', [], [], [], [], ... [ 0.001 0 0.01 0 -0.45 ]', ... [ 5 3 5 3 0.45 ]', [], ... optimset('LargeScale', 'off', 'Display', 'off', 'Diagnostics', 'off'), ... [], lapse); fits_ = [fits; lapse]; elseif isempty(lapse) % fit both guess and lapse [fits,f,e,o,l,g,H] = fmincon('quickT4_err', ... [ 0.05 0.5 2 0.1 0.0 ]', [], [], [], [], ... [ 0.001 0 0.01 0 0.0 ]', ... [ 5 3 5 3 0.5 ]', [], ... optimset('LargeScale', 'off', 'Display', 'off', 'Diagnostics', 'off'), ... guess, []); fits_ = [fits(1:4); guess; fits(5)]; else % fit both guess and lapse [fits,f,e,o,l,g,H] = fmincon('quickT4_err', ... [ 0.05 0.5 2 0.1 ]', [], [], [], [], ... [ 0.001 0 0.01 0 ]', ... [ 5 3 5 3 ]', [], ... optimset('LargeScale', 'off', 'Display', 'off', 'Diagnostics', 'off'), ... guess, lapse); fits_ = [fits; guess; lapse]; end % Standard errors % The covariance matrix is the negative of the inverse of the % hessian of the natural logarithm of the probability of observing % the data set given the optimal parameters. % For now, use the numerically-estimated HESSIAN returned by fmincon % (which remember is computed from -log likelihood) if nargout > 1 % -H because we used -logL in quick_err sems_ = sqrt(diag(-((-H)^(-1)))); end % return stats if nargout > 2 % log likelihood of the fits ("M1" in Watson) % is just the negative of the error function M1 = -quickT4_err(fits_); % deviance is 2(M0 - M1), where % M0 is the log likelihood of the data ("saturated model") -- % which in this case is, of course, ZERO dev = -2*M1; % probability is from cdf if isempty(guess) && isempty(lapse) p = 1 - chi2cdf(dev, size(data, 1) - 6); elseif isempty(guess) || isempty(lapse) p = 1 - chi2cdf(dev, size(data, 1) - 5); else p = 1 - chi2cdf(dev, size(data, 1) - 4); end stats_ = [M1 dev p]; end % return the predicted probability (of a correct response) for each observation if nargout > 3 preds_ = quickT4_val(Data(:,1:end-1), fits_); end % return the deviance residuals ... these are the square roots % of each deviance computed individually, signed according to % the direction of the arithmatic residual y_i - p_i. % See Wichmann & Hill, 2001, "The psychometric function: I. Fitting, % sampling, and goodness of fit if nargout > 4 % resids on correct/error cepreds = preds_; cepreds(data(:, 4) == 0) = 1 - cepreds(data(:, 4) == 0); % choice resids are a little trickier - we have to % make predictions based on choice lrpreds = preds_; lrpreds(data(:, 3) == -1) = 1 - lrpreds(data(:, 3) == -1); choices = data(:, 3); choices(data(:, 4) == 0) = -choices(data(:, 4) == 0); % first column is c/e resids % second column is l/r resids resids_ = [ ... (data(:, 4).*2-1) .* sqrt(-2.*log(cepreds)), ... choices .* sqrt(-2.*log(lrpreds))]; end

bpsk.m (http://spreadspectrum.googlecode.com/svn/trunk/) MATLAB · 23 lines

19 msg = [msg -1]; %accumulate the value of output into msg

20 end

21 b=b+onebit; %update the value of b for the next input

22 c=c+onebit; %update the value of c for the next input

knn.m (http://princeton-mvpa-toolbox.googlecode.com/svn/trunk/) MATLAB · 36 lines

4 % Description

5 % NET = KNN(NIN, NOUT, K, TR_IN, TR_TARGETS) creates a KNN model NET

6 % with input dimension NIN, output dimension NOUT and K neighbours.

7 % The training data is also stored in the data structure and the

8 % targets are assumed to be using a 1-of-N coding.

10 % The fields in NET are

11 % type = 'knn'

12 % nin = number of inputs

13 % nout = number of outputs

14 % tr_in = training input data

rotateGUI.m (http://matlab-image-customizer.googlecode.com/svn/trunk/) MATLAB · 123 lines

8 %

9 % ROTATEGUI('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in ROTATEGUI.M with the given input arguments.

11 %

12 % ROTATEGUI('Property','Value',...) creates a new ROTATEGUI or raises the

14 % applied to the GUI before rotateGUI_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to rotateGUI_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

som_eucdist2.m (http://research-code-base-animesh.googlecode.com/svn/trunk/) MATLAB · 95 lines

10 % d=som_eucdist(datamatrix1, datamatrix2);

11 %

12 % Input and output arguments ([]'s are optional):

13 % D (matrix) size Nxd

14 % (struct) map or data struct

70 end

71

72 % Check that inputs are matrices

73 if ~vis_valuetype(proto,{'nxm'}) | ~vis_valuetype(data,{'nxm'}),

74 error('Prototype or data input not valid.')

set_option.m (http://lamp-solar.googlecode.com/svn/trunk/) MATLAB · 34 lines

6 % value = set_option(option_list,{option1,option2,option3})

7 %

8 %% Input

9 % option_list - Cell Array

10 % option - String

aubt_getSpecRange.m (http://siento.googlecode.com/svn/trunk/) MATLAB · 29 lines

1 function value = getSpecRange (data, hz, r1, r2)

2 % Expects as input a signal vector and estimates the mean of the frequency

3 % spectrum in a given range.

4 %

5 % values = aubt_getSpecRange (data, hz, r1, r2)

6 %

7 % input:

8 % data: signal vector

9 % hz: samplerate of the input signal(s)

aubt_detecPQST.m (http://siento.googlecode.com/svn/trunk/) MATLAB · 83 lines

1 function [pind, qind, sind, tind] = aubt_detecPQST (signal, hz, rind)

2 % Expects an ECG signal and a corresponding vector with the fiducial

3 % locations of the r-waves as input and tries to detected the position of the

4 % P and T waves and the Q and S peak. Therefore positive and negative peaks

5 % on both sides of each r location are seeked. To achieve better results

15 % [pind, qind, sind, tind] = aubt_detecPQST (signal, hz, rind)

16 %

17 % input:

18 % signal the ECG signal

19 % hz sample rate of the signal

dbwrt.pro (git://github.com/charleshull6/c_soft.git) IDL · 207 lines ✨ Summary

This IDL code is a function that updates an index database by inserting, updating, and sorting values based on user-provided data. It takes in various parameters such as the index type, data values, and byte sizes to determine how to update the index records. The function returns after completing the necessary operations.

This IDL code is a function that updates an index database by inserting, updating, and sorting values based on user-provided data. It takes in various parameters such as the index type, data values, and byte sizes to determine how to update the index records. The function returns after completing the necessary operations.

9 ; dbwrt, entry, [ index, append, /NoConvert ]

10 ;

11 ; INPUTS:

12 ; entry - entry record to be updated or added if first

13 ; item (entry number=0)

14 ;

15 ; OPTIONAL INPUTS:

16 ; index - optional integer flag, if set to non zero then index

17 ; file is updated. (default=0, do not update index file)

25 ; data base file is updated.

26 ; If index is non-zero then the index file is updated.

27 ; OPTIONAL INPUT KEYWORD:

28 ; NoConvert - If set then don't convert to host format with an external

29 ; database. Useful when the calling program decides that

outputfileFF.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 122 lines

8 %

9 % OUTPUTFILEFF('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in OUTPUTFILEFF.M with the given input arguments.

11 %

12 % OUTPUTFILEFF('Property','Value',...) creates a new OUTPUTFILEFF or raises the

14 % applied to the GUI before outputfileFF_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to outputfileFF_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

subplot.m (https://plplot.svn.sourceforge.net/svnroot/plplot) MATLAB · 118 lines

19 ## given by index (there are columns X rows subwindows)

20 ##

21 ## Input:

22 ##

23 ## rows : number of rows in subplot grid

62

63 if (! (isscalar (rows) && rows >= 0))

64 error ("subplot: input rcn has to be a positive scalar");

65 endif

66

base64encode.m (http://psychtoolbox-3.googlecode.com/svn/beta/Psychtoolbox/) MATLAB · 1 lines

1 function y = base64encode(x, eol) %BASE64ENCODE Perform base64 encoding on a string. % % BASE64ENCODE(STR, EOL) encode the given string STR. EOL is the line ending % sequence to use; it is optional and defaults to '\n' (ASCII decimal 10). % The returned encoded string is broken into lines of no more than 76 % characters each, and each line will end with EOL unless it is empty. Let % EOL be empty if you do not want the encoded string broken into lines. % % STR and EOL don't have to be strings (i.e., char arrays). The only % requirement is that they are vectors containing values in the range 0-255. % % This function may be used to encode strings into the Base64 encoding % specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The % Base64 encoding is designed to represent arbitrary sequences of octets in a % form that need not be humanly readable. A 65-character subset % ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per % printable character. % % Examples % -------- % % If you want to encode a large file, you should encode it in chunks that are % a multiple of 57 bytes. This ensures that the base64 lines line up and % that you do not end up with padding in the middle. 57 bytes of data fills % one complete base64 line (76 == 57*4/3): % % If ifid and ofid are two file identifiers opened for reading and writing, % respectively, then you can base64 encode the data with % % while ~feof(ifid) % fwrite(ofid, base64encode(fread(ifid, 60*57))); % end % % or, if you have enough memory, % % fwrite(ofid, base64encode(fread(ifid))); % % See also BASE64DECODE. % Author: Peter J. Acklam % Time-stamp: 2004-02-03 21:36:56 +0100 % E-mail: pjacklam@online.no % URL: http://home.online.no/~pjacklam % check number of input arguments error(nargchk(1, 2, nargin)); % make sure we have the EOL value if nargin < 2 eol = sprintf('\n'); else if sum(size(eol) > 1) > 1 error('EOL must be a vector.'); end if any(eol(:) > 255) error('EOL can not contain values larger than 255.'); end end if sum(size(x) > 1) > 1 error('STR must be a vector.'); end x = uint8(x); eol = uint8(eol); ndbytes = length(x); % number of decoded bytes nchunks = ceil(ndbytes / 3); % number of chunks/groups nebytes = 4 * nchunks; % number of encoded bytes % add padding if necessary, to make the length of x a multiple of 3 if rem(ndbytes, 3) x(end+1 : 3*nchunks) = 0; end x = reshape(x, [3, nchunks]); % reshape the data y = repmat(uint8(0), 4, nchunks); % for the encoded data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Split up every 3 bytes into 4 pieces % % aaaaaabb bbbbcccc ccdddddd % % to form % % 00aaaaaa 00bbbbbb 00cccccc 00dddddd % y(1,:) = bitshift(x(1,:), -2); % 6 highest bits of x(1,:) y(2,:) = bitshift(bitand(x(1,:), 3), 4); % 2 lowest bits of x(1,:) y(2,:) = bitor(y(2,:), bitshift(x(2,:), -4)); % 4 highest bits of x(2,:) y(3,:) = bitshift(bitand(x(2,:), 15), 2); % 4 lowest bits of x(2,:) y(3,:) = bitor(y(3,:), bitshift(x(3,:), -6)); % 2 highest bits of x(3,:) y(4,:) = bitand(x(3,:), 63); % 6 lowest bits of x(3,:) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Now perform the following mapping % % 0 - 25 -> A-Z % 26 - 51 -> a-z % 52 - 61 -> 0-9 % 62 -> + % 63 -> / % % We could use a mapping vector like % % ['A':'Z', 'a':'z', '0':'9', '+/'] % % but that would require an index vector of class double. % z = repmat(uint8(0), size(y)); i = y <= 25; z(i) = 'A' + double(y(i)); i = 26 <= y & y <= 51; z(i) = 'a' - 26 + double(y(i)); i = 52 <= y & y <= 61; z(i) = '0' - 52 + double(y(i)); i = y == 62; z(i) = '+'; i = y == 63; z(i) = '/'; y = z; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Add padding if necessary. % npbytes = 3 * nchunks - ndbytes; % number of padding bytes if npbytes y(end-npbytes+1 : end) = '='; % '=' is used for padding end if isempty(eol) % reshape to a row vector y = reshape(y, [1, nebytes]); else nlines = ceil(nebytes / 76); % number of lines neolbytes = length(eol); % number of bytes in eol string % pad data so it becomes a multiple of 76 elements y(nebytes + 1 : 76 * nlines) = 0; y = reshape(y, 76, nlines); % insert eol strings eol = eol(:); y(end + 1 : end + neolbytes, :) = eol(:, ones(1, nlines)); % remove padding, but keep the last eol string m = nebytes + neolbytes * (nlines - 1); n = (76+neolbytes)*nlines - neolbytes; y(m+1 : n) = ''; % extract and reshape to row vector y = reshape(y, 1, m+neolbytes); end % output is a character array y = char(y);

guineapig.m (http://slac-lucretia.googlecode.com/svn/trunk/) MATLAB · 142 lines

7 % charge information) and a GuineaPig "acc.dat" template file.

8 %

9 % INPUTs

10 %

11 % erfile = matLIAR (DIMAD) "electron" output rays file name

28 wdir='D:\guineapig\work'; % working directory

29

30 % make input filespecs DOS compatible

31

32 erfiled=strrep(erfile,'/','\'); % DOS format

65 % run Andrei's GuineaPig prep program

66

67 disp(' preparing GuineaPig input files ...')

68

69 cmd=[gdir,'\prepare_gp'];

ft_filter_event.m (git://github.com/yuval-harpaz/ft_BIU.git) MATLAB · 120 lines

45 % $Id: ft_filter_event.m 944 2010-04-21 16:08:12Z roboos $

46

47 % get the optional input arguments

48 type = keyval('type', varargin);

49 value = keyval('value', varargin);

colifilt.m (http://sparse-mri-reconstruction.googlecode.com/svn/trunk/) MATLAB · 98 lines

15 % odd filt on . a a a a b b b b b b b b a a a a

16 %

17 % The output is interpolated by two from the input sample rate and the results

18 % from the two filters, Ya and Yb, are interleaved to give Y.

19 % Symmetric extension with repeated end samples is used on the composite X

detrend.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 158 lines

67 t = [];

68 elseif ischar(X)

69 error('unknown 2nd input argument');

70 elseif all(size(X)==1),

71 p = X;

77 elseif (nargin == 3)

78 if ischar(X),

79 warning('input arguments are not supported');

80 end;

81

quaternion.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 115 lines

39 case(1)

40 if (! (isvector (w) && length (w) == 4))

41 error ("input vector must be of length 4)");

42 endif

43 ## extract data

103 endif

104 if (! (isscalar (w) && isscalar (x) && isscalar (y) && isscalar (z)))

105 error ("input values must be scalars");

106 endif

107 a = [w, x, y, z];

arfit2.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 100 lines

17 % Copyright (C) 1996-2002 by Alois Schloegl <a.schloegl@ieee.org>

18

19 %%%%% checking of the input arguments was done the same way as ARFIT

20 if (pmin ~= round(pmin) | pmax ~= round(pmax))

21 error('Order must be integer.');

odeprint.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 68 lines

18 %# -*- texinfo -*-

19 %# @deftypefn {Function} {@var{[ret]} =} odeprint (@var{t, y, flag})

20 %# Displays the results of the differential equations in the octave window while solving. The first column shows the actual time stamp, the following columns show the values of the solvers for each time stamp. The return value @var{ret} depends on the input value @var{flag}. If @var{flag} is the string "init" then nothing is returned, else if @var{flag} is empty then true (resp. value 1) is returned to tell the calling solver function to continue, else if @var{flag} is the string "done" then again nothing will be returned. The input arguments @var{t} and @var{y} are the actual time stamp and the solver output. This function is an odepkg plotter function that can be set with @command{odeset}, therefore this function should never be directly called by the user. No error handling has been implemented in this function to achieve the highest processing speed.

21 %#

22 %# Run

30

31 %# As in the definitions of initial value problems as functions and if

32 %# somebody uses event functions all input and output vectors must be

33 %# column vectors by now.

34 function [varargout] = odeprint (vt, vy, vflag, varargin)

35

36 %# No input argument check is done for a higher processing speed

37 %# vt and vy are always column vectors, see also function odeplot,

38 %# odephas2 and odephas3 for another implementation. vflag either

test_put_get_att.m (http://m--pack.googlecode.com/svn/trunk/) MATLAB · 395 lines

49 input_data = 3.14159;

50 status = mexnc ( 'put_att_double', ncid, varid, 'test_double', nc_double, 1, input_data );

51 if ( status < 0 )

52 ncerr = mexnc ( 'strerror', status );

74 if ( return_value ~= input_data )

75 err_msg = sprintf ( '%s: return value did not match input for [PUT,GET]_ATT_DOUBLE\n', mfilename );

76 error ( err_msg );

77 end

214 error ( err_msg );

215 end

216 if ( double(return_value) ~= double(input_data) )

217 err_msg = sprintf ( '%s: return value did not match input for [PUT,GET]_ATT_SHORT\n', mfilename );

331 input_data = 'It was a dark and stormy night. Suddenly a shot rang out.';

332 status = mexnc ( 'put_att_text', ncid, varid, 'test_char', nc_char, length(input_data), input_data );

333 if ( status < 0 )

334 ncerr = mexnc ( 'strerror', status );

psycho.m (http://aac-codec-matlab.googlecode.com/svn/) MATLAB · 151 lines

1 function [ T , P ] = psycho( frameT , frameType )

2 %PSYCHO Calculates the psychoacoustic thresholds and the energy spectrum

3 % Inputs: frameT : the frame array with the samples in time

4 % : the type of the frame

5 % Outputs: T: a <numberofbands X numberofchannels> matrix with the

istype.m (http://acq3.googlecode.com/svn/trunk/) MATLAB · 32 lines

11 % Date: January 25, 1999

12

13 % check input arguments

14

15 type_flag = 0;

circ_plot.m (http://sqwang-matlab.googlecode.com/svn/trunk/) MATLAB · 144 lines

4 % Plotting routines for circular data.

5 %

6 % Input:

7 % alpha sample of angles in radians

8 % [format specifies style of plot

CreateField.m (http://thesisyossim.googlecode.com/svn/) MATLAB · 101 lines

20 Grid.Length = 0.30;

21

22 % Parameters of the input laser beam

23 Laser.lambda = 1064e-9;

24 Laser.beam_radius = 0.0200;

27 Laser.power = 1;

28

29 Laser.amplitude = sqrt(Laser.power*2/(pi*Laser.beam_radius^2)); % Amplitude for TEM00 input beam

30 %--------------------- Cavity parameters ---------------------------

31

89 CreateMirror;

90

91 %------------------- Create input EM field ----------------------

92

93 Field.Start = complex(zeros(Grid.Num_point,Grid.Num_point,'double'));

__calcperf.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 111 lines

28

29 ## comment:

30 ## perf, net performance.. from input to output through the hidden layers

31 ## Aa, output values of the hidden and last layer (output layer)

32 ## is used for NEWFF network types

42

43 ## shortcuts

44 IWtemp = cell(net.numLayers,net.numInputs,1);# IW: input weights ...

45 LWtemp = cell(net.numLayers,net.numLayers,1);# LW: layer weights ...

46 Aa = cell(net.numLayers,1);# Outputs hidden and output layer

52 for iLayers = 1:net.numLayers

53

54 ## calculate first input weights to weighted inputs..

55 ## this can be done with matrix calculation...

56 ## called "dotprod"

tunstallcode.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 93 lines

34 ## @end example

35 ##

36 ## essentially you will use the cw_list to parse the input

37 ## and then compute the code as the binary value of their index

38 ## of match, since it is a variable to fixed code.

odepkg_equations_vanderpol.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 112 lines

21 %#

22 %# @deftypefnx {Function} {@var{ydot} =} odepkg_equations_vanderpol (@var{t, y})

23 %# Returns two derivatives of the ordinary differential equations (ODEs) from the "Van der Pol" implementation, cf. @url{http://en.wikipedia.org/wiki/Van_der_Pol_oscillator} for further details. The output argument @var{ydot} is a column vector and contains the derivatives, @var{y} also is a column vector that contains the integration results from the previous integration step and @var{t} is a scalar value with actual time stamp. There is a error handling implemented in this function, ie. if an unvalid input argument is found then this function terminates with an error.

24 %#

25 %# Run

44 if (nargin == 0)

45 help ('odepkg_equations_vanderpol');

46 vmsg = sprintf ('Number of input arguments must be greater than zero');

47 error (vmsg);

48

49 elseif (nargin < 2 || nargin > 3)

50 vmsg = sprintf ('Number of input arguments must be greater 1 and lower 4');

51 error (vmsg);

52

get_ATF2_sexts_I.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 144 lines

5 % Compute ATF2 sext currents from KLs and beam energy

6 %

7 % INPUTS:

8 %

9 % KL = sext KLs (1/m^2) [5 element array]

22 Nsext=5;

23

24 % check input args

25

26 if (nargin<2)

27 error('At least 2 input arguments required')

28 end

29 if (length(KL)~=Nsext)

test_nc_datatype_string.m (http://m--pack.googlecode.com/svn/trunk/) MATLAB · 229 lines

2 % TEST_NC_DATATYPE_STRING:

3 %

4 % Bad input argument tests.

5 % Test 1: no inputs

6 % Test 2: two inputs

7 % test 3: input not numeric

8 % test 4: input is outside of 0-6

9 %

10 % These tests should succeed

11 % test 5: input is 0 ==> 'NC_NAT'

12 % test 6: input is 1 ==> 'NC_BYTE'

binsurface.m (http://brainstream.googlecode.com/svn/trunk/) MATLAB · 92 lines

7 % author: Qianqian Fang, <fangq at nmr.mgh.harvard.edu>

8 %

9 % input:

10 % img: a 3D binary image

11 % nface: nface=3 or ignored - for triangular faces,

gamutCheck.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 91 lines

10 % fit inside the gamut.

11 %

12 % INPUT

13 % bkgndrgb: RGBs of the background in normalized intensity units

14 % cc: Cone contrast desired (direction and amplitude)

mkbasis.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 55 lines

6 % onto 2-D linear subspaces.

7 %

8 % INPUT

9 % in: A column matrix of vectors that span the subspace

10 % of interest.

11 % opt: Option flag that specifies operations to be

12 % performed on the input vectors

13 % 'RotOrtho': Rotate columns [2:end] so that

14 % they are orthogonal to column 1

15 % 'ProjOrtho': If called with a three column

16 % input matrix - returns the linear combination

17 % of the 2nd and 3rd input columns that is orthogonal

18 % to the first input column.

19 %

20 % If the 'opt' field is left blank, we just scale

prodc.m (http://research-code-base-animesh.googlecode.com/svn/trunk/) MATLAB · 59 lines

4 % W = V*PRODC

5 %

6 % INPUT

7 % V Set of classifiers trained on the same classes

8 %

18 %

19 % If it is desired to operate on posterior probabilities, then the

20 % input classifiers should be extended like V = V*CLASSC.

21 %

22 % The base classifiers may be combined in a stacked way (operating

subplot.m (https://plplot.svn.sourceforge.net/svnroot/plplot) MATLAB · 128 lines

24 ## given by index (there are columns X rows subwindows)

25 ##

26 ## Input:

27 ##

28 ## rows : number of rows in subplot grid

72

73 if (! (is_scalar (rows) && rows >= 0))

74 error ("subplot: input rcn has to be a positive scalar");

75 endif

76

tokenize.m (git://github.com/yuval-harpaz/ft_BIU.git) MATLAB · 77 lines

39 % $Id: tokenize.m 1388 2010-07-10 09:12:47Z roboos $

40

41 % these are for remembering the type on subsequent calls with the same input arguments

42 persistent previous_argin previous_argout

43

69 end

70

71 % remember the current input and output arguments, so that they can be

72 % reused on a subsequent call in case the same input argument is given

timeZoneGui.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 141 lines

8 %

9 % TIMEZONEGUI('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in TIMEZONEGUI.M with the given input arguments.

11 %

12 % TIMEZONEGUI('Property','Value',...) creates a new TIMEZONEGUI or raises the

14 % applied to the GUI before timeZoneGui_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to timeZoneGui_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

olgd.m (http://pmtksupport.googlecode.com/svn/trunk/) MATLAB · 183 lines

5 % [NET, OPTIONS, ERRLOG, POINTLOG] = OLGD(NET, OPTIONS, X, T) uses on-

6 % line gradient descent to find a local minimum of the error function

7 % for the network NET computed on the input data X and target values T.

8 % A log of the error values after each cycle is (optionally) returned

9 % in ERRLOG, and a log of the points visited is (optionally) returned

meandev.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 81 lines

46

47

48 % check input arguments

49

50 if nargin==1,

delete_sst.m (http://seismic-event-matlab-suite.googlecode.com/svn/trunk/) MATLAB · 56 lines

6 % sst = delete_sst(sst,t1,t2,method)

7 %

8 %INPUTS: sst -->

9 % t1 -->

10 % t2 -->

15 method = 0; % default method: 'split'

16 if nargin < 3

17 error('DELETE_SST: Too few input arguments')

18 elseif nargin > 4

19 error('DELETE_SST: Too many input arguments')

nethess.m (http://pmtksupport.googlecode.com/svn/trunk/) MATLAB · 31 lines

5 %

6 % H = NETHESS(W, NET, X, T) takes a weight vector W and a network data

7 % structure NET, together with the matrix X of input vectors and the

8 % matrix T of target vectors, and returns the value of the Hessian

9 % evaluated at W.

rbfjacob.m (http://pmtksupport.googlecode.com/svn/trunk/) MATLAB · 51 lines

1 function jac = rbfjacob(net, x)

2 %RBFJACOB Evaluate derivatives of RBF network outputs with respect to inputs.

3 %

4 % Description

6 % of input vectors X and returns a three-index matrix G whose I, J, K

7 % element contains the derivative of network output K with respect to

8 % input parameter J for input pattern I.

9 %

10 % See also

calib_find.m (http://atf2flightsim.googlecode.com/svn/trunk/) MATLAB · 115 lines

8 %

9 % CALIB_FIND('CALLBACK',hObject,eventData,handles,...) calls the local

10 % function named CALLBACK in CALIB_FIND.M with the given input arguments.

11 %

12 % CALIB_FIND('Property','Value',...) creates a new CALIB_FIND or raises the

14 % applied to the GUI before calib_find_OpeningFcn gets called. An

15 % unrecognized property name or invalid value makes property application

16 % stop. All inputs are passed to calib_find_OpeningFcn via varargin.

17 %

18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one

ft_datatype_spike.m (http://open-realtime-fmri.googlecode.com/svn/trunk/) MATLAB · 105 lines

74

75

76 % get the optional input arguments, which should be specified as key-value pairs

77 version = keyval('version', varargin); if isempty(version), version = 'latest'; end

78

AddField.m (http://stock-shock-source.googlecode.com/svn/trunk/) MATLAB · 36 lines

2 %Add a new field to a table

3 %

4 %INPUTS:

5 % TableName: Name of the table you would like to add a field.

6 % Fieldname: Fieldname you want to add.

boot2ci.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 61 lines

3 % This funtion will accept neurometric and psychometric data and create

4 % confidence intervals for the threshold ratio(s) via nonparametric

5 % bootstrap. The first three input arguments are created by DTmocsUnpack.m.

6 % "confInterval" should be a percentage between 0 and 1;

7 %

subdir.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 111 lines

6 % files = subdir(...)

7 %

8 % This function performs a recursive file search. The input and output

9 % format is identical to the dir function.

10 %

11 % Input variables:

12 %

13 % name: pathname or filename for search, can be absolute or relative

gpfwd.m (http://pmtksupport.googlecode.com/svn/trunk/) MATLAB · 53 lines

4 % Description

5 % Y = GPFWD(NET, X) takes a Gaussian Process data structure NET

6 % together with a matrix X of input vectors, and forward propagates

7 % the inputs through the model to generate a matrix Y of output

8 % vectors. Each row of X corresponds to one input vector and each row

9 % of Y corresponds to one output vector. This assumes that the

10 % training data (both inputs and targets) has been stored in NET by a

32

33 if ~(isfield(net, 'tr_in') & isfield(net, 'tr_targets'))

34 error('Require training inputs and targets');

35 end

36

ft_volumereslice.m (http://brainstream.googlecode.com/svn/trunk/) MATLAB · 113 lines

16 %

17 % Undocumented local options:

18 % cfg.inputfile = one can specifiy preanalysed saved data as input

19 % cfg.outputfile = one can specify output as file to save to disk

20

45 if ~isfield(cfg, 'resolution'); cfg.resolution = 1; end % in physical units

46 if ~isfield(cfg, 'downsample'); cfg.downsample = 1; end

47 if ~isfield(cfg, 'inputfile'), cfg.inputfile = []; end

48 if ~isfield(cfg, 'outputfile'), cfg.outputfile = []; end

49

53 % the input data should be read from file

54 if hasdata

55 error('cfg.inputfile should not be used in conjunction with giving input data to this function');

56 else

57 mri = loadvar(cfg.inputfile, 'data');

dXdots.m (http://dotsx.googlecode.com/svn/trunk/) MATLAB · 1 lines

1 function [ds_, attributes_, batchMethods_] = dXdots(num_objects) % function [ds_, attributes_, batchMethods_] = dXdots(num_objects) % % Constructor method for class dots % Input: % num_objects ... number of objects to create % % Output: % ds_ ... array of created dots % attributes_ ... default object attributes % batchMethods_ ... methods that can be run in a batch (e.g., draw) % Copyright 2004 by Joshua I. Gold % University of Pennsylvania % get screen values [wn, sr, ppd, fr] = rGraphicsGetScreenAttributes; % default object attributes attributes = { ... % name type values default 'coherence', 'scalar', [], 51.2; ... % pct 'direction', 'scalar', [], 0; ... % deg 'speed', 'scalar', [], 8.0; ... % deg/sec 'seed', 'array', [], []; ... % [base coh*dir] 'size', 'scalar', [], 3; ... % pixels 'color', 'array', [], [1 1 1]*255;... % [r,g,b] 'bgColor', 'array', [], [0 0 0];... % [r,g,b] for aperture 'maxPerFrame', 'scalar', [], 9999; ... % number of dots 'loops', 'scalar', [], 3; ... % interleaved dots 'duration', 'scalar', [], 0; ... % ms (used if preCompute) 'density', 'scalar', [], 16.7; ... % 16.7 dots per sq.deg/sec 'x', 'scalar', [], 0; ... % deg visual angle 'y', 'scalar', [], 0; ... % deg visual angle 'diameter', 'scalar', [], 10.0; ... % deg visual angle 'apScale', 'scalar', [], 1.1; ... % >1 for bdotsigger field than aperture 'userData', 'array', [], []; ... % 'smooth', 'scalar', [], 0.0; ... % if set = 1, be sure to set dXscreen "blending" to true 'preCompute', 'scalar', [], 0; ... % -1='auto'; 0=no; 1+=#trials 'groupMotion', 'boolean', [], false; ... % move all dots together, or individually? 'deltaDir', 'scalar', [], 0; ... 'dirDomain', 'array', [], []; ... % arbitrary directions 'dirCDF', 'array', [], []; ... % arbitrary directions distribution 'flickerMode', 'string', {'random', 'move'}, 'random'; ... % displacement of non-coh dots 'wrapMode', 'string', {'random', 'wrap'}, 'wrap'; ... % dots behavior at edge of aperture 'lifetimeMode', 'string', {'random', 'limit'}, 'limit'; ... % force limited lifetime of dots 'visible', 'boolean', [], 0; ... 'tag', 'scalar', [], 0; ... % ignored for now 'debugSavePts', 'boolean', [], 0; ... % save all points data for debugging (SLOW!!!!) 'windowNumber', 'auto', [], wn; ... 'screenRect', 'auto', [], sr; ... 'pixelsPerDegree', 'auto', [], ppd; ... 'frameRate', 'auto', [], fr; ... 'drawRect', 'auto', [], []; ... % where dots are drawn 'drawSize', 'auto', [], []; ... % draw rect width (deg) 'drawSizePix', 'auto', [], []; ... % draw rect width (pix) 'dirCDFInv', 'auto', [], []; ... % arbitrary directions distribution 'nP', 'auto', [], 1e2; ... % size of CDFInv domain 'dxdyDomain', 'auto', [], []; ... % components of direction distribution 'maskColor', 'auto', [], [0 0 0]; ... % background color 'maskRect', 'auto', [], []; ... % mask screen location 'maskSource', 'auto', [], []; ... % mask extent in pix 'maskImage', 'auto', [], []; ... % mask RGBA image 'maskTexindex', 'auto', [], []; ... % pointer to GL texture 'apRect', 'auto', [], []; ... % viewable extent in mask 'dotCoh', 'auto', [], []; ... 'nDots', 'auto', [], []; ... 'jumpSize', 'auto', [], []; ... 'dxdy', 'auto', [], []; ... 'loopIndex', 'auto', [], []; ... 'pts', 'auto', [], []; ... 'Lpts', 'auto', [], []; ... 'ptsHistory', 'auto', [], []; ... % ugly, growing log of xy data for debugging 'sourceRect', 'auto', [], []; ... % unimplemented 'textures', 'auto', [], []; ... 'textureIndex', 'auto', [], 1}; % see set & recur % make an array of objects from structs made from the attributes d = cell2struct(attributes(:,4), attributes(:,1), 1); for i = 1:num_objects ds_(i) = class(d, 'dXdots'); end % return the attributes, if necessary if nargout > 1 attributes_ = attributes; end % return list of batch methods if nargout > 2 batchMethods_ = {'draw', 'blank'}; end

odepkg_structure_check.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 365 lines

34

35 function [vret] = odepkg_structure_check (vret)

36 if (nargin == 0) %# Check number of input arguments

37 vmsg = sprintf ('Number of input arguments must be greater than zero\n');

forward.m (git://github.com/karaaie/VoiceRecognitionMatlab.git) MATLAB · 1 lines

1 function [alfaHat, c]=forward(mc,pX) %[alfaHat, c]=forward(mc,pX) %calculates state and observation probabilities for one single data sequence, %using the forward algorithm, for a given single MarkovChain object, %to be used when the MarkovChain is included in a HMM object. % %Input: %mc= single MarkovChain object %pX= matrix with state-conditional likelihood values, % without considering the Markov depencence between sequence samples. % pX(j,t)= myScale(t)* P( X(t)= observed x(t) | S(t)= j ); j=1..N; t=1..T % (must be pre-calculated externally) %NOTE: pX may be arbitrarily scaled, as defined externally, % i.e., pX may not be a properly normalized probability density or mass. % %NOTE: If the HMM has Finite Duration, it is assumed to have reached the end %after the last data element in the given sequence, i.e. S(T+1)=END=N+1. % %Result: %alfaHat=matrix with normalized state probabilities, given the observations: % alfaHat(j,t)=P[S(t)=j|x(1)...x(t), HMM]; t=1..T %c=row vector with observation probabilities, given the HMM: % c(t)=P[x(t) | x(1)...x(t-1),HMM]; t=1..T % c(1)*c(2)*..c(t)=P[x(1)..x(t)| HMM] % If the HMM has Finite Duration, the last element includes % the probability that the HMM ended at exactly the given sequence length, i.e. % c(T+1)= P( S(T+1)=N+1| x(1)...x(T-1), x(T) ) %Thus, for an infinite-duration HMM: % length(c)=T % prod(c)=P( x(1)..x(T) ) %and, for a finite-duration HMM: % length(c)=T+1 % prod(c)= P( x(1)..x(T), S(T+1)=END ) % %NOTE: IF pX was scaled externally, the values in c are % correspondingly scaled versions of the true probabilities. % %-------------------------------------------------------- %Code Authors: %-------------------------------------------------------- T=size(pX,2);%Number of observations numberOfStates = length(mc.InitialProb) q = mc.InitialProb; A = mc.TransitionProb; B = pX; c = []; alfaHat = []; %initialization initAlfaTemp = []; for j=1:numberOfStates initAlfaTemp(j) = q(j)*B(j,1); end %sum AlfaTemps c =[c sum(initAlfaTemp)]; %calculate alfa hat for j=1:numberOfStates alfaHat = [alfaHat; initAlfaTemp(j)/c(1)]; end %forward step for t=2:T alfaTemp = []; for j=1:numberOfStates alfaTemp(j) = B(j,t)*(sum(alfaHat(:,t-1)'*A(:,j))); end c = [c sum(alfaTemp)]; for j=1:numberOfStates alfaTemp(j) = alfaTemp(j)/c(t); end alfaHat = [alfaHat alfaTemp']; end [rows columns] = size(A); if(rows ~= columns) c = [c sum(alfaHat(:,T)'*A(:,numberOfStates+1))]; end %termination end

plottetra.m (http://horwitzlab.googlecode.com/svn/) MATLAB · 67 lines

7 % author: Qianqian Fang <fangq at nmr.mgh.harvard.edu>

8 %

9 % input:

10 % node: a node coordinate list, 3 columns for x/y/z; if node has a

11 % 4th column, it will be used to set the color at each node.

sshift2d.pro (git://github.com/charleshull6/c_soft.git) IDL · 137 lines ✨ Summary

The Code’s Purpose

The provided IDL code implements a function sshift2d that shifts a 2D array by a specified amount along both x and y axes, replicating the margins to prevent wrapping around. It uses a damped sinc function for fractional part shifting, effectively creating an interpolation effect between integer shifts. The result is a shifted array with replicated borders, suitable for applications requiring precise control over image or data alignment.

The Code’s Purpose

The provided IDL code implements a function sshift2d that shifts a 2D array by a specified amount along both x and y axes, replicating the margins to prevent wrapping around. It uses a damped sinc function for fractional part shifting, effectively creating an interpolation effect between integer shifts. The result is a shifted array with replicated borders, suitable for applications requiring precise control over image or data alignment.

10 ; CALLING SEQUENCE:

11 ; result = sshift2d( array, shiftvec )

12 ; INPUTS:

13 ; array : Array to be shifted.

14 ; shiftvec : Vector of two elements: [ xshift, yshift ].

15 ; OPTIONAL INPUT PARAMETERS:

16 ;

17 ; KEYWORD PARAMETERS:

cplxreal.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 74 lines

20 %% eliminating one of each complex-conjugate pair.

21 %%

22 %% INPUTS:@*

23 %% @itemize

24 %% @item

fminbnd.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 71 lines

17 ## value @var{v} with the Golden Search method.

18 ##

19 ## @strong{Inputs}

20 ## @table @var

21 ## @item f

im2bw.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 73 lines

33 img = rgb2gray(img);

34 if (nargin != 2)

35 error("im2bw: two input arguments must be given when the image is a color image");

36 endif

37 t = a;

39 img = ind2gray (img, a);

40 if (nargin != 3)

41 error("im2bw: three input arguments must be given when the image is indexed");

42 endif

43 t = b;

44 elseif (isgray(img))

45 if (nargin != 2)

46 error("im2bw: two input arguments must be given when the image is gray scale");

47 endif

48 t = a;

poly2th.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 71 lines

17 ## @deftypefn {Function File} {} {poly2th (@var{a}, @var{b}, @var{c}, @var{d}, @var{f}, @var{v}, @var{T})}

18 ##

19 ## Represent the generalized Multi-Input, Single-Output (MISO) system

20 ## defined as follows:

21 ##

24 ## where

25 ## e is white noise

26 ## u is the input signal

27 ## y is the output signal

28 ##

34

35 ## TODO: incorporate delays: if system is discrete (T>0), then delay for

36 ## TODO: input i is the number of leading zeros in b(:,i)

37 function th = poly2th(a,b,c,d,f,v,T)

38 if nargin<1 || nargin>7,

boundaryPR.m (http://phd-workspace.googlecode.com/svn/trunk/) MATLAB · 73 lines

6 % The pb image can be smaller than the segmentations.

7 %

8 % INPUT

9 % pb Soft or hard boundary map.

10 % segs Array of segmentations.

plotting_S11.m (http://ua-fwlis.googlecode.com/svn/trunk/) MATLAB · 82 lines

3 set(0,'defaultaxesfontsize',15);

4

5 flag=input('Please enter 1 first and 2 then:');

6

7 if flag==1

temporal_sens_params.m (https://github.com/bnaecker/temporal-sens.git) MATLAB · 152 lines

8 % experiment.

9 %

10 % INPUT:

11 % ex - Experimental structure

12 % wntime - Length of white noise stimulus block (seconds)

dXgameHID.m (http://dotsx.googlecode.com/svn/trunk/) MATLAB · 1 lines

1 function [g_, attributes_, batchMethods_] = dXgameHID(num_objects) % function [g_, attributes_, batchMethods_] = dXgameHID(num_objects) % % Constructor method for class dXgameHID % DotsX interface to USB HID gamepads % % Input: % num_objects ... ignored -- always creates just one % % Output: % g_ ... created object % attributes_ ... default object attributes % batchMethods_ ... methods that can be run in a batch (e.g., draw) % Copyright 2007 Benjamin Heasly % University of Pennsylvania global ROOT_STRUCT % look for mex function available = exist('HIDx') == 3; % return empty matrix if not available, which % will automatically remove gameHID devices from the ui queue % if called from rInit if isfield(ROOT_STRUCT, 'dXgameHID') || ~available g_ = []; attributes_ = []; batchMethods_ = []; return end % how to find compatible device HIDCriteria.usageName = 'GamePad'; % default channelizer. % use raw values from each element % feebly guess at the number of elements: 8 n = 8; [HIDChannelizer(1:n).gain] = deal(1); [HIDChannelizer(1:n).offset] = deal(0); [HIDChannelizer(1:n).high] = deal(nan); [HIDChannelizer(1:n).low] = deal(nan); [HIDChannelizer(1:n).delta] = deal(0); [HIDChannelizer(1:n).freq] = deal(1); % default object attributes attributes = { ... % name type ranges(?) default 'available', 'boolean', [], available; ... 'active', 'boolean', [], false; ... 'FIRAdataType', 'string', [], 'gameHIDData'; ... 'HIDClass', 'string', [], 'dXgameHID'; ... 'HIDCriteria', 'struct', [], HIDCriteria; ... 'HIDChannelizer','struct', [], HIDChannelizer; ... 'HIDIndex', 'scalar', [], nan; ... 'HIDDeviceInfo','struct', [], []; ... 'HIDElementsInfo','struct', [], []; ... 'mappings', 'cell', [], {};... 'offsetTime', 'auto', [], 0; ... 'default', 'auto', [], []; ... 'other', 'auto', [], []; ... 'checkList', 'auto', [], []; ... 'checkRet', 'auto', [], []; ... 'values', 'auto', [], []; ... 'recentVal', 'auto', [], 1}; % make an array of objects from structs made from the attributes g_ = class(cell2struct(attributes(:,4), attributes(:,1), 1), 'dXgameHID'); % return the attributes, if necessary if nargout > 1 attributes_ = attributes; end % return list of batch methods if nargout > 2 batchMethods_ = {'reset', 'saveToFIRA', 'root', 'getJump'}; end

write_neuralynx_ncs.m (http://open-realtime-fmri.googlecode.com/svn/trunk/) MATLAB · 96 lines

2

3 % WRITE_NEURALYNX_NCS writes continuous data to a NCS file

4 % The input data should be scaled in uV.

5 %

6 % Use as

shift_test_2D.m (http://sparse-mri-reconstruction.googlecode.com/svn/trunk/) MATLAB · 112 lines

19

20 % draw(xx);

21 title('Input (256 x 256)','FontSize',14); drawnow

22 settitle('Input');

ode8d.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 109 lines

37 end

38

39 %# The following tests have been added to check the function's input arguments

40 %# and output arguments

41 %!test

98 %! % ---------------------------------------------------------------------

99 %! % The figure window shows the state variables x1, x2 as well as the

100 %! % input signal u and the output signal y(=x2) of a second order lag

101 %! % implementation (cf. the control theory). The function ode8d was

102 %! % called with an option argument A that has been set before with the

odepkg_equations_secondorderlag.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 117 lines

41 if (nargin == 0)

42 help ('odepkg_equations_secondorderlag');

43 vmsg = sprintf ('Number of input arguments must be greater than zero');

44 error (vmsg);

45

46 elseif (nargin <= 1)

47 vmsg = sprintf ('Number of input arguments must be greater or equal than 2');

48 error (vmsg);

49

50 elseif (isnumeric (tvar) == false || isnumeric (yvar) == false)

51 vmsg = sprintf ('First and second input argument must be valid numeric values');

52 error (vmsg);

53

SFBS_FS.m (https://code.google.com/p/matbat/) MATLAB · 55 lines

15 test = (indices == foldnum);

16 train = ~test;

17 train_input = data(train,:);

18 test_input = data(test,:);

27 num = size(train_input,1);

28 [train_t,train_v] = crossvalind('HoldOut',num,0.33);

29 train_t_input = train_input(train_t,:); %???

30 train_v_input = train_input(train_v,:); %???

32 train_v_target = train_target(train_v,:); %????

33

34 [ FS_SFBS,CP ] = SFBS( T_SFBS,train_t_input,train_v_input,train_t_target,train_v_target);

35

36 % din = find(FS_SFFS); %data index??????????????????

39 FS_Final= [FS_Final;din];

40

41 u = train_input(:,din); %????????feasub??????????

42 v = test_input(:,din);

binaryEPGP.m (http://pmtksupport.googlecode.com/svn/trunk/) MATLAB · 54 lines

17 % covfunc is the name of the covariance function (see below)

18 % lik is the name of the likelihood function (see below)

19 % x is a n by D matrix of training inputs

20 % y is a (column) vector (of size n) of binary +1/-1 targets

21 % xstar is a nn by D matrix of test inputs

28 %

29 % The length of the vector of hyperparameters depends on the covariance

30 % function, as specified by the "covfunc" input to the function, specifying the

31 % name of a covariance function. A number of different covariance function are

32 % implemented, and it is not difficult to add new ones. See "help covFunctions"

prompt.m (http://slac-lucretia.googlecode.com/svn/trunk/) MATLAB · 87 lines

3 % s=prompt(str,options[,deflt_option]);

4 %

5 % Prompts user for input of ONE character from options string. It uses only

6 % the first character of the user's response, converted to lower case, and

7 % returns this character which will then match at least one of the characters

10 % function displays a message and prompts again.

11 %

12 % INPUTs:

13 %

14 % str = the prompt string (the list of options and a colon are

66 while (1)

67 disp(' ')

68 s=input(str,'s');

69 ns=length(s);

70 if (ns==0)

mynanmean.m (http://dotsx.googlecode.com/svn/trunk/) MATLAB · 1 lines

1 function y = mynanmean(x) %NANMEAN Average or mean ignoring NaNs. % NANMEAN(X) returns the average treating NaNs as missing values. % For vectors, NANMEAN(X) is the mean value of the non-NaN % elements in X. For matrices, NANMEAN(X) is a row vector % containing the mean value of each column, ignoring NaNs. % % See also NANMEDIAN, NANSTD, NANMIN, NANMAX, NANSUM. % Copyright (c) 1993-98 by The MathWorks, Inc. % $Revision: 2.8 $ $Date: 1997/11/29 01:45:53 $ if isempty(x) % Check for empty input. y = NaN; return end % Replace NaNs with zeros. nans = isnan(x); i = find(nans); x(i) = zeros(size(i)); if min(size(x))==1, count = length(x)-sum(nans); else count = size(x,1)-sum(nans); end % Protect against a column of all NaNs i = find(count==0); count(i) = ones(size(i)); y = sum(x)./count; y(i) = i + NaN;

SplitSequenceMarkerEntry.m (http://brainstream.googlecode.com/svn/trunk/) MATLAB · 83 lines

25 idx = sort([idx{:}]);

26 if isempty(idx)

27 error('wrong marker sequence input detected, missing items');

28 end

29 mrks{n} = regexp(mrksq{n}(1:idx(1)-1),'\S.*\S','match'); % remove leading and tailing spaces

49 [name,startidx,endidx] = regexp(sqm{n},'*\S*','match','start','end');

50 if isempty(isempty(name) || isequal(endidx,length(sqm{n})))

51 error('wrong marker sequence input detected, *-parmameter or end marker for *-parameter not found');

52 end

53 if length(name)~=1 || length(startidx)~=1 || length(endidx)~=1

54 error('wrong marker sequence input detected, multiple *-parmameter items found');

55 end

56 mrkseq{n}.marker = char(mrks{n});

irsa_dftfp.m (https://octave.svn.sourceforge.net/svnroot/octave) MATLAB · 87 lines

23 ## irregular sampled time series

24 ##

25 ## Input:

26 ##

27 ## @var{xp} : Columnvector -- sampling points

Lexer.ooc (git://github.com/fperrad/ooc-lua.git) Unknown · 536 lines

14 Lexer: class {

15 current: Int /* current character (charint) */

16 linenumber: Int /* input line counter */

17 lastline: Int /* line of last token `consumed' */

18 t: Token /* current token */

19 lookahead: Token /* look ahead token */

20 z: Reader /* input stream */

21 buff: ArrayList<Char> /* buffer for tokens */

22 source: String /* current source name */

25 init: func {}

26

27 setInput: func(=z, =source) {

28 lookahead token = TK_EOS /* no look-ahead token */

29 linenumber = 1

RemoteRunner.html (http://datanucleus-appengine.googlecode.com/svn/trunk/) HTML · 111 lines ✨ Summary

This HTML code is for a Selenium Remote Runner application, which allows users to run functional tests on web applications remotely. It provides features such as viewing the DOM, showing log output, and displaying command history. The interface includes buttons, checkboxes, and text areas for inputting commands and viewing results. It also contains an iframe for running the actual test.

80 Show Log

81 </button>

82 <label><INPUT TYPE="CHECKBOX" NAME="FASTMODE" VALUE="YES" onmouseup="slowClicked()"> Slow Mode</label>

83 </fieldset>

84

one_ray.pro (git://github.com/charleshull6/c_soft.git) IDL · 62 lines ✨ Summary

ONE_RAY Procedure

The one_ray procedure draws a line with a specified starting point, length, and angle in device coordinates. It takes input parameters xcen, ycen, len, and angle, and returns the ending point of the ray as output. The procedure can be customized with optional keywords such as /NODRAW, /DATA, /NORMAL, /THICK, and /COLOR.

ONE_RAY Procedure

The one_ray procedure draws a line with a specified starting point, length, and angle in device coordinates. It takes input parameters xcen, ycen, len, and angle, and returns the ending point of the ray as output. The procedure can be customized with optional keywords such as /NODRAW, /DATA, /NORMAL, /THICK, and /COLOR.

10 ; one_ray, xcen, ycen, len, angle, terminus, /NODRAW ]

11 ;

12 ; INPUT PARAMETERS:

13 ; xcen, ycen = starting point in device coordinates, floating point

14 ; scalars

20 ; coordinates

21 ;

22 ; OPTIONAL KEYWORD INPUT PARAMETERS:

23 ; /nodraw if non-zero, the ray is not actually drawn, but the terminus

24 ; is still calculated

KOLMIDITYPE.PAS (git://github.com/rofl0r/KOL.git) Pascal · 102 lines ✨ Summary

This Pascal code defines a set of types and functions for working with MIDI (Musical Instrument Digital Interface) data on a Windows platform. It provides classes and procedures for creating and managing MIDI events, including sending and receiving MIDI messages, as well as handling sysex (system exclusive) data. The code is designed to be used in a KOL (Kolmogorov Object Language) application.

23 type

24 {-------------------------------------------------------------------}

25 { A MIDI input/output event }

26 pMyMidiEvent =^TMyMidiEvent;

27 TMyMidiEvent = object(Tobj)