text
stringlengths
8
6.12M
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % _ _ _ % % | | __ _ _ __ ___ | |__ _-(")- % % | | / _` | '_ ` _ \| '_ \ `%%%%% % % | |__| (_| | | | |_| | |_) | _ // \\ % % |_____\__,_|_| |_| |_|_.__/_| |__ ___ % % | | / _` | '_ \/ __| % % ...
% %Generating the data file % function GenerateDataFromDag() [bnet, UID, numberOfStudents] = currentDag(); a = size(bnet.observed); numberOfItems = a(2); %file name for the output saveFile = ['UID', num2str(UID), 'Data', num2str(numberOfStudents), '.csv']; saveFile2 = ['UID', num2str(UID), 'LatentData', num2str(numb...
clear all % Open Time video [FileName1,PathName1] = uigetfile('*.mat','Select the time for the video'); % Open Time camera [FileName2,PathName2] = uigetfile('*.mat','Select the time for the fluo'); % Open Data [FileName3,PathName3] = uigetfile('*.nii','Select the Nifti file'); file=strcat(PathName3,FileName3) B=...
function Flag = around_object2(laser_sub, robot_pub) angle_speed = 0.2; wait_time = 6.5; [x_lidar, y_lidar, scan_data] = get_lidar_data(laser_sub); dist1 = scan_data.Ranges(1:35); dist2 = scan_data.Ranges(325:360); dist1(dist1 == 0)=[]; dist2(dist2 == 0)=[]; minDist1 = min(dist1); ...
function [J, grad] = costFunctionReg(theta, X, y, lambda) %COSTFUNCTIONREG Compute cost and gradient for logistic regression with regularization % J = COSTFUNCTIONREG(theta, X, y, lambda) computes the cost of using % theta as the parameter for regularized logistic regression and the % gradient of the cost w.r.t. ...
function [r] = qadd(p,q) %UNTITLED4 Summary of this function goes here % Detailed explanation goes here r = p+q; end
function pf = dprime(a, b, x, pcorr) k=erfinv((pcorr-0.5)*2); pf=erf(k*10..^((x-a)*b));
function [ ] = MeshGridImgPlot(im, Vertex_set, COLOR_V) % Summary of this function goes here % Detailed explanation goes here % The Code (Version 1) is created by ZHANG Yabin, % Nanyang Technological University, 2015-12-30 % which is based on the method described in the following paper % [1] Wang, Yu-Shuen, e...
%% Add the approprate folders to the path %Path of the SOSpikingModel repository % %repopath = '/Users/dlevenstein/Project Repos/SOSpikingModel'; repopath = '/Users/jonathangornet/Documents/GitHub/SOSpikingModel'; %repopath = '/scratch/jmg1030/LogWeightSigma/SOSpikingModel'; addpath(genpath(repopath)) SAVESIM = true;...
function [ imperf, imcont ] = getPerfTestnii( dirnm,ndynamics ) % change to subdirectory given by dirnm. Read images rperf_N and rcont_N, where % N = 1:ndynamics, store in matrices and return % NB DYNAMICS ARE AVERAGED HERE AND NOT IN CALLING ROUTINE AS EARLIER % This is because knowledge of how many dynamics is he...
%Fall data extract from .dat interpolate and save as .mat sample_size = 2000 % pwd %% Amplitude extraction TX_ant = 1; kitchen_files = dir('../../../fall_data/falldefi/fall_detection/kitchen2/*.dat') mkdir(fullfile(pwd,'../../../interp/kitchen2/')) for i = 1:length(kitchen_files) file_name = kitche...
%% CFD Boston University Course ------------------------------------------- % Step 2 of 12 to Navier Stokes Code: One Dimmensional Covection % % Governing Equation: % \frac{\partial{u}}{\partial{t}} + u\frac{\partial u}{\partial x} = 0 % % This code is the simplest nonlinear CFD problem, which is essentially the % inv...
ScreenNum = 0; StimWin = Screen('OpenWindow', ScreenNum); % get pointer to stimulus window [xsize ysize ] = Screen('WindowSize', StimWin); ScreenRes = [xsize ysize ]; black = BlackIndex(StimWin); white = WhiteIndex(StimWin); Screen('FillRect', StimWin, black); % start with black [vbl]=Scree...
% Christopher Brant ENGR 1410-625 3/11/16 % Assignment A13 clear clc close all figure('color', 'w') %% Figure 1: Includes plot from #s 18-18, 18-19, 18-21 Data1 = [0.5 0.75 1 1.5 2 2.25 2.5 2.75; 0.004 0.04 0.13 0.65 3 8 18 22]; Diameter = Data1(1, :); Power = Data1(2, :); % Review 18-18 loglo...
function y = mad(x,flag) %MAD Mean/median absolute deviation. % Y = MAD(X) returns the mean absolute deviation of the values in X. For % vector input, Y is MEAN(ABS(X-MEAN(X)). For a matrix input, Y is a row % vector containing the mean absolute deviation of each column of X. For % N-D arrays, MAD oper...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EE 569 Homework #1 % Date: Oct. 11, 2015 % Name: Faiyadh Shahid % ID: 4054-4699-70 % Email: fshahid@usc.edu %------------------------------------------------------------------------% % Demo for Structured Edge Detector (please see readme.txt first). clear a...
function experiment = TivaroVstmStairSim %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %usefull for data analysis experiment.identifier =...
function [ output ] = plot_slice( w,g ) %output = plot_slice(tign) % function plots a vertical slice(s) of the fire arrival time cone % inputs : % w - struct with tign_g, fxlat,fxlon % g - sturct with detection data % outputs: % nothin so far %%% create list of fires fires = []; fire_lats = []; fire_lons =[]; fire...
% snake = HebiLookup.newConnectedGroupFromName('*', 'SA002') snakeType = 'SEA Snake'; numModules = 16; snakeData = setupSnakeData( snakeType, numModules); % snakeData.firmwareType = snake.getInfo.firmwareType;
function A = mesh_physarea(M, phys) A = 0; for ind_triangle = 1:M.num_triangles tphys = M.trianglephys(ind_triangle); if phys == tphys A = A + M.elements{M.triangles(ind_triangle)}.area; end end
function T = cell_T( A ) T = A(25:31,1); end
%functon to calculate the variable timestep % c is a constant (1/2 for euler sym and 1/10 for leapfrog) %^specified by the user function dt = timestep(y, c) % [x1, y1, x2, y2, x3, y3, vx1, vy1, vx2, vy2, vx3, vy3] x1 = y(1); y1 = y(2); x2 = y(3); y2 = y(4); x3 = y(5); y3 = y(6); vx1 = y(7); ...
tic clear; save_flag = 1; %% parameter setting Lp = 3; D_MS = 6.4;4.7;10.1; %假设x、y维度相同 D_BS = 0; %假设x、y维度相同 ele_max_MS = pi; azi_max_MS = pi; ele_max_BS = pi; azi_max_BS = pi; N_MS = MY_number_of_antennas_FDLens(D_MS, ele_max_MS, azi_max_MS); N_BS = 1; N_RF_MS = 4; N_RF_BS = 1; N_MS_block = N_MS/N_RF_MS; N_BS_block...
classdef ProgressBar < handle % Stripped down version for Neuropixel which does not support parallel mode % Generates a progress bar which uses ANSI color codes to colorize output % in a color terminal. The background color steadily advances along from % left to right beneath a custom message and progress percentage s...
%%PROGRAMA RELACION COSTO BENEFICIO%% [num,txt,raw]=xlsread('DatosRCB'); I=input('INGRESE EL MONTO DE LA INVERSION:') VAN_I=num(:,4); VAN_E=num(:,5); VAN_EI=VAN_E+I; RCB=VAN_I/VAN_EI; fprintf ('LA RELACION COSTO BENEFICIO ES: $ %f \n ', RCB ); %%PROGRAMA RELACION COSTO BENEFICIO%% [num,txt,raw]=xlsread(...
% spiral3drecon % % Luis Hernandez-Garcia @UM 2020 % % 1- This script reads FIDs from the GE scanner acquired with a % noncartesian 3d trajectory % 2 - it reads the gradient and kspace trajectories and rotates them % appropriately for each shot % 3 - it re-grids the k-space data into a cartesian grid % 4 - reconstructs...
entirecellsize = zeros(1,max(cell2mat(cellfulllist(:,2)))); for j = 1:max(cell2mat(cellfulllist(:,2))); boutonsize=0; for i = 1:length(cellfulllist) if(cellfulllist{i,2}==j) entirecellsize(j) = cellfulllist{i,3}+ entirecellsize(j); end; end; end; entireboundarycellsize = zeros(1,max(cell2...
k=1; members=sort(properties(GRID)); timein=1:150; t=timein./250; tf=(0:75)/150*250; txlim=[0 0.6]; fxlim=[0 125]; tmp=35; train_sl=repmat(tmp,1,12);%12 train targets channels=1:10; %for j=1:100 spf=[]; cal='cr'; for j=1:numel(members) S=GRID.(members{j}).copy; tmp1=S.default.train_classifier('spatialfilte...
function varargout = gui_ct(varargin) % GUI_CT MATLAB code for gui_ct.fig % GUI_CT, by itself, creates a new GUI_CT or raises the existing % singleton*. % % H = GUI_CT returns the handle to a new GUI_CT or the handle to % the existing singleton*. % % GUI_CT('CALLBACK',hObject,eventData,handles,...
%{ Author: Connor T. O'Reilly Collaborators: kevin yevak Last Revision: 12/12/2019 %} %% House Keeping clc; clear all; close all; %% Data %obtained from ansys fluent at multiple AOA cfd_data = readtable('CFD_Data_Real.csv'); %delete NAN values from empty rows cfd_data = cfd_data(~any(ismissing(cfd_data),2)...
function [cost,grad] = sparseAutoencoderCost(theta, visibleSize, hiddenSize, ... lambda, sparsityParam, beta, data) % visibleSize: the number of input units (probably 64) % hiddenSize: the number of hidden units (probably 25) % lambda: weight decay parameter % sparsityParam: The desired average activation for the ...
% Structure from Motion script % Based on optical flow points from first part of assignment 4 for Computer % Vision. % % INPUT: % - pts: dataset containing all centered points that are tracked, shape % [m, n], m = number of views, n = number of points per view. % % OUTPUT: % - 3D Graph of the tracked ...
function [coor, lat] = Read_MOPAC_Structure() global ORG_STRUC coor = callAWK('MOPAC_coor.awk', 'input.arc'); if ORG_STRUC.dimension == 0 lat = [30 0 0; 0 30 0; 0 0 30]; Xcm=(sum(coor(:,1)))/length(coor(:,1)); Ycm=(sum(coor(:,2)))/length(coor(:,2)); Zcm=(sum(coor(:,3)))/length(coor(:,3)); Dif= [15-Xcm 15...
% Solve for impulse response and pdps of a single record %%%Updated on 4/27/2017 by JDiener - Fixed the Frequency Energy Difference %%%issue. function [IQ_data, CIR_Discretescaling_Bandlimit, FreqResponse_allfreq, PathGain_avgfreq, PathGain_avgtime]= ... analyzeRecord_vs5(recorded_data, Tx_b2b, t_rec, norm_atten,...
function mat = helper2(mat) %B=rgb2gray(imread('A.jpg')); mat=imbinarize(mat); mat=~mat; mat = bwareaopen(mat,30); A_yeni = regionprops(mat, 'BoundingBox');%detect edges mat = imcrop(mat, A_yeni.BoundingBox); %crop image mat = imresize(mat, [42 24]); end
function [perstart,burstperstart,burstcyclenum] = est_cpg_phase(t,burstt,chanlocation, varargin) opt.tol = 0.1; opt.smoothwindow = 9; opt.outlier = 1.5; opt.relativeto = 'L1'; opt.basephaselag = 0.01; opt.excludenear = []; opt.excludenum = 0; opt = parsevarargin(opt,varargin,4); nchan = size(burstt,2); side = regex...
% Tarif Riyad Rahman % MATLAB syntax used % This is the test bed for the function sumDigit % sample cases are used for testing the correctness of the function function e=test_sumDigit() e=0; e=e+runtest(32,5); e=e+runtest(53,8); e=e+runtest(953,17); e=e+runtest(103,4); e=e+runtest(4944,21); e=e+runtest(256,13); ...
function s = flip_stats(nflip, nexp) %функция, моделирующая M экспериментов по N подбрасываний монеты s = zeros(nflip + 1, 1); %создаем массив нулей размером nflip+1х1 for i = 1:nexp matrix = coin_flip(nflip); %создаем логический вектор из nflip элементов (1 - орел и 0 - решка) buff = sum_heads(matrix)...
function [posCand,map_delta,halfRange]=getBasicSettings(x,theConf,deform_delta,layerID) deform_delta=deform_delta(:); [xh,xw,~]=size(x); posCandNum=min([theConf.learn_position_cand_num,xh,xw]); map_delta=theConf.learn_map_delta*xh; halfRange=round(min(theConf.learn_search_max_range(layerID)*xh/2,deform_delta.*theConf.l...
function [scaledata]=nresample(data,origHz,newHz) scaledata=resample(data,origHz,newHz); s2=sigresample(data,newHz,origHz,40); scaledata(1:round(.98.*length(scaledata)))=s2(1:round(.98.*length(scaledata)));
%obligatorio 2 %metodo de euler function [S, I, R] = SIREuler(So,Io,Ro,b,a,t,n) %OBS: las unidades del tiempo "t" dependen de las unidades de las tasas de contaguio "a" y "b" N=So+Io+Ro; h=t/n; S(1)=So/N; I(1)=Io/N; R(1)=Ro/N; for i=1:n S(i+1)=S(i)-b*S(i)*I(i)*h; I(i+1)=I(i)+I(i)*(b*S(i)-a)*h; R(i+1)...
function pks = findpeaks2D(x,z) % example: % export spectroscopy data to workspace with DataViewer % pks = toolbox.data_tool.findpeaks2D(y,z); % pks is 3 by length(x) matrix % the first row are the most prominent peaks, which migh % be false peaks at some points, in such case, you also have % the second and the third r...
classdef RecurrentInterface < handle methods function extract(obj, package) if not(exist('package', 'var')) package = obj.pkgap.poll(); end frames = obj.pkgap.unpack(package); % fill up cache of frames obj.frmap.reset(); ...
function score = cluster_analysis_gblmnn(output, label) %gblm %for i=[1:4] %for j=[1:2] %for k=[1:2] %for l=[1:2] %for m=[1:1] %for i=[1:1] %for j=[1:1] %for k=[1:1] %for l=[1:1] %for m=[1:1] %score(i,j,k,l,m) = cluster...
% Step 2 % Example link: https://www.mathworks.com/help/signal/ug/dct-for-speech-signal-compression.html clear dct; load('strong.mat'); % her audio x = her'; % get the inverse matrix of her X = dct(x); % get the DCT [XX,ind] = sort(abs(X), 'descend'); need = 1; while norm(X(ind(1:need)))/norm(X)<0.999 need = ne...
%% Read Bruker File clear all close all addpath('/home/valery/Dev/BruKitchen/matlab/'); [status,id]= system('whoami'); str_user= id(1:end-1); check_if_iam_using_the_ihuserver(str_user); [ str_network_imagerie, str_network_perso ] = get_network_name( str_user ); %% TODO voici la liste des problemes % completer le...
function out = I2(alpha,beta) for n3=1:size(alpha,3) for n2=1:size(alpha,2) for n1 = 1:size(alpha,1) out(n1,n2,n3) = quad(@xJo,0,1,[],[],alpha(n1,n2,n3),beta(n1,n2,n3)); end end end
function [ c ] = curvature( u , epsilon) % Calcul de la courbure en tout point de notre image % epsilon : param?tre de stabilisation du calcul dans les zones homogenes % (division par zero rendrait l'algo instable) [gradx, grady] = gradient(u); % Courbure qx = gradx./(sqrt(gradx.^2+grady.^2+epsilon^2)); qy = grady./(...
clc clear img_race = imread('race.tif'); figure(1) hist(img_race(:),0:255); img_kids = imread('kids.tif'); figure(2) hist(img_kids(:),0:255); hist_before = hist(img_kids(:),0:255); y = equalize(img_kids); figure(3) imshow(y) figure(4) hist(y(:),0:255); sum_h = sum(hist_before); F_hist_before = zeros(256); for i ...
function [ b, bint, r, p, yUnwrap] = circularSlope90d( Y,X ) %circularSlope90d calculate slopes and correlation coefficent (for FA) %[ b, bint, r, p, yUnwrap] = circularSlope90d( Y,X ) % % This code fits a line to circular data. It does this by first doing a % nonlinear least squares fit using a cost function that res...
function [ f,d ] = get_dsift_in_bound( I, bounds, m ,mode) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here % mode options: % 1: get points with highest contrast % 2: get random points % 3: order by contrast, split array in multiple arrays, use highest % contrast points of each of the re...
%***************************************************************************************************** % Write out plot to png file %***************************************************************************************************** function [fnpng]=wrplotpng(fn) % Print to png file fnpng=[fn,'.png']; print...
function sigmaSq = uq_Kriging_calc_sigmaSq( parameters, estim_method ) % UQ_KRIGING_CALC_SIGMASQ: returns the variance of the Guassian process % while trying to calculate it in the most efficient way depending on the % hyperparameters estimation method and in case of ML, the condition of the % correlation matrix R % % ...
clear; verbose = false; SNDRi = zeros(12,1); SNDRideal = zeros(12,1); for i=1:12 %%% ---------- Circuit parameters -------------- number_of_bits = 1+i; sine_freq = 200; sine_amplitude = .001; sine_bias = 0; Vref = 2; noise_quantization = Vref^2/12*2^(-2*number_of_bits); % Clock & ...
% mpc_steady_state_analysis.m % Xiaotian Dai % University of York % Segment reference signals and find corresponding steady state time. % Use for analysis results from `mpc_period_with_abitary_reference.m` addpath('../../Toolbox/') %% initialization r_end = 0; tss_a = []; h = mpc_param.Ts; %% start iteration while ...
clc; clear all; infile=strcat('scp\\dcase2016_all_lps.scp'); fsmlf = fopen(infile); %用fgetl读前面 7行 注意fgetl不会忽略空的行,如果遇到空的行,则fgetl会读入一个空的字符串 tline = fgetl(fsmlf) ; %fgetl 一次仅读入一行,并返回这一行的字符串。路径~ %fgetl函数,是从文本中读取一行数据,并丢弃行末的换行符 %system('mkdir D:\user\jundu\xuyong\yanping_10h\lsp_8k_be'); while (tline~=-1) ...
function [FF,nn]=fisherP(xpf,ypf,t,yreal) FF=zeros(length(xpf)-2,1); for i=1:length(xpf)-2 [cc1,in1]=min(abs(t-xpf(i))); [cc2,in2]=min(abs(t-xpf(i+1))); [cc3,in3]=min(abs(t-xpf(i+2))); xdata=t(in1:in3); ydata=yreal(in1:in3); tt=xdata; yy=ydata; slope ...
%> @file setupGlobal.m %> @brief Sets up global parameters that do not change between experiments %> @details Global parameters including paths, K-Means parameters, source type, quality measure, and log setup. %> @author Ben Nordin %> @date 2011-09-01 % ==================================================================...
% UPCOEF 1次元ウェーブレット係数から直接再構成 % % Y = UPCOEF(O,X,'wname',N) は、ベクトル X の N ステップ目の再構成された % 係数を計算します。'wname' は、ウェーブレット名を含む文字引数です。 % N は、厳密な意味での正の整数です。 % O = 'a' の場合、Approximation 係数が再構成されます。 % O = 'd' の場合、Detail 係数が再構成されます。 % % Y = UPCOEF(O,X,'wname',N,L) は、ベクトル X の N ステップの再構成された % 係数を計算します。そして、結果の中から中央の L の長さを抽出します。 % % ...
function [predict] = get_DA_fisherfaces(train, train_label, test, k) % fisherfaces的变种方法,效果并不好http://www.docin.com/p-1418109138.html % 计算DA-fisherfaces并用NN分类 % 输入: % train_image = [N_train X d],每行为一个d维样本 % train_image_label = [N_train X 1] % test_image = [N_test X d],每行为一个d维样本 % k = FLD降维后保留的维数 % 输出: % predict = [N_tes...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %plot showing wave to working scale and real scale % %Corwin Wright, c.wright@bath.ac.uk, 2021/02/14 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %...
% Read image img = imread('image.jpg'); % Switch to grayscale image img_gray = rgb2gray(img); % 1. Histogram of the input image % Compute and display the histogram of the input image using % self-implemented function my_imhist, and make a comparison with MATLAB % built-in function histogram figure(1); subplot(1, 2, 1)...
function dFs_heel_c1_4 = dFs_heel_c1_4(in1,in2,us,ud) %DFS_HEEL_C1_4 % DFS_HEEL_C1_4 = DFS_HEEL_C1_4(IN1,IN2,S_HEEL,US,UD) % This function was generated by the Symbolic Math Toolbox version 8.4. % 24-Jun-2020 13:53:55 q1 = in1(:,1); q2 = in1(:,2); q3 = in1(:,3); q4 = in1(:,4); q5 = in1(:,5); q6 = in1(:,6); q...
function z=Laplacian(size) c=(size+1)/2; z=ones(size); z(c,c)=1-size*size;
%% CS_SL0 Smoothed l0-Pseudonorm Algorithm % ÊäÈ룺y---²âÁ¿ÐźŠM X 1 % A---»Ö¸´¾ØÕó M X N % deltaT---×îСµÄdelta ÏÞÖÆdelta²»ÄÜ̫С,deltaԽСԽ½Ó½üÓÚl0·¶Êý % r---deltaµÄÊÕËõ²½³¤ % mu---ºÜСµÄ¸üвÎÊý£¬¼ûÎÄÕ % L---Ñ­»·´ÎÊý ĬÈÏȡֵ3 % Êä³ö£ºxs---»Ö¸´µÄÐźŠN X 1 % ...
clf;clear all; % plot bpsk signal load('./filter/Pulse_Shapping_Filter') load('./filter/FIR_distortion') signal = [-1,1,-1,1] delayed_signal = delay(signal,0) % sout = filter(FIR_distortion,signal) transmit_signal = filter(Pulse_Shapping_Filter,DAC(signal)) recieve_signal = ADC(filter(Pulse_Shapping_Filter,transmit_s...
function [rmax rmean rmeanci rmod] = respindex(tuning) %function [rmax rmean rmeanci rmod] = respindex(tuning) % % max rate, mean rate +- 95%CI, modulation depth % on = tuning.on.k(:); off = tuning.off.k(:); rates = [on(:); off(:)]; rmean = mean(rates); rmeanci = bootci(100, @nanmean, rates); rmax = nanmean(max(rat...
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXERCICE 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
function visualizeBoxes(img,cur_bboxes,filePath) figure (15), imshow(img); hold on; for i = 1:size(cur_bboxes,1) bb = cur_bboxes(i,:); plot(bb([1 3 3 1 1]),bb([2 2 4 4 2]),'g:','linewidth',5); end hold off; axis image; axis off; title(sprintf('imAge: Single Instance...
function path = findPath(map, start, goal) % Input: % map is an arbitrary size real matrix representing an occupancy grid. The elements are equal to 0 (free space) or 1 (occupied) % start is a 1x2 matrix containing the start coordinate [x y] for the path % goal is a 1x2 matrix containing the end c...
function [T ] = Top5( data ) %UNTITLED4 此处显示有关此函数的摘要 % 此处显示详细说明 conf = 0; reco = 0; N_element = size(data,1); for i = 1:N_element if (ismember(data(i,1),data(i,[2 4 6 8 10]))) % mauvais decision reco = reco+1; else conf = conf+1; % bonne decision end end Conf = round(conf/N_element*100);...
function [X,A,row,col] = reshape_hsi(I,A) %RESHAPE_HSI Summary of this function goes here % Detailed explanation goes here if nargin < 2 A = []; end if ndims(I) == 3 [row,col,B] = size(I); N = row*col; if ~isempty(A) [row,col,M] = size(A); A = reshape(A, N, M); end X = reshape...
% The function calculate speed destribution and shows wind rose for time % moment function [] = main3(dataPath, matrixName, calculatePath, timeMoment, timeThreshold) if nargin < 5 dataPath = "data"; matrixName = "smooth_colorEvents3.mat" baseLinePath = "data"; calculatePath = "Calc...
function dxdy=ode(x,y) dxdy=[y(2);5*x*exp(x)-y(1)+2*y(2)];
function e_b = fcn_f2b_eff(e_f,N) mu = 0.01; G = 1/N; sz_eff = length(e_f); e_b = zeros(size(e_f)); for idx_eff = 1:sz_eff thres = (1-G^2)/2; e = e_f(idx_eff); if thres < e && e <=1 e_b(idx_eff) = (2*e-1+G^2)/((1-G^2)*e+ 2*G^2); else e_b(idx_eff) = eps; end end end
function s = translatelabel(s, eng_scale_mode) % user can insert "$" character to be replaced by % engineering scale mode character. if it's already been % replaced, it's been replaced by {{{x}}}, which renders % just as "x" since it's latex-interpreted. therefore, we % can start by changing strings of this type...
function res=MAPE(x, xt) [n,m]=size(x); xt(xt==0)=1e-2; res=100/(n*m)*sum(sum(abs(x-xt)./abs(xt))); end
classdef Blender < handle %BLENDER Class for all image blenders % % See also: cv.Stitcher % properties (SetAccess = private) id % Object ID end methods function this = Blender(blenderType, varargin) %BLENDER Constructor % % obj = ...
function [ dfdx ] = dfdx( f, x, dx ) dfdx = ( f( x .* (1+dx) ) - f( x ) )./ (x.*dx) ; end
clear; clc; T=40; D=21; Duty=(D/T)*100; N = 50; omega0 = (2*pi)/T; C_0 = 0; t = -30:0.01:30; ...
function texture_metric_radiomics = run_radiomics(sPathImg, lMask,category) %%% Minor code efficiency fix %%% Fix bugs (feature calculation now takes into account image modality) %%% Added optional feature (non-isometric volume image to isometric) % settings for preprocessing % load volume if ~contains(sPathImg,'.mat'...
%% Stelling 16 % % Bij het opslaan van een function file mag je het bestand % een willekeurige naam geven. % Antwoord = NaN; % vul hier het juiste antwoord in 1 (WAAR) of 0 (ONWAAR)
function [ marksImUpdated ] = editMarks( I,marksIm ) %EIDTMARKS this function allows the user to manually edit or assign the %location of each turbine mark. %open new figure and show image tempFigure = figure(); imagePlot = imshow(I); hg = hggroup(); for i=1:9 imDots(i,1) = impoint(hg,marksIm{i,1}(1),...
%% Feature detection close all clear all img = imread('image_1.png'); % Calculate corner points using Harris Feature detector cp = detectHarrisFeatures(img); cp.Location %% Control f = 400; p = length(img)/2; Z = 50; l = 0.1; %lambda % Populate Observation vector using values from "feature detection section" % ...
function update(act, tag, val) % Main updating function. Update the control outlooks and manage the states. % % Input % act - action type, 0 | 1 | 2 | 3 | 4 | 5 % 0: initialize or click the poX menu % 1: click the puLo button % 2: click the puP button % 3: adju...
function [P,err] = dare(A,M,Q,R,N) %DARE Solution to Discrete-time Algebraic Riccati Equation % % [P,err] = dare(A,M,Q,R,N) % % returns a positive semi-definite solution, if existent, for % the following general discrete algebraic Riccati equation: % % P = A'PA - (A'PM + N)(R + M'PM)^{-...
%% Converts Sentinel 3 spectral response functions to MODTRAN .flt % Origin is flat text files from the libRadtran project % www.libradtran.org % Beyond that, the providence of this data is currently unknown % The MATLAB Mod5 package is required to run this script. % https://github.com/derekjgriffith/matlab-modtran-5 c...
clear; clc; % Images received from Clair-Pixel %input_image = double(imread('./CP_images/2M_IMG_0000.ppm')); % 8 bit %input_image = double(imread('./CP_images/2M_IMG_BNR.ppm')); % 8 bit %input_image = double(imread('./CP_images/CP8120_dark_0000.pgm')); % 16 bit (1 channel) %input_image = double(imread('./CP_images/CP8...
function [func_hat, var_hat] = hrf_deconv2(data, IRF) % function [func_hat, var_hat] = hrf_deconv(data, IRF) % % deconvolves the hrf from a time series, given: % % data - (of course)this needs to be a column % IRF - the IRF to deconvolve from the data % % the function uses a linear regression approach to % deconvo...
classdef Scan2017b < ne7.scanreader.scans.Scan5Point3 %SCAN2017B ScanImage 2017b end
function info = updateInfo_v2(info) w = info.wh; %learned w from observations % for histogram [t,id] = sort(w(end,:)*info.X',2,'descend'); theta_n = info.theta*info.norm; theta_n(id(1)) = theta_n(id(1)) + info.tau; info.theta = theta_n/sum(theta_n); info.theta_set(:,size(w,1)+1)...
function [Operators] = inequalityConstraint() Operators.value=@(index)value(index); Operators.evaluate=@(state,control,index)evaluate(state,control,index); Operators.firstDerivativeWrtState=... @(state,control,index)firstDerivativeWrtState(state,control,index); Operators.firstDerivativeWrtControl=... @(state,co...
function [numopen, denopen, denclsd]=pdcomp(num,den,s1) % Hadi Saadat, 1998 discr=[ ' ' ' The function pdcomp(num, den, s1) is used for the design of a PD ' ' controller. num & den are row vectors of polynomial coefficients ' ' of ...
function [phase,cycleind,cyclet] = getphase(t,sig, varargin) opt.smoothparam = 1; % lower is smoother opt.threshold = []; % peak threshold opt = parsevarargin(opt,varargin,3); if (~isempty(opt.threshold)) thresh = {'threshold',opt.threshold}; else thresh = {}; end %find the peaks, anticipating that so...
function [Y,Xx,Ea,Eu,W] = run(S,NPer,V) % simulate.linear.run [Not a public function] Linear simulation. % % Backend IRIS function. % No help provided. % -IRIS Macroeconomic Modeling Toolbox. % -Copyright (c) 2007-2017 IRIS Solutions Team. try V; %#ok<VUNUS> catch V = [ ]; end %--------------...
results = ['R27']; for j =1:length(results(:,1)) %Represesnts rat number %currentRat = results(j,:) %Break up the for i = 1:length(allAveragedEuclidDistSuccess) i if i == 1 Day3Success(j,:) = cell2mat(allAveragedEuclidDistSuccess(1)); Day3Success...
%% *5.3.5. "M" - Continous Line Laser Path* % This is the instruction to describe the laser beam toolpath, to be % executed with last set technological parameters % (see instructions "S", "F","P") % The total size of this instruction can be computed as is: % 1 + 4 + (4 + 4) x POINT_COUNT. The laser toolpa...
function [] = lead_predict_Avg(leadPred,leadbase,leadPredcheck,sample) % Filter all the leads by passing them through a bandpass filter leadPred=fftfilter150(leadPred,0.5,40); leadbase=fftfilter150(leadbase,0.5,40); leadPredcheck=fftfilter150(leadPredcheck,0.5,40); % Find the Rpeaks for all the leads % NOTE : We are...
%实验自定义驾驶场景,参考https://www.mathworks.com/help/releases/R2019b/driving/examples/driving-scenario-tutorial.html function mainTestDS1 scenario = drivingScenario; v1 = vehicle(scenario,'ClassID',1','Position',[6 0 0],'Velocity',[-3 0 0],'Yaw',180); v2 = vehicle(scenario,'ClassID',1,'Position',[0 10 0],'Velocity',[0 -4 0],'Y...
%% prt_my_pet_cit % read results_my_pet.mat to write my_pet_cit.html %% function author = prt_my_pet_cit(metaData, doi, destinationFolder) % created 2018/08/17 by Bas Kooijman %% Syntax % <../prt_my_pet_cit.m *prt_my_pet_cit*> (metaData, doi, destinationFolder) %% Description % Prints my_pet_cit.html with citation ...