text
stringlengths
8
6.12M
%This is the code for X-ray imaging processing and extracting 3D/2D sorghum %panicle features and seed profiles. %For Branch features, see another folder "IdentifyStemAndBranches". %integrate all images into 3D matrix H clear H file=dir('*.png'); for k=1:length(file) I=imread(file(k).name); H(:,:,k)=i...
function salida = cesar(entrada,desplazamiento) a=double(entrada); for i=1:length(a) aux=a(i); val=65; if 96 < aux if aux < 123 val=97; end end a(i)=mod(aux - val + desplazamiento,26); a(i)=a(i) + val; end salida=char(a); end
close all;clear;clc; load('F:\Study\Data\Dh.mat'); load('F:\Study\Data\Sh.mat'); load('F:\Study\Data\Vh.mat'); load('F:\Study\Data\Dg.mat'); v = Vh; s = Sh; d = Dh; dg = Dg; n = size(v,1); a = 5; p0 = 0; p1 = 1; p2 = -1; Su = 0; wSum = 0; vSum = 0; sSum = 0; aSum = 0; Lr = 0.002; for i = 1:n temp = d...
clear, close all [srcimg, map] = imread('girl.bmp'); image(srcimg); srcimg = double(srcimg); [hs, ws] = size(srcimg); outimg = zeros(hs, ws); p = 0:255; h = zeros(1,256); for j = 1:hs for i = 1:hs outimg(j, i) = srcimg(j, i); end end for j = 1:hs for i = 1:ws h(srcim...
function [G, TP, ARD, DI] = convert_to_ts(gid, acc, ard, di, tap_ch_type, CFG) CFG.estim_points = 10; %% groupid processing first_gid = find(gid >= 1,1); gid(1:first_gid-1) = 0; try last_gid = find(gid >= 1); last_gid = last_gid(end); catch keyboard end gid(last_gid+1:end) = 0; gid_idx = find(diff([gid,0])); G =...
clf; %清除图表 fs=1000;N=length([0:1e-4:10]); %采样频率和数据点数 disp(num2str(N)) n=0:N-1; % t=n/fs; %时间序列 g=9.8; l=0.7; omega=23; R=0.2; odefun=@(t,x)[(R*omega^2*cos(x(2))-g*sin(x(2))-l*omega^2*sin(x(2))*cos(x(2)))/l; x(1);]; [t,x]=ode45(odefun,[0:1e-4:10],[pi/30 pi/20]); X=0.155*cos(9*t)-0.9*sin(x(:,2)).*cos(9*t...
function rhs = vortStreamFuncBGS(t, w, v, A, B, C) p = bicgstab(A, w, 1e-6, 233); px = B*p; wx = B*w; py = C*p; wy = C*w; psiOmega = px.*wy - py.*wx; rhs = v*A*w - psiOmega;
function da = forwardprop(dn,n,a,param) %SATLIN.FORWARDPROP Forward propagate derivatives from input to output. % Copyright 2012-2015 The MathWorks, Inc. da = bsxfun(@times,dn,(n >= 0) & (n <= 1)); end
function [kalle] = drawDEMtree(arguments) global NOB layers axs nobh layh if (nargin == 0) close all; demDACgui; NOB = 14; layers = 5; arguments = 'update layers'; end; if (strcmp(arguments,'update NOB')) disp('jahadu, det tycker du...'); elseif (strcmp(arguments,'update layers')) layers = str2num(g...
function [cmAdjMat, vVertPos, mVertMembership, cmImageGraph, cmShuffledAdjMat, vShuffledVertPos] =... genBlockmodelWithBackground(sPosDist, posNum, graphSize, bShuffle, vBackgroundProp, sBlockmodelType,... varargin) % % Generate blockmodels, using a stocastic blockmodel (generative) model. % Compare...
function D = save_mem X = 1:10; D = pdist(X',@distfun); function d2 = distfun(XI, XJ) d2 = XI + XJ; end end
function [I,f]=esparso(n,x1,xn,m,y1,ym) #gera sistema I n*m com abcdef #olhar slide de PVC para referencia porque e muita formula I=zeros(n,m); fl=zeros(n,1); for i=1:n for j=1:m [a,b,c,d,e,f]=constantes(x1,xn,n,y1,ym,m,i,j); if(i==j) I(i,j)=a; elseif(i-1==j) I(i,j)=b; e...
function dataset_out = datasetCheck(dataset) % Checks that in dataset there are no inf or NaN valued data and replaces % them with the previous data eventually % % INPUTS % dataset = struct with fields % .InfettiRegioniOggi : matrix with data on positive peo...
function pa_prior_figure3 %% SUPSAC_SL beinhaltet die Data von RG, PH, CK % Jetzt probiere ich, diese Data zusammen zu analysieren %% Initialization close all clear all clc figurel2s %% Filenames fnames = {'JR-RG-2012-04-06-0001';... 'RG-JR-2012-04-26-0001';... 'RG-PH-2012-04-13-0001';... 'RG-PH-...
function [negloglik] = log_det_B(hyps, func, n, n_class, X, y, approxF) % a function evaluating log.det B % where B = I + KW % by Mark Norrish, 2011 % note: actually uses a bunch of other equations, esp. for derivations dim = length(hyps) / n_class; Hyps = reshape(hyps, dim, n_class); bigK = zeros(n*n_class); K = zer...
classdef prtDataSetBase % prtDataSetBase Base class for all prt data sets. % % This is an abstract class from which all prt data sets inherit from. % It can not be instantiated. It contains the following properties: % % name - Data set descriptive name % description - D...
function [stateEst,stateCovarianceDiag] = navigation_ahrs10(i,accel,gyro,mag,Rmag,lla,Rpos,gpsvel,Rvel,... imuUpdateFs,magUpdateFs,gpsUpdateFs,baroUpdateFs,radarUpdateFs,... X0_ahrs10,P0_ahrs10,fs,refloc,std_acc,std_acc_bias,std_alt,std_gpsvel,... std_gyro,std_gyro_bias,std_magNED,std_mag_bias) global filte...
% Run a stochastic simulation to determine good feedback matrices type = 'y=sin(t)'; model = 'P'; func_opt = @(type, kp_v, kp_th) P_model_V2(type, kp_v, kp_th); % Turn off plotting plotting = 0; % Try 100 trials ntrials = 100; err_total = zeros(1,ntrials); load(['best_',model,'model_',type]) for n = 1:ntrials fpr...
clear all close all load('../data/fig4_6.mat') %% Figure 4.6a h=figure for n=1:N semilogy(w_range, Fbar_collector{1,n}, 'color', 'k', 'LineWidth', n/40); hold on end ylim([10^(-10), 1]) xlim([0,200]) xlabel("$w$", 'Interpreter', 'latex') ylabel("$\bar F_n(w)$", 'Interpreter', 'latex') set(gca,'fontsize',14) ...
function nn_bayes1_MAP home; close all; %% Generative model % cd('E:\MATLAB'); pa_datadir; load AVpar2 figure(1) subplot(241) A = Vision(1).SupSac(:,23); E = Vision(1).SupSac(:,24); for ii = 1:4 a = Audiovisual(ii).SupSac(:,23); A = [A;a]; e = Audiovisual(ii).SupSac(:,24); E = [...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % function clursterTextons % Cluster all the 3x3 patches in the training database into textons % % Input parameters: % % % Output parameters: % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function doLoad3x3Pa...
%±æÊ¶ÆÀ¼Û function Q=QV(Y,U,dt,k,T,n) [lp,m]=size(Y); if m>lp lp=m; end Q=0; a=exp(-dt/T); b=1-a; X=zeros(n,1); for i=1:lp X(1)=a*X(1)+k*b*U(i); if n>1 X(2:n)=a*X(2:n)+b*X(1:n-1); end Y1(i)=X(n); Q=Q+(Y(i)-Y1(i))*(Y(i)-Y1(i)); end
function [emis]=interfaceF_getEmisCLEref(type, savedCLE, CLE, savedCLEref, CLEref, D, d, x, geometryIntermediateData, commonDataInfo) if isequal(type, 'FIRSTGUESS') if size(x,1) == size(savedCLEref,1) thisCLE=savedCLEref; else thisCLE=CLEref; end % E = D * sparse(x); % ...
doEmbryo = 0; doGut = 0; doTouching = 1; if doEmbryo X = imread('../data/embryo.png'); X = imresize(X,0.5); elseif doGut X = imread('../data/gut.png'); X = imresize(X,0.5); X = mean(X,3); %X = histeq(X); elseif doTouching imgName = '../data/touchingEmb/touching2'; X = imread([imgName,'.jpg']); X =...
function Y = y_AM_inc(alpha_out,s_c) alpha_2prime_t = 90 - alpha_out; C_t = 0.08*((alpha_2prime_t/30)^2-1); n_AM_t = 1+alpha_2prime_t/30; if alpha_2prime_t > 27 A_t = 0.025 + (27 - alpha_2prime_t) / 3085; else A_t = 0.025 + (27 - alpha_2prime_t) / 5...
function [Z] = myProcrustes(X,Y) %MYPROCRUSTES Function that stretches or contracts the input points set to fit the reference points set. % Input % X - Input points set % Y - Reference soints set % % Output % Z - Fitted points set %% Function starts here figure, subplot(2,2,1), plot(X(:,1),X(:,...
load('muab.mat'); red_wavelength = 600; %%INSERT_RED_WAVELENGTH (unit nm) green_wavelength = 515; %%INSERT_GREEN_WAVELENGTH (unit nm) blue_wavelength = 460; %%INSERT_BLUE_WAVELENGTH (unit nm) wavelengths = [red_wavelength, green_wavelength, blue_wavelength]; mua_blood_oxy = @(x) interp1(muabo(:,1), muabo(:,2), x);...
clear all ; close all subs = {'alex','dina','genevieve','jeremie','karl','russell','valerie'} ; prefix='1hz_' ; for sb=1:length(subs) ; cd(['c:/shared/badger_eeg/',subs{sb}]) ; ls gammas=dir([prefix,'preproc*gamma*set']) ; figure, for g=1:2 clear stims cd(['c:/shared/b...
%% Setting Path for vEMGP fprintf(['\n-----------------------------------------------\n']) fprintf(['Setting up paths for code-package vEMGP!\n']) addpath('~/Desktop/Matlab_Gatsby/Matlab/vEMGP/'); addpath('~/Desktop/Matlab_Gatsby/Matlab/vEMGP/Data_Transform/'); addpath('~/Desktop/Matlab_Gatsby/Matlab/vEMGP/Variational/...
%% Plots %% Section 1 figure(1); subplot(3,1,1) plot(theta, RyS); title('PSD Squarer'); xlabel('\theta'); subplot(3,1,2) plot(theta, RyH); title('PSD Half-wave rectifier'); xlabel('\theta'); subplot(3,1,3) plot(theta,RyA); title('PSD AM-SC modulator'); xlabel('\theta'); %% Section 2 % PSD Bartletts figure(2); ...
function [G6] = fix_graph_type_5_disconnection(G5,possible_edges_I_M_kinked) % this function appends the possible I-M edges to the existing graph edges % creating copy of graph G6=G5; % adding edges for i=1:numel(possible_edges_I_M_kinked(:,1)) disp(i) G6 = addedge(G6,possible_edges_I_M_kinked(i,1),...
function [idx] = idx_distance_metrics_clustering(scal_X, n_eigs, k, idx_0, iter_max, cent_crit, scal_crit, crit, manifold, DistParameter, varargin) % This function partitions the data into `k` clusters according to % distance from the low-dimensional manifold to the cluster centroids computed % with various distance me...
function [s, med ] = Calc_estadisticos(err0,t) % Cálculos estadisticos de las variables error. for i = t:1:length(err0) erms(i+1-t) = err0(i); end %% Variables Estadísticas med = sum(erms)/length(erms); %VALOR ERROR ...
function [CV,CF] = cylinder_mesh(R,N,varargin); % CYLINDER_MESH % %[CV,CQ] = cylinder_mesh(R,N); %[CV,CF] = cylinder_mesh(R,N,'ParameterName',ParameterValue, ...) % % Inputs: % R radius % N number of vertices around axs % Optional: % 'Quads' whether to output quads instead of triangles...
function bool = isfloateq(float1, float2, epsilon) %ISFLOATEQ (ps-utils): are two floating point numbers equal? % BOOL = ISFLOATEQ(FLOAT1, FLOAT2) % or BOOL = ISFLOATEQ(FLOAT1, FLOAT2, EPSILON) % returns 1 if arguments differ by less than epsilon % % EPSILON defaults to EPS*1e2, about 2.2e-14 for 8-byte doubles...
function getDataTable(searchDate) % Function to load the Data Table from a given experimental session, if it % exists dsgcDir = 'C:\Users\Mathew\Documents\MATLAB\Feller Lab\DSGC Recordings\'; searchDirName = sprintf('%s*',searchDate); %find directories that match input date oldDir = cd(dsgcDir); newDir = dir(searchDi...
function [ output_args ] = map3d( Frame,a1,a2 ) %map3d wyrysowanie zależności funkcji celu od 2 zmiennych % Detailed explanation goes here map2d=zeros(200,200); y=zeros(200); z=zeros(200); y=linspace(-1,1,200); z=linspace(84.2,86.2,200); for i=1:200 for j=1:200 point=[0,0,(j-100)*0.01,0,0,85.2+(i-100)*0.0...
function [trainPerf,valPerf,testPerf,trainN,valN,testN] = trainValTestPerfs(net,data,hints) % CALL KERNAL numMasks = 3; hints.Perfs_and_N = feval(hints.perfsKernel,... hints.Perfs_and_N,... % Output net,... data.X, data.Xi, data.Pc, data.Pd, ... data.Ac, ... % Temporary Storage data.T, data.EW, data.masks, ....
function enable_toolbox(name) local_toolbox_dir = ['./' name]; if exist(local_toolbox_dir,'dir'); rmdir(local_toolbox_dir,'s'); end mkdir(local_toolbox_dir); mkdir([local_toolbox_dir '/private']) addpath(local_toolbox_dir) % important to do this before copying matlabroot = '/Applications/MATLAB_R2018...
ff = fmdl; ff.fwd_model = fmdl; ff.jacobian_bkgnd.value = 1; ff.type = 'inv_model'; ff.RtR_prior = 'eidors_default'; ff.hyperparameter.value = 0.05; imgS = inv_solve_diff_GN_one_step(ff,v1,v2) elem = imgS.elem_data-min(imgS.elem_data); elem = elem/max(elem); elem = elem.*(max(abs(img_diff.elem_data))); el...
Ts = 0.002; Ns = 5000; Am = 1; NP = 0.001; R = 2; mr = 10; carrier_frequency = 700; for i=1:10, to=round(rand * 100); sim('model', Ts * Ns); sum(simout) end;
function annotationImport % kaya de barbaro june 2018 % video annotation data should include column headers . each row is an % annotation. the order of the columns does not matter but you may need to edit the code to % grab the correct columns. dataDir ='C:\Users\kdeba\Dropbox\Libraries\Documents\UT Austin\projects\M...
clear all; clc; format shortG; ttotal = 10; tmuestra = 0.05; var = 0.001; %conv = convolución num = conv(conv(conv([1 0.5], [1 0.7]),[1 -0.2]),[0 1]) denom = conv(conv(conv([1 0.2], [1 -0.6]),[1 0.4]),[1 -0.1]) tiempo = (0:tmuestra:ttotal)'; n = size(tiempo, 1); u(1:n, 1) = tiempo; u(1:floor(0.5*n), 2) = 0; u(f...
% ---------------------------------------------------------------------- % B-spline Lab is free software: you can redistribute it and/or modify it under the terms of the % GNU Lesser General Public License as published by the Free Software Foundation, either version 3 % of the License, or (at your option) any later ...
% Obtain the best LMS polynomial for fitting % The order of polynomial must be between 3 and 10 function LMS = bestPol(x,y) min = 10^8; min_ind = 2; for i=3:10 p = polyfit(x,y,i); LMS = polyval(p,x); dist = sqrt(sum((LMS-y).^2)); if (dist<min) min = dist; min_ind = i; end...
function distanceWithNoise = addGaussianNoise(distances,factor) if ~exist('factor','var') factor = 1; end [r,c] = size(distances); %% Save a file with noise, to make it the same for every run fullPath = mfilename('fullpath'); r1 = 10000; c1 = 10; fullPathFileName = createName(fullPath,r1,c1); if exist(fullPath,'di...
function weights = getTemporalWeights(imgs, temporalGradient, center, scale) %GETSPATIALWEIGHTS Computes spatial smoothness weights based on an input image or video % Input: % img - 4D img data [height x width x {1,3} x numFrames] % temporalGradient - Temporal gradient operator of size % ...
clear all; close all; global env; env.MFCCcompression = false; env.os = getenv('OS'); env.computeDTW = false; %% Voice command recognition %%{ global commands; addpath('lib'); %% READING AUDIO FILES (LABELED) load_data; env.mfccComprThreshold = 1; env.lpcN = 12; env.mfccN = 12; env.splitTrTe = 0.7; %% ENHANCING AUDIO...
% calculates the difference between Estimated (Z_bar) and measured (Z) % poses followed by normalization of the results % INPUT: % >measured noisy relative position of a stationary robot w.r.t a moving robot (Z) % >estimated relative postion of a stationary robot w.r.t a moving robot (Z_bar) % % OUTPUT % ...
% CSI 700: Newton method for minimum % J schott % 13 MAR 2011 function [currX] = newton(f, currX, vars, tol) J = jacobian(f); err = tol+1; i = 0; fprintf('solving system using newton''s method...\n'); %use newton to solve lagrange functions while ( err > tol ) i = i + 1; ...
% Input parameters: % data dataset; % shapeletSize u-shapelet length; % alphabetSize cardinality; % SAXshapeletLen dimensionality % Output parameters: % shapeletsHash hash map linking SAX representation of u-shapelet % candidates and time seri...
%generuje wykres funkcji figure(1); [x,y]=meshgrid(-8:0.1:8); z=sin(sqrt(x.^2+y.^2)); mesh(x,y,z);
function [labs,coords] = load_elocs(locname) % function [labs,coords] = load_elocs % load the electrode coordinate file output by the java program cd c:/shared/elocs ; fid = fopen(locname) ; icount = 1 ; while ~feof(fid) line = fgets(fid) ; split = strsplit(line,',') ; labs{icount} = split{1} ...
%versao2 %1) simbolos = ['a':'z', 'A' : 'Z']; files = {'pg21209.txt','pg26017.txt'}; pmf = pmfLetrasPT(files, simbolos); fCarga = 0.8; tamanho = 1000/fCarga; arr=zeros(1,tamanho); for x = 1: tamanho chave = chaveAleatoriaNormal(10, sqrt(5),pmf, simbolos); hash = string2hash(chave,tamanho)+1; arr(hash) = arr...
function sd = war_dls( x, td) %WAR_DLS - Dimensionless drawdown of Warren and Root (1963) solution % % Syntax: war_dls(x,t) % x(1) = sigma % x(2) = lamda % t = time % % Description: % Calculates the dimensionless drawdown % % References: % Warren, J. E., and P. J. Root (1963), The behaviour of naturally % ...
function varargout = MouseAnalysisTool(varargin) % MOUSEANALYSISTOOL MATLAB code for MouseAnalysisTool.fig % MOUSEANALYSISTOOL, by itself, creates a new MOUSEANALYSISTOOL or raises the existing % singleton*. % % H = MOUSEANALYSISTOOL returns the handle to a new MOUSEANALYSISTOOL or the handle to % t...
function [ h ] = heuristic( graphVector, idxX, idxGoal ) %HEURISTIC The heuristic function for the graph_search function, which is %just the euclidean distance between the two nodes with ideces idxX and %idxGoal. % graphVector is a graphVector structure as previously defined % idxX is the index of the first node % ...
function output = AnalyseBagFile(file) %ANALYSEBAGFILE Summary of this function goes here % Detailed explanation goes here bag = rosbag(file); start = bag.StartTime; topicselect = select(bag, 'Time', [start + 30 start + 60], 'Topic', '/odom'); ts = timeseries(topicselect, 'Pose.Pose.Position.X', 'Twist.Twist.Angular...
function [judgemtx]=rand_AHP(n,diff) judgemtx=ones(n); randIndex = randperm(n); for i=1:n for j=1:n if(i~=j) if((find(randIndex==j)-find(randIndex==i))>0) judgemtx(i,j)=rand_pos_or_neg()*abs((find(randIndex==j)-find(randIndex==i))/(n-1)*diff); ...
function [S,dv,U] = getxmlcue(fname) % % [S,dv,U] = getxmlcue(fname) % Extract the CUE sentence from a D3 xml file. % Returns S = [local_time,sample_number] for the first CUE % sentence found. local_time is in second of the day. % dv is the 6-element date vector. % U is the unix time numbe...
clear all; close all; load('wordsinput.mat'); load('testwordsinput.mat'); cat1num = 15; % # of exemplars for fruit category cat2num = 15; % # of exemplars for vegetable category % part A: MDS % use pdist function to compute cosine distances wordinput = [wordvec; testwordvec]; distvec = pdist(wordinput,...
function drawPartialPatch(u, v, z, varargin) %DRAWPARTIALPATCH Draw surface patch, with 2 parametrized surfaces. % % usage: % drawSurfPatch(u, v, zuv) % where u, v, and zuv are three matrices the same size, u and % corresponding to each parameter, and zuv being equal to a function of u % and v. % % ...
function nPMMA = PMMARefractiveIndexTemp(lambda, temperature) % nPMMA = PMMARefractiveIndexTemp(temperature, lambda) % % lambda is in microns % temperature is the temperature in C, between 20 and 100. Assumes pressure is sea level. % % Parameters and equation from Kasarova et al. Temperature dependence of refractive c...
%% TwoCarAnimation_handle = figure() sfh2 = subplot(2,2,3); plot(test_data_time-test_data_time(1),test_data_d_rel,'LineWidth',2,'Color',[0.9290, 0.6940, 0.1250]) hold on plot(t,d_rel,'-.','LineWidth',2) % plot(t_no_delay,d_rel_no_delay,'-.','LineWidth',2) xlabel('Time[s]','FontSize',30) ylabel('Relative position[m]'...
%% Codes to generate figure 5 in the document clear all % Parameter values nsim = 200; nVal = [50 100 200]; pVal = [2 5 10]; %% Compute numeric summaries for high noise hopt_MSEE_hn = zeros(length(nVal), length(pVal)); % Store best MSEE bandwidth indices for high noise MSEE_hn = zeros(nsim, length(nVal)*length(pV...
function decisionBoundariesDemo % Decision boundaries induced by a mixture of two or three 2D Gaussians % Based on code by Tommi Jaakkola % 2 class % linear decision boundary, with means on opposite sides figure; p1 = 0.5; p2 = 1-p1; mu1 = [1 1]'; mu2 = [-1 -1]'; S1 = eye(2); S2 = eye(2); plotgaussians2(p1, mu1, S1, ...
function [merged_assignment error] = merge_segments_secure(assignment, family) merged_assignment = []; error = 0; global debug_mode; [~, ~, error] = check_allsegments(assignment, family); if( error ~= 0 ) disp('error in global IBD'); return; end time = cputime; [merged_assignment error] = merge_segments(as...
function W_hk_c = calculate_W(A) options = []; options.NeighborMode = 'KNN'; options.k = 4; options.WeightMode = 'HeatKernel'; options.t = sqrt(10); A = A'; W_hk_c = full(constructW(A,options)); end
% im1 = imread('pics/01.bmp'); % im1 = imread('pics/02.bmp'); % im1 = imread('pics/03.bmp'); % im1 = imread('pics/04.bmp'); % im1 = imread('pics/05.bmp'); % im1 = imread('pics/06.bmp'); % im1 = imread('pics/07.bmp'); % im1 = imread('pics/08.bmp'); %color palmprint % im1 = imrea...
gca; %设置当前坐标轴用于绘制曲线 h = waitbar(0, '开始绘图...', 'WindowStyle', 'modal'); %创建置于屏幕前端的进度条,动态显示绘图进度 t = [0 : 0.01 : pi]; %数据的横坐标 try for i = 1 : 10 plot(t, sin(2 * pi * i * t)); %绘制数据曲线 waitbar(i / 10, h,...
function [A,B] = eje3b load("datos3a.mat") p = polyfit(x, x./y, 1) A = p(1); B = p(2); endfunction
function blkStruct = slblocks blkStruct.Name = sprintf('Model I/O and State Information'); blkStruct.OpenFcn = 'model_info'; blkStruct.MaskDisplay = 'disp(''Model I/O and State Information'')'; % Information for Simulink Library Browser Browser(1).Library = 'model_info'; Browser(1).Name = 'Model I/O and St...
close all N = 1000; T = 20; % [sec] t = (0:N-1)'/N*T; dt = T/N; a = [1 0.8]'; % amplitudes w = [1 2 ]'; % frecuencias f = zeros(N,1); for i=1:length(a) f = f + a(i)*sin(2*pi*w(i)*t); end r = 2.5*(rand(N,1)-0.5); fr = f + r; ax = [0 T/8 -1.5 1.5]; figure(1) clf subplot(2,2,1);plot(t,f),ylabel('f');axis(ax) subp...
function fLoop= getLoop() % returns loop constraints global W bigM zLoop ZLoop; % number of agents N = length(W); % number of states I = size(W{1},1); % time horizon h = size(W{1},2)-1; % Loop variables % zLoop(i)=1 where loop starts zLoop = binvar(h,1); % ZLoop(i)=1 for all i in loop ZLoop = zLoop; % ...
% Example 10.4 subroutine % from Parameter Estimation and Inverse Problems, 3rd edition, 2018 % by R. Aster, B. Borchers, C. Thurber % % [a,u,b]=bracket(@f) % % For a unimodal function f(alpha), finds a bracket [a,u,b] surrounding a % minimum of f(alpha), where f(a) >= f(u) and f(u) <= f(b). % function [a,u,b]=brack...
% Using no built-in function function v = sort3(a, b, c) if a <= b v = [a b]; else v = [b a]; end if c >= v(2) % a and b in v are ordered. Where to insert c? v = [v c]; % at the end elseif c <= v(1) v = [c v]; % at the beginning else ...
function [ UAttr ] = attractive_potential( xEval, potential ) %Determines the Attractive potential at a point xEval by the potential of %type 'potential' % xEval is a 2x1 vector with entries [x; y]. % potential is a struct following the definition in the homework. It has % fields xGoal (goal location), alpha (wei...
% Matlab + Arduino Serial Port communication % Autor: Mario Pérez Esteso - Geeky Theory % Blog: www.geekytheory.com % Facebook Page: www.facebook.com/geekytheory % Twitter: @geekytheory close all; clc; % AVI -------- %Configuración del gráfico plano = figure(); f1 = 2; f2 = 3; vocal = 'a'; h = plot(f2,f1,'rx','Lin...
function [diffe,mse] = errorResta(x,y) %ERRORRESTA % [e,em] = errorResta(x,y) % x: (in) Senal que se desea comparar % y: (in) Senal con la que se desea comparar x % diffe: (out) Error punto a punto, obtenido como la diferencia % mse: (out) Error cuadratico medio % % Calcula el error que ...
function opt = post_getopt(opt,tbl,vect,egv,param,ns) % opt = POST_GETOPT(tbl,vect,egv,ns) % % This function populates the optimal vectors % % % ------------------------------------------------------------------------- % ------------------------------- INPUTS ---------------------------------- % opt % tbl % vect % egv ...
function [angle1,angle2,all_angles] = find_min_dividing_angle_deg3(Y_nodes_idx,G3,XY3,s_node) % at any intersection, independent of degree, an edge makes two immediate % angles; these angles are the abutting angles which needs to be checked % for acute abutment or orthogonal abutment in the main script; they are % ...
function sb_callback(obj,event) global T sb; % while(sb.BytesAvailable>0) % q = fread(sb,5,'uint8')'; % T(end+1,:) = q; % end n = floor(sb.BytesAvailable/5); if(n>0) q = fread(sb,[5 n],'uint8'); T = [T; q']; end
%% Reference % [1] Peng, et al. "Active Transfer Learning.". in TCSVT'19. function [ A, P, obj ] = RMMD(X,Y,KXY,WXY,Part) [d, n1] = size(X); [~, n2] = size(Y); r = floor((3*d)/4) ; B1 = ones(n1,1); B2 = ones(n2,1); I = eye(n1,n1); P = eye( d, r ); r1 = Part.r1; r2 = Part.r2; A = zeros( n1, 1) ; V = ze...
%MAP_MCNN Translate .mat to point map. % % default parameters % img_path: 'UAVData/train_data/train_img' % gt_path: 'UAVData/train_data/ground_truth' % save_path: 'UAVData/train_data/train_gt' % scale: [-1, -1] represent for not resize, eg. [480, 640] is height % -> 480 and width...
function saveusergaps DirStart = pwd; if ispc cd \\Als-filer\physbase\hlc\SR\ID else cd /home/als/physbase/hlc/SR/ID end % ID_UserGap.sh FileName = mml2caput('ID', 'UserGap', getpv('ID', 'UserGap')); % ID_Setpoint_UserGap.sh (turn gap control off) FileName = mml2caput({'ID','ID'}, {'GapEnableControl', '...
clc; clear all; s=tf('s'); Gp = ((10)/(1.6*s+1))*(exp(-0.1*s)) Gp_simc = 0.8*(1+(1/(0.8*s))) Gp_coon = 1.4483*(1+(1/(0.2945*s))) step(Gp) margin(Gp*Gp_simc) % margin(Gp*Gp_coon)
function state_estimator_ukf close all; clear all; freq=10000;% in hertz keep it as high as possible - paper has done it on very slow moving robot T=60; data_T=200; ctrl_freq=400; offset_r=[0;0;0]; assumeFlatFloor=true; only_predict=false; %% get the data load('ground_truth.mat'); ctrl_state=load('ctrl_state.mat'); ct...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % REGRESS % Computes a linear regression. Uses generalized inverse if X'X is singular % Format % beta = regress(y,x); % Inputs % y nxm dependent variable(s) % x nxk independent variables (should include constant) % Output % beta kxm Regression slope estima...
function mask = SubtractDominantMotion(image1, image2) % input - image1 and image2 form the input image pair % output - mask is a binary image of the same size
% 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 y = step_sim(init_state, fs) % estimate the output in one step y2 = init_state(1); y1 = init_state(2); a1p = init_state(3); v1b = (y1 - y2)*fs; y = y1 + v1b/fs + a1p/fs^2; end
function d = obtain_procrustes(A,dims) AA = zeros(size(A,1),size(A,2)*size(A,3)); for i = 1:size(A,2) AA(:,(size(A,3)*(i-1)+1):(size(A,3)*i)) = squeeze(A(:,i,:)); end [AA_pca,~,~] = get_pca(AA,dims); [AA_isomap,~] = get_isomap(AA,dims); if strcmp(AA_isomap,'Not computed') disp('Error: isomap cannot co...
close all clear addpath('../../auxiliary') m =50; % weights weights = ones(m,1); % poles, in complex plane on circle of radius 1.5 rpoles_xi = 3; poles_xi = equiPointCircle([1:m-1]',rpoles_xi); rpoles_psi = 3; poles_psi = equiPointCircle([1:m-1]',rpoles_psi); % nodes on real line nodes = equiPointCircle([1:m].',...
function [GrdIdx, ObsIdx, UnkownIdx, GrdPts] = GroundSegmentationFunWithFixedHyp(pcData, GapThr, IS_SHOW) if nargin == 0 clc; close all; DataFolder = 'D:\Data\Sudoku\Record-2017-10-26-09-03-48(Match2016)\BinaryData'; nFrm = 655; DataDir = fullfile(DataFolder, sprintf('Binary%d.txt', nFrm)); pc...
function [scr_obj_dims] = objDimens(scr_width, scr_height, obj_width, obj_height) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here scr_widthVals = round(linspace(0,scr_width,9)); scr_heightVals = round(linspace(0,scr_height,9)); topLeft = [scr_widthVals(2) , scr_heightVals(2)]; topRigh...
%% Plot data from E4 clc clear all % task 1 % load the data file distData = importdata('distribution.data'); set(gcf,'renderer','painters','PaperPosition',[0 0 12 6]); Size = size(distData); %plot figure(1); clf subplot(2,2,1) hist(distData(:,1)); title('Uniform','fontsize',12); %plot subplot(2,2,2) hist(distData(:,2))...
clc close all clear all TS16GR4 = importfile16("E:\Studium\5,6-Ingenieurgeodaesie\Uebung\IngGeo-6-Semester-Uebung\14\matlab\TS16_GR4_mod.txt", [1, Inf]); TS30GR4 = importfile30("E:\Studium\5,6-Ingenieurgeodaesie\Uebung\IngGeo-6-Semester-Uebung\14\matlab\TS30_GR4_mod.txt", [1, Inf]); R = 6378137; z1 = zeros(10,1); z1...
function positions = InitializePositions(numberOfParticles, xMin, xMax) numberOfDimensions = 2; positions = zeros(numberOfParticles, numberOfDimensions); for i = 1:numberOfParticles for j = 1:numberOfDimensions r = rand; positions(i,j) = xMin + r*(xMax-xMin); en...
clear all; close all; clc I = imread('gDSC04422m16.png'); subplot (2,2,1) imshow(I) subplot (2,2,2) imhist(I) G=histeq(I,256) subplot (2,2,3) imshow(G) subplot (2,2,4) imhist(G)
% AM.m suppressed carrier AM with freq and phase offset pkg load signal time=0.6; Ts=1/10000; % sampling interval & time t=Ts:Ts:time; lent=length(t); % define a time vector fm=20; fc=1000; c=cos(2*pi*fc*t); % carrier at freq fc w=5/lent*(1:lent)+cos(2*pi*fm*t); % create "message" v=c.*w; ...