text
stringlengths
8
6.12M
function [CFvals,CFvecs,x,dx,nx] = setup_getBasis(basis_loc) load(basis_loc,'CFvals','CFvecs','x','dx','nx'); end
classdef WhiteLight_Axiovert200 < Modules.Source %LASER532 Summary of this class goes here % Detailed explanation goes here properties intensity = 100; % Intenisty 0-100 (0-5 V) prefs = {'intensity'}; end properties(SetObservable,SetAccess=private) source...
% function [ afValues, afTimes ] = GetRoomTemperatureForecastsFromALookUpTable( tSignal ) % taking the room temperature forecasts of a certain room from a desired % lookup table % function [ afValues, afTimes ] = GetRoomTemperatureForecastsFromALookUpTable( tSignal ) % % try % % % tDevicesIDs = Signal.Get...
L_values_neg=-(0:0.001:4); L_values=(0:0.001:1); plot(L_values_neg,real((sqrt(1+i*L_values_neg.^2)+sqrt(i)*L_values_neg).^4));hold on plot(L_values,real((sqrt(1+i*L_values.^2)+sqrt(i)*L_values).^4));hold on
function d2fdxdpval = SEIR_var_d2fdxdp(t,y,p,more) beta = more.more.beta_fun(t,p,more); t = t(:); beta = beta(:); dbetadp = more.more.beta_dfdp(t,p,more); n = size(y,2); r = zeros(length(t),n,n,n,length(p)); tmpdiag1 = diag(p(2)+y(:,3)); tmpdiag2 = diag(y(:,1)); r(:,1,1,1,more.more.beta_ind) = tmpdiag1 * dbetadp; ...
% input: f -> an 9-joint robot encoded as a SerialLink class % position -> 3x1 vector denoting the target position to move to % output: q -> 1x9 vector of joint angles that cause the end % effector position to reach <position> % (orientation is to be ignored) function q = Q1(f, positio...
function [ state ] = WaypointController_roundCorner( state, W, P ) wCurr = 2; W_2 = [[state(1); state(2)], W(:,1),W(:,2), W(:,3), W(:,4), [W(1,4)+ 10; W(2,4)]] R = 100; [WrowLength WColLength] = size(W_2); while(wCurr < WColLength) Wimin1 = W_2(:,wCurr-1) Wi = W_2(:,wCurr) Wiplus...
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - clc;clear;close all;format shortg addpath([pwd,'/utility/']) load('twistedxor2data.mat') whos % Name Size Bytes Class Attributes % ...
% Primer Ejemplo clc; % Limpiar la información de la ventana de comandos clear; % Limpiar las variables de la memoria close all; % Cerrar todas las figuras expuesta pkg load image A = imread('files/camarografo.jpg'); % Las imagenes se trabajan en dos formatos: % 1: 8 bits {0,1,.....,255} * El ...
%fit all aboussaids HF constants %addpath('C:\Users\Felix\Desktop\MSc Astrophysics Lund\Thesis\Matlab\10102016 matlab program full', 'C:\Users\Felix\Desktop\MSc Astrophysics Lund\Thesis\Matlab\thesis progrm 08 11 2016', 'C:\Users\Felix\Desktop\MSc Astrophysics Lund\Thesis\Matlab\thesis progrm 08 11 2016\R and stdev ...
%3 histograma('kid.bmp'); calculaEntropia('kid.bmp'); pause(); histograma('homer.bmp'); calculaEntropia('homer.bmp'); pause(); histograma('homerBin.bmp'); calculaEntropia('homerBin.bmp'); pause(); histograma('guitarSolo.wav'); calculaEntropia('guitarSolo.wav'); pause(); histograma('english.txt'); calculaEntropia...
phi_rank m_adjust_profile=zeros(Nradial,1); m_guess=q_initial_profile(pTAE_inf-1)*nTAE; % if (DOM_M<2) % m_adjust_profile1(pTAE_inf-1)=nTAE-mtheta1; % m_adjust_profile2(pTAE_inf-1)=nTAE-mtheta2-DOM_M; % else % m_adjust_profile1(pTAE_inf-1)=nTAE-mtheta1+1; % m_adjust_profile2(pTAE_inf-1)=nTAE-mtheta2; %...
function sample_registration(input_folder_path, number_of_frames, output_folder_path, output_file_name, ref_image) %% This function provides a sample to use QCHR(Lam et. al. 2013) to register a reference frame against all other frames and calculate the Beltrami Descriptor. Note that this function does not automatical...
fid = fopen('tmp'); path = fgetl(fid); src = double(dicomread(path)); src = src/max(max(src)); src = imresize(src,[504 504]); imwrite(src,'input.jpg');
clear all; % close all; addpath('.\jpegtbx_1.4'); %% Read an image from above Folder %% % %% Double Compressed Image (JPEG) %% % srcDCJpg = dir('.\DCMISALLIGN\*.jpg'); % img_num = 5; % img_name = strcat('.\DCMISALLIGN\',srcDCJpg(img_num).name) % img_Ycbcr = rgb2ycbcr(imread(img_name)); % img_Y = img_Ycbcr...
clc; clear; close all; % cd /project/compbioScratch/Zhuliu/LUNG_mESC_data load mESC_data.mat; %% prepare data, convert label to matrix % working on sub labels in serum serum_data = log10(data(:, 455:end)+1); serum_data_copy = data(:, 455:end); serum_label = SID_class_label(455:end,:); [m, n] = size(serum_da...
classdef cCompositeArea_YSymm < cCompositeArea %This class takes only the upper or lower half of composite area properties (Access = private) ind_vec end methods(Static) function d=Qy(~) d=0; end function f=z_bar(~) f=0;...
function v = rtd(X) % Dc RTD output % R1 R2 R3 R4 R5 R6 R7 R8 R9 RT E1 % 1 2 3 4 5 6 7 8 9 10 11 % Y=4; % N = 0, U = 4, and M = 1 not required for dc. % % The following adds to execution time, but is given for clarity. % R1=X(1);R2=X(2);R3=X(3);R4=X(4);R5=X(5);R6=X(6);R7=X(7); R8=X(8);R9=X(9);RT=X(10...
function OutputVector = BreakPointCheck1(X,eDims,tsteps) %NN1 breakpoints = zeros(length(tsteps),1); for tsteps_step = 1:1:length(tsteps), timestep_of_interest = tsteps(tsteps_step); for Estep = 1:1:length(eDims), [distance,timesteps,weights] = NNcheck(X,eDims(Estep),1); if( Estep == 1 ), ...
function test_unprincipal epsilon=1e-5; alpha=[0 pi/8 pi/4 3*pi/8 pi/2 5*pi/8 3*pi/4 7*pi/8 pi -pi/8 -pi/4 ... -3*pi/8 -pi/2 -5*pi/8 -3*pi/4 -7*pi/8 -pi]; a=0.14645; b=0.85355; c=0.35355; % Test for S1=1, S2=0 S1=1; S2=0; for ii=1:length(alpha) [s11(ii), s22(ii), s12(ii)] = unprincipal(S1, S2, alpha(ii))...
% function [evec] = solveSystem(W,D) % finds the second to smallest eigenvector, function [evec,allevecs] = solveSystem(W,D) Dinv = sqrt(inv(D)); % diagonal - so just dinv_ii = 1/d_ii .. this is a quick way to do that.. M = Dinv * (D - W) * Dinv; % system to decompose, minimizes the Rayleigh quotient. image(M*256...
function [out] = Print_Escala() %% Print_Escala % Imprime la escala en pantalla y guarda la frecuencia de las notas en una % matriz de 12x9 (notas x Nš_de_octava) %% Constantes P = nthroot(2,12); % Relacion entre notas P0 = 13.75 * P^(-9); % Primer nota que detecta (DO_-1 = LA_-1 - 9) notas = char('D...
%% Choix fonction boolf=0; %%%%%%% CHOIX CONTRAINTE %%%%%%%%%%%%%% while (boolf==0) prompt='Contrainte h1 ou h2 ? (h1 pour f1, h2 pour f2) : '; fonc=input(prompt,'s'); switch fonc case 'h1' [h, grad_h, hess_h]=contrainte(1); boolf=1; c...
clc, clear all, close all; points_num = 10000; points_3d = [100 0 0; 0 100 0; 0 0 100]*rand(3,points_num) + [-50;-50;50]; center = [0;0;100]; K = [568.996140852000,0,643.210559410000; 0,568.988362396000,477.982801038000; 0,0,1]; %% 初始化(虚拟了SIFT) % 随机生成相机姿态 视线方向对象点云中心 R1 = eye(3); t1 = zeros(3,1); [R2,t2] = gene...
function [ Cf, St ] = developed_flow( Re, Pr, shape ) %Compute friction factor and Stanton number from Reynolds and Prandtl %numbers if strcmp(shape,'circular') % Set coefficients for circular pipe aL = 16.0; bL = 4.36; else error('not implemented') end % Set laminar to turbulent transition points R...
function [ minArr ,maxArr, NoOnes] = mini_max_dist( skelImg ) %MINI_MAX_DIST returns average of min Max algo. % Detailed explanation goes here NoOnes=zeros([1 20]); maxArr=zeros([1 20]); minArr=zeros([1 20]); for index=1:20 ones1=find(skelImg(10*index,:)==1); sizeOnes=size(ones1,2); if(sizeOnes >1) ...
function z=MA_default_states(Y) NA = 6.0221415e23; % Avogadro (molecules in a mol) V = 1e-14; % Cell volume NAV = NA*V/1e9; % For concentration in nM z.z0 = zeros(30,1); z.z0(1) = max(Y(1,:))/NAV; z.z0(2) = max(Y(2,:))/NAV; z.z0(3) = max(Y(3,:))/NAV; z.z0(4) = max(Y(4,:))/NAV; z.name{1}='P1'; z.name{2}='P2'; z.na...
function [clustIm,LrwList,eVals,avClusts] = spectAvs(avList,k,sigma,NN,fullIm) wM = NNSort(avList,sigma,NN); Lrw = speye(length(avList)) - sparse(1:length(avList),1:length(avList),1./sum(wM))*wM; %Moved up to 10, used to be 3 [LrwList, eVals] = eigs(Lrw, 10, 'sr'); %Normalizing the eVects to avoid outliers for i = ...
% From angles to prototype clc clf close all clearvars %% Prototype filter parameter definition M = 16; % M channels for the FB, and 2M polyphase components for the prototype filter m = 1; % m taps for each polyphase component N = 2*m*M-1; % The order of the prototype filter %% Optimization definition the...
% np003A.m % Physics of Neurones % [1D] Dynamical Models: EXAMPLES % CELL 1: Phase Portrait Plot % Define function in CELL 1 % CELL 2: Time Evolution of State Variable: Solve equation of motion % Define function in CELL 4 at end of Script % CELL 3: Bifurcation Diagram % CELL 4: Define fu...
load('params.mat'); Lambda_k_M = A_k_M'*A_k_M; f_h_dir = F_h' / ( F_h*( eye(N) - A_k_M/Lambda_k_M*A_k_M' )*F_h' ) *F_h*A_k_M/Lambda_k_M*alpha; f_h_dir= f_h_dir / norm(f_h_dir); mu_alphat_delta_k_dir = alpha' / Lambda_k_M * A_k_M' * f_h_dir; lambda_k_dir = f_h_dir' * ( eye( N ) - A_k_M / Lambda_k_M * A_k_M' ) * f_h_di...
function PWP(met_input_file, profile_input_file, pwp_output_file) % function PWP(met_input_file, profile_input_file, pwp_output_file) % MATLAB version 1.4 (8 Oct 2001) % This main program is used to drive the pwp subroutine (pwpgo) % with a daily cycle of heating, or, an arbitrary (observed) time % series of su...
function tap_delay = tapped_delay_fcn(input) % The Tapped Delay function delays its input by the specified number % of sample periods, and outputs all the delayed versions in a vector % form. The output includes current input % NOTE: To instruct Embedded MATLAB to compile an external function, % add the following co...
function answer=question_dialog_fig(main_figure,tt_str,str_quest,varargin) p = inputParser; addRequired(p,'main_figure',@(h) isempty(h)|isa(h,'matlab.ui.Figure')); addRequired(p,'tt_str',@ischar); addRequired(p,'str_quest',@ischar); addParameter(p,'default_answer',1,@isnumeric); addParameter(p,'opt',{'Yes' 'No'},@isc...
function [fixRes, SD_Res2, SD_Res3] = plotStimTestResults(ra, varargin) % RelAbs.plotStimTestResults % % Description: plot results of ra.testStimFeat % % Syntax: [resSD, resFix] = ra.plotStimTestResults() % % In: % <optional> % testRes - <[]> a structure of results from ra.testStimFeat % groupPlots - <tr...
close all clear load bc_source global ubc num = 2000; % Number of samples for i = 1:num ubc = f_bc(i, :); model = createpde('structural','static-planestrain'); radius = 0.25; R1 = [3, 4,0,1,1,0,0,0,1,1]'; C1 = [1,0.5,0.5,0.25]'; C1 = [C1;zeros(length(R1) - length(C1),1)]; gm...
function y = wrapPhase(phalims, x) % y = WRAPPHASE(phalims, x) % % inputs % - phalims: 1x2 array, with min/max phase limits. % - x: phase (in the same units as phalims). % % outputs % - y: x wrapped (bounded) between phalims. % % Wraps phase values (x) between the limits given by phalims. % Matlab...
function [predictions, theClassifierEngine, responses] = computePerformanceRecon(nullScene, testScene, ... temporalSupport, nTrain, nTest, theNeuralEngine, theClassifierEngine, trainNoiseFlag, testNoiseFlag, oneSided) % Compute performance of a classifier given a null and test scene, a neural engine, and a classifi...
function [udot_0, udotdot_0] = ThirdOrder(u_4,u_3,u_2,u_1,u_0,dt) udot_0 = 1/6*(11*u_0-18*u_1+9*u_2-2*u_3)/dt; udotdot_0 = 1/12*(35*u_0-104*u_1+114*u_2-56*u_3+11*u_4)/dt/dt;
function [bool]=verificacionGYPANHDOL(x,y) [x1 y1 x2 y2 x3 y3]=cteGYPANHDOL; bool=triangulo(x1,y1,x2,y2,x3,y3,x,y); end
% create Guassian Kernel Matrices where \tau in [-10,10] function flag=gaussian_kernel(data_name, label_vector, instance_matrix) tau = -10:1:10; sample_n = size(instance_matrix,1); for t=1:length(tau) norms = sum(instance_matrix'.^2); K = exp((-norms'*ones(1,sample_n) - ones(sample_n,1)*norm...
function drawLines() img_name = '00840'; img = imread([img_name '.jpg']); for i = 1 : 4 lane_img = imread([img_name '_' num2str(i) '_avg.png']); %imshow(lane_img); lane_img = imresize(lane_img, 1638/800); [x, y] = find(lane_img > 100); for j = 1 : size(x) ...
function res = isIntersectInterval(I,target_I) % check an interval matrix inside interval matrix % % Syntax: % res = isIntersectInterval(I,targetSet) % % Inputs: % I - interval matrix % target_I - interval matrix % % Outputs: % res - indicate the interval is inside/outside/intersect % res = 0: I outside...
function autobeadfind(image, smp) if nargin==0 image=normalize(imread('00008153.jpg')); %smp = imread('00008153-s.jpg'); smp = imread('00008153-nc.jpg'); % badly centered smp=normalize(smp(:,:,1)); end image = image-mean(image(:)); image = makepowerof2(image); s = si...
function GE = selectNGenes(N, Gene_Expression, ~) if ~exist('Gene_Expression','var') fprintf('Loading the database.\n'); load('GE.mat'); end assert(N <=size(Gene_Expression,2)); [~,select] = sort(std(Gene_Expression),'descend'); select = sort(select(1:N)); GE = Gene_Expression(:,select); end
function list_sounds sounds = { 'heat' 'hot' 'hut' 'hoot' 'dog' 'mice' 'fame' 'heat' 'hot' 'hut' 'hoot' 'dog' 'mice' 'fame' 'heat' 'hot' 'hut' 'hoot'}; for i = 1:numel(sounds) fprintf('%d %s\n', i ,sounds{i}); end end
function [G_J, c_J] = Jacobi_factorization(A, b) N = diag (diag (A)); P = N - A; inv_N = inv (N); # contruiesc matricea si vectorul de iteratie G_J = inv_N * P; c_J = inv_N * b; endfunction
function [returnPowerB, returnPowerR] = laserOff(args) returnPowerB = zeros(1,8); returnPowerR = zeros(1,8);
function rgbSpace = split(target) R = target(:,:,1); G = target(:,:,2); B = target(:,:,3); [row,col,~] = size(target); Rr = reshape(R,1,row*col); Br = reshape(B,1,row*col); Gr = reshape(G,1,row*col); rgbSpace = [Rr;Br;Gr]; return
clc;clear;close all; root_dir = '../../results-plots/19-03-19/hyperparameters/'; num_files = size(dir(root_dir),1); pause_time = 0.1; for index = 16 filename = strcat(root_dir, int2str(index), '.mat'); load(filename); % if not(and((hp.destination(1,1) > 0), (hp.destination(2,1) < 0))) % continue % ...
x = [4 6 8 10 12]; y = [ 0.004852 0.002900 0.003274 0.003093 0.005837 ]; plot(x,y); title('Fungsi 2 tn'); xlabel('-log(tol)'); legend('Waktu(s)');
function [f0, timeInSec] = myPitchTrackMod1(x, blockSize, hopSize, fs) %% Blockwise Pitch Tracking based on a modified approach % Input: % x: (N x 1) float vector, input signal % blockSize: int, block size of the blockwise process % hopSize: int, hop size of the blockwise process % fs: flo...
%这段代码的作用是将原始的CSV数据文件的最后一行拿出来 %从中随机取出来十分之一的数据存成了CSV文件 filename = 'density.csv'; data = csvread(filename, 0, 3); data = data'; index = randperm(length(data), 5528); %length(data) = 55280 final_data = data(index); csvwrite('density_out.csv', final_data);
function [ R ] = matdownsample( R, val ) R_n = downsample(R',val); R = downsample(R_n',val); end
function [xdfb,tau] = IDfb( model, xfb, q, qd, qdd, f_ext ) % IDfb Floating-Base Inverse Dynamics (=Hybrid Dynamics) % [xdfb,tau]=IDfb(model,xfb,q,qd,qdd,f_ext) calculates the inverse dynamics % of a floating-base kinematic tree via the algorithm in Table 9.6 of RBDA % (which is really a special case of hybrid dynam...
## Copyright (C) 2016 thiago.basso ## ## Author: thiago <thiago.basso@gmail.com> ## Created: 2016-09-25 function [vetor] = InsertionSort (vetor) for j=2:length(vetor) chave = vetor(j); %inserir vetor(j) na sequencia ordenada vetor(1..j-1) i = j-1; while i>0 && vetor(i)>chave vetor(i+1) = vetor...
function result=Discretization(result) %% ÀëÉ¢»¯tÓëE global min_delta_t nu W; h=6.62607*10^-34; E_photon=h*nu; for x= W(1):W(2) for y = W(3):W(4) result{x,y}(:,1)=min_delta_t*ceil(result{x,y}(:,1)/min_delta_t); result{x,y}(:,2)=floor(result{x,y}(:,2)/E_photon); T=unique(result{x,...
function [TP,TN,FP,FN,oob] = classifier(Train, Test, nTrees_vec,nPCA) % Input: training data (train.X,train.y) % test data (test.X, test.y) % nTrees_vec (number of trees) % Output: rate_TP,rate_TN n_iter = length(nTrees_vec) rate_TP = zeros(n_iter,1); rate_FN = zeros(n_iter,1); rate_TN = zeros(n_iter,1...
%% 基于C-SVM算法的螺纹钢主力合约交易模型(R) 作者:张宇霖 % Modified by 李洋faruto 2014.06.01 % 支持向量机( Support Vector Machines, SVM)是近几年来应用于建模的一种新的学习方法 % 与传统经网络相比,支持向量机算法最终将转化为一个二次型寻优问题,从理论上讲得到的将是全局最优点, % 解决了在神经网络中无法避免的局部极小值问题。 % % 本篇报告旨在运用SVM模型系统对以螺纹钢期货主力合约进行动态的回测检验,目的是为了检测 % SVM算法在商品期货中进行价格推演和预测的可行性。 % % 本报告所涉及的SVM算法来自于台湾大学林智仁先生的libs...