text
stringlengths
8
6.12M
%@(#) sme_oe.m 1.2 04/09/01 12:09:35 % function sme_oe(fid) if nargin>0 fprintf(fid,'%c',246); else fprintf('%c',246); end
function [weights] = getSegWeights(pos) global seg a = 10; b = -10; for i = 1 : size(seg,1) p(i,1) = mean(mean(seg(i).p_map))*seg(i).a; end for i = 1 :size(seg,1) seg_c(i,:) = [seg(i).c.x,seg(i).c.y]; end pos = repmat(pos,size(seg,1),1); dist = pos - seg_c; dist = hypot(dist(:,1),dist(:,2)); dist = dist...
function bb=adabooster_regul(proto, boost_steps, phi, lambda, param1, param2) % bob=adabooster_regul(proto, boost_steps, phi, lambda, param1, param2) % % Constructor for adabooster_regul class % % BASECLASS(ES) : adabooster % G. Raetsch 1.6.98 % Copyright (c) 1998 GMD Berlin - All rights reserved % THIS IS UNPU...
TRESHOLD = 1.5; % 1.5 AMOUNT_OF_TRIPLES = 100; % 400 ACCURACY = 10; % 5 REGION = 30; % 30 warning('off','all'); % warning; im1 = imread('F029.jpg'); im2 = imread('F030.jpg'); table = siftTable(im1, im2, TRESHOLD); show2ImagesWithSiftMatches(im1, im2, TRESHOLD); table_iterate...
function [] = VFs_callback(block) % Callback processing function for mask parameter % - number of VF-s used in the Validation Functions Set set_param(block, 'LinkStatus', 'none'); load_system('Simulink'); % Load Simulink library (background) load_system('MIL_Test'); No = str2double(get_param(block,'No')); % G...
clc;clear;close all; %% 数据集是“海伦约会数据集”,并且这个数据集已经把原始的类别标签转换成了数字1,2,3,方便处理 data = load('datingTestSet.txt'); DataSet = data(:, 1:3); Label = data(:, 4); Simple_num = length(data); %% 数据归一化 maxV = max(DataSet); %返回矩阵每一列的最大最小值 minV = min(DataSet); Z = maxV - minV; %归一化因子 newDataSet = (DataSet - repmat(mi...
%%%%%%%%%%%%%%%% MEASURE INTENSITY %%%%%%%%%%%%%%%% function [intensity] = measureIntensity(N, picture, shape, snake, inDirectory) % makes the convolution kernel intensitySize = 11; % the mask radius is intensity_size plus 1/2 ksize = 2*intensitySize+1; convolveMask = zeros(ksize); for x=1:ksize; % x-direction ...
function []= geotech_mohrcirc (s3, s1) close all clear all clc s3= input('Minor principal stress sigma3 = ') % input sigma3 s1=input('Major principal stress sigma 1 =') % input sigma1 x=linspace(s3,s1,10000); % Divide the distance between s1 and s3 in 10000 parts r=(s1-s3)/2; % finding radius of the circle h=(s...
% line L = point A join point B function L=join(A, B) L=[ A(1)*B(2)-A(2)*B(1); A(1)*B(3)-A(3)*B(1); A(1)*B(4)-A(4)*B(1); A(2)*B(3)-A(3)*B(2); A(2)*B(4)-A(4)*B(2); A(3)*B(4)-A(4)*B(3) ]; end % function
function [zavg,sqr_err,zmin,zmax,mlist_clean,mlist] = test_estimate2(Xe,Ye,Ze,Xr,Yr,Zr,dx,dy) % Function to find the corresponding value in the experimental dataset that % corresponds to the one in the real dataset. Work only in 2D, x,y and z of % the real values are given and, based on x and y we find the correspondi...
classdef DG4102 < handle % class for Rigol DG4102 arb waveform generator % % WTJ , FM 20181031 properties address freq Vpp V_DC ch end methods function obj = DG4102(addr) if nargin < 1 addr = 'USB0::0x1AB1::0x0641::DG4E191700672::0::INSTR'; end ...
function plotSensorData(obj, h) persistent figureAxis1; persistent figureAxis2; persistent figureAxis3; persistent figureAxis4; persistent figureAxis5; persistent dataArray1; persistent dataArray2; persistent dataArray3; persistent dataArray4; persistent dataArray5; figure(h); % Red - Front sensor % Blue - Left sen...
%% a: Load audio and determine sampling rate [y fs]=audioread('/Users/user/Desktop/sound.wav'); display(fs); %% b: Plot signal in real time N=size(y,1); T=N/fs; t=1/fs:1/fs:T; subplot(3,1,1); plot(t,y'); xlabel('t'); ylabel('Sound(t)'); title('Main Voice'); legend('Signal'); axis([0 T -0.5 0.5]); %% c: Find Maximum a...
function model = DipRefractSolve(fwd,rvs) %*************************************************************************** % determine flat velocity model from refraction data % fwd(n,2) slopes and intercept times of forward % rvs(n,2) slopes and intercept times of reverse. % model(n,3) thickness, vel.m an...
clear all format long global P; global TMAX; global DT; global res P=[]; TMAX=[]; DT=[]; res=inf; Tmax=85; DTmax=10; i=1; startPoint=[2 5 10 18 30]; for i =1:length(startPoint) x0=startPoint(i); oldoptions = optimoptions(@fmincon,'DiffMinChange',0.002*x0,'DiffMaxChange',0.1*x0,'Display','iter-detailed',...
%%in barnamei baraye BUTTERWORTH BAND REJECT 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; %tasvire vorudi Img_in=imread('1.jpg'); FFT = fft2(double(Img_in)); FFT1=fftshift(FFT); [M N]=size(FFT); [X,Y] = meshgrid(1:N, 1:M...
classdef DemandEstimate < Estimate % Basic table and logit functionality % Subclassed by NestedLogit and MixedLogit % $Id: DemandEstimate.m 118 2015-05-26 10:34:48Z d3687-mb $ properties nestlist s s0 ls p q ms ...
function [ x0 ] = initParams( traindata, n, type ) %UNTITLED6 Summary of this function goes here % Detailed explanation goes here if type == 1 m = length(traindata); x0 = ones(n, 2); total = ones(n ,2); for i = 1:m line = traindata(i, :); u1 = line(1); ...
L = input ('What is the length of the pendulum rod? '); %length of pendulum rod t(1) = input ('What is the initial condition for t? '); %initial time X(1) = input ('What is the initial displacement of the top? '); %initial displacment of the top % Constants p = 0.050; % mass of pendulum mass m = 0.198; % mass of ...
function postprocess global fin % Function "postprocess.m" % Copies the plotting file "postplot.m" into the solution directories, % runs it, and appends a figure to the file "outplots.ps". III = [53:56]; % Cases to be postprocessed % sol lim_type functional flux_type var = {'sub', 'va...
% NZ RLS function [theta,P] = rls(x,y,theta,lambda,P) P = P/lambda - (P * (x') * x * P)./(lambda + x * P * x')./lambda; theta = theta + P*(x')*(y - x * theta); end
function [result] = is_point_on_segment(a, b, c) result = false; v = (b - a)' * (c - a); if v < 0 return end if v > (b - a)' * (b - a); return end result = true; end
% Clear the workspace and the screen close all; clearvars; sca % Here we call some default settings for setting up Psychtoolbox PsychDefaultSetup(2); % Get the screen numbers screens = Screen('Screens'); % Select the external screen if it is present, else revert to the native % screen screenNumber = max(screens); %...
function [out] = set_to_flat(tc,thresh) if ~exist('thresh','var') thresh = 0.1; end out = tc; % Find flat tcs, set to zero flattc = var(tc)<thresh; numflat = find(flattc); out(:,flattc) = zeros(size(tc,1),size(numflat,2));
function [pr]=pressure(Pk,R_input,X_input) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Last changed : 25-5-2015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% version : ...
function output_image = handCleanup(image) %HANDCLEANUP function used to clean up training images before contour % tracking % % INPUT ARGUEMENTS: % image - the image on which to perform the cleanup % % EXTENDED DESCRIPTION: % This function performs cleanup on grayscale training images. The cleanup % ...
function [] = mustBeDocumentable( mFile ) %MUSTBEDOCUMENTABLE Issues an error if input path is not a valid script, function, or classdef .m file. % % [] = mustBeDocumentable( mFile ) % % Throws an error if `mFile` does not meet the following requirements: % % - `mFile` is (or, is convertible to) a stri...
clear; % Maximale Anzahl an Datensätzen in einem Teilergebnisfile: max_profiles_per_file = 50; % Speicherort für die Simulationsergebnisse: save_path = [pwd,filesep,'Simulationsergebnisse']; sep = ' - '; %Seperator im Dateinamen % File mit Windgeschwindigkeiten: source_path = [pwd,filesep,'Wetterdaten',filesep,'Windg...
G1 = graph ([3 3 3 3 1 2 4],[1 2 4 5 2 4 5]); G2 = graph ([1 1 1 2 3 4 5],[2 3 4 4 4 5 6]); G3 = graph([1 1 1 1],[2 2 2 2]); G4 = graph ([3 3 3 3 1 2 4 6 6],[1 2 4 5 2 4 5 2 4]); G = {G1, G2, G3, G4}; H = GetNodeConfig(G); close all figure; for i = 1:length(G) subplot(1,length(G)+1,i), plot(G{i}); title(strc...
function [ p ] = newtonsMethod( dataRange,Tol,p0,N ) %data range should have a rnage of value in 1 index a slope in the second %slope i=0; [r,c]=size(dataRange); while(i<N) p=p0-round(dataRange(p0,1)/dataRange(p0,2)*stepSize); if(abs(p-p0)<Tol) return; end ...
function [Y_predict] = knn_classifier(k, X_train, Y_train,... X_test, weighting_policy_enum,... kernel_width) assert(0 <= weighting_policy_enum <= 4, 'invalid weighting policy'); m = size(X_test, ...
function [ path ] = searchFood( food_map,food_loc,v_r,itr) %food_loc is wrt to segment origin food_loc input('check food_loc'); %Generate a gaussian filter with visual uncertainity p_ff = Gaussian_filter(v_r,4); %invert the gaussian, uncertainity at persent vertex = 0 p_ff = max(max(p_ff)) - p_ff; %normali...
function [dtree,er] = train_dtree(train_x,train_y,test_x,test_y) dtree = classregtree(train_x,train_y,'method','classification'); labels = eval(dtree,test_x); labels = str2double(labels); er = sum(labels ~= test_y) / size(labels,1); end
%% curve fitting-slope c = fitresult.c; p = fitresult.p; x = 0:0.01:35; y = c+p*(x-1); plot(x, y, 'r', 'LineWidth',1); legend('CFD results','Fitting curve'); xlabel('theta') %Donnot forget to change ylabel('k_T') grid on %% point plot-ceiling figure( 'Name', 'ceiling' ); %Donnot forget to change plot(xData,yData,'-o...
function show2DCalMarks(boundingBox,halfAndCenter,calPoints) define2DArena(1,0,boundingBox,halfAndCenter,calPoints);
%@(#) opecall.m 1.3 05/12/08 13:40:12 % function opecall z=get(gcf,'userdata'); for j=4:7 if z(j)==1,z(j)=0;set(z(4+j),'value',0),end v=get(z(4+j),'value'); if v==1,z(j)=1;end set(z(4+j),'value',z(j)) end set(gcf,'userdata',z);
% Fuzzy RBF Approaching clc % 清屏 clear all; % 删除workplace变量 close all; % 关掉显示图形窗口 xite=0.20; % 学习因子 alfa=0.05; % 动量因子 b=5*ones(5,1); c=[-5 -2 0 2 5; -5 -2 0 2 5]; w=rands(25,1); c_1=c; c_2=c_1; b_1=b; b_2=b_1; w_1=w; w_2=w_1; u_1=0.0; y_1=0.0; ts=0.001; for k=1:1:1000 time(k)=k*ts; u(k)=0.5*sin(6*pi*k*...
function [r, c, beta, rake, skew, thickness, A] = generate_Tip(r, c, beta, rake, skew, thickness, A, dTip, rTip, cTip, tTip, skewTip, Nt) incr = dTip/Nt; Y = cell2mat(A(end)); Y = Y(:,2); tend = abs(Y); Ydd = cell2mat(A(end-1)); Ydd = Ydd(:,2); tendd = abs(Ydd); Yddd = cell2mat(A(end-2)...
// // MACPreviewCommand.m // MultiAirCam // // Created by Martin Gratzer on 11.12.12. // Copyright (c) 2012 Martin Gratzer. All rights reserved. //
function EEG = EEG_ATTLAB_Import_Data(sourceDir,filename) %{ EEG_ATTLAB_Import_Data Author: Tom Bullock, UCSB Attention Lab Date created: 09.28.20 Date updated: 09.28.20 Purpose: Import data from any of the following systems into EEGLAB 1) Biosemi ActiveTwo 2) Brain Products ActiCHamp 3) Brain Products BrainAmp MR I...
opts = get_opts(); addpath("src/missing_trajectories"); inputFilename = sprintf('%s/%s/result/result_%s.mat',opts.experiment_root, opts.experiment_name, opts.sequence_names{opts.sequence}); load(inputFilename); [idNum, ~] = max(trajectories(:, 2)); identities = struct("trajectories", []); missingTrajectories = []; f...
function h = CS4640_hemisphere(x,y) % CS4640_hemisphere - hemisphere height function % On input: % x (float): x value % y (float): y value % On output: % h (float): height of hemisphere at x,y % Call: % h = CS4640_hemisphere(2,3.1); % Author: % T. Henderson % UU % Spring 2018 % ...
function recedingAngleOfpores = poreRecedingAngle (minporeRecedingAngle ,... maxporeRecedingAngle , delta , etha) %% % Thsi function detremines pore receding angle by the use of distribution % function called Weibull %% global n_p x = rand(n_p,1); recedingAngleOfpores = weibull(deg2rad(maxporeRecedingAn...
%% construct the PCA and getting the scores clear load('D:\RCMIP\Pre_GSWP3_1901_2016.mat') %1901-2016 load('D:\RCMIP\Tas_GSWP3_1901_2016.mat') %1901-2016 temp1=mean(Pre_GSWP3(:,:,948+1:1392),3)*12; Pre_mean_116=temp1'; load('D:\RCMIP\Mask_land_05') % land mask Mask_land_05(Pre_mean_116<200)=nan; %Eliminate a...
% M-File showing that the RA method of creating the A & B arrays % gives the same results using the conventional method. % File: c:\M_files\short_updates\Matlab_Files\RAconvention.m % 02/16/07 % See Word file UsingGarray1.doc for background explanations. clear;clc; % unit suffixes u=1e-6;K=1e3;m=1e-3;u=1e-6;p=...
function Data_Smoothing = GetGaussianSmoothing(Data,Timewindow) %% Smoothing processing Data_Smoothing=zeros(1,size(Data,2)); gaussFilter = gausswin(Timewindow,2.5); gaussFilter=gaussFilter'; gaussFilter = gaussFilter / sum(gaussFilter); % Normalize. % % Data transformation for smoothing if size(Data,2)==1 && ...
img=imread('peppers.png'); imgS=single(img); [imgH, imgW, nCh] = size(img); if nCh==1 img=repmat(img,[1, 1, 3]); end net = load('imagenet-vgg-verydeep-19.mat'); net = vl_simplenn_tidy(net) ; imgC = imresize(imgS, net.meta.normalization.imageSize(1:2)); imgC = imgC - net.meta.normalization.averageImage; res = ...
%% ReadMe.m %% Modeling assumptions for PDSCH processing link % % Specifications based: % FDD mode (vs. TDD mode) % Multicodeword transmission for Spatial Mux, num=2 (vs. single codeword) % same length blocks of data - per one user only. % same Mod/rate per codeword - can be different to ge...
function [Acc] = TH3_Q8_Accurate(k,distance) %Tinh do chinh xac cua thuat toan %knn (n=0...9 %Load Anh train imgTrainAll = loadMNISTImages('./train-images.idx3-ubyte'); lblTrainAll = loadMNISTLabels('./train-labels.idx1-ubyte'); %Nap thuat toan mdl =fitcknn(imgTrainAll', lblTrainAll, 'NumNei...
%functie suma amplitudini function m_s_f = func_vd_msf (y) clear m_s_f; [B,A] = butter(9,.33,'low'); y1 = filter(B,A,y); m_s_f=sum(abs(y1));
y=@(x)4*cos(x).^3.*sin(x); %yf=quad(y,0,pi/2); yf=quad(@fun4,0,pi/2)
function cmap = corrmap(N) cmap = AdvancedColormap('vswor', N);
function eps=evaluate_a2_coef_nu_axis(a1_coef,a2_coef,dPsih,Psih,psi_region1,sign_ksi0,area_region3,x_nu_cont13,r_nu_cont13,x_nu_cont13_initial,r_nu_cont13_initial,omega_cont13,pos_psi_rx,rx,scale_r,scale_omega,NR,Nomega,alpha,nu_values,psi3_nu,Psih_limit13) % Deriving the expression of flux contours in the bean shape...
%% Author: epokh %% Website: www.epokh.org/drupy %% This software is under GPL %%This example show the use of DH matrix and differential operator clf clear %%Another 6 DOF manipulator %% with 5 revolute joints and 1 prismatic joint theta1=-30; theta2=-25; theta3=-50; theta4=-45; theta5=-20; theta6=...
% DET.m - DET class % % Copyright (C) 2013 Integrated System Laboratory ETHZ (SharperEDGE Team) % % This program is free software: you can redistribute it and/or modify it % under the terms of the GNU General Public License as published by the % Free Software Foundation, either version 3 of the License, or (at your % o...
A = [7 1 -1 2; 1 8 0 -2; -1 0 4 -1; 2 -2 -1 6]; b = [3; -5; 4; -3]; x = [0; 0; 0; 0]; [k, x] = jacobi(A, b, x); disp("Using Jacobi"); disp(k); disp(x); function [k, x] = jacobi(A, b, x) kmax = 2000; epsilon = 5e-5; delta = 1e-15; n = length(A); for k=1:kmax y = x; for i...
%% train landmark with softmax clear all;clc; addpath('../util'); %% caffe init caffe.reset_all(); caffe.set_mode_gpu(); caffe.set_device(1); model_fold = '../model'; pre_train_weight = fullfile(model_fold,'vgg-16', 'vgg16.caffemodel'); pre_train_mean = fullfile(model_fold,'vgg-16','mean_image.mat'); ft_model = fullfi...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Group ID : 329 % Members : Alexandar Arambašic, Juraj Peršic, Konstantinos Voulgaris, % Giannis Kapnisakis, Ricard Bordalba % Date : 14/10/2015 % Lecture: 7 Multilayer perceptions % Dependencies: % Matlab version: % Functionality: PCA 2 dimensional reduced data is class...
#include <lib/std.mi> System.onScriptLoaded (){ if(getPublicInt("ClassicPro.dontRemindOldWinamp", 0)==System.getDateDoy(System.getDate())) return; if(stringToInteger(getToken(getParam(), ";", 0))<=System.getBuildNumber()) return; int input = System.messageBox("For ClassicPro to work correctly, you'll need to up...
function filt2d(I,a) %读取原图像 if isstr(I) img = imread(I); end [IH,IW] = size(img); %取出图像高度和宽度 [m,n] = size(a); %取滤波器维数,这里m,n相同 temp1=double(img);%将矩阵转为浮点型便于计算 temp2=temp1; for i=1:IH-n+1 for j=1:IW-n+1 c=temp1(i:i+(n-1),j:j+(n-1)).*a; %进行相关运算,取出temp1中从(i,j)开始的n行n列元素与模板矩阵a相乘 s=sum(c(:)); %求模板c矩阵中...
% This is material illustrating the methods from the book % Financial Modelling - Theory, Implementation and Practice with Matlab % source % Wiley Finance Series % ISBN 978-0-470-74489-5 % % Date: 02.05.2012 % % Authors: Joerg Kienitz % Daniel Wetterau % % Please send comments, suggestions, bugs,...
function FunctionalLocalizer_main(hObject, ~) if nargin == 0 FunctionalLocalizer_GUI; fprintf('\n') fprintf('Use %s to start the GUI.','FunctionalLocalizer_GUI.m'); fprintf('\n') return end handles = guidata(hObject); % retrieve GUI data clc sca % Initialize the main structur...
a=0.21660849392; plasma_vol=1; interval=4; rect_t=2; A0=0; %in ug absorb=1; A=A0*absorb; B=0; amt_interval=0.5; time=34; step_size=0.001; B_array=zeros(1,time/step_size); A_array=zeros(1,time/step_size); rt=0:step_size:time; j=1; bol=0; k=1; for i=0:step_size:time A_array(1,j)=A; A1=A; j=j+1; A=A1-((A1)*a*...
clear global PD car L o fai2 N l = 0.1; E1 = -120^0.88; E2 = 2.25*360^0.88; o = l*E2; fai2 = -o/120^0.88+2.25; PD = importdata('排污矩阵.txt'); load car L = length(car); %% 限定排污量,求最底不满意度 ans13 = zeros(10,2); options = optimoptions('ga','PopulationSize',600,'MaxGenerations',100); N = 10; pn = 0; while true [x,y,~,~,p...
function [ Vq, N ] = direct_smoothing( obj, X, Y, V, bandwidth, kernel_function ) if ~exist('kernel_function','var'); kernel_function = 'gaussian'; end [ Vq, N ] = gaussian_smoothing( X, Y, obj.grid_width, kernel_function, ... bandwidth, V, obj.xc, obj.yc ); Vq = Vq';
%% % % perlOneLineDescription(Returns quadratic relative permeability) % %% function [krL, krG,krW] = quadraticRelPerm(sw) krL = sw.*sw; krW = krL; krG = (1 - sw).^2; end
% CutFrames.m % % SCRIPT for imlook4d % Jan Axelsson % INITIALIZE % imlook4d_current_handles is updated whenever SCRIPTS menu in imlook4d is % selected disp('SCRIPTS/CutFrames.m entered'); % Export to workspace imlook4d('exportToWorkspace_Callback', imlook4d_current_handle,{},i...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Step 1.5: 簇矩阵生成函数 clsGet(clsVector,clsNum,imgData) %输入:簇的编号clsNum、聚类向量clsVector、图片数据库imgData %输出:簇矩阵,每一行表示这一簇中的一张图片的信息,行数代表该簇的图片数量 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function cls = clsGet(clsVector,clsNum,imgData) indexVec = find(clsVector==clsNum); N = length(indexVec); cls ...
function [numout] = GenFileNumber(numin) %Returns 00xyz string z=numel(num2str(numin)); switch(z) case 3 numout = strcat("00",num2str(numin)); case 2 numout = strcat("000",num2str(numin)); case 1 numout = strcat("0000",num2str(numin)); otherwise ...
% POSTER_Plot_CoOccur % this takes in the output from the SfN rushcode script % POSTER_CollectCorrSequences % generates a multiplot of all sequences data. Choose whether you want % matched or non matche dfield data plotted (data must exist already). % % aacarey Oct 2015 clear % WHAT DO YOU WANT THIS SCRIPT TO DO?...
function y = pi_theorique(signal, sigma) alpha = 0.01:0.01:0.99; sigma = sqrt(signal'*(sigma^-1)*signal); Ba = normcdf(-norminv(alpha./2)+sigma)-normcdf(norminv(alpha./2)+sigma); y = 1-Ba; end
function [data,b]=filterout_nans_and_infs(data,b) dataT=data'; nan_rows=any(isnan(dataT)); data=data(~nan_rows,:); b=b(~nan_rows); dataT=data'; inf_rows=any(abs(dataT)==Inf); data=data(~inf_rows,:); b=b(~inf_rows); end
function [LF,in] = limit_faces(F,L,exclusive) % LIMIT_FACES limit given faces F to those which contain (only) indices found % in L. % % [LF] = limit_faces(F,L,exclusive); % [LF,in] = limit_faces(F,L,exclusive); % % Inputs: % F #F by 3 list of face indices % L #L by 1 list of allowed indices % ...
function Vnew = embeddingRd_vecs(p,V) %EMBEDDINGR6_VECS embeds V in TpM onto R6. % % p is a base point. V is tangent vectors. % V is d-by-d-n. n is the number of matrices. XwrI = grpaction_p2i(mu_x, Xwr); Vnew = symmx2vec(XwrI)'; end
function [LL, LH, HL, HH] = haar_dwt2D(img) [m, n] = size(img); for i = 1:m [L, H] = haar_dwt(img(i,:)); img(i,:) = [L, H]; end for j = 1:n [L, H] = haar_dwt(img(:,j)); img(:,j) = [L, H]; end LL = mat2gray(img(1:m/2,1:n/2)); LH = mat2gray(img(1:m/2,n/2+1:n)); HL = mat2gray(img(m/2+1:n,1:n/2)); HH = mat2...
function coco_category = GetCocoCategories() keyset = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20,21, 22, 23, 24, 25, 27,28,... 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, ... 60, 61, 62, 63, 64, 65, 67, 70, 72, 73, 74, ...
%% Path Clean Up %open script adds these Simulink.fileGenControl('reset'); if exist('projectPath','var') rmpath(strcat(projectPath,'\Scripts')); rmpath(strcat(projectPath,'\Data')); rmpath(strcat(projectPath,'\Models')); else fprintf('Project path does not exist.\n'); end if exist('libraryPath','var')...
function [B] = rotacionZ(A, theta) rotZ = [cosd(theta) -sind(theta) 0 0;... sind(theta) cosd(theta) 0 0;... 0 0 1 0;... 0 0 0 1]; B = A*rotZ; end
function udpHandle = udpOpen(udpIP,udpPort,connTimeout) %#ok<INUSD,STOUT> % % Opens persistent UDP socket. % % Inputs: % IP Address string in the format XX.XX.XX.XX % UDP Port integer port number to connect to % Timout [optional] timeout delay in ms. Default value is 500 ms. % % Outputs...
%%% SET PACKED BED INPUT VARIABLES %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nhot = 1; % Set up the classes for ii = 1 : Nhot pbH(ii) = packbed_class('hot') ; end %for ii = 1 : Ncld % pbC(ii) = packbed_class('cold') ; %end % *** HOT PACKED BEDS *** % for ii = 1 : Nhot ...
function w_degree = weighted_degree(A) w_degree = zeros(size(A,1),1); for i = 1:size(A,1) w_degree(i) = sum(A(i,:)); end
close all clc %% Load Data tic fprintf('Importing Data \n'); if exist('ACWI','var') == 0 % load('201812 - NewEsgMsciDb.mat'); save ACWI save Index save FF else clearvars -except ACWI Index FF end NbFact = 3; % Select 3 (3FFF), 4 (3FFF+Mom) or 5 (5FFF) if NbFact==3 NbFact=...
function Q=GivensRotation(i, j, theta) % Returns a rotation matrix along the axis that is not present(i>j). k=3-mod(i+j, 3); cosine=cos(theta); sine=sign(i-j)*sin(theta); Q=zeros(3,3); Q(i,i)=cosine; Q(j,j)=cosine; Q(i,j)=sine; Q(j,i)=-sine; Q(k,k)=1; end
classdef ContenciosoSimulator < handle % ContenciosoSimulator: Armazena os modelos das arvores, os cluster, % a carteira e input de configuração. % Carrega todos os objetos citados acima. % Inicia a simulação, gerando o .mat correspondente properties carteiraInicial inpu...
%% Used for simulation data % V7 is meant for simulating spectra with typical uncertainties, and a % phase and amplitude decay based on a frequency scan %V7_1 fixes the time spacing issue % close all % clear all % clc uncertainty_upload %Current directory T_Amp = 20; % uncertainty_upload_laptop %% Checking whi...
function esc_analysis_rev7_parfor_rand_app(app,step_size,filename1,filename2,filename3,parallel_flag,write_report,tf_custom_ant,tf_load,industry_label,TerHandler,TerDirectory,workers) top_start_clock=clock; % % % 210 dB path loss threshold shall be used % % % Radar EIRP (121 dBm/MHz) � ESC detection threshold (-89...
function s = argPairs2Struct(s,pairs) % Copyright 2012 The MathWorks, Inc. numPairs = numel(pairs)/2; if rem(numPairs,1) ~= 0 error('nnet:OddNumberOfNameValues','Odd number of name/value pair arguments.'); end names = pairs(1:2:numel(pairs)); values = pairs(2:2:numel(pairs)); fields = fieldnames(s); fields_lower ...
function [posDis] = bmOverlapPosDist(mMembership1, mAdj1, mMembership2, mAdj2, sPosDist, varargin) % % Computes the positional distances between clustering/bm 1 and % 2. % % sPosDist - Position distance to use. % % mMembership1 % mMembership2 % parse arguments inParser = inputParser; % add parameters and...
function [z] = metminquadpond3(X, Y, vfb1,w) %METMINQUAD3 calcula a função que melhor se ajusta a um dado conjunto de %pontos. Recebe um vetor horizontal com x, um vetor horizontal com y, um %cell array das funções de base em string e um lista de pesos w f=vfb1;%cell array com strings das funções numf = length(f); %nú...
x0 = 0; %tspan=[0,20]; tspan = [0:0.5:50]; %V = zeros(size(tspan)); %V(15:20) = [0.1:0.1:0.6]; %V(21:25) = [0.5:-0.1:0.1]; %V(45:50) = [0.1:0.1:0.6]; %V(51:55) = [0.5:-0.1:0.1]; %V = sin(tspan); rand('seed',100); V = rand(size(tspan)); [t,x]=ode45(@RLcircuit,tspan,x0); figure(1); plot(tspan,V,'.',tspan,x,'o') title...
function [] = cellTrack_ParseStacks_v3(paramsFilePath) %%%%%%%% % This code sorts raw image files from live imaging in a folder structure % and needs to be run only ***ONCE*** as a preperation for analysis %%%%%%%% % Copyright MIT 2016 % Developed by Simon Gordonov % Laboratory for Computational Biology & Biophysics %...
function setOrigin(obj,newOrigin) obj.origin = newOrigin; end
% process sweep laser piezo scan filter % WTJ %% % load('./filterScans/sweep_piezo_scan_filter_res_20190801T235444.mat') load('./filterScans/sweep_piezo_scan_filter_res_20190802T113651.mat') %% figure; hold all; shft = 0.2; vs_peaks = []; h_peaks = []; for ii = 1:length(res_all) plot(vs_filter, ...
load GOOG.mat; interpolation = interp(GOOG,24); up = upsample(GOOG,24); down = downsample(GOOG,7); reconstruction = interp(down,7); figure('Name', 'Interpolation'); plot(interpolation); figure('Name', 'Upsample'); plot(up); figure('Name', 'Downsample'); plot(down); figure('Name', 'Reconstruction vs GOOG');...
function [output] = mf_green(data) output = {'',0;'',0}; if data<25 output(1,1) = {'rendah'}; output(1,2) = {1}; output(2,1) = {'rendah'}; output(2,2) = {1}; elseif data>=25 & data<61 output(1,1) = {'rendah'}; output(1,2) = {(61-data)/(61-25)}; output(...
clear all clc image = double( imread( 'data/images/lena_small.tif' ) ); [ height, width, dimension ] = size( image ); M = 8; epsilon = 0.1; D_previous = 1; D_next = 11; index = zeros( size( image ) ); error = zeros( size( image ) ); %index_lena_small = zeros( length(image(:))/4, 1 ); index_lena_small = zeros( size( ...
% Options and parameters for the current CNN opts.imdbPath = fullfile('F:\Bharti\Thesis\data\imdbVOC2012_segmentation_offsets_ssc256.mat'); opts.getBatchFunction = @CNN.getOffsetBatchMultiClass1; %lr = logspace(-1, -4, 30) ; lr1= ones(1,5)*0.001 ; lr2= ones(1,25)*0.0001 ; lr = [lr1,lr2,0.0001] ; % Training options %...
clc clear all % mex CgetPolygonCoords.cpp % mex CgetPolygonCoords_polar.cpp % mex CdownSampling.cpp % mex CreadCor.cpp %% parameter setting db=10000000; %set unit to anstrom lambda=13.5e-6; delta=0.008; f=3; NA=0.0875; R=f*tan(asin(NA)); Nx=1000; Ny=1000; % dire=1; AccuCtrl=0.005; [polyPre,polyForm,polyPost]=poly...
rng(1234) % was rng(1234) % ground-truth parameters om_true = 0.3; ok_true = 0; w0_true = -1; wa_true = 0; h0_true = 0.7; logom_true = log(om_true); % -0.52 logh0_true = log(h0_true); % -0.357 bigtheta_true = [logom_true, ok_true, w0_true, wa_true, logh0_true]; % ground-truth parameters parba...
% function to rotate green tensor from NEZ to RTZ function G2 = rot_nez2rtz(G,az) % NEZ => z downward direct system % RTZ => Z downward direct system phi = az*pi/180; a = size(G); R = [cos(phi) sin(phi) 0 ; ... -sin(phi) cos(phi) 0 ;... 0 0 1 ] ; if a(1)>1 && a(2)>1 if min(a) == 3 && max(a) > 3 ...