text
stringlengths
8
6.12M
%% LTI controllability observability % <html><p class="lead">Check controllability and observability of an LTI % system using LMI conditions</p></html> % % File: LTI_ctrb_obsv.m % Directory: 2_demonstrations/workspace/ccs/ccs_2018 % Author: Peter Polcz (ppolcz@gmail.com) % % Created on 2018. November 06. % %%...
classdef NonhydrostaticSolitaryWave < SWEConventional2d %NONHYDROSTATICSOLITARYWAVE 此处显示有关此类的摘要 % 此处显示详细说明 properties H0 H5 U0 U5 W0 W5 P0 P5 end methods function obj = NonhydrostaticSolitaryWave(N, deltax, cellType)...
% The function iprime = symshort(t, i) defines the differential % equations of the synchronous machine in Example 8.2 during a % balanced three-phase fault. The function returns the state % derivatives of the current. % Copyright (c) 1998 H. Saadat function iprime =symfault(t,i) f=60.; w=2.*pi*f; d=0.; d=d*...
format long g; input = VideoReader('input.mov'); test = cell(1); k = 0; while hasFrame(input) k = k+1; test{k} = rgb2gray(readFrame(input)); end [testHeight, testWidth] = size(test{1}); reff = rgb2gray(imread('reference.jpg')); [reffHeight, reffWidth] = size(reff); %window = [1 2 4 8 16 ...
function my_string = abs_ave_diff_txt(tm) % returns a string value of output from abs_ave_diff my_string = [' Absolute average difference: ', num2str(abs_ave_diff(tm)), ' mph'];
%% filter clc clf clear close fc = 2e9; % Carrier freq. [Hz] v = 30/3.6; % Relative speed [m/s] Ts = 1e-4; % Sample interval [s] N = 1e3; % Length of filter [samples] Ns = 1e5; % Number of simulated samples (Ns>>2*N+1) kc = 0; c = filter_met...
% Approximate estimations for Vcmax, Jmax, and TPU were given by: function [Vcmax0,Jmax0,TPU0]=preidbound global t global ci global pho R=8.314; T0=273.14; O=21; Tleaf=T0+t; % Temperature coefficient kc=exp(35.9774-80.99*1000./(R*Tleaf)); ko=exp(12.3772-...
% This script performs a comparison analysis of several classifiers for % P300 classification in BCIAUT clinical trial data % % November 2017 % Creator Marco Simoes (msimoes@dei.uc.pt) and Carlos Amaral. % % All rights reverved % setup path addpath(genpath('.')); rmpath(genpath('.git')); %% load configs configs = get...
%% INSTINFO - instantaneous information analysis % Calculates various information theoretic quantities for trial based or % single trial data. Single trial data are analyzed through time, while % trial based data are analyzed across trials at each time bin. % % Syntax: [InfoVal,p,s,MCInfoVals] = instinfo(StatesRaster, ...
function Flag=WriteRSDCM(structAxialROI, FileName, PatInfo, ImgUIDInfo, hText) %Update status set(hText, 'String', 'Creating DICOM RS file ...(1/2)'); drawnow; %--Load template load('ExportRSTemplate.mat'); %PatientName RSInfo.PatientName.FamilyName=PatInfo.LastName; RSInfo.PatientName.GivenName=PatInfo...
% calculate rate of OH + CH3OH -> H2O + CH2O + HO2 % Updated 7/14/06 AEP % Based on JPL Data Evaluation #15 % rate=kOHCH3OH(T,M) % methanol function j=kOHCH3OH(T,M) j=2.9e-12.*exp(-345../T);
function vel = velocity_interp_old(x,t,xx, yy,velocityGrid) %rentre un vecteur x de taille 2*n avec n le nombre de points vel = zeros(2,1); epsilonx = abs(xx(1,1) - xx(1,2))*0.5; epsilony = abs(yy(1,1) - yy(2,1))*0.5; for i=1:size(xx,1) for j=1:size(xx,2) deltax = x(1) ...
function labelTool(filename,collector,restore) % labelTool - Allows the user to add ground truth to a B-Scan % % If restore is true, the function checks for previously created label files in collector.options.saveDir. % If no such file is detected, the fallback position is to load labels that are provided with the data...
function [Iout, Zout] = recursive_compensation(Iv, Zv, sigma) maxZ = max(Zv(:)); minZ = min(Zv(:)); Iout = single(Iv); Iout(isnan(Iv)) = 0; %W = single(~isnan(Zv)); W = (Zv-minZ)/(maxZ-minZ); W(isnan(W)) = 0; Iout = Iout.*repmat(W, [1 1 3]); Zout = Zv.*W; Zout(isnan(Zout)) = 0; If = recursive_gaussian(Iout, sigma); Z...
function startTimer(hTimer) if strcmp(get(hTimer, 'Running'), 'off') start(hTimer); end end
clear, clc, close all %% %calcula magnitude e direção % tempo1(:,:,1) = imread('/Users/pma009/Documents/Pessoal/Codes/ArtigoIEEE/ImagensReflectancia/SaoFelixa_184/clip/SR_2000b1_270.tif'); % tempo1(:,:,2) = imread('/Users/pma009/Documents/Pessoal/Codes/ArtigoIEEE/ImagensReflectancia/SaoFelixa_184/clip/SR_2000b2_270.t...
function varargout = MAIN_Group3(varargin) % MAIN_GROUP3 MATLAB code for MAIN_Group3.fig % MAIN_GROUP3, by itself, creates a new MAIN_GROUP3 or raises the existing % singleton*. % % H = MAIN_GROUP3 returns the handle to a new MAIN_GROUP3 or the handle to % the existing singleton*. % % M...
classdef MixMvnMc < MixMvn & BayesModel % Mixture of Multivariate Normal Distributions where the posterior is % represented in terms of samples. properties paramDist; end methods function model = MixMvnMc(varargin) args = processArgs(varargin,... '-nmixt...
% function params = chooseParametersRotX(params, paramnames, showall) % % Opens an interactive window for users to modify the parameters % for a parameterized unfolding fhandle and returns the chosen parameters % % inputs: params = cell of parameter values for input into fhandle % paramnames = cell of parameter...
% reads a txt file produced by to_lex1.pl filename = 'wiktionary_bilexicon_en-es'; X = importdata([filename,'.txt']); fid = fopen([filename,'.txt']); i = 1; while 1 % read lines one by one. line = fgetl(fid); if ~ischar(line) break end matches = split(line, ','); word1 = matches{1}; ...
% Determine the various average u values for various Nx for Nx = [8, 16, 32, 64, 128] % Calculate the values [u, Nx, Nt, dx, dt, u_avg] = explicit_FDM_func(Nx); % Display the result fprintf('Nx = %4d, Nt = %4d, dx = %2.4f, dt = %2.4f, u_avg = %2.4f\n', ... Nx, Nt, dx, dt, u_avg); figure ...
% %%psk clc; clear all; runs=100; M=4; k=log2(M); n=k*100000; EbNo_db=1:1:20; EbNo=10.^(EbNo_db/10); beta=0.35; sps=8;%Samples per symbol span=20; tblen = 10; tb=16; const = pskmod([0:M-1],M); Offset1=0; Offset2=0; % Offset=abs(Offset1-Offset2); % del=Offset/sps; % n1=1/del; Symbols = pskmod([0:M-1],M); p1 =(1/sqrt(2)...
clc clear close all xmin=-1.5; xmax=1.5; ymin=-1.5; ymax=1.5; zmin=-1.5; zmax=1.5; alpha=[0 90 0 -90 90 -90]; ai=[0 0 0.4 0 0 0]; di=[0 -0.4 0 0.4 0 0]; thetai=[0 90 -90 0 0 0]; thetaf=[0 90 -90 0 0 0]+30; n=6; den=[0; 0;0.4]; % thetai = [0 0 30 15 30 15]; % thetaf = [30 30 60 45 60 45]; % for j = 1:90 ...
%clear all; function [TPH, smoothData, data1D_HOLD] = func_TPH_read(pth_sdt, tph_name, frames,FrameStart) tph_dir = [pth_sdt tph_name]; global yBin %Height of data global yBotEnd D_tph = dir([tph_dir '\*.tif']); %Get size info from the first frame TPH_Temp = double(imread([tph_dir D_tph(1).name])); yBotEnd = lengt...
lidarSub = rossubscriber('/catvehicle/lidar'); mapSub = rossubscriber('/catvehicle/map'); receive(lidarSub); pause(0.5); tftree = rostf; pause(2); disp('tftree loaded') dist = 40; height = -1.5; map = receive(mapSub); mapOccGrid = map.readOccupancyGrid; ptCloudRef = receive(lidarSub); pose = getTransform(tftree, 'ca...
function [tbx_1, tbx_2, options] = pca_nl_test(data, varargin) %{ A Nonlinearity Test for Principal Component Analysis (V 1.0) Developers: Dr. Ali Habibnia London School of Economics alihabibnia@gmail.com Eghbal Rahimikia Iran University...
function y = sinc(x) y = zeros(1, length(x)); a = 2; for i = 1:length(x) if x(i) == 0 y(i) = 1; else y(i) = sin(pi*x(i))/(pi*x(i)); end end
% List of open inputs % M/EEG Conversion: File Name - cfg_files % M/EEG Epoching: File Name - cfg_files % M/EEG Filter: Cutoff - cfg_entry % M/EEG Filter: Cutoff - cfg_entry nrun = X; % enter the number of runs here jobfile = {'/home/leonhard/MEG_HH/data/meg/scripts/l_batch_sleep_13sep12_job.m'}; jobs = repmat(jobfile,...
% You have a DSP processor with a sampling rate of 1000 samples/s. % Generate an impulse response h(n) of an FIR system with response % y(n) = 1/3 * [x(n) + x(n ? 1) + x(n ? 2)]. Plot the frequency spectrum % of h(n). clear all; h(n) = 1/3 () fs = 1000; hn =[1/3,1/3,1/3,0,0,0]; f = linspace(-fs/2, fs/2, 1000); ...
clear all close all clc addpath(genpath('./libs')) addpath(genpath('./data')) load experiment2_results % load exprmnt2_results numrandomtrials = size(randomgraph_second_auc,1); for r=1:length(Rho) rho = Rho(r); % Y = prctile(random_auc(r,:),94); percentile(r) = length(find(randomgraph_second_auc(:,r)<=s...
function w=updtmv12(w,l1,l2,p1,p2,amb,amb1,amb2,cst) % % Function updtmv12 % ================= % % This function updates the misclousure vector for L1/L2 ambiguities % computation % % Sintax % ====== % % w=updtmv12(w,l1,l2,p1,p2,amb) % % Input % ===== % % w -> misclousure vector ...
function [tris, sibhes, v2he, us] = swap_vertices_surf( vid1, vid2, tris, sibhes, v2he, us) %#codegen %SWAP_VERTICES_SURF Swap two vertices in a triangle mesh. % [TRIS, SIBHES, V2HE] = ... % SWAP_VERTICES_CURV( VID1, VID2, EDGS, SIBHVS, V2HV) swaps two vertices % in connecitivity table. if vid1==vid2; re...
function [mo_features, x_spikes] = find_mesopelagic_organism(x, p, cfg, verbose) % FIND_MESOPELAGIC_ORGANISM use spikes in bio-optical profiles to find the depth of mesopelagic % organism (MO) if they are present. % The method is combining an outlier detection algorithm (Hampel Filter) and a clustering algorithm % ...
close all; % fuel use is given by F(p) = p+ gamma*p^2 (for p>=0) % define Preq, required power at wheels % Preq is piecewise linear % a is slope of each piece a=[0.5 -0.5 0.2 -0.7 0.6 -0.2 0.7 -0.5 0.8 -0.4]; % l is length of each piece l=[40 20 40 40 20 40 30 40 30 60]; Preq=(a(1):a(1):a(1)*l(1))'; for i=2:length(l)...
classdef TableQuery < azure.object % TABLEQUERY Represents a query against a given table % Copyright 2018 The MathWorks, Inc. properties end methods %% Constructor function obj = TableQuery(~, varargin) % Initialize the object obj.Handle = com.microsoft.azu...
%% p = inline('(t>=5) & (t<=7)', 't'); t = (-7:1:7); plot(t, p(t)); xlabel('t'); ylabel('P(t) = u(t-5)-u(t-7)'); axis([-1 1 1.1]);
% Dati % A (3x3) % B (3x1) % C (2x3) % D (?x?) % Fare: % - Rappresentazione state-space % - Funzione di trasferimento % - Risposta all'impulso % - Risposta al gradino % Pulisci clear; clc % Dati del problema A = -[ rand 0 0; 0 rand 0; 0 0 rand ]; % Sistema stabile B = rand(3, 1); C = rand(2, 3); D = rand(2, 1...
function phenotypeFactor = constructSigmoidPhenotypeFactor(alleleWeights, geneCopyVarOneList, geneCopyVarTwoList, phenotypeVar) % This function takes a cell array of alleles' weights and constructs a % factor expressing a sigmoid CPD. % % You can assume that there are only 2 genes involved in the CPD. % % In the...
clear all clc rng(100,'twister') N = 15; T = 5000; mu = 0.5; phi = 0.985; Y_n = 1; epsilon_1 = 1; epsilon_2 = 0.5; epsilon_3 = 0.05; x_n = zeros(N,T+1); logWeight = zeros(N,T); weights = zeros(N,T); N_eff = zeros(1,T); x_n_new = zeros(N,T); % LogLike = 0; Loglikelyhood_1 = zeros(1,T_n); for t = 2:T+1 x_n(:,t) =...
%% ConnectVNA_SN_1 % %% Description % CONNECTVNA_SN_1 Creates PicoVNA COM object. % % connectVNA() returns a COM object to a PicoVNA device. % % Copyright: © 2017-2018 Pico Technology Ltd. All rights reserved. % % See also DISCONNECTVNA. function [obj] = connectVNA_SN_1(serialNumber) % Create VNA COM...
function generalProperty = loadXml(generalXml) [ s ] = xml2struct(generalXml);
function obj = modelAddNewFolders(obj,varargin) % Add folders to the class. % Biafra Ahanonu % started: 2014.12.22 (probably before) % changelog % 2019.10.09 [18:28:12] - use inputdlgcol to allow re-sizing of window % 2019.11.18 [15:15:47] - Add the ability for users to use GUI to add folders as alternative opt...
%% RBES_script_example_evaluate_Iridium_mission.m RBES_Init_Params_Iridium;% Creates params [r,params] = RBES_Init_WithRules(params); instrument_list = {'BIOMASS','LORENTZ_ERB','CTECS','GRAVITY'}; mission = RBES_Create_Mission('s/c', 'POL_800km', instrument_list,params); [r,score,panel_scores,objective_scores,subobjec...
%%%%%%%%%%%%%%%%%%%%%%%%%% % function f1 of ex. 1.1 % % first derivative % %%%%%%%%%%%%%%%%%%%%%%%%%% function y = f1d(x) y = 6*x*x + 2*x - 3;
% trackletVelocities = getTrackletVelocities(tracklets); % trackletData = [tracklets trackletVelocities]; % gpParameters = getTrajectories(trackletData); % %% gpCov = [3.8438; -3.6444]; gpLik = -2.0525; gpParameters.cov = gpCov; gpParameters.lik = gpLik; predictionLocs = []; counter = 1; for i=10:10:160 for j=10:...
clear all; close all; % some global variables: IMAGE_DIM=350; FINAL_DIM = 300; aug_num = 10; NETNAME = 'v31'; % mean BGR pixel %mean_pix = [104.00698793, 116.66876762, 122.67891434]; %mean_pix_50 = [128.9595, 132.0086, 153.0701]; % this is used: mean_pix_200 = [132.0989, 138.2469, 156.8581]; % image directory imaDI...
function [m, Lambda] = Kt(m,S,gamma,dt) %This script implements the linear dynamical system modelling the %chemotactic response K(t) using a first-order Euler scheme %internal dynamics m(:,1) = m(:,1) + dt * ( S - m(:,1)/gamma ); m(:,2) = m(:,2) + dt * ( m(:,1) - m(:,2)/gamma ); m(:,3) = m(:,3) + dt * ( 2*m(...
function DCM = quat2dcm(q_in) %Compute the direction cosine matrix from Euler Parameters % [DCM] = quat2dcm(q_in) % % Author: Karl Ludwig Fetzer DCM = zeros(3); DCM(1,1) = 1 - 2 * q_in(2)^2 - 2 * q_in(3)^2; DCM(1,2) = 2 * (q_in(1)*q_in(2) - q_in(3)*q_in(4)); DCM(1,3) = 2 * (q_in(3)*q_in(1) + q_in(2)*q_in(4)); DCM(2,1)...
function [powe,fre]=fast_psd(x,nfft_in,fs); % function [p,f]=fast_psd(x,nfft,Fs) computes the properly % normalized psd for a series x. Just like matlab's. nfft is the % desired fourier transform length, and Fs is the sampling % frequency. This routine detrends the data and applies a hanning % window before tr...
% HRTF % Author: Hong Ma % E-mail: contact@mahong.org % Created: Dec 2015 % TU Ilmenau | IMT | Elektronische Medientechnik. %------------------------------------------------------------------------------------------------------------ clear; fn = 'nokia.wav'; fs = 44100; hrir_fn= 'hrir_final.mat'; front = 9; back...
% Inicialización UDP, necesita un puerto para recibir y otro para enviar % Se debe inicializar primero este script y luego ejecutar Unity Server = udp('localhost', 9002, 'LocalPort', 9003); fopen(Server); disp(Server.status); while(1) % Enviar mensaje % fwrite(t, msg); % Recibir mensajes A = fre...
clc clear all close all % Ucitavam signal po signal, jebu me pikovi jer ne znam gde koji signal % pocinje % Ucitaj Udrarac 1 [Intezitet_1,Signal_1]=pakovanje(1,'Signali/p1_',11); % Ucitaj Udrarac 2 [Intezitet_2,Signal_2]=pakovanje(2,'Signali/p2_',11); % Ucitaj Udrarac 3 [Intezitet_3,Signal_3]=pakovanje(3,'Signali/p3_'...
function [Images, ImageNames, ImageSize] = ImageLoader(folder_path) % Images = ImageLoader(folder_path) ******************************** % % Description: % Loads Images into Memory % % Output: % folder = Directory where images to be loaded are located % WB = Disply Wait Bar Yes == 1, No == 0 (Default) % % Images...
function [cellList, cMat] = ExtractCells(bwLabel,im,Options) im(im>0)=1; [xdim,ydim]=size(im); nbr=[1,1;1,0;1,-1;0,1;0,-1;-1,1;-1,0;-1,-1]; epImg = bwmorph(im, 'endpoint'); labelImg=epImg+im; cellNum = nnz(epImg)/2; if(mod(nnz(epImg),2)==1) disp('error in number of endpoints'); error('error in extracting manu...
function [transformedembs]=coalignNamedEmbryosPerTime(emb_e1,temb1,t4emb1,anisotropy_1,embryostoalign,tsembstoalign,t4embstoalign,anisotropy_2) %UNTITLED given a template embryo and list of n embryos to be aligned to it %along with start and end time for computing linear temporal alignment %for end frame compute ...
function geteval() NMI = zeros(1, 5); ACC = zeros(1, 5); [NMI(1), ACC(1)] = evaluation(strcat('./results/polbooks_', 'alinkjaccard', '.txt'), './lab02-dataset/polbooks_gd.txt', 3); [NMI(2), ACC(2)] = evaluation(strcat('./results/polbooks_', 'girvannewman', '.txt'), './lab02-dataset/polbooks_gd.txt', 3);...
%Oppgave 2b) function outtype = absoluttverdi(inputarg) outtype=abs(inputarg); end
%Regla de crammer para cualquier tipo de matriz clear all clc N=input('Digita el tamaņo de la matriz: '); for I=1:N for J=1:N A(I,J)=input('Digite el valor de la matriz'); end B(I)=input('Ingrese el tamaņo vector de constantes'); end B=B'; a=det(A); for I=1:N c=A; c(:,I)=B X(I)=det(c...
function [alpha, LEig, REig] = TwohostOnepopESS(alpha, m, theta, gamma, mu, tol0, tol1, B, diffB, C, dA, lambda) ics1 = [0.25, 0.25, 0.01, 0.01, 0.01, 0.01]; %m is multiplying parameter %\theta are 2x2x2 arrays storing values for beta functions %gamma is recovery rate %mu is natural mortality %B is beta function...
%17-35 w = input("weight of desk in lb: "); f = input("force of push in lb: "); mu = input("coefficient of friction: "); L1 = input("distance L1 in ft: "); L2 = input("distance L2 in ft: "); L3= input("distance of L3 in ft: "); syms Na Nb A sumX = f * cosd(30) - mu * (Na + Nb) == w * A / 32.2; sumY = Na + Nb - f * si...
%SelectKRandomPoints %Purpose: Generates a list of 'k' randomly selected pixels from an image %Inputs 1)3D image array to select points from 'A' % 2)Number of points to select 'k' %Outputs 1)2d array containing k rows and 2 columns 'points' %Fiona Lin function [points]=SelectKRandomPoints(A,k) [m,n,~...
%% main.m %{ This is the new main script, %} %loadnums = [5,6,7,8,9,10,11,14,15,16,17,18,19];
%% VoLAre Example 1c: Full-span swept wing analysis using coarse mesh. % This example is used to check the alternate full-span boundary condition % option. % % Anthony Ricciardi % August 2017 % https://github.com/vtpasquale/VoLAre % % o Planform described and tested by Weber and Brebner [1] % o Mesh and s...
inds = [1:numel(seq)]; frame{5}{10} = []; frame{5}{11} = []; frame{4}{36} = []; frame{4}{37} = []; frame{4}{38} = []; frame{4}{31} = []; frame{9}{8} = []; gm = 1/1.6 for i = inds if i > 3, gm = 1; end t = load(fullfile(folder, seq(i).name)); if ~isempty(seq(i).end_ind) video = VID.VideoMat(imresize(im2double(t.V...
clear all; clc; close all; load Data\S10_midLine;% vtMidLine; % load data\glottis_lout;%%a_lout u_lout A B c_point; load Data\S5_glottis_struct; % a_lout A B c_point newx newy origin alpha; %%change for rotate load Data\S9_midPointsAdded;%%midshu C D; %% calculate qie line AB=[A;B]; meanAB=mean(AB); meanCD=midshu(end...
function myDelta=Delta(aBot,aStrike,aTime,aBoolean) if aStrike==10, myCallOptionDepth=aBot.Call1000Depth; myPutOptionDepth=aBot.Put1000Depth; end myStrike=aStrike; myInterest=0; myExpiry=((169000-aTime)+3600*24*daysact('10-jun-2016', '16-sep-2016'))/(3600*24*252); if isempty(aBot.StockDepth)==0, if isemp...
%clrscr(); format short; x = [ 7 1 1 1 1 1 1 1; 1 7 1 1 1 1 1 1; 1 1 7 1 1 1 1 1; 1 1 1 7 1 1 1 1; 1 1 1 1 7 1 1 1; 1 1 1 1 1 7 1 1; 1 1 1 1 1 1 7 1; 1 1 1 1 1 1 1 7 ]; L = [ 1 0 0 0 0 0 0 0; 0 1 0 0 0 0 0 0; 0 0 1 0 0 0 0 0; 0 0 0 1 0 0 0 0; 0 0 0 0 1 0 0 0; 0 0 0 0 0 1 0 0; 0 0 0 0 0 0 1 0; 0 0 0 0 0 0 0 1; ];...
classdef CloudStorageAccount < azure.object % AZURE Storage Account for the Microsoft Azure services in MATLAB % This account object provides MATLAB the appropriate access to the Azure % cloud services and serves as a container for the various handles to the % Azure Platform. % % If the UseDevel...
function [errorCode, errorMsg,cancelNo] = batchEntrustCancel(self, batchNo) %ENTRUSTCANCEL 在CounterHSO32中重新包装函数EntrustsCancel % -------------------------- % 程刚,20160201 connection = self.connection; token = self.token; [errorCode, errorMsg,cancelNo] = BatchEntrustsCancel( connection,token, batchNo); end
% Get axon and neuron data from simulation and plot the location % of the neurons and trajectory of the axons % directory containing simulation data DIRPATH = '../data/processed/'; DIR = dir(strcat(DIRPATH, 'axon_*.csv')); files = {DIR.name}; hold on % load neuron and axon files from directory for i=1:lengt...
% WBMPEN ウェーブレット1次元、または2次元の雑音除去用のペナルティ付き % スレッシュホールド % % THR = WBMPEN(C,L,SIGMA,ALPHA) は、雑音除去用のグローバルスレッシュホールド % THR を出力します。THR は、Birge-Massartにより提唱されたペナルティ法を使って % ウェーブレット係数選択則から得られます。 % % [C,L] は、雑音除去された信号、またはイメージのウェーブレット分解の % 構造体です。 % % SIGMA は、雑音除去モデルの中の平均がゼロのガウス白色雑音の標準偏差です % (詳細は WNOISEST を参照)。 % % ALPHA ...
function [best_err,Wout,Zout] = Random_EM(y,X, K, T_random,T_EM) [N,D] = size(X); best_err = 1e300; for t = 1:T_random W1 = randn(K,D); [W2,Z2] = EM(y,X,W1,T_EM); err = norm(y-sum(Z2.*(X*W2'),2))/sqrt(N); if err < best_err best_err = err; Wout = W2; Zout = Z2; end ['random_trial=' num2st...
function [A, B] = covMask(cov, hyp, x, z) % Apply a covariance function to a subset of the dimensions only. The subset can % either be specified by a 0/1 mask by a boolean mask or by an index set. % % This function doesn't actually compute very much on its own, it merely does % some bookkeeping, and calls another cova...
function x = InnProdPolyImage(xi1,xi2,ft_r1,ft_r2,b) dxi1 = xi1(1,2) - xi1(1,1); dxi2 = xi2(2,1) - xi2(1,1); %id = find(xi == 0); ax1 = abs(xi1); ax2 = abs(xi2); %if xi1 is not a matrix %Polynomial Metric tmp=sqrt(ax1.^2+ax2.^2); term = (1./(1 + tmp).^b); %Exponential Metric %term = exp(-pi*xi.*xi)...
function [tspan, states, inputs, params] = exportSolution(obj, sol) % Analyzes the solution of the NLP problem % % Parameters: % sol: The solution vector of the NLP problem @type colvec phase = obj.Phase; % phase_var_indices = obj.PhaseVarIndices; n_phase = length(phase); tspan...
clc; clear; filename='3.jpg'; a=importdata(filename); i=rgb2gray(a); y = histeq(i); subplot(2,2,1); imshow(i); subplot(2,2,2); imhist(i); subplot(2,2,3); imshow(y); subplot(2,2,4); imhist(y);
counter = diff(floor(SourceFile.HallCount)); counter_locs = find(logical(counter)); counter_spaces = diff(counter_locs); counter_locs = [0;counter_locs]; for j =2 : (length(counter_locs)-1) leftbound = counter_locs(j-1)+1; midpt = counter_locs(j); rightbound = counter_locs(j+1)-1; leftbin = [...
%% This script used for prepare the image before using %% Read and show the image [filename,pathname]=uigetfile('*.*','select the image'); file = sprintf('%s\\%s',pathname,filename); OriginalImage = imread(file); figure,imshow(OriginalImage),impixelinfo,title('Original Image'); %Number of cols and rows Ro...
dicomfiles=spm_select; hdr=spm_dicom_headers(dicomfiles); spm_dicom_convert(hdr, 'all', 'series', 'nii')
pkg load symbolic; clc; clear all; syms x y; factor((x^4 - 16) / (x^2 - 4))
function [prdData, info] = predict_Procambarus_virginalis(par, data, auxData) % unpack par, data, auxData cPar = parscomp_st(par); vars_pull(par); vars_pull(cPar); vars_pull(data); vars_pull(auxData); filterChecks = k * v_Hp >= f_tL1^3 || ... % constraint required for reaching pube...
% separates the data into testing and training data % for each of the subjects, open files with windows % doesn't shuffle, first n% is train, remainder is test function separate_ordered % set the percent of data to be saved for test and the percent for train testPercent = 0.2; trainPercent = 0.8; % number of windows (...
% takes the screen size - finds the height of the screen divides by a ratio % of 768/8 and scales up the text by the same amount function[]=textSizeChange(figNumber) fig=figNumber; SS=get(0,'screensize'); ratio=768/8;%768 is based on a computer newTextSize=floor(SS(4)/ratio); set(findall(fig,'-prope...
clear all % Program reads the data from the wea files and writes the data in an % output file used in carboeuroflux (Michael Boy June 2012) % Open sme files for every month YEAR = input('Year: ', 's'); year = eval(YEAR); day_month_03 = [0 31 59 90 120 151 181 212 243 273 304 334]; day_month_04 = [0 31 6...
function [Flatf, Mlatf, Mlatr, Flatr] = lateral_load(A, fcm) Mlatf = A*(fcm.Msloc(1) + fcm.Msloc(2))*(fcm.Hcgs - fcm.Rcf); Mlatr = A*(fcm.Msloc(3) + fcm.Msloc(4))*(fcm.Hcgs - fcm.Rcr); Fuf = (2*A*fcm.Muf*fcm.Hcgu)/fcm.Lcw; Fur = (2*A*fcm.Mur*fcm.Hcgu)/fcm.Lcw; Flatf = (Fuf + (A*fcm.Msf*f...
% By Mohammad Zandsalimy % mohammad.zandsalimy@ubc.ca clc; clear all; close all; R = 287.058; % Ideal gas constant [J.kg^-1.K^-1] k = 1.4; % Ideal gas heat capacity ratio T = 273.15 + 20; % Static temperature [K] c = sqrt(k * R * T); % Speed of sound [m.s^-1] s.M = 1.0; % The horizontal Mach number of the source s.x...
% If we list all the natural numbers below 10 that are multiples of % 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. % % Find the sum of all the multiples of 3 or 5 below 1000. printf("%d\n", sum(unique([3:3:999 5:5:999])))
%% MAKESUBPLOTS % Combines a group of figures onto a grid with dimensions specified by % the user. Figures can either be saved in the working directory or another % directory, or simply open. % % Syntax: SubFig = makesubplots(nRows, nCols, varargin) % % Inputs: % nRows (scalar double) - number of rows in subp...
classdef Modality %MODALITY Summary of this class goes here % Detailed explanation goes here properties(Constant) CT = 'CT'; MR = 'MR'; PET = 'PT'; end methods(Access=private) function this = Modality() end end end
function TDALABinitialization global numOfMode numOfComp PMFalgIDs PMFalgParaList; global Y Ycap SIRs MCTimes; global algOptions algs; global tdalabStatus; algs=[]; algsInitialize; algOptions=cell(1,numel(algs)); PMFalgIDs=[];PMFalgParaList=[]; Y=[]; Ycap=[];SIRs=[]; numOfComp=inf;numOfMode=0; Ynoise=[];SNR=inf; gl...
function[adjList] = edgList_to_adjList(edgList) % iterate through every edge in the list % adding appropriately to an adjacency list n = max(max(edgList)); adjList = cell(n,1); for i = 1:size(edgList,1) v1 = edgList(i,1); v2 = edgList(i,2); adjList{v1} = [adjList{v1}, v2]; ...
function labelToAnnos(imgset, isTest) % Transform the from that can be read by label tools to the VOC flavor annotations if nargin < 1 imgset = 'Main/train_coco_clean' isTest = false end rootPath = './COCOclean/Labels'; savePath = './COCOclean/Annotations'; imgSetPath = './COCOclean/ImageSets/'; imgPath = './COCOcle...
clear all close all clc % define system s = tf('s'); % sys = 1/(1+s)^3; delay=0; % simple example sys = 1/(1+20*s); delay=5; % delay #1 % sys = 1/(1+20*s); delay=20; % delay #2 % sys = 1/(1+10*s)^8; delay=0; % repeated pole % sys = (1-5*s)/((1+10*s)*(1+...
% map = multigradient(rgb[, pts, varargin]) % % Returns a custom or preset colour map generated from the indicated % colours anchored at optional control points (colour stops), with % their relative positions intact, and gradients between them. % % In: % rgb - n-by-3 matrix of rgb color values ...
% 1.3 #1 pg 32 u = [-1;2]; v = [-3;-1]; one= u+v; two = u-(2*v); %1.4 #3 pg 40 m1 = [6 5;-4 -3; 7 6]; m2 = [2; -3]; m3 = m1 * m2; %1.4 #1 pg 40 m4 = [-4 2;1 6;0 1]; m5 = [3; -2; 7]; m6 = m4 * m5; % When multiplying two matrixes (m x n) and (p x q) % their "inner dimensions" have to be equal, i.e the % columns ...
while 1 pause(0.05) theta = getTxtData(string('pnp_theta.txt')); theta = theta / 180 * pi; T = getTxtData(string('pnp_t.txt')); clf; World = rotx(0); Camera = trotx(theta(1))*troty(theta(2))*trotz(theta(3)); Camera = transl(T) * Camera; axis_size = [-500 500 -500 500 -500 500]; ...
clear all; fileName = 'Conditions.xlsx'; bLeft = xlsread(fileName,'H4:H6'); bLeft = bLeft .* (-1); bRight = xlsread(fileName,'I4:I6'); A = xlsread(fileName, 'D4:G6'); C = xlsread(fileName, 'D7:G7'); total = xlsread(fileName, 'D8:D8'); m = size(A, 1); n = size(A, 2); b = [bRight;bLeft]; b = [b; total; total*(-1)];...
[xx,fs]=audioread(fle); % 读入数据 xx=xx-mean(xx); % 消除直流分量 x=xx/max(abs(xx)); % 幅值归一化 N=length(x); % 取信号长度 time=(0:N-1)/fs; % 设置时间 signal=GnoiseGen(x,SNR); % 叠加噪声 wnd=hamming(wlen); ...
function Y = uq_PCE_polynomials(X) %% Function built using orthonormal polynomials according to specification % Define input variable type % 'u': Uniform % 'g': Normal / Gaussian type = ['u','g','g','u','u','g','u']; % Define polynomial degree for univariate polynomials alphas = [1,0,2,0,1,5,1;... % 1...
function [density] = perimeterDensity(img, p_blackthreshold, windowwidth) width = size(img,2); height = size(img,1); colordepth = size(img,3); centerwidth = floor(width/2); centerheight = floor(height/2); maxdistance = ((width/2)^2+(height/2)^2)^.5; newimg = zeros(width,height,colordepth); newimg = img; matrixofpix...