plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | old-NWTC/MATLAB_Toolbox-master | ReadFASTMotionMeshes.m | .m | MATLAB_Toolbox-master/Utilities/ReadFASTMotionMeshes.m | 4,566 | utf_8 | 7167e67917477a9b8f252af982b15369 | function [Mesh] = ReadFASTMotionMeshes(fileName,plotMeshes)
%%
% fileName = ...
% ['C:\Users\bjonkman\Documents\DATA\DesignCodes\simulators\FAST\SVNdirectory\branches\BJonkman\CertTest\' ...
% 'Test21.gra'];
%%
if nargin < 2
plotMeshes = false;
end
%% read the file and header:
[... |
github | old-NWTC/MATLAB_Toolbox-master | ReadFASTmappingData.m | .m | MATLAB_Toolbox-master/Utilities/ReadFASTmappingData.m | 774 | utf_8 | bdf28c62072e523ef51601d46e7d5786 | function [MotionMap, LoadMap, Aug, lumpSrc, lumpDest] = ReadFASTmappingData(fid)
MotionMap = ReadFASTmatrix(fid);
LoadMap = ReadFASTmatrix(fid);
M = fread( fid, 3, 'int32');
if M(1) ~= 0
Aug = ReadFASTmesh(fid);
else
Aug = [];
end
if M(2) ~= 0
... |
github | old-NWTC/MATLAB_Toolbox-master | CompareMatrices.m | .m | MATLAB_Toolbox-master/Utilities/CompareMatrices.m | 2,080 | utf_8 | 633b29cfad77e5c4c0e199ded47f15e2 | function CompareMatrices(MatTitle,CellMat,caseDescr)
% function CompareMatrices(MatTitle,CellMat,caseDescr)
% this plots up to 2 dimensions of matrices stored in cell array Mat
% (CellMat can also be a structure with field MatTitle)
%%
refMat = 1;
nMat = length(CellMat); % number of matrices to compare/plot
... |
github | old-NWTC/MATLAB_Toolbox-master | GetFASTPar.m | .m | MATLAB_Toolbox-master/Utilities/GetFASTPar.m | 611 | utf_8 | 77cbd50df0556311e1bad2e01f9da094 | % Function for getting FAST parameter
% In: FASTPar - FAST parameter structure
% Par - Parameter string
% Out: OutData - Value of input parameter
%
% Knud A. Kragh
function [OutData,err,Indx]=GetFASTPar(FASTPar,Par)
err = false;
OutData=[];
Indx=0;
if isfield(FASTPar, 'Labe... |
github | old-NWTC/MATLAB_Toolbox-master | ReadFASTLinear.m | .m | MATLAB_Toolbox-master/Utilities/ReadFASTLinear.m | 3,383 | utf_8 | d1283344e9a4dfef3748781ea08411ea | function [data] = ReadFASTLinear(fileName)
fid=fopen(fileName);
if (fid == -1)
error(['Linearization file "',fileName,'" could not be opened.']);
end
% generic header:
fgetl(fid); % skip a blank line
data.ver{1,1} = fgetl(fid); % FAST version info
data.ve... |
github | old-NWTC/MATLAB_Toolbox-master | SD2Matlab.m | .m | MATLAB_Toolbox-master/FAST2MATLAB/SD2Matlab.m | 10,717 | utf_8 | e0c2921ea394ea82b726c40c1d3753de | function DataOut = SD2Matlab(HD_file,hdrLines,DataOut)
%% HD2Matlab
% Function for reading HydroDyn input files in to a MATLAB struct.
%
%
%This function returns a structure DataOut, which contains the following
% cell arrays:
%.Val An array of values
%.Label An array of matching labels... |
github | old-NWTC/MATLAB_Toolbox-master | FAST2Matlab.m | .m | MATLAB_Toolbox-master/FAST2MATLAB/FAST2Matlab.m | 13,034 | utf_8 | 4b2c96567c8b9134650129028969e70e | function DataOut = Fast2Matlab(FST_file,hdrLines,DataOut)
%% Fast2Matlab
% Function for reading FAST input files in to a MATLAB struct.
%
%
%This function returns a structure DataOut, which contains the following
% cell arrays:
%.Val An array of values
%.Label An array of matching label... |
github | old-NWTC/MATLAB_Toolbox-master | HD2Matlab.m | .m | MATLAB_Toolbox-master/FAST2MATLAB/HD2Matlab.m | 16,125 | utf_8 | a6b776a593576eea38b63cdf43e98384 | function DataOut = HD2Matlab(HD_file,hdrLines,DataOut)
%% HD2Matlab
% Function for reading HydroDyn input files in to a MATLAB struct.
%
%
%This function returns a structure DataOut, which contains the following
% cell arrays:
%.Val An array of values
%.Label An array of matching labels... |
github | old-NWTC/MATLAB_Toolbox-master | Matlab2SD.m | .m | MATLAB_Toolbox-master/MATLAB2FAST/Matlab2SD.m | 16,468 | utf_8 | 090148e1d3e2e575acad94e8903281c3 | % Matlab2SD
% Function for creating a new SD file given:
% 1) An input template file
% 2) A SD parameter structure
%
% In: SDPar - A SD parameter list
% TemplateFile - A .dat file to use as a template
% OutputFilename - Desired filename of output .fst file
%
% Paul Fleming, JUNE... |
github | old-NWTC/MATLAB_Toolbox-master | GenStepWindFile.m | .m | MATLAB_Toolbox-master/MATLAB2FAST/GenStepWindFile.m | 1,136 | utf_8 | 8916e1297eecfd16e3d0f7c2a1e19e0f | % GenStepWindFile
% Function for generating a step wind speed file given:
% 1) A base filename
% 2) An array of windspeeds
% - The generated file will have a name BaseName_Windspeed_MPS.wnd
%
%In: fileName - filename for step file
% windSpeedArray - array of wind speeds in m/s
%
%
% P... |
github | old-NWTC/MATLAB_Toolbox-master | Matlab2FAST.m | .m | MATLAB_Toolbox-master/MATLAB2FAST/Matlab2FAST.m | 16,230 | utf_8 | 270a3952cd5932257d959545389a29a8 | % Matlab2FAST(FastPar,TemplateFile,OutputFilename,hdrLines)
% Function for creating a new FAST file given:
% 1) An input template file
% 2) A FAST parameter structure
%
% In: FastPar - A FAST parameter list
% TemplateFile - A .fst file to use as a template
% OutputFilename - Desir... |
github | old-NWTC/MATLAB_Toolbox-master | GenConstWindFile.m | .m | MATLAB_Toolbox-master/MATLAB2FAST/GenConstWindFile.m | 1,477 | utf_8 | 9174e59aa551d8a51957a760d35c08e0 | % GenConstWindFile
% Function for generating a constant wind speed file given:
% 1) A base filename
% 2) A windspeed
% - The generated file will have a name BaseName_Windspeed_MPS.wnd
%
%In: baseName - directory and basename of generated wind file
% windSpeed - wind speed in mps
%
... |
github | old-NWTC/MATLAB_Toolbox-master | Matlab2HD.m | .m | MATLAB_Toolbox-master/MATLAB2FAST/Matlab2HD.m | 21,687 | utf_8 | d1b8143508bd4f9e5274665e433affef | % Matlab2HD
% Function for creating a new HD file given:
% 1) An input template file
% 2) A HD parameter structure
%
% In: HDPar - A HD parameter list
% TemplateFile - A .dat file to use as a template
% OutputFilename - Desired filename of output .fst file
%
% Paul Fleming, JUNE... |
github | old-NWTC/MATLAB_Toolbox-master | DCM_LogMap.m | .m | MATLAB_Toolbox-master/math/DCM_LogMap.m | 4,444 | utf_8 | 50c2798e973b859df62a8c83134c9c0f | % function [logMap, theta, v_pi] = DCM_LogMap(DCM)
function [logMap, theta, v_pi] = DCM_LogMap(DCM)
cosTheta = 0.5*( trace(DCM) - 1.0 );
cosTheta = min( max(cosTheta,-1.0), 1.0 );
theta = acos( cosTheta ); % Eq. 25 ( 0<=theta<=pi )
%%
if ( theta > 3.1 ) % th... |
github | old-NWTC/MATLAB_Toolbox-master | PlotFASToutput.m | .m | MATLAB_Toolbox-master/Plots/PlotFASToutput.m | 30,737 | utf_8 | 0883f84d112af7dd1e2da3111fb4ac08 | function [outData]=PlotFASToutput(FASTfiles,FASTfilesDesc,ReferenceFile,Channels,ShowLegend,CustomHdr,PlotPSDs,OnePlot)
%..........................................................................
%function [timeSeriesData] = PlotFASToutput(FASTfiles,FASTfilesDesc,ReferenceFile,Channels)
%function [timeSeriesData] = ... |
github | old-NWTC/MATLAB_Toolbox-master | PlotFASTIOMeshes.m | .m | MATLAB_Toolbox-master/Plots/PlotFASTIOMeshes.m | 9,058 | utf_8 | 7220999eca90546272e8197f09576771 | function [Mesh1_I,Mesh1_O,Mesh2_I,Mesh2_O, f] ...
= PlotFASTIOMeshes( Mesh1_Input, Mesh1_Output,Mesh2_Input,Mesh2_Output, exportFigure )
%%
%
DisplacedOnly = true;
if nargin < 5
exportFigure = 0;
end
if exportFigure ~= 0
fig_start = 1;
fig_end = 2;
else
fig_start = 2;
fig_end... |
github | old-NWTC/MATLAB_Toolbox-master | PlotFASTIOMeshes_mapping.m | .m | MATLAB_Toolbox-master/Plots/PlotFASTIOMeshes_mapping.m | 3,211 | utf_8 | aec77054e1976dc83aaebf37995e0bf9 | function [Mesh1_I,Mesh1_O,Mesh2_I,Mesh2_O, f1, MotionMap, LoadMap] ...
= PlotFASTIOMeshes_mapping( MeshInputFile )
%% -----------------
% Read file:
[fid, message] = fopen( MeshInputFile );
if fid < 1
error(['PlotFASTIOMeshes:: Error opening file: ' MeshInputFile '. ' message]);
end... |
github | old-NWTC/MATLAB_Toolbox-master | PlotFASTMesh.m | .m | MATLAB_Toolbox-master/Plots/PlotFASTMesh.m | 3,899 | utf_8 | 2a5a2937ad47385333c4833a5e9dde09 | function PlotFASTMesh( MeshFileName, figure_id, MarkerColor )
%
%
Mesh = ReadFASTmesh(MeshFileName);
if nargin < 2
figure_id = figure;
MarkerColor = 'c';
end
FieldNames = {'RefOrientation','Orientation','TranslationDisp',...
'TranslationVel','RotationVel',...
'Translati... |
github | rmgarnett/gp_dla_detection-master | spectrum_loss.m | .m | gp_dla_detection-master/spectrum_loss.m | 2,233 | utf_8 | 75f795f11a70291326f9d33f23af1af4 | % spectrum_loss: computes the negative log likelihood for centered
% flux y:
%
% -log p(y | Lyα z, σ², M, ω², c₀, τₒ, β)
% = -log N(y; 0, MM' + diag(σ² + (ω ∘ (c₀ + a(1 + Lyα z)))²)),
%
% where a(Lyα z) is the approximate absorption due to Lyman α at
% redshift z:
%
% a(z) = 1 - exp(-τ₀(1 + z)ᵝ)
%
% and its der... |
github | rmgarnett/gp_dla_detection-master | read_spec.m | .m | gp_dla_detection-master/read_spec.m | 1,148 | utf_8 | c02927e087ba93682fc374e16c63055c | % read_spec: loads data from SDSS DR12Q coadded "speclite" FITS file;
% see
% https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spectra/PLATE4/spec.html
% for a complete description of the data format
function [wavelengths, flux, noise_variance, pixel_mask] = read_spec(filename)
% mask bits to consider... |
github | rmgarnett/gp_dla_detection-master | objective.m | .m | gp_dla_detection-master/objective.m | 2,103 | utf_8 | 38e7f82750308c0c3a6dac311cd41b3e | % objective: computes negative log likelihood of entire training
% dataset as a function of the model parameters, x, a vector defined
% as
%
% x = [vec M; log ω; log c₉; log τ₀; log β]
%
% as well as its gradient:
%
% f(x) = -∑ᵢ log(yᵢ | Lyα z, σ², M, ω, c₀, τ₉, β)
% g(x) = ∂f/∂x
function [f, g] = objective(x, c... |
github | rmgarnett/gp_dla_detection-master | log_mvnpdf_low_rank.m | .m | gp_dla_detection-master/log_mvnpdf_low_rank.m | 662 | utf_8 | 49ebd82712afbf8e961104ebf9ab49bb | % log_mvnpdf_low_rank: efficiently computes
%
% log N(y; mu, MM' + diag(d))
function log_p = log_mvnpdf_low_rank(y, mu, M, d)
log_2pi = 1.83787706640934534;
[n, k] = size(M);
y = y - mu;
d_inv = 1 ./ d;
D_inv_y = d_inv .* y;
D_inv_M = d_inv .* M;
% use Woodbury identity, define
% B = (I + M' D... |
github | rmgarnett/gp_dla_detection-master | objective_lyseries.m | .m | gp_dla_detection-master/multi_dlas/objective_lyseries.m | 2,375 | utf_8 | 18a2d767eb0e0f87d48b8cc36726c915 | % objective: computes negative log likelihood of entire training
% dataset as a function of the model parameters, x, a vector defined
% as
%
% x = [vec M; log ω; log c₉; log τ₀; log β]
%
% as well as its gradient:
%
% f(x) = -∑ᵢ log(yᵢ | Lyα z, σ², M, ω, c₀, τ₉, β)
% g(x) = ∂f/∂x
function [f, g] = objective_lyse... |
github | rmgarnett/gp_dla_detection-master | spectrum_loss_lyseries.m | .m | gp_dla_detection-master/multi_dlas/spectrum_loss_lyseries.m | 2,888 | utf_8 | 3378fb728c047ad1c3a8075b32c173d7 | % spectrum_loss: computes the negative log likelihood for centered
% flux y:
%
% -log p(y | Lyα z, σ², M, ω², c₀, τₒ, β)
% = -log N(y; 0, MM' + diag(σ² + (ω ∘ (c₀ + a(1 + Lyα z)))²)),
%
% where a(Lyα z) is the approximate absorption due to Lyman α at
% redshift z:
%
% a(z) = 1 - exp(-τ₀(1 + z)ᵝ)
%
% and its der... |
github | mws262/MATLAB-GJK-Collision-Detection-master | GJK.m | .m | MATLAB-GJK-Collision-Detection-master/GJK.m | 5,908 | utf_8 | 4c34ab2cd0e919cc7cb2caaaad61b245 | function flag = GJK(shape1,shape2,iterations)
% GJK Gilbert-Johnson-Keerthi Collision detection implementation.
% Returns whether two convex shapes are are penetrating or not
% (true/false). Only works for CONVEX shapes.
%
% Inputs:
% shape1:
% must have fields for XData,YData,ZData, which are the x,y,z
% coord... |
github | yuxng/ObjectNet3D_toolbox-master | annotate_pose.m | .m | ObjectNet3D_toolbox-master/annotate_pose.m | 43,574 | utf_8 | 66c8f4823f4b06e9f532f36d658544a1 | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Wonhui Kim, Yu Xiang
% --------------------------------------------------------
% pose annotation tool
function varargout = annot... |
github | yuxng/ObjectNet3D_toolbox-master | count_objects.m | .m | ObjectNet3D_toolbox-master/count_objects.m | 1,653 | utf_8 | 71fd594473cfa7a0f574217a863f39ab | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% count the number of objects for each class in ObjectNet3D
%... |
github | yuxng/ObjectNet3D_toolbox-master | load_off_file.m | .m | ObjectNet3D_toolbox-master/load_off_file.m | 909 | utf_8 | 5e21bff6072d02014ecd09233396483c | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% load the vertices and faces of an .off file
function [v,f] ... |
github | yuxng/ObjectNet3D_toolbox-master | project_3d_msid.m | .m | ObjectNet3D_toolbox-master/project_3d_msid.m | 1,134 | utf_8 | 8dd84ffcfe7f5fc381a4476d0bbbd9f2 | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% project 3D points to 2D according to the camera parameters
... |
github | yuxng/ObjectNet3D_toolbox-master | load_obj_file.m | .m | ObjectNet3D_toolbox-master/load_obj_file.m | 6,494 | utf_8 | dc72469dd93b5d56f936daf7b12cec19 | function [V,F3,F4] = load_obj_file(modelname, opts)
% loadawobj load a Wavefront/Alias obj style model.
% It will only consider polygons with 3 or 4 vertices.
% [v,f3,f4]=loadawobj(modelname)
% s=loadawobj(modelname)
% s=loadawobj(modelname,1) % will load vertex normals and textures
% Programme will normall... |
github | yuxng/ObjectNet3D_toolbox-master | globals.m | .m | ObjectNet3D_toolbox-master/globals.m | 372 | utf_8 | a95db277018d29e33aa3199c64a51c6d | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
function opt = globals()
opt.root = '/datasets/ObjectNet3D';... |
github | yuxng/ObjectNet3D_toolbox-master | VOCevaldetview_validation.m | .m | ObjectNet3D_toolbox-master/VOCevaldetview_validation.m | 8,437 | utf_8 | bbb1bb979eed717875c4da582bf4e75c | function VOCevaldetview_validation
% path of the results
network = 'vgg16';
region_proposal = 'selective_search';
minoverlap = 0.5;
result_dir = '/var/Projects/SubCNN/fast-rcnn/output/objectnet3d/objectnet3d_val';
method = sprintf('%s_fast_rcnn_view_objectnet3d_%s_iter_160000', network, region_proposal);
poolobj = pa... |
github | yuxng/ObjectNet3D_toolbox-master | draw_cad_off_file.m | .m | ObjectNet3D_toolbox-master/draw_cad_off_file.m | 1,137 | utf_8 | 070f9ef64d03e99ecca5b46b1b9c963a | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% display CAD model and anchor points
% example: draw_cad_off... |
github | yuxng/ObjectNet3D_toolbox-master | show_pose_annotations.m | .m | ObjectNet3D_toolbox-master/show_pose_annotations.m | 3,871 | utf_8 | 9f49395c6c2e6025c8294243cdbac53b | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% Overlap 3D shapes to images according to the pose annotatio... |
github | yuxng/ObjectNet3D_toolbox-master | draw_cad.m | .m | ObjectNet3D_toolbox-master/draw_cad.m | 837 | utf_8 | af89c70b5de55795cd54ebfbec29af6b | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% display CAD model and anchor points
% example: draw_cad('ca... |
github | yuxng/ObjectNet3D_toolbox-master | project_3d.m | .m | ObjectNet3D_toolbox-master/project_3d.m | 1,402 | utf_8 | 54ddc305c42c2c661ad72feffb4a990d | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% project 3D points to 2D according to the camera parameters
... |
github | yuxng/ObjectNet3D_toolbox-master | show_shapenet_annotations.m | .m | ObjectNet3D_toolbox-master/show_shapenet_annotations.m | 3,701 | utf_8 | 200eade1ff5515eda712d6975b7aef4f | % --------------------------------------------------------
% ObjectNet3D
% Copyright (c) 2016 CVGL Stanford University
% Licensed under The MIT License [see LICENSE for details]
% Written by Yu Xiang
% --------------------------------------------------------
% Display the 3D shape retrieval results from ShapeNet
% Note... |
github | fzhangcode/computational_lab_manual-master | testSample.m | .m | computational_lab_manual-master/matlab/xunit/architecture/testSample.m | 150 | utf_8 | 8b67b7df9d9f1b950b8071780e330763 | function test_suite = testSample
initTestSuite;
function testMyCode
assertEqual(1, 1);
assertElementsAlmostEqual(1, 1.1);
assertTrue(10 == 10); |
github | fzhangcode/computational_lab_manual-master | testFliplr.m | .m | computational_lab_manual-master/matlab/xunit/doc/example_subfunction_tests/testFliplr.m | 210 | utf_8 | dba2423d0ec496209cb1ad0e9db20302 | function test_suite = testFliplr
initTestSuite;
function testFliplrMatrix
in = magic(3);
assertEqual(fliplr(in), in(:, [3 2 1]));
function testFliplrVector
assertEqual(fliplr([1 4 10]), [10 4 1]);
|
github | fzhangcode/computational_lab_manual-master | test_that.m | .m | computational_lab_manual-master/matlab/xunit/doc/+abc/+tests/test_that.m | 161 | utf_8 | 97300fd8d3adec69102d836a63110ca5 | % Do-nothing test used in the examples for organizing tests inside packages.
%
% Steven L. Eddins
% Copyright 2010 The MathWorks, Inc.
function test_that
|
github | fzhangcode/computational_lab_manual-master | test_this.m | .m | computational_lab_manual-master/matlab/xunit/doc/+abc/+tests/test_this.m | 161 | utf_8 | fa26021122fc1ebe7ff54a143d85c458 | % Do-nothing test used in the examples for organizing tests inside packages.
%
% Steven L. Eddins
% Copyright 2010 The MathWorks, Inc.
function test_this
|
github | fzhangcode/computational_lab_manual-master | testWithSetupError.m | .m | computational_lab_manual-master/matlab/xunit/doc/examples_general/testWithSetupError.m | 297 | utf_8 | 754e7acc098bd1d5b72421ff071bc6af | function test_suite = testWithSetupError
%Example of a test with an error. The setup function calls cos with
%too many input arguments.
initTestSuite;
function testData = setup
testData = cos(1, 2);
function testMyFeature(testData)
assertEqual(1, 1);
function teardown(testData)
|
github | fzhangcode/computational_lab_manual-master | testSetupExample.m | .m | computational_lab_manual-master/matlab/xunit/doc/examples_general/testSetupExample.m | 285 | utf_8 | c97034e753adbc170317aeff3beaae86 | function test_suite = testSetupExample
initTestSuite;
function fh = setup
fh = figure;
function teardown(fh)
delete(fh);
function testColormapColumns(fh)
assertEqual(size(get(fh, 'Colormap'), 2), 3);
function testPointer(fh)
assertEqual(get(fh, 'Pointer'), 'arrow');
|
github | fzhangcode/computational_lab_manual-master | testBadSinTest.m | .m | computational_lab_manual-master/matlab/xunit/doc/examples_general/testBadSinTest.m | 198 | utf_8 | 8ff60b6183c1c48b0eecb9aa9581dfc1 | function test_suite = testBadSinTest
initTestSuite;
function testSinPi
% Example of a failing test case. The test writer should have used
% assertAlmostEqual here.
assertEqual(sin(pi), 0);
|
github | fzhangcode/computational_lab_manual-master | testCos.m | .m | computational_lab_manual-master/matlab/xunit/doc/examples_general/testCos.m | 131 | utf_8 | 7e061a28319448a380aa41c5bd35c21b | function test_suite = testCos
initTestSuite;
function testTooManyInputs
assertExceptionThrown(@() cos(1, 2), 'MATLAB:maxrhs'); |
github | fzhangcode/computational_lab_manual-master | test_that.m | .m | computational_lab_manual-master/matlab/xunit/doc/+abc_tests/test_that.m | 161 | utf_8 | 97300fd8d3adec69102d836a63110ca5 | % Do-nothing test used in the examples for organizing tests inside packages.
%
% Steven L. Eddins
% Copyright 2010 The MathWorks, Inc.
function test_that
|
github | fzhangcode/computational_lab_manual-master | test_this.m | .m | computational_lab_manual-master/matlab/xunit/doc/+abc_tests/test_this.m | 161 | utf_8 | fa26021122fc1ebe7ff54a143d85c458 | % Do-nothing test used in the examples for organizing tests inside packages.
%
% Steven L. Eddins
% Copyright 2010 The MathWorks, Inc.
function test_this
|
github | fzhangcode/computational_lab_manual-master | TestRunDisplay.m | .m | computational_lab_manual-master/matlab/xunit/xunit/TestRunDisplay.m | 10,030 | utf_8 | 24f4a694479ffe2dcf3e7255bd249bef | classdef TestRunDisplay < TestRunMonitor
%TestRunDisplay Print test suite execution results.
% TestRunDisplay is a subclass of TestRunMonitor. If a TestRunDisplay
% object is passed to the run method of a TestComponent, such as a
% TestSuite or a TestCase, it will print information to the Command
% Window... |
github | fzhangcode/computational_lab_manual-master | TestSuite.m | .m | computational_lab_manual-master/matlab/xunit/xunit/TestSuite.m | 13,487 | utf_8 | 4a3e72035a673d0511e4d6386689a4a8 | %TestSuite Collection of TestComponent objects
% The TestSuite class defines a collection of TestComponent objects.
%
% TestSuite methods:
% TestSuite - Constructor
% add - Add test component to test suite
% print - Display test suite summary to ... |
github | fzhangcode/computational_lab_manual-master | runtests.m | .m | computational_lab_manual-master/matlab/xunit/xunit/runtests.m | 5,001 | utf_8 | 3bb41e64615af58cf99651fbefef9971 | function out = runtests(varargin)
%runtests Run unit tests
% runtests runs all the test cases that can be found in the current directory
% and summarizes the results in the Command Window.
%
% Test cases can be found in the following places in the current directory:
%
% * An M-file function whose nam... |
github | fzhangcode/computational_lab_manual-master | isTestCaseSubclass.m | .m | computational_lab_manual-master/matlab/xunit/xunit/+xunit/+utils/isTestCaseSubclass.m | 933 | utf_8 | 1a1ee7cece4bd3d76c9823737c53c81b | function tf = isTestCaseSubclass(name)
%isTestCaseSubclass True for name of a TestCase subclass
% tf = isTestCaseSubclass(name) returns true if the string name is the name of
% a TestCase subclass on the MATLAB path.
% Steven L. Eddins
% Copyright 2008-2009 The MathWorks, Inc.
tf = false;
class_met... |
github | fzhangcode/computational_lab_manual-master | arrayToString.m | .m | computational_lab_manual-master/matlab/xunit/xunit/+xunit/+utils/arrayToString.m | 3,068 | utf_8 | a26e49f162e838cae6baa458ce8a3272 | function s = arrayToString(A)
%arrayToString Convert array to string for display.
% S = arrayToString(A) converts the array A into a string suitable for
% including in assertion messages. Small arrays are converted using disp(A).
% Large arrays are displayed similar to the way structure field values display
... |
github | fzhangcode/computational_lab_manual-master | compareFloats.m | .m | computational_lab_manual-master/matlab/xunit/xunit/+xunit/+utils/compareFloats.m | 4,504 | utf_8 | 8e53c740ecedcf9e986479cd7c359a73 | function result = compareFloats(varargin)
%compareFloats Compare floating-point arrays using tolerance.
% result = compareFloats(A, B, compare_type, tol_type, tol, floor_tol)
% compares the floating-point arrays A and B using a tolerance. compare_type
% is either 'elementwise' or 'vector'. tol_type is eithe... |
github | fzhangcode/computational_lab_manual-master | testIsAlmostEqual.m | .m | computational_lab_manual-master/matlab/xunit/obsolete/tests/testIsAlmostEqual.m | 1,280 | utf_8 | 1ba7369398f316f90d543c04b32e8765 | function test_suite = testIsAlmostEqual
%testIsAlmostEqual Unit tests for isAlmostEqual
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testExactlyEqual
A = [1 2; 3 4];
B = [1 2; 3 4];
assertTrue(mtest.utils.isAlmostEqual(A, B));
function testDefaultTolerance
assert... |
github | fzhangcode/computational_lab_manual-master | testAssertAlmostEqual.m | .m | computational_lab_manual-master/matlab/xunit/obsolete/tests/testAssertAlmostEqual.m | 1,102 | utf_8 | ba66ade4b38bb11cf47cf991b39c852e | function test_suite = testAssertAlmostEqual
%testAssertAlmostEqual Unit tests for assertAlmostEqual
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testEqual
assertAlmostEqual(1, 1);
function testEqualWithThreeInputs
assertAlmostEqual(1, 1.1, 0.2);
function testEqu... |
github | fzhangcode/computational_lab_manual-master | testSubfunctions.m | .m | computational_lab_manual-master/matlab/xunit/obsolete/tests/cwd_test/testSubfunctions.m | 229 | utf_8 | d40e59204ad52a0350ef36b9ea09a883 | function test_cases = testSubfunctions
%testSubfunctions Contains two passing subfunction tests
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
findSubfunctionTests;
function testSub1
function testSub2
|
github | fzhangcode/computational_lab_manual-master | isTestCaseSubclass.m | .m | computational_lab_manual-master/matlab/xunit/obsolete/+mtest/+utils/isTestCaseSubclass.m | 933 | utf_8 | 1a1ee7cece4bd3d76c9823737c53c81b | function tf = isTestCaseSubclass(name)
%isTestCaseSubclass True for name of a TestCase subclass
% tf = isTestCaseSubclass(name) returns true if the string name is the name of
% a TestCase subclass on the MATLAB path.
% Steven L. Eddins
% Copyright 2008-2009 The MathWorks, Inc.
tf = false;
class_met... |
github | fzhangcode/computational_lab_manual-master | compareFloats.m | .m | computational_lab_manual-master/matlab/xunit/obsolete/+mtest/+utils/compareFloats.m | 3,598 | utf_8 | 6a545c961c56d5c60a5d1688e6a397b7 | function result = compareFloats(varargin)
%compareFloats Compare floating-point arrays using tolerance.
% result = compareFloats(A, B, compare_type, tol_type, tol, floor_tol)
% compares the floating-point arrays A and B using a tolerance. compare_type
% is either 'elementwise' or 'vector'. tol_type is eithe... |
github | fzhangcode/computational_lab_manual-master | parseFloatAssertInputs.m | .m | computational_lab_manual-master/matlab/xunit/obsolete/+mtest/+utils/parseFloatAssertInputs.m | 2,025 | utf_8 | 885cace1b16bb740872e6c94927a46e5 | function params = parseFloatAssertInputs(varargin)
%parseFloatAssertInputs Parse inputs for floating-point assertion functions.
% params = parseFloatAssertInputs(varargin) parses the input arguments for
% assertElementsAlmostEqual, assertVectorsAlmostEqual, and compareFcn. It
% returns a parameter struct cont... |
github | fzhangcode/computational_lab_manual-master | test_assertVectorsAlmostEqual.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_assertVectorsAlmostEqual.m | 2,518 | utf_8 | 15331dd22771a1f95ddb4a43d8837370 | function suite = test_assertVectorsAlmostEqual
initTestSuite;
%===============================================================================
function test_happyCase
A = [1 1e10];
B = [2 1e10];
% All code here should execute with no error.
assertVectorsAlmostEqual(A, B);
assertVectorsAlmostEqual(A, B, 'cus... |
github | fzhangcode/computational_lab_manual-master | test_arrayToString.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_arrayToString.m | 505 | utf_8 | 8d56541f1f4e3cd3cc1c455e50a732eb | function test_suite = test_arrayToString
%test_arrayToString Unit test for arrayToString.
% Steven L. Eddins
% Copyright 2009 The MathWorks, Inc.
initTestSuite;
function test_smallInput
A = [1 2 3];
assertEqual(strtrim(xunit.utils.arrayToString(A)), '1 2 3');
function test_largeInput
A = ze... |
github | fzhangcode/computational_lab_manual-master | test_assertFilesEqual.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_assertFilesEqual.m | 1,071 | utf_8 | 000206d5e281d7c86139439735d57e66 | function test_suite = test_assertFilesEqual
%test_assertFilesEqual Unit test for assertFilesEqual
% Steven L. Eddins
% Copyright 2009 The MathWorks, Inc.
initTestSuite;
function test_equal
assertFilesEqual('black.tif', 'black.tif');
function test_differentSize
assertExceptionThrown(@() assertFilesEq... |
github | fzhangcode/computational_lab_manual-master | test_parseFloatAssertInputs.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_parseFloatAssertInputs.m | 3,951 | utf_8 | 575c87f68aeea76dacd5ea069a0da73a | function suite = test_parseFloatAssertInputs
initTestSuite;
%===============================================================================
function test_tooFewInputs()
assertExceptionThrown(@() xunit.utils.parseFloatAssertInputs(), ...
'MATLAB:nargchk:notEnoughInputs');
%================================... |
github | fzhangcode/computational_lab_manual-master | test_TestSuiteInDir.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_TestSuiteInDir.m | 685 | utf_8 | 68c757319cff3826ffbcf5b9c9f2ccaf | function test_suite = test_TestSuiteInDir
%test_TestSuiteInDir Unit test for TestSuiteInDir class.
% Steven L. Eddins
% Copyright 2009 The MathWorks, Inc.
initTestSuite;
function test_constructor
this_test_path = fileparts(which(mfilename));
cwd_test_dir = fullfile(this_test_path, 'cwd_test');
suite =... |
github | fzhangcode/computational_lab_manual-master | testAssertFalse.m | .m | computational_lab_manual-master/matlab/xunit/tests/testAssertFalse.m | 836 | utf_8 | 83d408335838b3c7588fef242c41417e | function test_suite = testAssertFalse
%testAssertFalse Unit tests for assertFalse
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testAssertFalseHappyCase
assertFalse(false);
function testAssertFalseHappyCaseWithTwoArgs
assertFalse(false, '1.e4 e5 2.Nf3 Nc6');
func... |
github | fzhangcode/computational_lab_manual-master | testAssertTrue.m | .m | computational_lab_manual-master/matlab/xunit/tests/testAssertTrue.m | 817 | utf_8 | 2f016e5ff969597d9b2dc259ad2568c5 | function test_suite = testAssertTrue
%testAssertTrue Unit tests for assertTrue
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testAssertTrueHappyCase
assertTrue(true);
function testAssertTrueHappyCaseWithTwoArgs
assertTrue(true, '1.e4 e5 2.Nf3 Nc6');
function test... |
github | fzhangcode/computational_lab_manual-master | testRuntestsWithDirectoryName.m | .m | computational_lab_manual-master/matlab/xunit/tests/testRuntestsWithDirectoryName.m | 355 | utf_8 | 531bd30f67a5235ac66912ea5f6c428c | function test_suite = testRuntestsWithDirectoryName
%testRuntestsWithDirectoryName Unit test for mtest('dirname') syntax.
initTestSuite;
function testDirName
current_dir = pwd;
target_dir = fullfile(fileparts(which(mfilename)), 'cwd_test');
[T, did_pass] = evalc('runtests(target_dir)');
assertFalse(did_pass)... |
github | fzhangcode/computational_lab_manual-master | testIsTestString.m | .m | computational_lab_manual-master/matlab/xunit/tests/testIsTestString.m | 617 | utf_8 | 017171162606d826ffb3b96ed5108e7a | function test_suite = testIsTestString
%testIsTestString Unit tests for isTestString
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testOneStringIs
assertTrue(xunit.utils.isTestString('testFoobar'));
assertTrue(xunit.utils.isTestString('Test_foobar'));
function testO... |
github | fzhangcode/computational_lab_manual-master | test_compareFloats.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_compareFloats.m | 3,352 | utf_8 | 1e3c0b554b55747f535af7585a3e1426 | function suite = test_compareFloats
initTestSuite;
%===============================================================================
function test_elementwiseRelativeTolerance
tol = 0.1;
floor_tol = 0.01;
assertTrue(xunit.utils.compareFloats([10 20], [11 20], 'elementwise', ...
'relative', tol, floor_to... |
github | fzhangcode/computational_lab_manual-master | testAssertEqual.m | .m | computational_lab_manual-master/matlab/xunit/tests/testAssertEqual.m | 1,406 | utf_8 | 4e69b6a932e343f517a69fa31701260d | function test_suite = testAssertEqual
%testAssertEqual Unit tests for assertEqual
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testAssertEqualHappyCase
assertEqual(5, 5);
function testAssertEqualWithThreeInputs
assertEqual(5, 5, 'Scandinavian Defense');
function... |
github | fzhangcode/computational_lab_manual-master | test_assertElementsAlmostEqual.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_assertElementsAlmostEqual.m | 1,795 | utf_8 | 100b258664a62734aa6ae46b1960909a | function suite = test_assertElementsAlmostEqual
initTestSuite;
%===============================================================================
function test_happyCase
% All code here should execute with no error.
assertElementsAlmostEqual(1, 1 + sqrt(eps)/10);
assertElementsAlmostEqual(1, 1 + sqrt(eps)/10, '... |
github | fzhangcode/computational_lab_manual-master | testContainsRegexp.m | .m | computational_lab_manual-master/matlab/xunit/tests/testContainsRegexp.m | 616 | utf_8 | 4e61703bd3c92d6740bf5f37f1e19726 | function test_suite = testContainsRegexp
%testContainsRegexp Unit tests for containsRegexp
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testOneStringContains
assertTrue(xunit.utils.containsRegexp('MATLAB is great', '[A-Z]'));
function testOneStringDoesntContain
ass... |
github | fzhangcode/computational_lab_manual-master | testAssertExceptionThrown.m | .m | computational_lab_manual-master/matlab/xunit/tests/testAssertExceptionThrown.m | 693 | utf_8 | 9de19aebb86cdc2008d307e8ea6d7afd | function test_suite = testAssertExceptionThrown
%testAssertExceptionThrown Unit tests for assertExceptionThrown
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function test_happyCase
assertExceptionThrown(...
@() error('MyProd:MyFun:MyId', 'my message'), 'MyProd:MyFun:MyId')... |
github | fzhangcode/computational_lab_manual-master | test_stringToCellArray.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_stringToCellArray.m | 688 | utf_8 | 71cf479ac7b08d8106cbda2784853cf1 | function test_suite = test_stringToCellArray
%test_stringToCellArray Unit test for stringToCellArray
% Steven L. Eddins
% Copyright 2009 The MathWorks, Inc.
initTestSuite;
function test_happyCase
s = sprintf('Hello\nWorld');
assertEqual(xunit.utils.stringToCellArray(s), {'Hello' ; 'World'});
functio... |
github | fzhangcode/computational_lab_manual-master | testIsTearDownString.m | .m | computational_lab_manual-master/matlab/xunit/tests/testIsTearDownString.m | 605 | utf_8 | d2accbeba9903f309ad00dd70f4f4572 | function test_suite = testIsTearDownString
%testIsTearDownString Unit tests for isTearDownString
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testOneStringIs
assertTrue(xunit.utils.isTearDownString('teardownfoobar'));
assertTrue(xunit.utils.isTearDownString('TearDown_... |
github | fzhangcode/computational_lab_manual-master | test_packageName.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_packageName.m | 994 | utf_8 | 3735ceb22b5ef9e48eb10aedb53a425e | function test_suite = test_packageName
initTestSuite;
function test_happyCase
suite = TestSuite.fromPackageName('xunit.mocktests');
assertEqual(numel(suite.TestComponents), 5);
assertEqual(numel(suite.TestComponents{1}.TestComponents), 1);
assertEqual(suite.TestComponents{1}.Name, 'xunit.mocktests.subpkg');
... |
github | fzhangcode/computational_lab_manual-master | test_comparisonMessage.m | .m | computational_lab_manual-master/matlab/xunit/tests/test_comparisonMessage.m | 557 | utf_8 | 604a04180cabe74c4cc4546e3f808648 | function test_suite = test_comparisonMessage
%test_comparisonMessage Unit test for comparisonMessage.
% Steven L. Eddins
% Copyright 2009 The MathWorks, Inc.
initTestSuite;
function test_happyCase
s = xunit.utils.comparisonMessage('user message', 'assertion message', ...
[1 2 3], 'hello');
c = xun... |
github | fzhangcode/computational_lab_manual-master | testIsSetUpString.m | .m | computational_lab_manual-master/matlab/xunit/tests/testIsSetUpString.m | 563 | utf_8 | c960957ff15551a2ba968f1264198bc6 | function test_suite = testIsSetUpString
%testIsSetUpString Unit tests for isSetUpString
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testOneStringIs
assertTrue(xunit.utils.isSetUpString('setup'));
assertTrue(xunit.utils.isSetUpString('setUp_fixture'));
function tes... |
github | fzhangcode/computational_lab_manual-master | testIsTestCaseSubclass.m | .m | computational_lab_manual-master/matlab/xunit/tests/testIsTestCaseSubclass.m | 438 | utf_8 | fbdaf5ad8bc6b856f66b1c8ee23fe722 | function test_suite = testIsTestCaseSubclass
%testIsTestCaseSubclass Unit tests for isTestCaseSubclass
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testTestCase
assertTrue(xunit.utils.isTestCaseSubclass('TestCase'));
function testSubclass
assertTrue(xunit.utils.isT... |
github | fzhangcode/computational_lab_manual-master | testSubfunctions.m | .m | computational_lab_manual-master/matlab/xunit/tests/cwd_test/testSubfunctions.m | 222 | utf_8 | 6cf5104a1d3b62a50992ed21df09c61f | function test_suite = testSubfunctions
%testSubfunctions Contains two passing subfunction tests
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testSub1
function testSub2
|
github | fzhangcode/computational_lab_manual-master | testFunctionHandlesC.m | .m | computational_lab_manual-master/matlab/xunit/tests/helper_classes/testFunctionHandlesC.m | 544 | utf_8 | c19c253bb3da5c2ee4b9b28220005566 | function test_suite = testFunctionHandlesC
%testFunctionHandlesC Test file used by TestFunctionHandlesTest
% Contains two passing tests that use a test fixture containing an intentional
% error.
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testData = setUpFcn
tes... |
github | fzhangcode/computational_lab_manual-master | testFunctionHandlesE.m | .m | computational_lab_manual-master/matlab/xunit/tests/helper_classes/testFunctionHandlesE.m | 308 | utf_8 | 03e1c696776541e1abb5b4db8fd7c166 | function test_suite = testFunctionHandlesA
%testFunctionHandlesE Test file used by TestFunctionHandlesTest
% Contains one failing test.
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testA
error('testFunctionHandlesA:expectedFailure', 'Bogus message');
|
github | fzhangcode/computational_lab_manual-master | testFunctionHandlesA.m | .m | computational_lab_manual-master/matlab/xunit/tests/helper_classes/testFunctionHandlesA.m | 260 | utf_8 | b0ac7dbb35e22e369df2187b6a1b5ee6 | function test_suite = testFunctionHandlesA
%testFunctionHandlesA Test file used by TestFunctionHandlesTest
% Contains two passing tests.
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testA
function testB
|
github | fzhangcode/computational_lab_manual-master | testFunctionHandlesB.m | .m | computational_lab_manual-master/matlab/xunit/tests/helper_classes/testFunctionHandlesB.m | 466 | utf_8 | b5fa9f7591d956cd540b9f097310f8ab | function test_suite = testFunctionHandlesB
%testFunctionHandlesB Test file used by TestFunctionHandlesTest
% Contains two passing tests that use a test fixture.
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function testData = setUpFcn
testData = 5;
function testA(testData... |
github | fzhangcode/computational_lab_manual-master | testFunctionHandlesD.m | .m | computational_lab_manual-master/matlab/xunit/tests/helper_classes/testFunctionHandlesD.m | 477 | utf_8 | cfcdffb571117bd9ef1d231e1dbb329e | function test_suite = testFunctionHandlesD
%testFunctionHandlesD Test file used by TestFunctionHandlesTest
% Contains two passing tests that use a test fixture with no test data.
% Steven L. Eddins
% Copyright 2008 The MathWorks, Inc.
initTestSuite;
function setUpFcn
function testA(varargin)
ass... |
github | fzhangcode/computational_lab_manual-master | notTestString.m | .m | computational_lab_manual-master/matlab/xunit/tests/helper_classes/notTestString.m | 249 | utf_8 | 1e5f9fedf4aea8ed33c1ef0f3ed28fd8 | function suite = notTestString
% This function exists to help test that the TestSuite.fromPwd() method does not
% pick up function-handle test files that do not match the naming convention.
initTestSuite;
function testA
function testB
|
github | fzhangcode/computational_lab_manual-master | testFunctionHandlesTeardownNoSetup.m | .m | computational_lab_manual-master/matlab/xunit/tests/helper_classes/testFunctionHandlesTeardownNoSetup.m | 238 | utf_8 | 92a3d78f8031ffd20628f86c98286af2 | function suite = testFunctionHandlesTeardownNoSetup
% Verify that test file works if it has a teardown function but no setup
% function.
initTestSuite;
function teardown
close all
function test_normalCase
assertEqual(1, 1);
|
github | fzhangcode/computational_lab_manual-master | test_thatFails.m | .m | computational_lab_manual-master/matlab/xunit/tests/dir2/test_thatFails.m | 96 | utf_8 | 34e02f228f68df39c225632c99ab4cbd | function test_suite = test_thatFails
initTestSuite;
function test_case
assertTrue(false);
|
github | fzhangcode/computational_lab_manual-master | test_thatPasses.m | .m | computational_lab_manual-master/matlab/xunit/tests/dir1/test_thatPasses.m | 96 | utf_8 | aa7ff8d94041653dc57679ed4af902a3 | function test_suite = test_thatPasses
initTestSuite;
function test_case
assertTrue(true);
|
github | fzhangcode/computational_lab_manual-master | test_that.m | .m | computational_lab_manual-master/matlab/xunit/tests/+xunit/+mocktests/test_that.m | 171 | utf_8 | 45cd827358c8abe95ea7a80a133c915e | % test_that.m is a subfunction test file.
function test_suite = test_this
initTestSuite
function test_the_other
a = magic(3);
function test_nifty
b = magic(5);
|
github | fzhangcode/computational_lab_manual-master | test_this.m | .m | computational_lab_manual-master/matlab/xunit/tests/+xunit/+mocktests/test_this.m | 63 | utf_8 | 36a606f9aabceb58b1fc37150196f7f8 | % test_this.m is a function-file test case.
function test_this |
github | fzhangcode/computational_lab_manual-master | helper_that.m | .m | computational_lab_manual-master/matlab/xunit/tests/+xunit/+mocktests/helper_that.m | 74 | utf_8 | f9e1aecb247079baa10015b63cc5f91c | % helper_that is not a test file.
function y = helper_that(x)
y = x;
|
github | fzhangcode/computational_lab_manual-master | test_a_bit.m | .m | computational_lab_manual-master/matlab/xunit/tests/+xunit/+mocktests/+subpkg/test_a_bit.m | 93 | utf_8 | 6f36a1a388d4320ca125235ad71a9346 | function test_suite = test_a_bit
initTestSuite
function test_now
function test_later
|
github | fzhangcode/computational_lab_manual-master | m3f_tib_rnd.m | .m | computational_lab_manual-master/matlab/m3f/m3f_tib_rnd.m | 4,912 | utf_8 | e1bd0613ce94553e207b558e19b957ab | function [sample] = m3f_tib_rnd(model, uIDs, mIDs, sampleRatings)
%M3F_TIB_RND Sample from m3f_tib prior.
%
% Usage:
% [sample] = m3f_tib_rnd(model)
% [sample] = m3f_tib_rnd(model, uIDs, mIDs)
% [sample] = m3f_tib_rnd(model, uIDs, mIDs, sampleRatings)
%
% Inputs:
% model - m3f_tib structure (see m3... |
github | fzhangcode/computational_lab_manual-master | m3f_tif_rnd.m | .m | computational_lab_manual-master/matlab/m3f/m3f_tif_rnd.m | 5,885 | utf_8 | a09e8bd14e04f1b2a4744a9f1a36efee | function [sample] = m3f_tif_rnd(model, uIDs, mIDs, sampleRatings)
%M3F_TIF_RND Sample from m3f_tif prior.
%
% Usage:
% [sample] = m3f_tif_rnd(model)
% [sample] = m3f_tif_rnd(model, uIDs, mIDs)
% [sample] = m3f_tif_rnd(model, uIDs, mIDs, sampleRatings)
%
% Inputs:
% model - m3f_tif structure (see m3... |
github | mkneuron/compneuro-master | PT2_3Subcritical.m | .m | compneuro-master/CNS2015 assignments/week 2/PT2_3Subcritical.m | 2,303 | utf_8 | aead7d9a9c75260c946b5cbd2ae0668c | function Paul3Subcritical
% - By plotting the r-nullcline, we can explain if the limit cycle is either asymtotically stable or unstable.
% When the slope at the fixed point is positive, the fixed point is unstable.
% When the slope at the fixed point is negative, the fixed point is
% asymtotically stable.
% ... |
github | mkneuron/compneuro-master | PT2_2.m | .m | compneuro-master/CNS2015 assignments/week 2/PT2_2.m | 1,553 | utf_8 | 6bfaef4db13d3fafc1b0bf1d97822a3d | function Paul2
% - When C equals 0, the amplitude of the oscillator depends on where you start.
% - C determine the duration of the transient towards the stabile limit cycle, i.e. higher C, quicker the state goes to the limit cycle.
% - C and w determine the frequency of the oscillation.
clc
clear all
% close a... |
github | mkneuron/compneuro-master | PT2_1a.m | .m | compneuro-master/CNS2015 assignments/week 2/PT2_1a.m | 1,139 | utf_8 | 7a0e4e77d0386e1be87f55947ed9f325 | function Paul1a
clc
clear all
% close all
%% Fixed points
% saddles
% x1_fp=0;x2_fp=0;
% x1_fp=1;x2_fp=-1;
% x1_fp=1;x2_fp=1;
% x1_fp=-1;x2_fp=-1;
% x1_fp=-1;x2_fp=1;
% centers
x1_fp=0;x2_fp=-1;
% x1_fp=0;x2_fp=1;
% x1_fp=-1;x2_fp=0;
% x1_fp=1;x2_fp=0;
%% Eigenvalues
A=[0 -1+3*x2_fp^2;
-... |
github | mkneuron/compneuro-master | PT2_1b.m | .m | compneuro-master/CNS2015 assignments/week 2/PT2_1b.m | 992 | utf_8 | 069ca05baf3c2de7012828331e45dcbf | function Paul1b
clc
clear all
% close all
%% Fixed point
% centers
x1_fp=1/2;x2_fp=0;
% x1_fp=-1/2;x2_fp=0;
%% Eigenvalues
A=[2*x2_fp 2*x1_fp;
-2*x1_fp 2*x2_fp];
lambda = eig(A)
%% Specify range around the fixed point
x1min=x1_fp-0.5;
x1max=x1_fp+0.5;
x2min=x2_fp-0.5;
x2max=x2_fp+0.5;
fi... |
github | mkneuron/compneuro-master | PT2_3Supercritical.m | .m | compneuro-master/CNS2015 assignments/week 2/PT2_3Supercritical.m | 1,375 | utf_8 | 3ec84d2dbeba833f7b839249a35197d0 | function Paul3Supercritical
% - By plotting the r-nullcline, we can explain if the limit cycle is either asymtotically stable or unstable.
% When the slope at the fixed point is positive, the fixed point is unstable.
% When the slope at the fixed point is negative, the fixed point is
% asymtotically stable.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.