text
stringlengths
8
6.12M
clear; clc; close all; % https://www.mathworks.com/help/signal/ug/fir-filter-design.html % https://www.mathworks.com/help/signal/ref/fir1.html % https://www.mathworks.com/help/signal/ref/cheby1.html % https://www.mathworks.com/help/signal/ref/kaiserord.html % %https://www.mathworks.com/help/signal/ref/freqz.htm...
addpath('quaternion_library'); clear all;close all;clc; load('AllData8.csv');%load('AllData_Double_deney2.csv');%load('ExampleData.mat'); % SENSOR DATA ---------------------------------------------------- % Ideal IMU Data % acc = zeros(N,3);av = zeros(N,3);rng(1);% q = randrot(N,1); % uniformly distributed random rota...
disp('instancias/chr20a.dat'); for i=1:1 Pso('instancias/chr20a.dat'); end disp ('QAP finish') return
% Example navigation task % Copyright 2018 The MathWorks, Inc. %% Setup connectToRobot; % Create publishers and subscribers for navigation odomSub = rossubscriber(AMCL_POSE); [vPub,vMsg] = rospublisher(ROBOT_CMD_VEL); % Reset the odometry to zero %resetOdometry; %% Path planning % First, load the pre...
clear all; close all; clc; %% Read Original Image Original_Image = imread('SunnyLake.bmp'); figure(1) subplot(1,2,1) imshow(Original_Image) title('Original Image'); %% Manual GrayScale Generate [w,h,z] = size(Original_Image); % GrayScale_Image=zeros(w,h); for(i=1:w) for(j=1:h) GrayScal...
function tmp = AMIGO_toString(f,writeEmptyType) % AMIGO_toString converts variable into string. if nargin < 2 || isempty(writeEmptyType) writeEmptyType = true; end tmp = ''; fs = size(f); cf = class(f); if isempty(f) if writeEmptyType tmp = strcat(tmp, sprintf('[] (%s)',cf)); end elseif isscalar(f)...
data = []; tags = []; % 0 means nonspeech and 1 means speech dataIndex = 1; speechfolder = fullfile(datasetFolder,'speech'); nonspeechfolder = fullfile(datasetFolder,'nonspeech'); splist = dir(fullfile(speechfolder,'*.wav')); for i=1:length(splist) disp(splist(i).name); disp(['speech ',num2str(i) , '/' , num2...
% Vertex eccentricity - the maximum distance to any other vertex % Input: adjacency matrix % Output: vector of eccentricities % Other routines used: simple_dijkstra.m function ec=vertex_eccentricity(adj) n=size(adj,1); ec=zeros(1,n); for s=1:n; ec(s)=max( simple_dijkstra(adj,s) ); end
% EJERCICIOS RESUELTOS DE VISIÓN POR COMPUTADOR % Autores: Gonzalo Pajares y Jesús Manuel de la Cruz % Copyright RA-MA, 2007 % Ejercicio 12.8: Formas a partir de la intensidad %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 12.7.3 Obtención del albedo y la dirección de iluminación ...
%% Problem 1 close all; clear; clc; e0 = 8.85e-12; % [E/m] Lx = 0.03; %[m] Ly = Lx; R = Lx/6; x0 = Lx/2; y0 = Ly/2; % center of the cylinder rou0 = 8.85e-12; % charge density [C/m^3] nx = 20; % number of intevals ny = nx; delx = Lx/nx; dely = Ly/ny; x = 0:delx:Lx; y = 0:dely:Ly; [X, Y] = meshgrid(x,y); r = ((X-x0)...
%% microFJ gives the function to zero for finding equilibrium % sys1 - reference state % sys2 - reference state for phase shift condition % M - number of cars (M must divide N) % N - discretization points % L - length of road % tau - momentum constant; % Returns: % F - the function to zero for an equilibrium so...
function fo = warp_f_gamma(f,gamma,t) fo = interp1(t, f, (t(end)-t(1)).*gamma + t(1))';
% In/out/pass Self-Organizing Map for vertical samples function result = som_v(input) %% Checking input dimension if size(input, 1) ~= 1 error('Wrong input row size'); elseif size(input, 2) ~= 30 error('Wrong input column size'); end %% Input computation global som_net_v so...
function[] = myOutlier(path, h, w, num_ids, num_train, num_test, k) % path = '../../../att_faces/s'; h= 112; w = 92; num_ids = 32; num_train = 6; num_test = 4; k = 0; d = h*w; trainSet = zeros(h, w, num_train, num_ids); testSet = zeros(h, w, num_test, num_ids); outliers = zeros(h, w, num_test, (40-num_ids)); meanArr =...
% Aufgabe 9 % Erstellen eines kartesischen Gitters xmesh = linspace(0,1,11); ymesh = linspace(0,1,11); zmesh = linspace(0,1,11); mesh = cartMesh(xmesh, ymesh, zmesh); Mx = mesh.Mx; My = mesh.My; Mz = mesh.Mz; nx = mesh.nx; ny = mesh.ny; nz = mesh.nz; np = mesh.np; % Erstellen des Strom-Vektors jbow = zeros(3*np,1);...
clc;close all; clear all; Annotation_root = '/home/zouyunzhe/JointTracking/tmp/posetrack/posetrack_data/annotations/'; Annotation_path = fullfile(Annotation_root,'train_box_pairs_same_frame'); folder_layer = dir(Annotation_path); folder_layer(1:2) = []; if length(folder_layer) % old_folder = % new_folder =
% clear % close all % load('s.mat') D = 200; N = D; Nu = D; lambda = 1; Ypp = 33.42; Upp = 27; Umin = 0; Umax = 100; % dUmax = 0.1; % dUmin = -0.1; Yzad = zeros(N,1); Y0 = zeros(N,1); Yk = zeros(N,1); % U(1:11) = Upp; % Y(1:11) = Ypp; dU = zeros(Nu,1); dUp = zeros(D-1,1); M = zeros(N,Nu); Mp = zeros(N,D-1); for ...
fig1 = figure('Position',[1,40,400,300]);fig2 = figure('Position',[1,40,400,300]); fig3 = figure('Position',[1,40,400,300]);fig4 = figure('Position',[1,40,400,300]); fig5 = figure('Position',[1,40,800,600]); % fig6 = figure('Position',[1,40,400,300]); % fig7 = figure('Position',[1,40,400,300]);fig8 = figure('Position',...
%% Description % this code generates visiblity field for a target represented by a % gaussian model addpath('..\ASAP1','..\multi_target_tracking\','..\plotregion\'); addpath('..\multi_target_tracking\polytopes_2017_10_04_v1.9') addpath(genpath('..\robot-10.1')) addpath(genpath('.\Matlab_Polygons_intersection\')) addp...
clear all; Htable = zeros(8,181,181,400); ccount = 1; for count = 1:100 for count2 = 2:2:8 %if(count == 32 && count2 == 7) %ccount = ccount + 1; % continue; %end filename = strcat('C:\Users\Vamshi\Desktop\Fingerprint\Database\FVC2002\Dbs\DB1_A\',num2str(count),'_',num2...
function [J, grad] = costFunction(theta, X, y) % Compute cost and gradient for logistic regression % J = COSTFUNCTION(theta, X, y) computes the cost of using theta as the % parameter for logistic regression and the gradient of the cost % w.r.t. to the parameters. m = length(y); % number of training examples J = 0; gr...
% MeanVelocityToAcceleration.m % File defining one of the methods of class BallisticDataAnalysis. % ========================================================================= % Write something short. % This function take input from "AvgVar" to find average acceleration due % to gravity and compare with the acceleration ...
function trs = filter1(omega,Dw_f,Loss_f) % transmission or transmittance omega = omega'; omega =fftshift(omega); m = 1; % gausssian parameter trs = sqrt(1-Loss_f)*exp(-0.5*(4^m)*log(2).*(omega./Dw_f).^(2*m)); end
function [progress, angles] = computeProgressOfProjection(v,cursorToTarget) % v is dxN % cursorToTarget is dx1 or dxN % % This is simple linear algebra that YOU SHOULD KNOW! % % Sanity check: % theta = linspace(0,2*pi,100); % v = [cos(theta); sin(theta)]; % velocities are on unit circle % targetDirection = [1;0]; % uni...
% FILE: Assignment2.m % NAME: ZHIMINGYUAN LIU % DESCRIPTION: Plot the first 50 samples of cat.wav, both discrete one % and % continous one. % Clear all variables and close all windows clear all; close all; % Load the cat.wav signal [y, Fs] = audioread('cat.wav'); n = 0:(1):(length(y)-1); % Extract the 50 samples an...
function [idx] = search_parent(parent_node, OPEN) %UNTITLED6 Summary of this function goes here % Detailed explanation goes here c1 = size(OPEN, 1); idx = 0; for i = 1:c1 if OPEN(i, 2:3) == parent_node idx = i; break; end end if 0 == idx error('not ...
currentfolder = pwd; cd currentfolder; file = 'test\foot10inpen.txt'; dem = ' '; A = importdata(file,dem); h = fspecial('gaussian'); y = filter2(h, A); save('test\foot10inpenmat.txt','y','-ascii');
% testmouse.m - testing mouse functionality config_display(0); config_mouse(100); config_keyboard; start_cogent; map = getmousemap; x=0; y=0; n=0 while(1) n=n+1 % Draw text at position defined by mouse (0,0 at first). clearkeys; clearpict( 1 ); preparestring( '+', 1, x,y ); drawpict( 1 ); ...
% plot aggregate data across subjects % plot target jump responses (as position or velocity) as well as basic % trajectory metrics (path length etc) % clear all load P2P groups = {'rot','mir'}; Nsubj = 10; g = NaN(10,600); col = lines; col = col(1:7,:); figure for i = 1:length(groups) pathlength = g; RT = g; ...
classdef Series < handle %SERIES DICOM Series % A Series has a UID, a modality and contains zero or more SopInstances and % zero or more Images. Each Series belongs to a Study. %---------------------------------------------------------------------------- properties end %------------------------------------...
function [AA,BB,CC,V,Go,Gi,Ind,dims,U]=zzescbedz(E,A,B,C,type,tol) % Structure Decomposition of Strictly Proper System (E,A,B,C,0) % % [AA,BB,CC,V,Go,Gi,Ind,dims,U]=zzescbedz(E,A,B,C,type,tol) if nargin==4 type=0; tol=1e-8; elseif nargin==5, tol=1e-8; end n=size(A,1); m=size(B,2); p=size(C,1); if...
function [message] = bitGenerator(length) message = randi([0 1], length, 1); end
function mergeBlobsAcrossSlices(inputMatFile, outputFileName) % This function consolidates the puncta across slices % scale = 3.72; %3.72 nm/pixel for the gelatin dataset [~, scale, dxy_thresh] = getSignalTreshold(); %Bring CC & CC_stats into the workspace load(inputMatFile); % Get location of all the centroids det...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % <subspaces> % Copyright (C) 2016 Gamaleldin F. Elsayed and John P. Cunningham (see full notice in README) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [Ix] = sampleRandSubspaces(dim, useCov, IndexFn, numSample...
clear all close all A = mmread('rajat11.mtx'); %A = A(1:100,1:100); figure subplot(2,2,1) spy(A,'b'); subplot(2,2,2) [a,b] = getBlock(A,10); spy(a,'r'); subplot(2,2,3) F = SILUR(A,2); spy(F,'b'); subplot(2,2,4) f = SILUR(a,2); spy(f,'r');
%% setTfSettings.m % function setTfSettings() settings.tfDir = 'C:\Documents and Settings\Wilson Lab\Desktop\Code\tetheredFlight\'; settings.dataDir = 'C:\Documents and Settings\Wilson Lab\Desktop\Data\Flight\'; oldDir = cd([settings.tfDir,'Acquisition\']); save('.tfSettings.mat','settings');...
function [F1, F2, M1, M2] = applyFpCalib(cortex_f1_adc, cortex_f1_adc_offset, cortex_f2_adc, cortex_f2_adc_offset) % defining the calibration matrix, as is from the AMTI calibration files % FP1 = 0541 % FP2 = 0561 % setting up conversion factors analogToVoltFactor = (2^16)/20; % analog units to...
function y = comb(x, fs, gain, delayLength) % note, gain should be less than 1. delayLength = round(delayLength*fs); % create coefficients b = [zeros(1, delayLength), 1]; a = [1, zeros(1, delayLength-1), -gain]; % filter the input signal y = filter(b,a,x);
function Gbest = UpdateGbest(W,Population,Z) % Update the global best set %-------------------------------------------------------------------------- % The copyright of the PlatEMO belongs to the BIMK Group. You are free to % use the PlatEMO for research purposes. All publications which use this % platform or any code...
function [nderiv, derivcoef, Lconstwrd] = Lset(Lfd) % LSET Determine order and coefficients of linear differential operator % last modified 1 July 1998 derivcoef = 0; Lconstwrd = 0; switch class(Lfd) case 'double' if length(Lfd) == 1 nderiv = Lfd; if nderiv ~= round(nderiv) ...
classdef OptCell < OptObject properties maximumArea areaVariable end methods function obj = OptCell(maxArea) if nargin > 0 obj.maximumArea = maxArea; end end function matrix = initialize(self, matrix) s...
i = 0; %% Ori column %12:21 i = i+1; db(i).mouse_name = 'M151203_FR068'; db(i).date = '2015-12-18'; db(i).expts = [2]; db(i).stimType = {'oris'}; db(i).expID = 1; db(i).starterID = 1; db(i).ObjZ = 0 + 85; db(i).starterYX = [266, 256]; i = i+1; db(i).mouse_name = 'M151...
classdef FixedMultiIndexSetTest < matlab.unittest.TestCase % Copyright 2014 - 2016 The MathWorks, Inc. methods ( Test ) function size( testCase ) dim = 2; maxOrder = 3; mset = FixedMultiIndexSet(dim,maxOrder); testCase.verifyEqual( double(mset.Size()), (...
function shiftman = fn_alignimage(a,b,varargin) % function [shift =] fn_alignimage(a,b[,shift][,hf]) %--- % display a superposition of gray-level images a and b, and allow to move % image b % % Example: % load trees, % Y = interp2(1:350,(1:258)',X,-4.3:344.7,(13:270)'); % shift=fn_alignimage(X,Y) % Thomas Dene...
%% Average cost of transpor for a city % file: question4.m % % by Nathaniel Chang % 03/03/2021 % programing (MATLAB and C) Semester 1 % firstly I'm going to assume that everyone in the city population drives a % car to work everyday and that everyone in the city population works. I % have also assumed that every one t...
%number of samples numsample = 5000; %the input file close all; m = csvread('./../Data/data.csv', 1, 1); % [t3,idx] = sort(m(:,3)); % y3 = m(idx,11); t3 = m(:,3); y3 = m(:,11); bins = 50; y = zeros(bins,1); t = zeros(bins,1); range = max(t3)-min(t3); j = 1; for i = 1:bins, in = min(t3) + (range/bins)*(i-1); ...
function CC_link_MRI % Create softlinks to freesurfer recon directories % % -BQR 07/27/16 datafile = '/space/mdeh7/1/halgdev/projects/bqrosen/CC/doc/freesurfer_file_location.txt'; dest = '/space/mdeh7/1/halgdev/projects/bqrosen/CC/RECON'; data = importdata(datafile); for iln = 1:numel(data) if isempty(data{iln}) ...
function [ Hb ] = binentropy( p ) % calculates the binary entropy function (see https://en.wikipedia.org/wiki/Binary_entropy_function ) of a % Bernoulli process with probability p Hb = -(p*log2(p) + (1-p)*log2(1-p)); end
function Funcs = func_getFunctions(ConNet) % ConNet is a connectivity matrix! global num_gene; global Kmax; % max inputs per gene Funcs = zeros(num_gene, 2^Kmax); for i=1:num_gene vec = ConNet(:,i); nP = sum(vec); % number of parents (<=3) nB = 2^nP; % number of bits for...
function [X] = pairfeat(X_in, dimGroup) dimGroup = dimGroup(:); set = cumsum(dimGroup); set = set + 1; set = [1;set]; X_in = X_in(set(1):set(2)-1, set(2):set(3)-1); X = KM(X_in);
function myView3D(image,spacing,crosshair,crange,cmap) dimentions = size (image); image = double(image); if nargin < 3 | ~exist('crosshair','var') crosshair = floor(dimentions * .5); end if nargin < 4 | xor(~exist('crange','var'),isempty(crange)) imin = min(image(:)); imax = max(image(:)); crange = [im...
clear clc %headers disp('\% Class, Professor Name, Class Section, Due Date') disp('\% Student A') disp('\% Student B') disp('\% Student C') dateZ = strcat('\% DATE: ',date); disp(dateZ) %open and read from file myfile = input('Which design would you like to evaluate? ','s'); fid = fopen(myfile,'r'); %this opens th...
% Projekat za Petnicu - Detekcija Photoshop-a na slikama % Obucavanje klasifikatora % Ova skripta se koristi za obucavanje klasifikatora. Podrazumeva se % sledece: % - Slike se nalaze u folderu baza % - Originalne slike su oznacene kao oi.jpg gde je i broj slike % - Modifikovane slike su oznacene kao mi.jpg gde...
syms u0 v0 f real syms tx ty tz wx wy wz real syms X Y Z real % Ihe intrinsic parameter matrix K=[f 0 u0; 0 f v0; 0 0 1]; % Expression for the rotation matrix based on the Rodrigues formula theta=sqrt(wx^2+wy^2+wz^2); omega= [0 -wz wy; wz 0 -wx; -wy wx 0;]; R = eye(3) + (sin(theta)/theta)*om...
function g = confMatrix(T,P) %CONFMATRIX Compute confusion matrix for 2-class problem % [cm] = CONFMATRIX(T,P) computes the 2x2 confusion matrix using true class % (T) and predicted class (P) values % %T = true conversion value %P = predicted conversion value %T and P must be of same size, and can only take on values ...
classdef Katz methods(Static = true) function [ScoreMatrix] = katz_exact(M, beta) % KATZ computes the Katz measure between two nodes in a social network. % % function [ScoreMatrix] = katz(M, beta) % % INPUT: % M (matrix) adjacency matrix of the graph, size n by n % beta (scala...
function d = DuijDVi(Vi, Vj, Gij, Bij, deltai, deltaj, tap, yshunt) d = -2*Vi*(tap*Bij+yshunt)+Vj*(Gij*sin(deltai-deltaj)-Bij*cos(deltai-deltaj));
recalculate = 0; sr = 1000; params.tapers = [2,5]; params.Fs = 1000; params.err = [2, 0.05]; params.trialave = 1; recname = '1240'; foldername = 'ID1240-1241'; % if ~exist(['C:\Users\Julia\work\data\others\elenascottLFP\' recname '\filtered.mat']) || recalculate % % load(['C:\Users\Julia\work\data\others\elenasc...
function [matRxLocWithPathloss, rxAntH, cellAntLoc, cellAntH] ... = fetchPathlossResultsFromSimState(simState, idxEffeCell, ... idxRxHeight, mapType, simConfigs, locType) %FETCHPATHLOSSRESULTSFROMSIMSTATE A helper function to fetch pathloss %results from the simulation state struct variable simState. % % Note t...
function [arrived] = slamMove(inputargshere) % move function - avoid beacons and continuously move (circle?) % until confident enough that the beacon locations are correct. % Once this confidence is high enough, move towards final location % (but continue updating everything). Maybe have a binary output...
%% Test the performance for 1 image % % img = readimage(val,2); % % [pred,scrs] = classify(whalenet,img); %% Test the performance for the whole test set % you can run this section to measure the performance in test set load('whalenetSgdm0.001.mat') % this line can be change to % val.ReadFcn = @(loc)imresize...
function [y]=eval_gauss(x,mu,sigma,gamma) y = gamma * exp( -((x-mu).^2)/2/sigma^2 )/sqrt(2*pi)/sigma;
function [J, grad] = linearRegCostFunction(X, y, theta, lambda) %LINEARREGCOSTFUNCTION Compute cost and gradient for regularized linear %regression with multiple variables % [J, grad] = LINEARREGCOSTFUNCTION(X, y, theta, lambda) computes the % cost of using theta as the parameter for linear regression to fit the % ...
clear all; demo_setup; % Using "ground truth" cameras (assuming that congealing finds transform % yielding structure with optimal compaction). structure = true_structure; cameras = true_cameras; S = k_reshape(structure_to_matrix(structure), 3); %S = project_rank(S, K); structure = structure_from_matrix(k_unreshape(S...
function [f] = m_mem2(t,y,opts,k,K,Cw,twd) %----------------------------------------------------------- % function file for empore disk uptake of diuron % This file is called by Params.m % states are: y(1)= mass of herbicide in disk (ng) % units are: volume (L) % mass (ng) % kA ...
function reg_P2 = alvaro_6dof( P2, P1 ) th=5; lwbnd=10; %not working yet gap=10; boxSide= floor((max(P1(:,1)) - min(P1(:,1))) * 0.3); xP1 = downsample_OPC_to_less_than(P1,60); xP2 = downsample_OPC_to_less_than(P2,60); [~, T, ~, ~] = run_bnb6dof(xP2, xP1, th, lwbnd, gap, boxSide); ...
function [ nl_data ] = prepare_input_dataset( dataset ) %Prepare dataset min_data=min(dataset); %Computes a vector with the minimum values of each column max_data=max(dataset); %Computes a vector with the maximum values of each column min_rep=repmat(min_data,size(dataset,1),1); %Creates a matrix the size of the data ...
function d = matrixNorm(A, B, type) d = 0; switch type case 1 for i = 1:size(A, 1) for j = 1:size(A, 2) d = d + abs(A(i, j) - B(i, j)); end end case 2 for i = 1:size(A, 1) for j = 1:size(A, 2) d = d + abs(A(i, ...
% Normalizes variances of patches % Data given as a matrix where each patch is one column vectors function Xnorm=variancenormalize(X); patchnorms=sum(X.^2); %compute 10% lower quantile %and define epsilon as this quantile [patchnormssorted,dummy]=sort(patchnorms,'ascend'); epsilon=patchnormssorted(round(size(X,2)/10)...
classdef RigidImpact < DiscreteDynamics % RigidImpact represents a rigid body impact map assuming that the % impact is plastic and occurs instantaneously. % % % @author Ayonga Hereid @date 2017-04-26 % % Copyright (c) 2016, AMBER Lab % All right reserved. % % Redistribution ...
function [net] = cria_RNA(camadas,n_neuronios_camada,funcoes,net_bias,net_IW,net_LW,learningRate,backFunction) load('maxminNN'); net = newff(c,[n_neuronios_camada,1],funcoes); net.trainFcn = backFunction{1}; net.trainParam.lr = learningRate; % Learning rate used in some gradi...
clear;%clc;%close all tic dates_all={'Nov_26_13' 'Dec_03_13' 'Dec_17_13' 'Dec_17_13' 'Dec_17_13' 'Dec_18_13'... 'Mar_24_15' 'Mar_28_15'}; %'Jul_03_13' Used different number of increments so much be analyzed separately, but data still good cellnum_all={'A' 'B' 'A' 'B' 'C' 'A'... 'A' 'A'}; %'B' trials_all=[1 1 ...
% minFunc % cd ('E:\GitHub\paper\lbfgs\lbfgs\minFunc_comprehension') % addpath(genpath(pwd)) % mexAll fprintf('Compiling minFunc files...\n'); cd('minFunc/mex/movepixels'); files=dir('*.c'); for i=1:length(files) filename=[files(i).name]; if(length(filename)<19||(~strcmpi(filename(1:19),'image_interpolation')))...
function gaborMatrix = EmbedInNoise3(GaborMatrix, Coherence, ProbabilityGaussian, GaussianMatrix) %EmbedInNoise3 embeds a gabor matrix in noise. It does not trim the gabor into a circle, but instead sets all pixel values with a NaN to random noise. % GaborMatrix - 2D matrix that holds the pixel values of the Gabor t...
function O = NonMetricMDS(I) % Non-Metric Multidimensional scaling by using MATLAB built-in function % mdscale(). % % Explanation of input structure, I % I.DisSimilarityMatrix : Dissimilarity matrix that will be used as guide % while placing the data points onto 2-D space. % I.InitMethod ...
clc clear all; close all; f=(imread('girl.png')); g=im2double(f); %%1st channel img(:,:)=g(:,:,1); [r,c]=size(img); order = 50; n = 0:order; hlpf = sin(0.5*pi.*(n-(order/2)))./(pi.*(n-(order/2))); hlpf((order/2)+1) = 0.5; hlpf2=ftrans2(hlpf); hhpf = -hlpf; hhpf((order/2)+1) = 1 + hhpf((order/2)+1); hhpf2...
function cid = CpmId( xid,Cpm ) %{ find cpm index having xid %} import mbn.* cid = []; for ii = 1:length(Cpm) cpm_ = Cpm{ii}; if isa(cpm_,'cpmjoint') if ismember(xid,cpm_.scope) cid = [cid ii]; end else if ismember(xid,cpm_.scope(1:cpm_.nc)) cid = [cid ii]; ...
function [ cmaVal ] = cma( seq, semi_win ) %CMA: Central Moving Average, simple % seq input sequence % semi_win semi window size of CMA % simple special processing at head and tail. i.e. % a(1:100), semiwindow = 10 % head = a(1:10) -> b(i) = mean( a(1: 2i+1) ) % body = a(11:90) -> normal % tail = a...
function uiopen(filepath,direct) % UIOPEN overloaded for custom Files. % Executed when file is dragged into Command Window DMStypes = {'.VHD','.VRD','.VDD'}; %Define DMS types PKtypes = {'.mdd','.svd'}; %Define PK types [~, filename, extension] = fileparts(filepath); is...
clear all;close all;clc; s = tf('s'); g = 1/((s+0.5)*(s+1)*(s+10)); vector_k = linspace(150,180,100000); figure('Name', 'lugar de raices de g') rlocus(g,vector_k) figure('Name', 'Respuesta al escalon para K critico') K_critico = 173.25; gbc=feedback(g*K_critico,1); step(gbc) Pc = 1.64; Ti = Pc/2; Td = Pc/8; Kp = 0....
function [Qsim, param, varargout] = HydroMod13( P, E, param ) % % [Qsim, param, varargout] = HydroMod13( P, E, param ) % % PDM8 hydrological model (modified version) % % INPUTS (time series of daily observations [n,1]) % P = mean areal rainfall (mm) % E = mean areal evapotranspiration (mm) % Q = stream flow...
% FuzzyController function fis = FuzzyController(Safe_Dist,detectorRange,ruleList) SD = Safe_Dist; RD = detectorRange; % Fuzzy Controller fis = mamfis('Name',"SwarmController"); fis = addInput(fis,[-0.4*SD RD],'Name',"Magnitude"); fis = addInput(fis,[-1.5 1.5],'Name',"Bearing"); fis = addOutput(fis,[-3 3],'Name',"Turni...
%% ======================================================================== %% BASIC SETUP %% BASIC SETUP %% BASIC SETUP %% BASIC SETUP %% %% BASIC SETUP %% BASIC SETUP %% BASIC SETUP %% BASIC SETUP %% %% BASIC SETUP %% BASIC SETUP %% BASIC SETUP %% BASIC SETUP %% %% ====================================================...
clc,clear y=1997:2012; x0=[5566.03 5435.39 5590.88 5497.59 5567.43 5497.28 5320.4 5547.8 5632.98 5794.97 5818.67 5909.95 5965.15 6021.99 6107.18 6141.8]; n=length(x0); lamda=x0(1:n-1)./x0(2:n) %求级比 range=minmax(lamda) x1=cumsum(x0); %累加 for i=2:n z(i)=0.5*(x1(i)+x1(i-1)); end B=[-z(2:n)',ones(n-1,1)]; %构造矩阵B和向量Y Y=x0(...
% Ex4 % d) N = 10; P = 100000; lambda = 1800; C = 10; f = [2500,5000,7500,10000,12500,15000,17500,20000]; b = 0; % Simulator 2 Run Sim2_PL = zeros(1,length(lambda)); Sim2_termPL = zeros(1,length(lambda)); Sim2_APD = zeros(1,length(lambda)); Sim2_termAPD = zeros(1,length(lambda)); Sim2_MPD = zeros(1,length(lambda)); ...
% x값의 데이터를 입력합니다 x = [0 100 200 400 600 800 1000]; % fx값의 데이터를 입력합니다 fx = [0 0.82436 1 0.73576 0.40601 0.19915 0.09158]; % xx값을 이용해 (0,1000) 구간을 100등분합니다 xx = linspace(0,1000); % sp1에 자연끝단조건 3차 스플라인의 값을 입력합니다 sp1 = interp1(x,fx,xx,'spline'); % sp2에 Hermite 3차 스플라인의 값을 입력합니다 sp2 = interp1(x,fx,xx,'pchip...
function [theta_list, phi_list, a_n] = get_angu_spectrum(data,narrow_band,plot_it,save_name, hn) N_theta = 25; N_phi = 50; N_X = 10; N_Y = 10; N_Z = 10; if narrow_band N_taps = 1; else N_taps = 8; end h_tot = zeros(1, 1, N_taps); theta_list = linspace(0, pi, N_...
% Demo for VIPeR dataset clear; clc; curName = mfilename('fullpath'); [demoDir, name, ext] = fileparts(curName); cd(demoDir); addpath(genpath(fullfile(demoDir, '../'))); addpath(genpath(fullfile(demoDir, '../../code/'))); resDir = fullfile(demoDir, 'result'); mkdir(resDir); matDir = fullfile(demoDir, '..\..\mat\viper')...
% Copyright (C) 2018-2019 % Abhishek Moturu, moturuab@cs.toronto.edu % Alex Chang, le.chang@mail.utoronto.ca % creates nodules, inserts them into CT data, and makes PARALLEL X-Rays % must have the following files in the same folder: % random_shape_generator.py % readNPY.m % readNPYheader.m % dicomHandler.m % posit...
% function im_SR = faceSR2(im_l,PPs,dicts, imrow, imcol, upscale,patch_size,overlap) function im_SR = faceSR2(im_l,PPs,dicts, imrow, imcol, upscale,patch_size,overlap,center_flag,impat_pixel) %faceSR 此处显示有关此函数的摘要 % 此处显示详细说明 % [imrow, imcol , ~] = size(YH); U = ceil((imrow-overlap)/(patch_size-overlap)); V = ceil((im...
function res = TV_Temp() res.adjoint = 0; res = class(res,'TV_Temp');
function [ final_train,final_trainlabels ] = RUS( final_ratio,train,train_labels ) %Minority class label is 1; Majority class label is 0 final_train=train; final_trainlabels=train_labels; MAJ_num=final_ratio.*length(find(train_labels==1)); MAJ_ind=find(train_labels==0); MAJ_size=length(MAJ_ind); rand_ind=randpe...
function [] = Dhuliya_Arjun_Stop_sign (img_name ) % Image chain to detect road sign from image % adding the folder path %closing any opened figure close all; %adding possible image folder paths addpath('Stop_Sign_Images'); addpath('Stop_Sign_Hi_Res'); addpath('Images'); %Open a new figure % figure %reading the image i...
function [G, T] = addToNetwork(G, neuron, synapseName, varargin) % ADDTONETWORK % % Description: % Add a neuron and all neurons linked by a specific synapse type to a % directed graph. % % Syntax: % [G, T] = addToNetwork(G, neuron, synapseName, varargin); % % Inputs: % G...
function [T t z] = diffusioneq(n,zmax,t_f,D) %Solution of the Diffusion equation of the Wine Cellar Problem (HW09) using explicit Euler %where n is the number of gridpoints over z %note that t is in years and z in meters %THERES SOME SMALL BUG IN HERE, BETTER USE NEW VERSION!!! tic; a = 12; b=10; dz = zmax/n; %take dt ...
classdef SimHopRob < handle properties(SetAccess = protected) CoM; Padel; Height; PadelHeight; CoMRadius; Target; end methods function rob = SimHopRob(CoMRadius,PadelHeight,Height,bnd_B) % input: CoMRadius: radius of C...
function [ undx, xdnu ] = r8col_tol_undex ( m, n, a, unique_num, tol ) %*****************************************************************************80 % %% R8COL_TOL_UNDEX indexes tolerably unique entries of an R8COL. % % Discussion: % % An R8COL is an M x N array of R8 values, regarded as N columns % each of ...
%% Stelling 21 % % Als je in Matlab vectoren bij elkaar optelt, dan wordt % dit 'pair-wise addition' genoemd. % Antwoord = 1;
clear all close all Num_Sections = 4; %number of sections in laminar flow profile Ra= 0.5; % Radius of Artery in cm V_max = 60; %(cm/s) off_start= 0; off_step = 10; %0.02; off_end = 500; grad_err_start = -0.3; grad_err_step = 0.02; grad_err_end = 0.3; Y=off_start:off_step:off_end; X=grad_err_start:grad_err_step:gr...
%{ common.MpSession (manual) # multipatch session info -> common.MpSlice mp_sess : smallint # mutipatch recording session number for this slice ----- mp_sess_purpose='stimulation' : enum('stimulation','firingpattern','spontaneous','other') # purpose mp_sess_path ="" ...