text
stringlengths
8
6.12M
classdef InstrumentIO < matlab.mixin.Copyable & dynamicprops methods function obj = InstrumentIO() end function ax = plot(obj) figure(); ax = axes('NextPlot', 'add'); names = properties(obj); for i=1:length(names) ...
function NE = lalo2llf(trk,pt) % NE = lalo2llf(trk) % or % NE = lalo2llf(trk,pt) % % Convert latitude-longitude track points into a % local level frame. % % Inputs: % trk = [latitude,longitude] is a matrix of track points. % pt = [latitude,longitude] is the centre point of the % ...
% when performing label transfer, we only look at objects that are in a certain size range, and at most 2 feet off the ground % this script returns an array containing the valid components % we only perform label transfer on the components returned by this script necessaryIdx=0; necessaryIndices=zeros(0); for i=1:leng...
function PlotScenarios( ... tGenerator, ... fJulianDate, ... aafSolarRadiationScenarios, ... aafSkyCoverScenarios, ... afMaximalRadiation ) % % manage the cases where the PlotScenarios() is called without % additional parameters switch( nargin ) % case 1 fJulianDate = Time....
% a list of bulb hotspots to be analyzed disk = 'f'; hotspotmapList=[]; %1 hotspotmapList{1}.dirPath = [disk ':\Data\2011\Jan\Jan 27 OMP bulb\']; hotspotmapList{1}.neuron = 1; hotspotmapList{1}.cluster = 1; hotspotmapList{1}.th = 0; hotspotmapList{1}.spotTh = 30; hotspotmapList{1}.cen = [1 4 ]; %2 hotspotm...
% This is Exercise 2 of the course "Model Predictive Control" in the summer % term taught at the IST. function computeAlpha_solution % In this exercise, a suitable terminal set for a % Quasi-Infinite-Horizon MPC scheme shall be computed. % % Here, we use the 4-step procedure described in the paper[ Quasi-Infinite H...
function aprintf(varargin) global VERBOSE A_FID if VERBOSE; fprintf(A_FID,varargin{1:nargin}); end
function [coherence,centric] = calDistributionCRM(salSup,Isum,x_vals,y_vals,m,n,spnum,number) % salSup:每个超像素与其他超像素的相似性乘以其包含的像素个数 公式13-15的分子的一部分 % Isum:每个超像素与其他所有超像素的(相似值*像素个数)的和 公式13-15的分母 % x_vals,y_vals:超像素的x,y坐标 % spnum:超像素个数 x_valMat = ones(number,1)*x_vals'; y_valMat = ones(number,1)*y_vals'; x0 = (sum(salSup.*x...
function [fig, handles] = plotDenmark() %% Goal %Plots map of Denmark %% Load data inpMap = load('data/DenmarkMapWithInhab.mat'); zoneData = inpMap.data; %% Plot f = figure; f.Name = 'ZOMBIESINDENMARK'; hold on handles = gobjects(1,size(zoneData,2)); for k = 1:size(zoneData,2) handles(k) = plo...
%Whale Group at MTBI %This function corresponds to the ratio between single male and paired females %for the Whale Group (also know as the Whale Watchers :P ) %x = single females %y = single males function maleratiopaired = rmp( y, px ); maleratiopaired = y / px;
function fit_stats = find_linear_fit_stats(data1, data2, options) % Determine optional inputs if (nargin() == 2) [figure_ID, verbose, debug_mode] = process_options([]); elseif (nargin() == 3) [figure_ID, verbose, debug_mode] = process_options(options); else error('Must have 2 or...
function block__plot(blocklist, mcluster, children) % % drawing the blocks given in blocklist % N = mcluster(end,2) - mcluster(end,1) + 1; % Frame fig = figure; rectangle('Position', [0,0,N,N]); axis([0 N 0 N]); hold on % Off-diagonal blocks for i = 1 : size(blo...
function K = apx(hyp,cov,x,opt) % (Approximate) linear algebra operations involving the covariance matrix K. % % A) Exact covariance computations. % There are no parameters in this mode. % Depending on the sign of W, we switch between % - the symmetric Cholesky mode [1], where B = I + sqrt(W)*K*sqrt(W), and %...
function [freq_out, psd_out, fpeak, psdpeak] = ppsd(x,dt,c,doPlot, df) % ppsd plot psd % % [F, psd, F_peak, psd_peak] = ppsd(x,dt,color,[doPlot], df) % % plots psd, optionally returning psd and location of peaks (>3sd from % mean) % color is color letter + optionally, linestyle % doPl...
clearvars; % set param data_requirement = 'nonlinear'; kernel = 'rbf'; sigma = 1; C = 1; % generate dataset [X_train,y_train] = generate_dataset(data_requirement); [X_test,y_test] = generate_dataset(data_requirement); % train SVM model [alpha, b] = svmHardMargin_train(X_train, y_train, kernel, sigma); % [alpha, b] =...
function [f,g] = OF_Cost(vy,opstr) idx = opstr.idx; par = opstr.par; n_real = opstr.n_real; n_int = opstr.n_int; x = vy(1:n_real); y_int = vy(n_real+1:n_real+n_int); y_bin = vy(n_real+n_int+1:end); y = [y_int;y_bin]; k = par.value; for ii=1:1:size(idx,2) k(idx{ii})=x(ii); end D_max = opstr.D_...
%% Affine mapping for p=1 shape functions %% Affine mapping for p=2 shape functions %% Affine mapping for p=3 shape functions
% Tanvir Ferdousi % Kansas State University % Last Modified: Dec 2017 % Copyright (c) 2019, Tanvir Ferdousi. All rights reserved. % Redistribution and use in source and binary forms, with or without % modification, are permitted % Estimates the mosquito abundance factor based on the day of the year function [f] = sea...
confid99_in = 3*ones(length(output),1)*sqrt(Pycl_infty); confid99_out = 3*ones(length(input),1)*sqrt(Pu_infty); subplot(211) plot(output) hold on plot(confid99_in, 'color','r') plot(-confid99_in, 'color','r') legend('Simulated output','Theoretical 99% confidence') hold off subplot(212) plot(input) hold on plot(confid9...
function wander(velocity) % wander - This function wander the robot around an obstacle % ======================================================================== % % wander(velocity) % % Description: % This function uses some obstacle avoidance routines. % % Input: % velocity: The desired translational...
function [ edge_set ] = TIGRE( graph, starting_node) %UNTITLED7 Summary of this function goes here %%%% Graph as incidence matrix and edge_set as output %graph=graph'; number_of_nodes = size(graph,1) ; number_of_edges= size(graph,2) ; Edges_traversed =[]; edge_set=zeros(number...
function [chi]=PCCA_plus(P,n) %n=3; % number of clusters m = size(P,1); % number of states %% Different possibilities to define the initial distribution %sd=rand(1,m); fprintf('\n initial distribution = random'); %sd=ones(1,m); fprintf('\n initial distribution = uniformly'); [sd, onv]=eigs(P',1,'lr'); fprintf...
function [out1,out2] = trainlm(varargin) %TRAINLM Levenberg-Marquardt backpropagation. % % <a href="matlab:doc trainlm">trainlm</a> is a network training function that updates weight and % bias states according to Levenberg-Marquardt optimization. % % <a href="matlab:doc trainlm">trainlm</a> is often the fastest bac...
function [uu] = hgbeam(xx,yy,m,n,omega) c1=[zeros(1,m),1]; c2=[zeros(1,n),1]; uu=sqrt(omega)*HermitePsi(c1,sqrt(omega)*xx).*HermitePsi(c2,sqrt(omega)*yy); end
% Example 10.2 % from Parameter Estimation and Inverse Problems, 3rd edition, 2018 % by R. Aster, B. Borchers, C. Thurber % This script creates the synthetic data set for the EM-38 example % % make sure we have a clean environment clear rand('state',0); randn('state',0); % Number of layers. M=11; % The model conduc...
% Demonstrate basic computation of retinal image and mosaic responses from RGB % % Description: % This tutorial shows how we process a set of RGB images through ISETBIO % to give us a dataset that has the RGB image, the retinal image, and % the mosaic responses. We can then use this dataset in various machine...
% Make this a function! % Select Directory Containing T Files %ds = dirstruct('/Users/Neil/Desktop/2016-02-11'); ds = dirstruct('/Volumes/Data3/Neil/2016-06-10'); % school %ds = dirstruct('/home/neil/Data/2016-04-15'); % home % Get all cells from directory [cells,cellnames]=load2celllist(getexperimentfile(ds),'cel...
function [S,BVSymInt,ia] = SymmetrizeSMatrixArbL(Sin,bvint,symmetry) % SymmetrizeSMatrixArbL symmetrizes S-matrix for identical particles % [S,BVSymInt]=SymmetrizeSMatrixArbL(Sin,bvint,symmetry) Sin is input S % matrix, BVint is input interal basis vectors, and symmetry=1,-1 defines % whether it is symmetric or anti-sy...
function EmbedPointScanner(bh, bw, topBuffer, leftBuffer, loch, locw, binSize, cycleAll, debug) % Point scan inside the active box % % bh: active box height, bw: active box width % topBuffer: num of black rows above the active box % leftBuffer: num of black columns to the left of the active box % binSize: length of th...
function rottwodscript(secondinterface, thetamax, g, string) %eyabs is now intensity zi=0; xi=-10; zf=10; xf=10; zstepfrac=0.1; xstepfrac=0.01; size=ceil(((zf-zi)/(zstepfrac)))+1; sizex=ceil(((xf-xi)/(xstepfrac)))+1; eta='pi'; eps2=-1; mu2=-1; thetai='0'; dsource=1; kxcutoff='30'; %secondinterface=3*dsource; firstinter...
% table % This script executes the commands use to run the examples in Table ex = 'QP_ls'; certtags={'BSOS','SBSOS','SPUT'}; k=1; id = [pwd,'/']; jct = 0; tt = zeros(4,4); ts = zeros(4,4); tg = zeros(4,4); nn = zeros(4,4); ng = zeros(4,4); ict = 0; fprintf('pat \t cl \t n \t nnvar \t fvar \t constr \t remconst \t rnk ...
function yout = solve_nonlin(tspan, STATES, extra) A = extra.A; xN = extra.xN; yN = extra.yN; M_single = extra.M_single; M_basal = extra.M_basal; XATPase = extra.XATPase; id_myo = find(A==0); id_mit = find(A~=0); num_myo = numel(id_myo); num_mit = numel(id_mit); id_myo_to_solve = sparse(num_...
function [root,ea,iter]=secant(func,xrold,xr,es,maxit) if nargin<3,error('at least 3 input arguments required'),end if nargin<4|isempty(es),es=0.0001;end if nargin<5|isempty(maxit),maxit=50;end iter=0; ea=100; while(1) nxr=xr-func(xr)*(xrold-xr)/(func(xrold)-func(xr)); iter=iter+1; if nxr~=0, ea=abs((nxr-xr)...
N= 1843; mu = 0.5; sigma = 0.5./sqrt(N); mx = makedist('Normal','mu',mu,'sigma',sigma); P = 2. * cdf(mx,0.94.*mu)%La probabilidad
clear all close all clc format long syms y t L = 2; M = 1; n = 100; O = 1; N = 4; h = (2/N); x = -1:h:1; x1 = -1:0.01:1; T = sym(zeros(N+2,1)); U = sym(zeros(N+1,1)); f1 = zeros(N+1,1); f2 = f1; T(1) = 1; T(2) = y; U(1) = 1; U(2) = 2*y; for j=1:N-1 T(j+2) = 2*y*T(j+1) - T(j); U...
%% Cut UDF function [Master] = Cut(A,normstep) Ax = []; Ay = []; Az = []; %A = [ A(:,1) A(:,2) A]; for i = 1:length(A)-1 dist = sqrt((abs(A(i,1) - A(i+1,1)))^2 + (abs(A(i,2) - A(i+1,2)))^2 ... + (abs(A(i,3) - A(i+1,3)))^2); num = dist/normstep; Axx = linspace(A(...
function [zl, cl] = Column(Layers, dep, c) % Interpolate variable c onto equidistant depth. % The input dep and c are cells of the same size, while the output % zl and cl are long column vectors. zl = []; for m = 1 : Layers if (isempty(zl) == 1) zl = dep{m}; cl = c{m}; e...
function [P] = initialize(data, maxClusters, sizePopulation, maxKMSIter) %Initialize the population with k-means [numObjects numFeatures] = size(data); individual = struct( 'mean', NaN([maxClusters numFeatures]), ... 'covariance', repmat(squareformSymmetric(NaN(numFeatures))', maxClusters, 1), ... 'mixCoe...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Gaussian Process Demo Script % Demonstrates GP regression using the taco-pig toolbox on 2-D Data. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Add optimization folder % p = pwd(); slash = p(1); ...
% g_max (Angstrom^-1) g = 12; % STEM Pixel Size (Angstrom) dx = 0.35; % Size of STEM scan field (Angstrom) scan_field = 20; % Offset to account for probe size (Angstrom) probe_size = 10; %%%%%%%%%%%%%%%%%% Load multem default parameter %%%%%%%%%%%%%%%%%%% input_multem = ilm_dflt_input_multem(); % Load defau...
%applyStochasticSquaredErrorTwoLayerPerceptronMNIST Train the two-layer %perceptron using the FEI dataset and evaluate its performance. %Training Face database % Load FEI dataset. [inputValues, targetValues] = input_preprocess(); % Transform the labels to correct target values. % Choose form of...
clearvars close all I = imread('SquareCircle.png'); I_Filtered3x3 = imread('I_3x3MedianFiltered.png'); I_Filtered_Median = I; Filtersize = 7; %Change the filtersize to better see the Edge Shift effect [rows,cols] = size(I); ctr = (Filtersize+1)/2; Mean_Filter = ones(Filtersize,Filtersize)/(Filtersize^2); for i = ...
% demonstrate usage of regression % % Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch 2010-07-21. clear all, close all %% SAY WHICH CODE WE WISH TO EXERCISE id = [1,1]; % use Exact % id = [1,2; 3,2; 4,2]; % compare Laplace id = [1,3; 2,3; 3,3]; % compare EP id = [1,4; 2,4; 3,4; 4,4]; % compare VB seed = 19...
function [out, vers] = RTBoxPorts(allPorts) % [availPorts, vers]= RTBoxPorts(); % return available RTBox ports and vers % [allPorts, vers]= RTBoxPorts(1); % all RTBox ports and vers (close if needed) % % [port, st]= RTBoxPorts(busyPorts); % cell input If input is a cellstr, it will be treated as in-use RTBox ports. %...
% Example on Hopkins155 dataset % Data obtained from: http://www.vision.jhu.edu/data/hopkins155/ %% Load Hopkins data %subsample frames to simulate high-rank setting load data/hopkins_1R2RC_truth.mat s = size(x,2); %num data points F = 6; frames = floor(linspace(1,size(x,3)-1,F)); %even spacing between frames n = 2*F;...
classdef TuACore < TuSol % TUACORE is a subclass object of TUSOL to perform several computations for retrieving % and modifying game data. It stores relevant game information needed to draw the % anti-core by overloading functions. % % Usage: clv = TuACore(v,'gtype','gformat') % % Define variables: % output: % clv ...
function[offset_img,rects_struct] = generate_offset(In_cls_aug,seg_obj_aug) % file_name=files_info(file_no).name; rects_struct = struct('x_mins',[],'y_mins',[],'widths',[],'heights',[]); uniq_vals=setdiff(unique(seg_obj_aug),[0,255]); offset_img=zeros(size(In_cls_a...
classdef F18DeoxyGlucoseFigures < mlkinetics.AbstractGlucoseFigures %% F18DEOXYGLUCOSEFIGURES % $Revision$ % was created 09-Apr-2017 04:11:18 by jjlee, % last modified $LastChangedDate$ and placed into repository /Users/jjlee/Local/src/mlcvl/mlraichle/src/+mlraichle. %% It was developed on Matlab 9.2.0.53...
function [MPF,EMG_s,alpha,beta,theta,delta]=MPFEMG(EEG,EMG,hour) samplerate_EEG=125; samplerate_EMG=250; window=16; minute=60; second=60; fo=2; fc=32; window_length_EEG=samplerate_EEG*window; window_length_EMG=samplerate_EMG*window; fft_E=[];fft_M=[]; slide_time=floor(hour*minute*second/window)*2-1; for i=1:slide...
clear;clc; % ------ 预处理,转换灰度图 ------ % p1 = imread('ChinaLakeAirport.jpg'); p2 = imread('FarmhouseNearAlbuquerque.jpg'); gp1 = rgb2gray(p1); gp2 = rgb2gray(p2); gp1 = medfilt2(gp1); gp2 = medfilt2(gp2); % ------ Otsu算法分割 ------ % level1 = graythresh(gp1);% 计算阈值 level2 = graythresh(gp2); go1 = im2bw(gp1, leve...
% performs the least squares regression on test data to determine a % transfer function for commanded PWM -> velocity clc; close all; clear %% Load Data % bring in the matlab data timeseries for a working encoder and the PWM load('ID_rosbags/matFiles/speedID_1.mat'); PWM_ts1 = sig{10}; % motor PWM time series encoder...
function tracker_param = init_tracker(data_path, seq_name, start_frame) %% particle filter parameters pf_param = struct('affsig', [10,10,.004,.00,0.00,0], 'p_sz', 64,... 'p_num', 600, 'mv_thr', 0.1, 'up_thr', 0.35, 'roi_scale', 2); %% check if sequence exists seq_path = [data_path seq_name '/']; if ~isdir(s...
function p = bsigmoid(y); % p = CSIGMOID(y) % Multi-sigmoid function. This is the inverse to CLOGIT. % % Input: y is a real vector with n components. % % Output: p is an n-ary discrete probability distribution of which % the n (positive) components sum to one. e = exp(y); s = sum(e); for i=1:s...
function show_neuroimaging(input_SN, input_CN, input_KN, output_SN, output_CN, output_KN, saim_type, tagged, simu_name) % % show_neuroimaging(input_SN, input_CN, input_KN, output_SN, output_CN, output_KN, saim_type, tagged, simu_name) % plots figure 7 and 8 in Abadi et al. % % model: 1 = EM; 2 = PE % tagged: 0 = ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % Create the Offspring Population % % by using the Mating Pool Population % % ...
% This manuscript generates flow from disparity for Sintel Dataset function GenerateNewDatasetSintel(flow_fmt) switch flow_fmt case '.pfm' write_flow = @write_pfm; case '.flo' write_flow = @write_flo; otherwise warning('Unexpected file format') end % sdk for read disparity addpath...
close all clearvars Img = imread('Noisy_checkboard.PNG'); Img = rgb2gray(im2double(Img)); Filtersize = 3; Sigma = 1; Threshold = 0.0001; H_Threshold = 0.1; L_Threshold = 0.005; [rows,cols] = size(Img); K = 0.05; ctr = 2; Corner = size(Img); % Reduce noise by Gaussian filter Gaussian = fspecial('gaussian',Filtersize...
% Assingment2 % Na Cui % clear all; close all; % read image eyetrackerPic = imread('image2.png'); imshow(eyetrackerPic); % read data file fid = fopen('Copydata.txt'); %% ex=importdata('data.txt') % this function can see the format of file data = fscanf(fid,'%f,%f,%f,%f',[4,inf]); data = data'; fclos...
%% Saved variable load('sparsePrior.mat'); load('inputImage_128.mat'); load('retinaRender_m40.mat'); render = double(render_m40); regParas = [1e-6, 1e-5, 1e-4, 5e-4, 1e-3, 5e-3, 1e-2, 5e-2, 0.1, 1]; outputImage = zeros([length(regParas), size(inputLinear)]); %% Run reconstruction for regIdx = 1:length(regParas) ...
function powerSpectrumPlotSimple(data,sampleRate,tapers,fpass,err) % example: powerSpectrumPlotSimple(data,10000,[2 3],[0.025 100],[2 0.05]) dt = 1/sampleRate; params.Fs = 1/dt; params.tapers = tapers; params.fpass = fpass; params.err = err; %use jack-knife resampling confidence intervals p = 0.05 % [Power, Hz, ...
function data_mat = get_hog_feat_of_list(frm_list, im_size) % Get data matrix of all images in FRM_LIST. % Each image is format as a row vector of IMG_SIZE. % % DATA_MAT format: (n_frames, n_dim) cellSize = 8; hog_feat = get_hog_feat(frm_list{1}, cellSize, im_size); vec_size = size(hog_feat(:),1); n_fr...
clc clear all close all N=100; % numero de vetores de teste aleatorios EW=8; % tamanho do expoente FW=18; % tamanho da mantissa % valores de entrada entre 0 e 1.0 floatxul = fopen('floatxul.txt','w'); floatxir = fopen('floatxir.txt','w'); binxul = fopen('xul.txt','w'); binxir = fopen('xir.txt','w'); ...
function varargout = NIU(varargin) % NIU(NeuroImaging Utilities) MATLAB code for NIU.fig % NIU, by itself, creates a new NIU or raises the existing % singleton*. % % H = NIU returns the handle to a new NIU or the handle to % the existing singleton*. % % NIU('CALLBACK',hObject,eventData,handles,...
function W = compute_edge_energy(M,s,epsi, center_point) % compute_edge_energy - compute an energy for fast marching. % % W = compute_edge_energy(M,s,epsi); % % W is the speed function for the front propagation % (should be high in the area of strong gradient). % The formula is : % % 1/W(x) = 1/(1 ...
function [onoff] = get_onoff(subj_id, run, conn, do_cache) % helper function to get screen on/off regressors in vgdl_create_multi % copied & modified from get_visuals % note run is a struct % if ~exist('do_cache', 'var') do_cache = false; end % optionally cache filename = full...
% InitVolume - this will initialize the viewer with data necessary for loading volume textures. % Viewer.InitVolume(ImageDims,PhysicalUnits) % Image -- This should be a vector up to five elements indicating the volume size in the order (y,x,z,channel,time). % PhysicalUnits -- A 3-element vector representing ...
clear all ; close all ; subs = {'lowcont_carmen','lowcont_lyndis','lowcont_mael','lowcont_lorne','lowcont_lyes','lowcont_greg','lowcont_angelina','lowcont_cesar','lowcont_charles','lowcont_alex','lowcont_janie','lowcont_russell','lowcont_anne'} ; comps = {[3,4,12,19],[7],[15,21],[4,5,8],[4,11],[5,6],[8,12],[38,11],...
function []=writeCSV() roisNames= getROInames(); wd=pwd; visPath=fullfile(wd,'CSV','roiNames-visRW.csv'); autoPath=fullfile(wd,'CSV','roiNames-autoRW.csv'); delete autoPath; delete visPath; viscsv = fopen(visPath,'w'); autocsv = fopen(autoPath,'w'); dicomPath=[wd,'/DICOM']; fprintf(viscsv,"PatientID,ImagingScanName...
function drawq(a,b,c) x = [-100:1:100] y = a * (x.^2) - (b .* x) + c hold("on") plot(x,y) x = linspace(-200, 200, 200) y = x.*0 plot(x,y) x = x.*0 y = linspace(-20000, 20000, 200) plot(x,y) hold("off") endfunction drawq(2,-6,-4)
clear; load('Energy Generation of DDDF (Phi=0.8) calculated in 26-Feb-2014.mat'); n=9; i=1; e_opt_t=con_e_opt(i,:); deltaP1_=deltaP1(i,:); deltaP2_=deltaP2(i,:); for j=1:n e_opt_t2(j,:)=e_opt_t(1+(j-1)*n:n+(j-1)*n); deltaP1_opt(j,:)=deltaP1_(1+(j-1)*n:n+(j-1)*n); deltaP2_opt(j,:)=del...
function [S,E] = hydrogen_modes(R,N1,N2,b,opts) %HYDROGEN_MODES first four modes for hydrogen molecular ion H2+ in 2D % % [S,E] = HYDROGEN_MODES(R,N1,N2) returns separations constants S and % electronic energy E for the first four modes 1sg+, 2pu+, 2sg+, and 2pu- % from Table 1 and Table 2 (page 2201) in Patil, Hy...
function [radar] = Xi_radar(radar) Nr = radar.Rx; Xi_r = zeros(Nr,1); for nr = 1:Nr alpha_nr = radar.alpha_r(nr); W_rnr = radar.WMMSE_weights{nr,1}; E_rnr = radar.MMSE_nop{nr,1}; Xi_r_nr = alpha_nr*real(trace(W_rnr*E_rnr)); Xi_r(nr) = Xi_r_nr; end radar.Xi_r = Xi_r; end
function [in1, in2, out1, out2, m, F] = ransac8pF(xy1, xy2, threshold) number = size(xy1,2); % Total number of points bestInNum = 0; % Best fitting F with largest number of inliers F = eye(3); % parameters for best fitting line xy1 = [xy1; ones(1, number)]; xy2 = [x...
function [ ] = visualizeConfusionMatrix( mat,labels) %VIUALIZECONFUSIONMATRIX Plot confusion matrix % % Author: I.Bogun (ibogun2010@my.fit.edu) % Date : 03/07/2013 %mat=randn(2)/max(mat(:)); imagesc(mat); %# Create a colored plot of the matrix values colormap(flipud(gray)); %# C...
function [freqVals,psdST,psdBL,baseCorrectedLog10PSD, theta, RHO, stLFP, gammaSig, harmonicSig, gammaFreq, harmonicFreq, gammaAmp, harmonicAmp] = getPSDandPhase(highRMSElectrodes,folderLFP,goodPos,stPos,blPos,mt,Fs) % PSD = 3D Array - (Freq, trialIndex, electrodeInd) % RHO = 3D Array - (100, trialIndex, electrodeInd) ...
function parfor_calc_esc_rev5_50rand_idx(app,temp_esc_idx,uni_esc_name_dpa,uni_dpa_index,cell_50_dpa_pts,reliability,confidence,radar_height,FreqMHz,path_loss_threshold,step_size,TerHandler,TerDirectory,array_rand_esc_idx) %%%%%%%%Break the 50 and 95 into separate functions %%%%%%This is 50 esc_i...
%% Start code figure(1) [y, Fs] = audioread('GNR.m4a'); y = y.'; trgnr = length(y)/Fs; % record time in seconds plot((1:length(y))/Fs,y); xlabel('Time [sec]'); ylabel('Amplitude'); title('Sweet Child O''Mine'); %p8 = audioplayer(y,Fs); playblocking(p8); %% n = length(y); L = trgnr; t2 = linspace(0,L,n+1); t = t2(1:n);...
% clear all; clc; syms q1 q2 q3 q4 q5 q6 q7 dq1 dq2 dq3 dq4 dq5 dq6 dq7 g lT lf lt MT Mf Mt IT If It pMT pMf pMt pMua pMfa lua Mua ... psh real Iua Mfa Ifa q=[q1;q2;q3;q4;q5;q6;q7]; dq=[dq1; dq2; dq3;dq4;dq5;dq6;dq7]; g=9.8;lT=0.63;lf=0.4;lt=0.4;lua=0.25;lfa=0.25; MT=12;Mf=6.8;Mt=3.2;Mua=1.36;Mfa=1; IT=1.33;If=0.47...
clear all; file=('C:\Users\stefm\Downloads\Benchmarks\jump\eli_jump.avi'); source = VideoReader(file); numberOfFrames = source.numberOfFrames; dir = 'C:\Users\stefm\Desktop\23'; window1=2; %Filtering Windows window2=2; blobSize=300; %The Blobs minimum size to be written by the method %-----------...
function [p_e,p1,p2,p3,plane_hmat] = DFK3(q,config,Z_MAX_LENGTH) %configuration DELTA_ALPHA = config(:,1); ROD_RADIUS = config(:,2); ROD_LENGTH = config(:,3); DELTA_ALPHA_A = DELTA_ALPHA(1); DELTA_ALPHA_B = DELTA_ALPHA(2); DELTA_ALPHA_C = DELTA_ALPHA(3); ROD_RADIUS_A = ROD_RADIU...
clear all clc [x,y,z]=peaks(40); ind=x+y>2; z(ind)=NaN; mesh(x,y,z) colorbar view(70,54)
function [G2,XY_new] = fix_graph_type_8_disconnection(G1,small_I_I_I_trielements_AR,XY) % this function is to rectify, type 8 disconnections, i.e, I-I-I triple % point type disconnections. The input graph is the input argument and the % small_I_I_I_trielements. These are the trielements which are sorted out % by s...
%parallel coordinate fig clear mop.name='DTLZ2'; mop.obj_nums=10; R='R9'; A=load(strcat('pf_solution/','PFs_',mop.name,'(',int2str(mop.obj_nums),')_',R,'.dat')); xaxis=1:mop.obj_nums; disp(xaxis); %c=jet(length(A)); n='bgrcmykw'; for k=1:length(A) disp(A(k,:)); % plot(xaxis,A(k,:),'Color',[rand(),0.5+0...
function [ errmsg, chunksize, nfft, jump, window ] = chk_spectrogram_arg( argin ) % Messages d'erreur error0 = [ 'SPECTROGRAM ERROR. Invalid number of arguments' ]; error1 = [ 'SPECTROGRAM ERROR. The number of samples for computing the fft must be greater or equal than the chunks size.' ]; error2 = [ 'SPECTROGRAM...
% Tests for circuit_info %% Test: lr_test_two_connected [G, is_ext_node] = load_mrewiens('lr_test_two_connected'); info = circuit_info(G, is_ext_node); assert(8 == info.num_nodes) assert(4 == info.num_external) assert(4 == info.num_internal) assert(8 == info.num_resistors) assert(2 == info.num_conn_components) %% Tes...
function [output1family, state_code, error] = ... process_1family_secure... (family_range, family_genotype, parameters, option) error = 0; output1family = []; state_code = []; [error] = check_1processedfamily(family_range); if( error ~= 0 ) error = 1; disp('error in family structures'); return; ...
clear close all clc nos = 1e3; %% BAD sampling theta = 2*pi*rand(nos,1); phi = pi*rand(nos,1); x = sin(phi).*cos(theta); y = sin(phi).*sin(theta); z = cos(phi); figure plot3(x,y,z,'.','MarkerSize',10) %% Ok sampling d=zeros(3,nos); for kk=1:nos v = randn(3,1); d(:,kk) = v/norm(v); end figure plot3(d(1,:),...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2010 - 2015 Moon Express, Inc. % All Rights Reserved. % % PROPRIETARY DATA NOTICE: % The data herein include Proprietary Data and are restricted under the % Data Rights provisions of Lunar CATALYST Space Act Agreement % No. SAAM ID#...
results={}; for i=1:length(dists) disp(dists(i)); results=[results;[dists{i} num2cell(M(dists{i})) ]]; end results=results';
clear; load ../data/city_train.mat load ../data/city_test.mat load ../data/word_train.mat load ../data/word_test.mat load ../data/bigram_train.mat load ../data/bigram_test.mat load ../data/price_train.mat X_train =[city_train word_train bigram_train]; Y_train = price_train; X_test = [city_test word_test bigram_test]; ...
function mmlintpd(mmluifac,value) % Obtains interpolation factor % and re-writes dwell x intpfact % Called by mmgmm % Value indicates calling routine global mmlifact mmlifxd mmgdwelr; mmlifact = 2^(get(mmluifac,'Value') -1) ; % write dwell x intp & if value == 1 % color yellow mmlifxdf(mmlifxd,mmlifact,mmgdwelr...
function script_LJ( folder, openmm ) %LJ parameters %This script gets the C6 and C12 terms used in the force field from the %DDEC values and assigns them there atom type. This is where 0.5,0.5 or 1,1 LJ scaling is decided % onefourscaling decides is the 1-4 LJ interaction should be scaled by 0.5 % as happens in the ...
function [alpha,last]=stab(A,sigma) iters=1000; alpha=1; tol=0.025; k=10; d=2; I=eye(d); last=1; x=zeros(d,iters); x_mean=zeros(d,iters); x(:,1)=rand(d,1); x(:,1)=x(:,1)/norm(x(:,1)); x_mean(:,1)=x(:,1); errx(1)=norm(x(1))^2; b=A*[1;1]; for i=2:iters n=0.5*(rand-0.5); At=A+sigma*(rand(d)-0.5); x(:,i)=x(:,i-1)+alpha*(n+...
%%% TESTES ESTIMADOR ESPARSO clc clear all close all set(0, 'defaultAxesFontSize',12); set(0, 'defaultAxesFontName','times'); %Ddk = zeros(100,2000); %fail = zeros(1,20); for i=1:20 fail(i) = 10^(-i); end for w=1:length(fail) %amort_vetor = ones(50)*amort(w); % Vetor de referência para amortecimento % -...
% mettre synchro OFF n=1 ; % les 4 tours (2 coups par tours) dt=[13 13 13 -39]; %dt=[13 13 -26]; %dt=[13 -13]; % le meme tour 8 fois - reiterer 'run' pour changer de quart % dt=[13 0 0 0]; % writeattribute('BOO/AE/dipole/current',545); % writeattribute('BOO/AE/QF/current',201.7677); % writeattribute('BOO/AE/Q...
clear all; pkg load image; A1 = imread ('C:\Users\HP\Desktop\GoruntuIsleme\futbolcu.jpg'); A2 = rgb2hsv(A1); sat=size(A2)(1); sut=size(A2)(2); D=rgb2gray(A1); figure 1, imshow(D); title('Gri Resme dönüştürme'); im_edge = edge(D, 'sobel'); figure 2, imshow(im_edge); title('sobel'); %D = imcomplement(im_edge); %figure...
function S=mat2spss(M) S=[]; [n,m]= size(M); for k=1:m x=[ones(n,1)*k,M(:,k)]; S=[S;x]; end
function samples = get_samples(X, nsamp) [n, ~] = size(X); ind0 = randperm(n); ind0 = ind0(1:nsamp); samples = X(ind0, :); [ns, ds] = size(samples); assert(ns == nsamp && ds == 2,'Output is wrong.')
function [obj,obj_prime] = recover(obj,FEM,obj_prime,FEM_prime) % analysis results u_e = FEM.u(obj.gdof,:); nm = size(u_e,2); FEMCASE=FEM.CASE; % speeds up execution if nargin < 3 % element kinetic energy if FEMCASE.EKE && FEMCASE.SOL == 103 obj.eke= (pi*FEM.fHz).*diag(u_e.'*obj.me*u_e); ...
clc clear variables close all % Load from files and folders faceFolder = '3D_Faces_Processed_Step2/'; fileType = '.obj'; folderContent = dir([faceFolder,'*',fileType]); addpath('3D_Faces_Processed_Step2/'); % number of faces in the folder nface = size (folderContent,1); res = 100; sel = 1; lvSet = 0:...