text stringlengths 8 6.12M |
|---|
function varargout = VideoPlayFigure(varargin)
% VIDEOPLAYFIGURE MATLAB code for VideoPlayFigure.fig
% VIDEOPLAYFIGURE, by itself, creates a new VIDEOPLAYFIGURE or raises the existing
% singleton*.
%
% H = VIDEOPLAYFIGURE returns the handle to a new VIDEOPLAYFIGURE or the handle to
% the existing si... |
function test_suite = test_intersectLineCylinder
%Check parallelity of 2 vectors
% output = testIsParallel3d(input)
%
% Example
% testIsParallel3d
%
% See also
%
%
% ------
% Author: David Legland
% e-mail: david.legland@grignon.inra.fr
% Created: 2009-06-19, using Matlab 7.7.0.471 (R2008b)
% C... |
classdef spider_wrap
properties
% Parameters
algo = [];
ind_o = [];
ind_u = [];
K = [];
end
methods
% constructor
function obj = spider_wrap(varargin)
obj = set(obj,varargin{:});
end
function [ obj ] = set( obj, varargin )
... |
function [F, Jc] = jacobian_arap_translation_skeleton_attachment(centers, model_points, model_indices, data_points, attachments, D)
num_points = length(model_points);
F = zeros(num_points * D, 1);
Jc = zeros(num_points * D, length(centers) * D);
%% Compute tangent points
for i = 1:num_points
q = model_point... |
function [ fval ] = imageDistance( img1,img2 )
%IMAGEDISTANCE Summary of this function goes here
% This MatLab function takes two image matrices as input and calculates
% the Eatrh movers distance between them. The image passed will be
% automatically convered to Grayscale.
% For more details about Earth M... |
function [ Priors, Mu, Sigma ] = my_gmmInit(X, K, cov_type, plot_iter)
%MY_GMMINIT Computes initial estimates of the parameters of a GMM
% to be used for the EM algorithm
% input------------------------------------------------------------------
%
% o X : (N x M), a data set with M samples each bein... |
% Given line flow and line capacity, find an augmenting path from the last point to the first.
% Used for Edmonds-Karp Algorithm
%
% INPUTS: Line flow(adj), line capacity(adj)
% OUTPUTS: An augmenting path
%
% GB: last updated, Jan 19, 2019
function Pat = findAugmentingPath(adjf,adjcf)
% Examine the inputs
[x_1,y... |
function [score,board,moves,vine] = grade(moves,vine,board,limit)
% GRADE scores the solution for a given problem for the Vines Contest
%
% board is an m-by-n array of distinct positive integers.
% limit is the total budget of moves plus vine length.
% moves is an p-by-2 array of move orders (using absolute indices)... |
% This function segments image using Mean-Shift algorithm,
% computes the average red, green and blue color per segment,
% and returns the resulting features in a small data matrix
function [ResultingFeatures, im] = extractinstances(image, width)
im = im_meanshift(image, width);
% plot the segments to find the width ... |
function whisk_struct = CompileWStruct(data_directory, feature_list)
for b = 1:numel(feature_list)
fileName = ['whisk_' feature_list{b} '_window'];
if exist([data_directory 'Whisking\' fileName '.mat'], 'file')
disp(['Loading whisking stucture for ' feature_list{b}])
load([data_directory '... |
function p_avg = compute_average_pressure(solution, xmin, xmax, ...
ymin, ymax, Nx, Ny, varargin)
% find quadrature points inside averaging volume
z = solution.problem.domain.z;
zp = solution.problem.domain.zp;
indices = 1:length(z);
indices = indices(real(z) > xmin & real(z) < xmax & ...
imag(z) > ymin & imag... |
%% AKASH SADASHIVAPETH
% cleats an array of linearly seperable points
function [data,slope,y_intercepts] = plotPoints(number_points)
%plot random points
x_points=random('uniform',-1*ones(1,number_points),ones(1,number_points));
y_points=random('uniform',-1*ones(1,number_points),ones(1,number_points));
%plot a line
y_... |
function [V, angle0] = InterpAero(settings, AoAvec, Mvec, Bvec, hvec, cvec, CmatF, CmatE, AoA, M, B, h, c, t)
%{
InterpAero - This function interpolate with nearest-neighbor method a R4->R
the aerodynamics coefficient and a linear interpolation in time or control
action
INPUTS:
- F = F(x1...x4), [NxMxLxI... |
function [net,tr,out3,out4,out5,out6]=train(net,varargin)
%TRAIN Train a neural network.
%
% [NET,TR] = <a href="matlab:doc train">train</a>(NET,X,T) takes a network NET, input data X
% and target data T and returns the network after training it, and a
% a training record TR.
%
% [NET,TR] = <a href="matlab:doc trai... |
%--------------------------------------------------------------------------
%
% SAT_Const: Definition of astronomical and mathematical constants
%
% Last modified: 2018/01/27 M. Mahooti
%
%--------------------------------------------------------------------------
% Mathematical constants
const.pi2 = 2*pi; ... |
function [ output_args ] = sampleTopicCollapsedTimeMat( input_args )
%SAMPLETOPICCOLLAPSEDTIMEMAT Summary of this function goes here
% Detailed explanation goes here
end
|
function [ ] = plot_result( u_x, frame )
%PLOT_RESULT Summary of this function goes here
% Detailed explanation goes here
global tet_mesh ver_num cmin cmax K q
obj_tet = tet_mesh.t;
q_x = K * u_x + q;
color = energy_color(q_x);
r_q_x = reshape(q_x, 3, ver_num)';
file = figure(1);
% set(gcf, 'Render', 'opengl')... |
function [u, z] = ctl_linearisation(setpoint, y, z_old, period)
% controller parameters
u_min = -0.5;
u_max = 0.5;
% here you have to write your own code
end
|
clear all;
Pin=500;
Pout=500;
R_L=40.5;
Vout=100;
Vin=100;
f_0=20000;
w_0=2*pi*f_0;
Iout=Vout/R_L;
Iin=Pin/Vin;
kpr=0.1;
krs=0.35;
Qs=1;
%%
k_irip=0.4;
Ir=Iin*k_irip;
Mrs=Vout/(w_0*Ir);
Ls=Qs*R_L/w_0;
Lr=Mrs^2/((krs^2)*Ls);
Mpr=Vin/(w_0*Ir);
Lp=Mpr^2/((kpr^2)*Lr);
Req=((w_0)^2*(Mrs)^2)/R_L;
Qt=(... |
function initPClock(obj,years,doys,settings,varargin)
p = inputParser;
%
% p.addParameter('FLAG_NO_LOAD',false);
% p.addParameter('atxData',[]);
% p.addParameter('FLAG_APC_OFFSET',true);
% parse the results
parse(p, varargin{:});
res = p.Results;
% FLAG_NO_LOAD = res.FLAG_NO_LOAD; % Flag to not actually load t... |
function [ x ] = setOne( x,n )
%SETONE auxilary method to set the nth value of x to 1
x(n)=1;
end
|
function simulateData( flag )
%get simulation data
% if(flag==1)
sp1=normrnd(5,0.1,100,1);
sp2=normrnd(5,0.15,100,1);
sp3=normrnd(100,5.2,100,1);
sp4=normrnd(220,9.8,100,1);
sp5=normrnd(700,16,100,1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
spf1=normrnd(0.5,0.1,100,1);
spf2=nor... |
close all
clear all
addpath functions
% THE AGENTS IN THE MULTI-AGENT SYSTEM
% Define the structure 'agent'. that contains information about the four
% agents in this exampel. The functions f1, h1, and g1, used below, can be
% founnd in the directory 'functions'.
% Specify which dynamic model that is used
agent(1)... |
function a_n = normal_angle(a)
a_np = mod(mod(a, 2*pi) + 2*pi, 2*pi);
if (a_np > pi)
a_np = a_np - 2*pi;
end
a_n = a_np;
end
|
function [ NEWparams,sessionDataOut] = variationalMStep(params,sessionDataIn,nParams)
%VARIATIONALMSTEP Main Function for Implementing the Variational MStep
%Konstantinos Panagiotis Panousis
%Gatsby Computational Neuroscience Unit
%University College London
%17 June 2015
%Inputs: params: the struct containing the par... |
function [sigma] = sigma(HPFW)
%SIGMA function to calculate sigma value
sigma = HPFW / (2*sqrt(log(2)));
end
|
function r = genlind3fdx2dp(t,fd_cell,p,more)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% genlind3fdx2dp
%
% The third derivative of linear differential equations with respect
% to the input x (twice) and p(once) at time t.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
clear;
close;
videoInfo = csvread('C:\Users\anupr\Documents\eating-gesture-recognition-master\data\ground_truth.csv');
group_id_mapping = csvread('C:\Users\anupr\Documents\eating-gesture-recognition-master\data\group_id_mapping.csv');
videoFile = videoInfo(:,2);
videoFrames = videoInfo(:,3);
[row_data,col] = size(vi... |
function [scope] = Pattern_Extraction(dataSet, IDX, pattern)
% extract the model pattern of the dataSet
% input : dataSet - m*3 matrix each colum related to a MIMO
% IDX - the index of each pattern points
% pattern - the point which lof > thread
% output : scope - each abnomarl patte... |
clc
close all hidden;
clear all hidden;
mm2deg = 90/45.65; % deg/mm
mu = [23.991 23.638 20.11 8.116;24.59 24.365 23.179 17.887; 21.263 19.807 8.228 5.36; 24.976 24.746 21.145 7.107]*mm2deg;
sd = [2.618 2.448 8.287 19.859; 2.199 3.129 3.888 15.815; 3.934 5.236 11.912 5.948; 2.649 2.261 9.17 16.729]*mm2deg;
... |
function res = fix_Ei200(varargin)
simulate = false;
data_file = fullfile(pwd,'sqw','Data','Fe_ei200.sqw');
dE = [70,80];
prj1.u=[1,0,0];
prj1.v=[0,1,0];
prj2.u=[1/sqrt(2),1/sqrt(2),0];
prj2.v=[1/sqrt(2),-1/sqrt(2),0];
prj3.u=[1,-1,0];
prj3.v=[1,1,0];
w000 =cut_sqw(data_file,prj1,[-2,0.01,2.5],[-2,0.01,2],[-0.08... |
%% Takes split ND2s (TIFFs), deletes the even numbered-numbered ones, merges TIFFs 3 & 5.
folderName = uigetdir();
%%
fileList = dir([folderName,filesep,'*c=0*.tif']);
%
%disp([fileList.name]);
%%
for iFile = 1:length(fileList);
% % delete
% c=1 is phase
% %
% c=3 is old, second image plan... |
%% Example
% This is what you do in MATLAB
w = []; % set w equals to an empty vector;
for ii = 1:length(v)
if v(ii) >= 0
w = [w v(ii)];
% we are appending v(ii) to the end of w
end
end
|
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
% N- point DFTs of a 4-point sequence
% 4-point DFT
x=[1 2 3 4];
fft(x)
% 6-point DFT
fft(x,6)
xx=[x 0 0];
% 6-point DFT
fft(xx)
% 3-point DFT
fft(x,3)
% 3-point DFT
xx=[1 2 3];
fft(x... |
function printelog(FigHandle, varargin)
%
% Author, Category, ScalingFlag
% -l Controls -a Author=Greg -a Type=Other -a Category="Hardware" -a Subject="Matlab Figure" "Print from Matlab worked!"');
if nargin < 1
FigHandle = gcf;
end
% Defaults ???
Logbook = 'Operations';
Author = 'Guest';
Category = 'Other';
... |
x=[];
y=[];
number=[1,1,1,1,1];
for i=1 : size(Manufacturer)
if strcmp(Manufacturer(i), 'bmw')
x(1, i) = Weight(i);
y(1, i) = MPG(i);
elseif strcmp(Manufacturer(i), 'ford')
x(2, i) = Weight(i);
y(2, i) = MPG(i);
elseif strcmp(Manufacturer(i), 'honda')
x(3, i) = Weight(i)... |
function ellipseObj = createEllipseObj(x, y, z, c, t, radX, radY, transform)
%ellipseObj = createEllipseObj(x, y, z, c, t, radX, radY, transform)
ellipseObj = pojos.EllipseData;
ellipseObj.setX(x);
ellipseObj.setY(y);
ellipseObj.setTheZ(z);
ellipseObj.setTheC(c);
ellipseObj.setTheT(t);
ellipseObj.setRadiusX(radX);
ell... |
function [ y , n ] = sig_shift( x,m,n0 )
n=m+n0;
y=x;
end
|
function [weights] = logistic_train(data, labels, epsilon, maxiter)
%% HW4 Q1: Newton-Raphson (IRLS) iterative reweighted least squares (gradient descent)
% INPUTS:
% data = n * (d+1) matrix withn samples and d features, where
% column d+1 is all ones (corresponding to the intercept term)
% labels = n * 1 vector o... |
% ======================================================================
% task 1
%
% Made by ElijahOzmegov@gmail.com as a part of the second laboratory work
%
% Task is to transform vector omega and angle theta to quaternion, so
% here will be used parts from the previous lab code
% A... |
function fcns = weightFcns(net,netInputFcn)
% Copyright 2012-2015 The MathWorks, Inc.
if nargin < 2, netInputFcn = ''; end
fcns = {};
for i=1:net.numLayers
if isempty(netInputFcn) || strcmp(net.layers{i}.netInputFcn,netInputFcn)
for j=1:net.numInputs
if net.inputConnect(i,j)
fcns{end+1} = net.inp... |
% sample from the (non-exchangeable) Indian Buffet Process
%
% N - number of customers
% alpha - as is
% Z - the sampled binary feature matrix
%
% Note: Samples can be lof-equivalent to each other in this case.
%
% Written by Minjie Xu (chokkyvista06@gmail.com)
function Z = ibprnd(N, alpha)
EKp = ceil(alpha*hrmsum(... |
classdef Transformation < handle & matlab.mixin.Copyable & LinearTransformationBase
%TRAJECTORY Encapsulates trajectory functionality
% Detailed explanation goes here
properties
% Raw data
orientation_quat
position
end
methods
% Constructor
... |
A = tBenchMarkCO2Controller.tModel.aafA;
B = tBenchMarkCO2Controller.tModel.aafB;
C = tBenchMarkCO2Controller.tModel.aafC;
E = tBenchMarkCO2Controller.tModel.aafE;
for iTimeStep = 1 : tBenchMarkCO2Controller.iPredictionHorizon
%
tBenchMarkCO2Controller.tSimulation.aafStatesMatrix(:,iTimeStep + 1) = ...
A * ... |
function [fObs,zObs] = getObs(Obs, epsilon)
% returns collision avoidance constraints
global x bigM;
% number of agents
N = length(x);
% time horizon
h = size(x{1},2);
% Obstacle avoidance constraints
fObs= [];
zObs = [];
% for each robot
for n = 1:N
% at each time instance
for t = 1:h
xt = x{n}(:,t)... |
function [varargout]=SUPER_PredictPatients(PAT_STRUCT,NUM_REPS,varargin)
% PredictPatients
% Uses (leave-1/3)-out cross validation to determine the predictive
% power of the BASE_CALLS and ELM vectors in predicting patient
% response. This method is set-up to be used by the BLADECENTER.
%
% ... |
function [] = run_everything_simul()
%runAllSubjects_Simul( choiceFile, outcomeFile, ...
% startFile, outputFile, choiceRule)
runAllSubjects_Simul('output/simul/Simul_M4',...
'input/outcomes_1.csv',...
'input/startValues_1.csv',...
'output/simul/Simul_',1);
runAllSubjects_Simul('output/simul/Simul_M4',...
... |
clc
clear
tempC=input('What is the temperature in Celcius:');
tempF=(tempC*(9/5)+32);
if(tempC<25)
fprintf('Hello World! It is chilly outside!\n')
else
fprintf('Hello World! It is warm outside!\n')
end
fprintf('The temperature is %0.2f C or %0.2f F\n',tempC,tempF) |
classdef aceModeSwitch
properties (GetAccess = 'public', SetAccess = 'public') % public read access, but private write access.
mode = 2;
activeDOFs = [];
numStates = 0;
state = 1;
saChan = 0;
saGain = 3;
... |
function files = getFiles( filter, prompt )
% GETFILES User prompt for filenames
%
% FILES = GETFILES( FILTER, PROMPT )
% Asks the user to select files, where the listed files are filtered
% according to FILTER (for example, '*.txt'). The text in PROMPT is shown
% in the title bar to the user. A file-open dia... |
function [H]=CrearFiltro(W, Do, xv, yv)
D = sqrt((xv.^2)+(yv.^2));
H= 1./(1+(((D.*W)./(D.^2-(Do^2))).^2));
end |
function [Rround P] = mcs_pc_corr(season,vname,dlat,ilatzone,pc,svec,dosave)
%[Rr.dt P.dt] = mcs_pc_corr(season,'dt',dlat,ilatzone,pc,svec,dosave)
%[Rr.dq P.dq] = mcs_pc_corr(season,'dq',dlat,ilatzone,pc,svec,dosave)
ii=1;
latzone = {'trop','midlat','pole','global'};
diro = ['/Users/g/archive/matlab/F_2000_SPCAM_m2005_... |
classdef bootstrapSample
%BOOTSTRAPSAMPLE Summary of this class goes here
% Detailed explanation goes here
properties
values;
sampleDimension;
end
methods
function obj = bootstrapSample(sample, sampleDimension)
obj.values = sample;
if narg... |
close all;
clear;
clc;
setup_paths();
cell_size = 6;
nOrients = 9;
%nDim = 3*nOrients+5-1;
% uncomment below to show zero's color
nDim = 3*nOrients+5;
im_orig = imread('data/orig.jpg');
im_v13 = imread('data/orig_v13.jpg');
im_v68 = imread('data/orig_v68.jpg');
[im_height, im_width, num_im_cha... |
% pay attention to the ncol,nrow,dt_mov,dnsamp,dire,and cycle!
% this script is for df/F probe.
% Luxin Peng, last edited in 20181106
% Luxin Peng, last edited in 20190415
% Luxin Peng, last edited in 20190415
% change the methods for fingding peaks and normalization
%
% Zoulab
% dF/F and Vm an... |
function [DGfinalsoln,data] = RIrDG_method_cc_interior(DGsolution_old,data)
%Run the DG data.method for the given inputs
% Detailed explanation goes here
deltatx = data.deltav1/data.Fspeedmax*data.cfl;
deltaty = data.deltav2/data.Gspeedmax*data.cfl;
deltatz = data.deltav3/data.Hspeedmax*data.cfl;
%%{
if strcmp(data... |
function f=fitfit(a,x);
N=max(size(a));
X=x(1:a(N));
Y=x(a(N)+1:a(N)+a(N-1));
[y,x]=meshgrid(X,Y);
ff=a(1)*cos(a(2)*(x.^2+y.^2)+a(3))./(x.^2+y.^2).^a(4);%THIS IS A USER %DEFINED FUNCTION.
%ONE CAN CHANGE IT ACCORDING TO THE FITTNG EQUATION TO BE USED
ff=ff';
[m,n]=size(ff);
f=reshape(ff,1,m*n);
|
clear all;
%%
cm = {[1,2],3, 4};
EID_AR = [-1.033, -1.033, -1.1]';
num_modes = length(EID_AR);
thresh = 10^-3;
diff_p = squareform(pdist(EID_AR)/max(abs(EID_AR)));
inds = find(diff_p < thresh);
eq_modes = {};
if length(inds) > num_modes
[i,j] = ind2sub([num_modes, num_modes], inds);
eq_ind = i== j;
i(eq_... |
function generate_parameter_file(path, im_height, im_width, im_no, plant_axis, do_remove_plane, do_remove_pot, depth_thresholds, bounding_box, save_pc, save_measurements)
% Saves a parameter file containing a structure with the specified
% parameter values
parameters.im_height = im_height;
par... |
scra_ID = fopen('scra_chunk_21','rb') %Open scrambled chunk
scra_21 = fread(scra_ID,inf,'double') %Read scrambled chunk
hist_ID = fopen('hist_chunk_21','rb') %Open histogram
hist_21 = fread(hist_ID,inf,'int32') %Read histogram
max_hist = max(hist_21) %Find element with the highest value
pos_hist = find(hist_21 == ... |
function expec_Plot2(L_y)
N = 1e3;
L_x = [0.1:0.1:1 10:10:100 100:100:1e3];
Y = [];
for i=1:length(L_x)
y = expected_Distance(N,L_x,L_y);
Y = [Y y];
end
AR = [];
AR(i) = L_x(i) / L_y;
semilogx(AR,Y)
end |
function [W]=censoring_fast(data,thr,M1,M2,sigma)
M=max(thr,thr+L);
thr=min(thr,thr+L);
KT=sigma^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% exp(-a*(X-XA)^2)*exp(-b*(X-XB)^2)
a=(1/KT);
b=(1/(sqrt(M2-M1)*KT));
%XA is the center of the normal Gaussian, hence data(i,j)
XB=(M1+M2)/2; %XB is the... |
% SETUP
% 1. umer2at and at2umer need to be written
% umer2at - DONE
% at2umer - DONE
%
% 2. Add proper .Ranges, .Tolerances, and .DeltaRespMat
% added in umerinit file
% Tolerances - DONE (umer magnets run around 2-3 amps and have mA tolerances
% Ranges - DONE (umer magnets run max 2.5/3 amps other will bur... |
%%
clc;
clear;
%%
% Summary of example objective
% The goal of this tutorial is to use LQR theory applied to
% a model of collective behavior. The model choosen shares a formal
% structure with the semidiscretization of the semilinear 1d heat equation.
%%
% Consider $N$ agents $y_i$ for $i=1,...,N$, and let $y=(y_1,.... |
function []=eo_reactor1D
%==========================================================================
%2016 EO reactor, S.R.A. Kersten
%1D model
%assumptions: velocity is constant, no pressure drop
%==========================================================================
%the variables below can be changed in ... |
ns = 1:500;
ts = 1:500;
for n = ns
tic;
det(magic(n));
ts(n) = toc;
end
plot(ns,ts);
|
function [ N, signal ] = Signal02()
N = 300;
signal = zeros(N);
for (i = 1:N)
signal(i) = 0.95*sin(2*pi*i/35);
if (i>=110 && i<=210) signal(i)= signal(i)+ sin(2*pi*i*20/35)* 0.2*exp(-0.01*(i-110));
end
end
|
clear
clc
%Dj Hinton, Clair, M
%Engineering 0012, Vidic 2pm
%Jan. 24, 2017
%Homework 3
%This script finds the basic statistical information )such as mean, median, and variance) of the data sets
%given.
check='y';
while check == 'y'
%LOADING THE DATA
%step 1
%file 1
filename1=input('file(one) name: ','s');
whil... |
function [GPC Low GS GS1] = OrthDesign(Xo,y)
%%%%%%%%%%%%%%%Jason Bentley (2008) University of Canterbury%%%%%%%%%%%%%%%
%Gibbs sampler for Bayesian variable selection in linear regression using %
%Zellner's prior or Jeffreys prior with the binomial prior for gamma. %
%INPUT: y is the n.1 response vector ... |
function plotDotPerp2LineABC(Dot, Line, color, width)
global axisRange;
x0=Dot(1);
y0=Dot(2);
a=Line.a;
b=Line.b;
c=Line.c;
A=[b -a; a b];
B=[b*x0-a*y0;-c];
Head=inv(A)*B;
plot([x0,Head(1)],[y0,Head(2)],color,'linewidth',width);
axis(axisRange); |
classdef YSI
%% YSI
% $Revision$
% was created $Date$
% by $Author$,
% last modified $LastChangedDate$
% and checked into repository $URL$,
% developed on Matlab 8.6.0.232648 (R2015b)
% $Id$
properties (Constant)
GLUT_HOME = fullfile(getenv('ARBELAEZ'), 'GluT', '');
... |
% Script that calculates the cost of each component and subsequently the
% total cost of the system, as well as other economic metrics (possibly
% ...)
% Some input variables - move these to an input file?
% Have a structure called Cdata
Cdata.lifetime = 25.0 ; % Lifetime
Cdata.price = 0.06 ; % Elec... |
function writePbmData(filename,gen_rets_file,setName1,asset_val,A,alpha,TW,W0,tree,final_rets_file)
%this function creates filename file for the ampl solver. It loads returns from gen_rets_file
%and inserts it with the parameters A,alpha,TW,W0 in filename
%if final_rets_file is passed, the leaves nodes rets are written... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The function show in 3D how variables in the input matrix data
% are cluster. Usage example:
% plot3Dclusters({'TE','PE','SL'},YoungNPdataSET,YoungSIMdataSET)
% types for plot3Dclusters(cell,cell,cell)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
%% Run WCST simulation in healthy
%% young subjects % Score by Heaton
clear; clc;
%% Define number of trials
numTrials = 25; %set the total number of trials
%% Print initial time
fprintf('Simulating WSCT\n');
fprintf('Beginning time: %s\n', datestr(now,'HH:MM'))
%% Draw first figure
figure; %PlotSIMvsNP;
%drawnow... |
function [segout]=divpeak(estf,faxis)
% DIVPEAK is a function that divides EST into several lines,circumventing
% the local minima and maxima of input data EST. DIVPEAK returns several
% segments separated by minima and maxima. Elements of number +- 'range' around
% minma and maxima will be discarded. The percentage of... |
%% FINITE LAYER ANALYSIS
% getConcreteLayers.m
% 3 Mar 2015
% Trent Taylor
function [ layers ] = getConcreteLayers(compressiveStrength_default)
%GETCONCRETELAYERS Assembles a struct of concrete layers
%% Get number of layers
layerCount = inputdlg('Input number of layers: ');
layers{str2num(layerCount{1})} = {};
las... |
function [rads1,rads2] = computeRrInverseKinematics(X,Y)
syms theta1 theta2 ;
S = solve([theta1>0,theta1<pi/2,theta2>0,theta2<2*pi],[cos(theta1)+cos(theta1+theta2)==X,sin(theta1)+sin(theta1+theta2)==Y],[theta1,theta2]);
rads1 = double(S.theta1);
rads2 = double(S.theta2);
|
function [Csat_ugPm3, Csat_ugPm3_log10] = Csat_calculate_v1(Molar_mass_gPmol,saturation_vapor_pressure_Pa, Temperature_K, optional_convert_Psat_from_mmHg)
% [Csat_ugPm3, Csat_ugPm3_log10] = Csat_calculate_v1(Molar_mass_gPmol,saturation_vapor_pressure_Pa, Temperature_K, optional_convert_Psat_from_mmHg)
%%
% Created b... |
%%
function [ cikti] = renk_tabanli_k_means_algoritmasi( dosya_adi,kume_sayisi )
he = imread(dosya_adi); % resmimizi okuduk.
%imshow(he), title('Orjinal Resim');
%%
cform = makecform('srgb2lab'); % resmimizi rgb formatında... |
function [GMMWeight,Peaks] = OnlineSSL_DPRTF_EG(soundData,rtfTemp,freRan,MP)
%% Input
% Sound Data : audio signal, with the size of (No. of samples) x (No. of mics), and with the sampling rate of 16 kHz
% rtfTemp: RTF template for candidate locations, with the size of (No. of freqencies) x (No. of microphone pairs) x (... |
clc
clear all
close all
%% Parameters
k1=8; % 2^k1: Length of each VT codeword section
disp('k1:');
disp(k1);
k2=0; % 2^k2: Number of VT codeword sections
disp('k2:');
disp(k2);
p=0.5; % Bernoulli probability of each element in data-bit string d
data_num=10000; % Number of different data-bit strings
c... |
function CreateCutterWindow(self)
% KKwikCutter.CreateCutterWindow
MCS = MClust.GetSettings();
MCD = MClust.GetData();
self.CreateCutterWindow@MClust.Cutter(); % call superclass to build initial window
%--------------------------------
% constants to make everything identical
uicHeight = self.uicHeight;
uicWidth ... |
%% problem 2
%Henrik Lucander
%724140
%clear all;
%close all;
%house_params = [45 1978 1 1 0.2 0.3];
function price_house = estimate_price(house_params)
data=readtable('data2.xlsx');
arrData = table2array(data);
P = [1.43 0.63]; %coordinates of downtown
%calculating distance to downtown(P) with basic distance between ... |
function model = rank_elm_pointwise_train(X_train, Y_train, Q_train, option)
%% input option
NumberofHiddenNeurons = option.NumberofHiddenNeurons;
ActivationFunction = option.ActivationFunction;
metric_type = option.metric_type;
C = 2^option.C;
if isfield(option, 'seed')
seed = option.s... |
function [outputSignal] = sigfold(inputSignal)
% Folds inputSignal to produce outputSignal.
% Here, outputSignal(n) = inputSignal(-n).
%
% Parameters:
% inputSignal - The inputted signal that is to be folded.
%
% Returns:
% outputSignal - The folded signal.
% outputSignal is the folded signal of in... |
clear;
clc;
ncdisp('NewFile.nc')
%Seleccionar las variables que se desean cortar creando una celda.
%variables=input('Introduce las variables que deseas cortar en un arreglo de celda.')
variables={'velocity'};
%Guarda las variables Longitude y Latitude del archivo NetCDF en LON y LAT
%respectivamente.
LON=ncread('Ne... |
%718091 Stefan Benox
%715023 Tobias Falk
%funktion generiert Ton abhaenig von der Tastennummer keynum
function [tone] = note(keynum,relDuration,fullDuration,fs)
tone = createWaveform(440*(2^(1/12))^(keynum - 49),fs,relDuration*fullDuration,1)
end |
function phaseDiffMax = LRCphaseDiffMax
%LRCPHASEDIFFMAX Summary of this function goes here
% Detailed explanation goes here
% 5 hours in seconds, max allowed difference between activity acrophase and pacemaker
phaseDiffMax = 5*60*60;
end
|
function [X]=dos_recon_lq_wc_2p_f_mams(f0,para)
AmX=para.A;
Nxy=para.nx*para.ny;
Nvz=para.nz;
for iz = 1:para.nz
idxz = (iz-1)*Nxy + (1:Nxy); %mua
AmX(:,idxz) = AmX(:,idxz) * para.Ma(iz);
idxz = Nxy*Nvz + (iz-1)*Nxy + (1:Nxy); %mus
AmX(:,idxz) = AmX(:,idxz) * para.Ms(iz);
end
i=6;
j=5;
k... |
clear all;
close all;
clc;
Frequence1= 1000; % Fréquence 2 kHz
A1= 1; % Amplitude du signal 1
FrequenceEchant= 48*Frequence1; % Fréquence d'échantillonnage des signaux
Tmax=1 ; % Durée des signaux en seconde
pas= 1/... |
clear
clc
prompt = input('Do you want to provide Order of Hilbert Matrix (Y or N): ', 's');
if prompt == 'Y' || prompt == 'y'
n = input('Order of Hilbert Matrix: ');
k = n;
else
k = [2,3,4,10,20];
end
f = 2;
table = {'n','GE_Err','GS_Err','HH_Err','M_Err','Inv_Err','Div_Err','Condition Number'};... |
% demonstrate the find function in matlab (pg 343)
% assumes that matrix-ops2 has been previously executed
find(grades>=90)
|
%% Convert Axis-Angle Rotation to Rotation Matrix
% Copyright 2015 The MathWorks, Inc.
%%
axang = [0 1 0 pi/2];
rotm = axang2rotm(axang)
|
clc
clear
numRetainedTracts=100;
travelData=table2array(readtable("seattle_travel_numbers.csv"));
gisData=readtable("seattle_GIS_data.csv");
uVData=table2array(readtable("seattle_UV_coordinates.csv"));
hundredTractIndices=table2array(readtable("seattle_100_sameArea_indices.csv"));
travelData100(numRetainedTracts,numRet... |
%% shear force
function sfd(lb,npb,nub,pbm,pbx,Rab,Rbb)
j = 0;
for x=0:0.02:lb
j = j + 1;
temp1 = 0;
for pi = 1:npb
if(x<pbx(pi))
v1(j) = 0;
break;
else
temp1 = temp1 + pbm(pi);
v1(j) = 0;
m1(j) = 0 ;
end
end
for ui = 1:nub
if(x<ubx(u... |
clear outcast recast
% correct the particles that are out of simulation domain
% by giving them a position randomly in the initial distribution
outcast=find(alphas_psi>Nradial-2);
if (~isempty(outcast))
recast=randi(Nalphas_simulated,size(outcast,1),1);
reposition_lost_particles_3DG;
... |
function y = LPF3(x)
%LPF3 Filters input x and returns output y.
% MATLAB Code
% Generated by MATLAB(R) 8.2 and the DSP System Toolbox 8.5.
% Generated on: 24-Jun-2014 01:10:11
%#codegen
% To generate C/C++ code from this function use the codegen command. Type
% 'help codegen' for more information.
persistent Hd;
... |
% Script to illustrate the sensitivity issue with naive NCR
% To get amplification, we need lots of Cas13, but having lots of Cas13
% gives rise to significant levels of background activity that "looks"
% exactly like activated Cas13 activty wrpt cutting specificity
clear
close all
addpath('../utilities')
FigPath = ... |
function [newmap error] = hotspot_scale(map, hotspots)
error = 0;
newmap = [];
[nloc, c] = size(map);
if( nloc <= 1 || c ~= 2 )
error = 1;
disp('error in physical map');
return;
end
phy_map = map(1:nloc,2);
intervals = (phy_map(2:nloc) - phy_map(1:nloc-1));
if( any(intervals < 0) )
error = 1;
dis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.