text
stringlengths
8
6.12M
% % This code accompanies the paper: % % "Partial Functional Correspondence" % Rodola, Cosmo, Bronstein, Torsello, Cremers % Computer Graphics Forum 2016 % % Please cite the paper above if you use this code in your research. % % Written by Luca Cosmo % classdef mumford_shah < handle properties (Hidden = true, SetAc...
function [pt_sparsed] = sparsePoints(pt, sparse_times) % Reduces matrix of points selecting 1 of each 'sparse times' rows. % Zmniejsza macierz punktow wybierajac 1 z kazdych 'sparse times' wierszy. sparse_indexes = [1: sparse_times: size(pt,1)]; pt_sparsed = pt(sparse_indexes, :); end
clear all ; close all; cd E:\angelina_2; eegs = dir('*gamma*vhdr'); for i=1:length(eegs) eeg = pop_loadbv('.',eegs(i).name) ; eeg = pop_chanedit(eeg,'lookup','C:\mscripts2\eeglab13_6_5b\plugins\dipfit2.3\standard_BESA\standard-10-5-cap385.elp') ; eeg = pop_resample(eeg,256); if i==1; merged = eeg ; else mer...
% This function draws the trajectory of a billiard in a rectangular table. % User inputs the L_H, L_V, which are the base and height of rectangle respectively. % As well as side, alpha, position vectors that is a result of running % square_billiards_cobweb.m function P_anim = parallelogram_billiards_draw(h, gamma...
function x=SortingStr(x,p,q,col) % 函数功能:只用counting sort递归排序长度不同的字符串(仅限小写字母a~z)。 % 思想: % 利用字母排序性质:第1位字母小即整个string都小。 % 我们从左到右对每一位(列)排序并分组,对每组的下一列递归排序。 % 参数:col为列数;p,q表示x[p,...,q]。 if(p < q) % 对第col列,第p到q行排序 [x,C]=Countstr(x,p,q,col); % 利用C构建滑动窗,分成round组,每组范围:pnext~qnext round=length(C); pnext=p; ...
%%linear convolution of discrete signal clc; close all; clear all; xn=input('enter the range of x[n] : '); x=input('enter x[n] : '); hn=input('enter the range of h[n] : '); h=input('enter h[n] : '); yn=min(xn)+min(hn):max(xn)+max(hn); k=length(yn); y=zeros(1,k); l=length(x); m=length(h); for i=1:k; for j=1:l; ...
function [ UB ] = CalculateObject1UB( C ) %CALCULATEOJECT1UB 此处显示有关此函数的摘要 % 此处显示详细说明 UB = sum(sum(C)); UB = UB-sum(diag(C)); UB = UB/2; end
% Homework 5 % Michael A. Guignard, PSID 1338371 clear all % Remove all the variables from workspace. close all % Closes all figures. clc % Clears command window. %% Creating Arrays of Random Numbers sig = input('Number of decimal places: '); % Input of how many decimal places wanted. N = input('Number of ...
classdef SoftMembershipCoord % % Soft membership coordinate update. % Based on "Overlapping Community Detection via Bounded nonnegative matrix % Tri-factorisation" % % % @author: Jeffrey Chan, 2013 % methods function [mMembership] = updateMembership(obj, mAd...
function tmpdir = getTmpdir % getTmpdir (mh-tools): crossplatform way to find temp directory ($TMPDIR) % % histed 11105 if isunix tmpdir = getenv('TMPDIR'); if isempty(tmpdir) tmpdir = '/tmp'; end else % windows tmpdir = getenv('TEMP'); if isempty(tmpdir) error('Temp directory n...
function Proc = ProcessImage(strImageName,tolerance,imgObjectR,imgObjectG,imgObjectB,imageCount) % ********************************************************************************** % * % * ProcessImage(strImageName,tolerance,imgObjectR,imgObjectG,imgObjectB) % * % * strImageName = name of the initial image in...
% Code implementing the paper "Injective and Bounded Mappings in 3D". % Disclaimer: The code is provided as-is and without any guarantees. Please contact the author to report any bugs. % Written by Noam Aigerman, http://www.wisdom.weizmann.ac.il/~noamaig/ function A = find_2d_embedding(V) %given a 3X3 matrix whose col...
function [ClusterIDs, ClusterMembers, data] = KNNBuiltInClustering(dataset, nClusters, k) %KNNBuiltInClustering returns a fixed number of clusters. % imputing the missing values by k-nearest neighboring and kmeans for % clustering %Input: % -dataset is subj-by-time data matrix. % -nClusters is the desired numb...
function result = batch_windows( ... x1, x2, window_size, ... func_handle) % Batch Windows takes two signals, window size and a function handler as its % parameters, which used to preprocess the raw signals and do the indicated % task for the segments of the signals. % The preprocessing of the raw signals incl...
function T=Triangle(r,xdim,ydim,midy,midx) T=zeros(xdim,ydim); for i = 1:xdim for j = 1:ydim x=i-xdim/2-midx; y=j-ydim/2-midy; R=sqrt((x^2+y^2)); %disk if((x^2+y^2)<r^2) T(i,j)=1-R/r; end end end end
%B01fsgrzbiet1=draw(B01fsgrzbiet1, inserting); inserting=1; % if exist('B01fsgrzbiet1','var') % B01fsgrzbiet1=draw(B01fsgrzbiet1, inserting); % end if exist('B02fsgrzbiet1','var') B02fsgrzbiet1=draw(B02fsgrzbiet1, inserting); end if exist('B03fsgrzbiet1','var') B03fsgrzbiet1=draw(B03fsgrzbiet1, ins...
clc clear all; close all; c1=1; c2=1; r1=1; r2=1; num1=[1]; den1=[r1*c1*r2*c2 r1*c1+r2*c2+r1*c2 1]; sys1=tf(num1,den1); [y]=step(sys1); %plot(y); bode(sys1)
% matrice réponse DQ/ Dx sur dispersion en 16 points (symetie) % on cherche M tel que dX = M dQ par famille pourcentage=0.001; wait=2; M = []; target=[1 30 31 60 61 90 91 120]; % sextion longue target=[target 15 16 45 46 75 76 105 106] ; % section centre maille length(target) fprintf('***************************\n...
clear; clc; input = 523764819; %input = 389125467; part1 = 0; %% decode sitTemp = num2str(input); for i=1:length(sitTemp)-1 index = str2num(sitTemp(i)); sit(index,1) = str2num(sitTemp(i+1)); end lastValue = str2num(sitTemp(end)); firstValue = str2num(sitTemp(1)); if part1 % part1 steps = 100; els...
% model_analysis.m % % Generate plots that allow us to compare how the model performs at scale % when working with seasonal and non-seasonal data. % % TODO Go through this script and move anything useful over to the support % TODO repostiory. The plotSimuatedVsReferencePfPR should NOT be used since % TODO the correct ...
a = linspace(0,8, 100); b = linspace(0,8, 100); zero = linspace(0,0, 100); [A,B] = meshgrid(a,b); F = -3*A -2*B; hold on; contour(A,B,F) plot(a, zero, 'k'); plot(zero, b, 'k'); plot(a, 8-2*a, 'k'); plot(15-3*b, b, 'k'); xlim([0 8]); ylim([0 8]);
clear; %close all; % Create an m-fileIR1.m that conducts a simple experiment to estimate % the impulse response (IR) of the acoustic channel, by literally % applying the definition of the IR (i.e., ‘the response of the system when % applying animpulse at the input’). The m-file should plot a figure ...
function fval = benchmark_func1(x,probstruct) %BENCHMARK_FUNC1 Wrapper for optimization benchmark objective function. fval = benchmark_func(x,probstruct);
function [ result, num_faces ] = load_faces( subject ) listing = dir(['../data/CroppedYale/yale' subject '/yale' subject '_P00A*.pgm']); filenames = {listing.name}; num_faces = size(filenames,2); result = zeros(48*42, num_faces); for i = 1 : num_faces im = imread(['../data/CroppedYale/yale...
function [coeffs] = mfcc(filename) [file,Fs] = audioread(filename); % Length = 30s % Total Number of samples = 30*22050 % 40ms main frame + (20ms from each side)*2 = 80ms total % Total number of frames = 30/(40*1e-3) file = file(1:661500); num_frames = (size(file,1)/Fs)*100; num_samples = Fs*20*1e-3; sample_...
function[] = savesongs(files) addpath(genpath('/Users/alexrockhill/Documents/UW/Winter 2016 UW/NBIO 450')); for i = 1:length(files) [song,fs] = audioread(files{i}); if exist(strcat('/Users/alexrockhill/Documents/UW/Winter 2016 UW/NBIO 450/Songs/', ... files{i}(1:end-4),'.mat'),'file'...
function [FL,FR] = AreaFaces() % This function returns an array filled in by the user. Every row of the array % contains the vertices of a triangle. All of the triangles should % approximately compose the wing % % Copyright Julian Lopez-Uricoechea & Kenny Breuer, Brown University 2019 % % assign number values st...
clear all; clc; k=8; N=2^k; h=2/N; X=0:h:2; tmp=ones(N+1,1); set(0,'RecursionLimit',10*N) phi0=@(x)((x>=X(1)).*(x<=X(2))*1/h.*(X(2)-x)); phiN=@(x)((x>=X(N)).*(x<=X(N+1))*1/h.*(x-X(N))); phi=@(x,i)((x>=X(i-1)).*(x<X(i))*1/h.*(x-X(i-1))+(x>=X(i)).*(x<=X(i+1))*1/h.*(X(i+1)-x)); K=diag((2/h+2/3*h).*tmp,0)+diag((-1/h+h/6)...
function x = readflat(filename,showheader) %READFLAT Read flat text file with header. % READFLAT(FILENAME) returns the data in FILENAME ignoring any % non-numeric header lines (which are displayed on the screen). % The data will be returned in a matrix where the number of % columns is equal to the number o...
function K = mkf_gain(H,P_prior,R) %MKF_GAIN Summary of this function goes here % Detailed explanation goes here K = P_prior*H'/(H*P_prior*H'+R); end
function J = computeCost(X, y, theta) %COMPUTECOST Compute cost for linear regression % J = COMPUTECOST(X, y, theta) computes the cost of using theta as the % parameter for linear regression to fit the data points in X and y % Initialize some useful values m = length(y); % number of training examples % You need t...
function cami % Parameters lineWidth = 32; squareSize = 100; rectSize = 700; angle = 0; movieDurationSecs=20; % Abort demo after 20 seconds. texsize=300; % Half-Size of the grating image. try AssertOpenGL; % Get the list of screens and choose the one with the highest screen number. screenNumber=max(Scree...
function img_out=imageresize(img_in, rowScale, colScale,method) %IMAGERESIZE Resize image % IMAGERESIZE resize an image to any scale. % This is a simple implementation of IMRESIZE. % Structure of function from: % https://de.mathworks.com/matlabcentral/fileexchange/30787-image-resize if nargin<3 ...
%% Code to simulate Isham model with a treatment on most infected hosts for % a set time using gillespie algorithm. The code then performs a simulation % of the untreated model using the deterministic moment closure model and % then calculate the mean and variance of the treated/untreated proportion % of the popula...
function [C, sigma] = dataset3Params(X, y, Xval, yval) %DATASET3PARAMS returns your choice of C and sigma for Part 3 of the exercise %where you select the optimal (C, sigma) learning parameters to use for SVM %with RBF kernel % [C, sigma] = DATASET3PARAMS(X, y, Xval, yval) returns your choice of C and % sigma. You...
%Compute the whole simulation saving and showing images %also display error on recovery. function simulation() addpath('./filters'); x = loadData('../data/saturn'); colormap(gray(255)); %Display original image doi(x); %Display image transformed into phase tic X = ctfft2(x); toc ditip(X); %Display image t...
x = -1.01:.001:1.01; y = 4/5*(sqrt(1-x.^2) + sqrt(abs(x))); z = 4/5*(-sqrt(1-x.^2) + sqrt(abs(x))); plot(x,y,'r'); plot(x,z,'r');
% Companion function to pca. % % Use pca to retrieve the principal components U and the mean mu from a % set fo vectors X1 via [U,mu,vars] = pca(X1). Then given a new % vector x, use y = pca_apply( x, U, mu, vars, k ) to get the first k % coefficients of x in the space spanned by the columns of U. See pca for % genera...
%% fieldtrip cd('C:\Users\mvdm\Documents\GitHub\fieldtrip'); ft_defaults; % start buffer.exe in \GitHub\fieldtrip\realtime\bin\win32 % start ./emotiv2ft.exe emotiv-config.txt ft_realtime_plot([])
function [Params Fval MaxTime2Mat MinTime2Mat LongYTM ShortYTM OptMinLambda ParamsMS FvalMS] = NSest(Bonds, ShortRates, Model, Optimization) % ========================================================================= % NSESTP estimates Nelson-Siegel or Svensson model parameters % % [Params Fval MaxTime2Mat MinTime...
% ClearVariables allVariablesNow=[]; % Make this variable name to be included allVariablesNow=whos(); allVariablesNow=struct2cell(allVariablesNow); allVariablesNow=allVariablesNow(1,:); % All variables as cell array of strings %NOTE: Stored variables in imlook4d_variables_b...
function [u1,u2]=MKtest(x) m=length(x); for i=1:m xr(i)=x(m+1-i); end u1(1)=0; d=0; for i=2:m num=0; for j=1:i if x(i)> x(j) num=num+1; end end d=d+num; e=i*(i-1)/4; ...
clear all, close all % % addpath('../gp') % addpath('..') % addpath('~/svnprojects/ClassSystem/Helpers/') % addpath('../DERIVESTsuite/') % addpath('../teach-grad-hess/') muContext = [0; 0]; covContext = diag([.5; .3]); dt=.02; tend = 2; forceStd = 1; numTrajs = 1; prefsForSamples = 3; consecutivePref = 0; initialSa...
function [X, Y] = rotation(X, Y, rads, C) % fonction realisant la rotation de plusieurs point dont les coordonnees en % abscisse de ces points sont specifiees dans le vecteur X, et les % coordonnees en ordonne dans le vecteur Y Xtmp = X - C(1); Ytmp = Y - C(2); X = Xtmp*cos(rads) - Ytmp*sin(rads) + C(1); ...
close all;clear all;clc; % il y a 300 frames from 0-299,300frames sur news.qcif % il y a 300 frames from 0-299,300frames sur akiyo.qcif [Y,U,V]= f_yuv_import ('../data/images/news.qcif',[176 144],300,0); % for i = 1:length(Y) % imshow((uint8(Y{i}))) % end V1 = VideoWriter(['news1.avi']); %V = VideoWriter(['filenam...
#Modified by Jiamin Liu (liujiamin@cc.nih.gov) function script_faster_rcnn_demo() close all; clc; clear mex; clear is_valid_handle; % to clear init_key run(fullfile(fileparts(fileparts(mfilename('fullpath'))), 'startup')); %% -------------------- CONFIG -------------------- opts.caffe_version = 'caffe_faster_r...
% Gauss LPF clear all;clc; img=imread('house.tif'); %Import image f=im2double(img(:,:,1)); f_fft=fftshift(fft2(f)); %Gaussian end frequency D1 = 0.1; % img=imread('lena.tif'); % f=im2double(img(:,:,1)); % f_fft=ff...
CleanUp1D; clc clear all close all model = 'Euler'; gas_const = 1.0; gas_gamma = 1.4; test_name = 'LowDen'; rho_IC =@(x) 0*x + 7.0; vel_IC =@(x) (x<0)*(-1.0)+ (x>=0.0)*1.0; pre_IC =@(x) 0*x + 0.2; bnd_l = -1.0; bnd_r = 1.0; mesh_pert = 0.1; bc_cond = {'D',7,'D',7; 'D',-7,'N',7.0; ...
function filter_gui11 N = 50; n = 0:N; %imp = [1 zeros(1, N)] imp = ( n==0 ) Fs=8000; % fc = 0.78 fc = 0.1; [b, a] = butter(2, 2*fc); % [b, a] = butter(2, fc); y = filter(b, a, imp); [H, om] = freqz(b, a); f_freqz = om*Fs/(2*pi);% Input signal figure(1) clf subplot(2,1,1) line_handle = plot( y); xlim([0, N]); ylim(...
classdef KineticsDirector %% KINETICSDIRECTOR % $Revision$ % was created 19-Oct-2015 21:55:01 % by jjlee, % last modified $LastChangedDate$ % and checked into repository /Users/jjlee/Local/src/mlcvl/mlarbelaez/src/+mlarbelaez. %% It was developed on Matlab 8.5.0.197613 (R2015a) for MACI64. pro...
% mtoggle_2 % Produces toggled mpgb1 from BIR2 % Each direction 4 steps (except 2 at begin and end) % Assumes mpgb1 is BIR2 with 0 to neg freq sweep, followed by pos to zero % sweep % AND that length(mpgb1) is divisible by 4 i = sqrt(-1) ; global mpgb1 b1 = mpgb1 ; manglist = unwrap(angle(mpgb1)) ; % figure; plot(...
function y = eq_M(alfa,S,P,jm,tl,Hz,A,calctype) % eq_M % % y = eq_M(alfa,S,P,jm,tl,Hz,A,calctype) % Calculates momentum balance for the nodes (calctype==1) % If calctypes==0 the flow inertia is calculated % If calctype==1 Gm.*Hz is calculated % Eq. 4.4.120 %@(#) eq_M.m 2.2 02/02/27 11:48:47 global geom ter...
function x = pulse(f,Tdur,fs) % Sinusoid multiplied by a Hann window function. % f sinsusoid frequency (Hz) % Tdur duration (s) % fs sampling frequency (Hz) nmax = floor(Tdur*fs); % duration (samples) n = 1:nmax; % discrete time index x = hann(nmax).'.* cos(2*...
function [edge_point,num_edge_point] = edgePointFinder(edge_img,y_line,width_img) % edge_point = zeros(1,width_img); % index = 1; % for i=1 : width_img % if edge_img(y_line,i) == 1 % edge_point(index) = i; % index = index + 1; % end % end edge_point = find(edge_img(y_line,:)==1); % to en...
function R = sat_range(alt,elevation,unit) %R = sat_range(alt,elevation,unit) %compute the range R between the GS and the satellite %alt is the altitude in km of the satellite (not taking in account radius of %earth) %elevation is the elevation angle in degrees %unit if true return value in km, else return in m (defau...
function distance = computeDistance(data1, data2) [m,~] = size(data1); [n,~] = size(data2); distance = zeros(m,n); for i = 1:m for j = 1:n % calculate the cosine distance between two data points distance(i,j) = cosineDistance(data1(i,:), data2(j,:)); end end end
% Analyze Seahorse Data Mito Stress Assay %% make table time=[1.31 7.76 14.22 20.77 27.24 33.70 40.28 46.75 53.23 59.80 66.28 72.75]; time=repmat(time,8,1); time=sortrows(time); replicate=[1:8]'; replicate=repmat(replicate,12,1); parentalO2=[]; brm2O2=[]; lm2O2=[]; data=readmatrix('mitodataO2.c...
t = Robot1_Groundtruth(:,1); x = Robot1_Groundtruth(:,2); y = Robot1_Groundtruth(:,3); theta = Robot1_Groundtruth(:,4); theta(theta < 0) = theta(theta<0) + 2*pi; %make angles from 0 to 2pi %Odometry time stamps and velocities tq = Robot1_Odometry(:,1); v = Robot1_Odometry(:,2); w = Robot1_Odometry(:,3); deltat = diff(...
% autor Elżbieta Pastucha % sieć net_scalone_13 % wczytanie obrazu testowego, zmiana rozdzielczości do 0.25, przetworzenie % przez sieć, zapis wyników do struktury R, następnie wstępne % przetwarzanie, wykrycie pierwszego automatycznego progu, i pierwsza % binaryzacja obrazów clear all, close all; tic sciezka_data...
function C = pink() % PINK Returns a nice pink color % % Outputs: % [254 194 194]/255; C = [254 194 194]/255;; end
file = fullfile('Datasets','DatasetB.avi'); vidObj = VideoReader(file); % Create the Video reader object vidFrames = read(vidObj); %reading video frames into Mat histo = cell(size(vidFrames,4)); for x = 1:size(vidFrames,4)-1 %disp(x); %disp(vidFrames(:,:,:,10)); temp = ICV_calc_colour_histogram(vid...
CorrelationMatrix=squeeze(nanmean(CorrelationMatrices_perFish,3)); CorrelationMatrix=1-CorrelationMatrix; CorrelationMatrix=weight_conversion(CorrelationMatrix,'autofix'); CorrelationMatrix=weight_conversion(CorrelationMatrix,'normalize'); figure;imagesc(CorrelationMatrix,[0 1]); Correlation_bin_prop=threshold_proporti...
function [db,mag,fase,grd,w] = freqz_m(b,a); [H,w] = freqz(b,a,1000,'whole'); H = (H(1:501))'; w = (w(1:501))'; mag = abs(H); db = 20*log10((mag + eps)/max(mag)); fase = angle(H); grd = grpdelay(b,a,w);
function [A, B] = NTTm(N, M) a = m = end
function [stacks] = laplacianstacks(img, levels) img_old = img; cur_gauss = 1.2; img_cur = imfilter(img, fspecial('gaussian', round(cur_gauss+1), cur_gauss)); % laplacian stacks are difference of successive Gaussians with different standard deviations for k = 1:levels-1 stacks{k} = img_old ...
%Calcul le vecteur g de la force de viscosité d'une balle de ping-pong pour l'algorithme de Runge-Kutta . %massBall: La masse de la balle %rayon: Le rayon de la balle function g = frottementVisqueux(q0, t0, balle) rayon = 0.0199; masse = 0.00274; rho = 1.2; C = 0.5; aire = pi...
function test_drug_rep() test_svm(); test_sgd(); test_center_data(); test_rescale_data(); test_normalize_expression_data() %test_norm_rows(); %test_norm_data_two_ways();
%创建一个层反馈网络 net=newnarx([-1 1],0,1,1,{'purelin'}); %创建单层、单神经元、输出延迟为1的反馈网络 net.biasConnect=0; %偏置值为0 net.lw{1}=0.5; %输出层权重为0.5 net.iw{1}=1; %输入层权重为1 a=sim(net,P); %网络再一次仿真 c=cell2mat(a); stem(c) %绘制层反馈网络序列图,效...
function varargout = Prepa82(varargin) % PREPA82 M-file for Prepa82.fig % PREPA82, by itself, creates a new PREPA82 or raises the existing % singleton*. % % H = PREPA82 returns the handle to a new PREPA82 or the handle to % the existing singleton*. % % PREPA82('CALLBACK',hObject,eventDa...
function [image] = lab1condscale(J,I) m=size(J); if (length(m)==3) J=rgb2gray(J); % 3D to 1D conversion end m2=size(I); if (length(m2)==3) % 3D to 1D conversion I=rgb2gray(I); end I=double(I); J=double(J); [row,col] = size(J); ret = zeros(row,col); %irrelevant vj = std(J(:)); mj = mean(J(:)); mi = mea...
init clear do_force do_plot parms_inner = parms; %z % if ~isfield(parms_inner,'metric_method') % parms_inner.metric_method = get_user_method_res; % else % disp(sprintf('parms.metric_method exists with value %s. Proceeding without user input',parms_inner.metric_method)) % end parms_inner.metric_method = 'oasi...
function varargout = browsegui(varargin) % BROWSEGUI: Start a GUI for browsing scoring result in CSV format % % See also: GLYCOPATGUI, DIGESTGUI, SCOREGUI, FRAGGUI, SPECTRAANNOTATIONGUI % Author: Gang Liu % Date Lastly Updated: 7/30/14 % Edit the above text to modify the response to help browsegui % Last Modified by...
function features = speech_features_stereo(fname, filter_val) if (nargin<2) filter_val = []; end rms = wavrms(fname, filter_val); % Compute voicing features and energy from audio [featuresL, featuresR] = wav_speech_features(fname, 256, 128, rms(1) / 5, rms(2)/5, filter_val); % Make sure they're both...
%Verification of Sampling theorem for different sampling rates clc; clear all; close all; %user input parameters m=input('Choose CT signal type : sine or cosine ','s');%asking for the type of CT signal Sm t=input('Enter the message signal length: '); %asking for message signal length n=input('Enter the sampled signal l...
function [] = plotData(train, test) N = size(train, 2); C1 = []; C2 = []; for n=1:N if test(1,n) == 1 C1 = [C1 train(:,n)]; else C2 = [C2 train(:,n)]; end end scatter(C1(1,:), C1(2,:), 52, [1, 0, 0], 'x'); hold on; scatter(C2(1,:), C2(2,:), 26, [0, 0, 1], 'o'); hold off;
%Assignment 2 - submitted by Deepak E. Gopinath (2909041) - Code A+B clear;addpath('ds1'); clc; close all; addpath('ds1'); loadMRCLAMdataSet; disp('Running SCRIPT Q1'); Q1_A; disp('Running SCRIPT Q3'); Q3_A; disp('Running SCRIPT Q5'); Q5_A; disp('Running SCRIPT Q7'); Q7_B; disp('Running SCRIPT Q8'); Q8_B; disp('Runn...
clear clc load('MC_6.mat') %% %%problem setup % disp('-----+-----+-----+-----+-----+-----+-----+-----+-----+-----') % disp('| |') % disp('| |') % disp('+ SETTING UP PROBLEM ...
function MR=min_homogrep(th,w_vec,hrQ,tol); % MIN_HOMOGREP computes from the threshold th and % the weights w_vec the minimal homogeneous representation of an homogeneous % weighted majority game. % % Source: A. Ostmann (1987) On the minimal representation of homogeneous games. % Int J Game Theory 16, 69–81 (...
% ------------------------------------------------------------------------------------------------------------------------- function net = add_pair_of_streams(net, stream, inputs, outputs, siamese) % Luca Bertinetto, Jack Valmadre, Joao F. Henriques, 2016 % ------------------------------------------------------------...
clc,clear load('yx.mat') %原始数据以列向量的方式存放 yt=yx; n=length(yt); alpha=[0.1 0.3 0.9];m=length(alpha); yhat(1,1:m)=(yt(1)+yt(2))/2; for i=2:n yhat(i,:)=alpha*yt(i-1)+(1-alpha).*yhat(i-1,:); end yhat;%预测值 err=sqrt(mean((repmat(yt,1,m)-yhat).^2))%预测误差总和 yhat114=alpha*yt(n)+(1-alpha).*yhat(n,:) %预测下一时刻值
coll = db.getCollection('testCollection'); query = dbobject('{ info: {$exists: true } }'); projection = dbobject('{info.description: 1}'); docs = coll.find(query, projection); while docs.hasNext() doc = docs.next(); jsonString = char(doc.toString()); s = loadjson(jsonString); s end disp('Aggregat...
t = 0:0.01:1; E1=2*cos(2*pi*2*t); E2=5*ones(size(t)); E3=3*sin(2*pi*3*t); E = [E1; -E2; -E3]; %risināsim %vienādojumu sistēmu Ik=R\E; % atrast un uzzīmēt IR6 - ? IR6=Ik(3); IR6=Ik(3,:); plot(t,IR6) [Warning: MATLAB has disabled some advanced graphics rendering features by switching to software OpenGL. For more informa...
x = 0:0.1:1; y = 0:0.1:1; x2 = 0.2:0.1:1.2; figure(); plot(x,y); hold on; plot(x2,y,'--');
% Minjun Park, CAAM 210, 10/14/15 % % This is decoder function % This code calls encrypted file, and using letter transition % probabilities, it decodes the file. The logic of the function is simply % replacing a pair of letters with the higher probability % % USAGE: Call three different filename, and then this funct...
function make(varargin) %MAKE LAMG MATLAB code installation script. % MAKE(COMPILE) compiles mex files and adds directories to the path. % MAKE() is synonymous with MAKE(FALSE). goals = varargin; home = currentPath(); % Read dependencies file with list of relative paths to make in makeConfig = conf.MakeC...
%%Section 4.1 %Problem 6 clear all close all clc f = @(x) 1/(1+25*x^2); v=linspace(-1,1,1000); for i=1:1000 y1(i)=f(v(i)); end y1=y1'; %a x = linspace(-1,1,10); for i=1:10 y(i)=f(x(i)); end [y2] = LagrangePoly(x,y,v); fprintf("n=10\nlargest difference:") disp(max(abs(y1-y2))) %b x = linspace(-1,1,15); for i=...
function [xtimes,rate_per_bin,maxrate] = pe_th(spikes, events, secbefore, secafter, nbins) %function pe_th(spikes, events, secbefore, secafter,nbins) %plots a perievent time histogram %spikes=array of timestamps for a single unit %events=array of timestamps for a single behavioral event %secbefore=time (in seconds) bef...
% Experiment 3: rTR-ALS % % This experiment is meant to be for sparse real world data, for the % rTR-ALS method. % % No outputs from this script were used in the paper. I may everntually % remove it entirely. % Settings dataset = "nell-mini"; R = 10; no_it = 20; tol = 1e-1; %% Load and preprocess if strcmp(dataset,...
function y=design(x) % DESIGN % DESIGN(x) creates a matrix of 1 and 0 corresponding to x % y: Rows(x) x Max(x) i=1:1:rows(x); k=ones(rows(x),1); s=sparse(i,x,k,rows(x),max(x)); y=full(s);
% 地月日全运动动态仿真程序 clc;close all; G = 6.674e-11; Ms = 1.989e30;Rs = 696300e3; Me = 5.972e24;Re = 6378e3; Mm = 7.348e22;Rm = 3678e3; sim_time = 3600*24*375*3; h = 3600*24; i = 1; w_e = [0 0 29535.6 1.52171522e11 0]; w_m = [w_e(1) 0 990.32 405500e3 0]; trajectory_earth2sun = zeros(5,376); trajectory_moon2earth = ...
load KsrT.mat; load('data925.mat'); load('data926.mat'); load('data927.mat'); load('data928.mat'); Ksr(1)=min(Ksr925); Ksr(2)=min(Ksr926); Ksr(3)=min(Ksr927); Ksr(4)=min(Ksr928); T_all=[5.4;T10;T16]; K_all=[0.0211;Ksr;Humphrey1]; [fitresult, gof] = createFit_KsrT(T_all, K_all); T=[0:1:200]; figure;...
%% RECTANGLE TESTING clear all; clc L_H = vpa(1); L_V = vpa(3.5); x = linspace(0.01, L_H-0.01, 100); % Initial positions on base side period = 10; for j=1:length(x) y(j) = rec_area(L_H, L_V, vpa(atan(4*L_V/1*L_H)), vpa(x(j)), period); end plot(x,y) xlabel('P_0'); ylabel('Area') %% Recta...
function [Corr,Y] = pa_predictripple(strfFname,dname,varargin) % PA_PREDICTVOCAL % % Assumptions: 0.25 octave, 2.5 octave bandwidth %% Initialization close all if nargin<1 strfFname = 'joe6715c01b00.mat'; % strfFname = 'nep'; end if nargin<2 dname = 'E:\DATA\Cortex\Test\Both'; end dspFlag =...
function [morphCpts,morphType] = applyProtrusionMorph(cPts) morphType = 'protrusion'; nSidesToProtrude = randi(3); includeProtrusionMidPt = 0; [~,longestSides] = sort(sqrt(sum(((cPts - circshift(cPts,[-1 0])).^2),2)),'descend'); ptsToAdd = cell(1,nSidesToProtrude); idxBet = zeros(nSid...
function [param,FrameIdUsed] = ZhangCalibration( OmigaCell, BoardCornerGap_in, BoardCornerXYNum_in,ShowFlag) % 标定板参数设置*************************************************************** BoardCornerGap = BoardCornerGap_in; % 标定板上特征点之间的间隔。先纵,后横 BoardCornerXYNum = BoardCornerX...
function [vp, sigma, beta] = getHSReflector(x, p) s = 0; for i = [p:columns(x)] s = s + x(i) * x(i); s = realsqrt(s); s = s * sign(x(p)); sigma = s; vp(p) = x(p) + s; for i = [p + 1:columns(x)] vp(i) = x(i); endfor for i = [ 1 : p - 1] vp(i) = 0; endfor beta = vp(p) * sigma; endfunction
%% Read wells from the 2000 run wells = readWells('../input/well_data4.npsat'); %% calculate ratio Qtarget = 3195370; rat = Qtarget/abs(sum(wells(:,5))); wells(:,5) = wells(:,5)*rat; %% write new wells fid = fopen('well_dataTR.npsat','w'); fprintf(fid, '%d\n', size(wells, 1)); fprintf(fid, '%0.3f %0.3f %0.3f %0.3f %0.3...
function [x1,y1,x2,y2,x3,y3]=cteSalSIL %paramétros del compuesto %Tenemos tres pares de puntos (x1,y1), (x2,y2), (x3,y3) que determinan una región %punto (x1,y1) x1=0.628;y1=0.8704; %punto (x2,y2) x2=0.628; y2=0.810; % (x3,y3) x3=0.914; y3=1.16; end
%in barnamei baraye TOP-HAT ast,BARAYE %EJRAYE BARNAME HAME BARNAME RA ENTEKHAB KARDE(Ctrl+A & Ctrl+C)VA DAR Command %Window MATLAB PASTE KONID. clc; clear all; close all; BB=imread('13.tif'); %otsu threshol level=graythresh(BB); AA=im2bw(BB,level); Img=im2single(imread('13.tif')); figure(1);imshow(Img);title('tasvir...
function [signals,SNRdB,ch] = Test1(nlindex,disp,link,sp,signal,amp,pdbm) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Link parameters % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LL = link....