text
stringlengths
8
6.12M
function printer = latexPrinter(result, f) %LATEXPRINTER Result bundle latex PRINTER. % Detailed explanation goes here if (nargin < 2) f = 1; end PRINTER_FACTORY = graph.printer.PrinterFactory; % Create a printer from custom run options. printer = PRINTER_FACTORY.newInstance('latex', result, f); %pri...
function [template, mask]=GenerateTemplate(filename) %filename='file1.jpg' %%function [t,m]=GenerateTemplate(filename) A=imread(filename); %if ndims(A)>2 % A=rgb2gray(A); %endif %v=70; %C=(A<=v); %figure, imshow(C); %% Segmentation Pupil=PupilBoundary(A); %Centroid and radius of the Pupil ...
% Anthony Ricciardi % Reads Nastran .pch file % % Inputs: % InString - string that is the .pch file name % % Outputs: % response - [ngrid x ndofs x ncases] % frequencies [nmodes x 1] function [response,frequencies,ev] = punchRead(InFile) % InFile = 'l_static'; fid = fopen(strcat(InFile,'.pch'),'r'); %...
function [curves_in_group, from_row, to_row] = parse_group_file(groups_array, first_crv, last_crv) group_rows = length(groups_array(:,1)); group_cols = length(groups_array(1,:)); groups_array(:, group_cols+1) = {-1}; curves_in_group = []; %% make an array with a...
function [predict, coefs] = LI(Xtrain,Ytrain,Xtest,~) F=scatteredInterpolant(Xtrain(:,1),Xtrain(:,2),Xtrain(:,3),Ytrain,'linear'); predict=F(Xtest(:,1),Xtest(:,2),Xtest(:,3)); coefs=[];
clear all; k0=MyConst.k0*MyConst.ab; kk=k0*[1 0 0; -1 0 0; 0 1 0; 0 -1 0; 0 0 1; 0 0 -1]; pot_for_ff(kk(1,:), kk(1,:),'1'); pot_for_ff(kk(2,:), kk(2,:),'2'); pot_for_ff(kk(3,:), kk(3,:),'3');
function [ret] = mala(a,b,c) aux = sqrt(b^2-4*a*c); f = (-b - aux)/(2*a); g = (-b + aux)/(2*a); ret = [f,g] end
duct = DuctNetwork(); duct.AddParameter({'Density(kg/m^3)','Roughness(mm)','Kinematic Viscosity(m^2/s)'},[1.204,9e-5,15.11e-6]); duct.AddBranch(0,1); duct.AddFitting(1,'CircularDarcyWeisbach',[4.6,0.3]);%duct1 duct.AddFitting(1,'ED1_3',[0.3,0.06]);%1 duct.AddFitting(1,'CD9_1',[0.3,0.3,0]);%2 damper 1 duct.AddBranch(0,1...
path = '\\134.130.86.237\projekt\vulnusMON\201802_Bochum\aufnahmen'; addpath(path); irt_img = 'IRT_19_l'; rgb_img = 'RGB_19_l'; irt_img_bmp = imread(strcat(path,'\',irt_img,'.bmp')); % get 2D matrix (irt_img) containing temperature values for each pixel in °C irt_img = dir(strcat(path,'\',irt_img,'*.asc'));...
function output = updatae_select_molecules(handles) %sorted_data = handles.proc_data; select_mol = get(handles.uitable2,'Data'); select_spec = get(handles.uitable3,'Data'); % Only Sort For Selected Molecules %temp = cellfun(@(x) x(x==true), select_spec(:,1)); select_spec = [cell2mat(select_spec(:,1)) cellfu...
clear all; inFilevio = importdata('/home/jixingwu/vins_output/agz/vio.csv'); [rows_vio,cols_vio] = size(inFilevio); % outFile = zeros(rows_vio, cols_vio-3); outFile = inFilevio(:,1:cols_vio-3); writematrix(outFile, 'Agz_vio.txt', 'Delimiter', ' ');
function [equivalenceClasses, objectClassLabels, notInvolvedNodes] = ... findConnectedComponents(sparseAdjMatrixOrEdgeList, keepOnlyAboveSize1, keepOnlyConnectedNodes, nrNodes) % Finds connected components in undirected graph %INPUT: % sparseAdjMatrixOrEdgeList: % either sparse adjanceny matrix (should be sym...
% Graphs GKK Wealth Tax % Sergio Ocampo Diaz javaaddpath('jxl.jar'); javaaddpath('MXL.jar'); import mymxl.*; import jxl.*; %% Parameters % Grids n_a = 201 ; n_z = 7 ; n_l = 5 ; n_e = 5 ; Max_Age = 81 ; Ret_Age = 45 ; % Utility and technology sigma = 4.00 ; gamm...
function directed_planning(i) global robot direction zone task dist_to_zone = [-(robot(i).path(1,1) - zone(robot(i).target_zone(1), robot(i).target_zone(2)).corner(1)),... % up edge robot(i).path(1,1) - zone(robot(i).target_zone(1), robot(i).target_zone(2)).corner(3),... % down -(robot(i).path(1,2) - zone(robo...
clear rng(941); %%% construct data n1 = 20; n2 = 30; n3 =40; sz = [n1,n2,n3]; nd = length(sz); ntotal = prod(sz); r = 2; % rank [U,~,~] = svd(randn(n1)); U = U(:, 1:r); [V,~,~] = svd(randn(n2)); V = V(:, 1:r); [W,~,~] = svd(randn(n3)); W = W(:, 1:r); comp1 = kolda3(1, U(:,1), V(:,1), W(:,1)); comp2 = kolda3(1, U(:...
function E = edges(F) % EDGES Compute the unique undireced edges of a simplicial complex % % E = edges(F) % % Input: % F #F x simplex-size matrix of indices of simplex corners % Output: % E edges in sorted order, direction of each is also sorted % % Example: % % get unique undirected edges ...
% Temperature for i=2:length(Int) T_raw(i) = 1/(1/T_raw(1)- k*a1{1,i}/q); T_plus_raw(i)=1/(1/T_raw(1)- k*a1_plus{1,i}/q); T_min_raw(i)=1/(1/T_raw(1)- k*a1_min{1,i}/q); delta_T_interval_raw(i)=max(abs(T_plus_raw(i)-T_raw(i)),abs(T_raw(i)-T_min_raw(i))); delta_T_slope_raw(i)=T_raw(i)^2*sqrt((del...
%@(#) cycall.m 1.3 95/03/29 08:19:26 % function cycall(num) hmat=get(gcf,'userdata'); hvec=hmat(1,:); ll=length(hvec); for i=1:ll-2 set(hvec(i),'value',0) end set(hvec(num),'value',1)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Lab 3: The geometry of two views % (application: photo-sequencing) addpath('sift'); % ToDo: change 'sift' to the correct path where you have the sift functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%...
traindataFM = csvread('../data/trainFM4.csv'); valdataFM = csvread('../data/valFM4.csv'); testdataFM = csvread('../data/testFM4.csv'); m = length(traindataFM); C = 2; theta1 = linspace(0, 100, 11); theta2 = linspace(0, 100, 11); theta3 = linspace(-50, 50, 11); [T1, T2, T3] = ndgrid(theta1, theta2, theta3); evalFunc = ...
clear all; clf; wb y=data(:,3:4); u=data(:,5); dat=iddata(y,u,5); %plot(dat) na=[2 2; 2 2]; % na=[1 2; 0 2]; na=[3 3; 3 3]; nb=[1;1]; k=[1; 1]; ns=[na nb k]; th=arx(dat,ns); present(th)
function res = parallelPlane(plane, point) %PARALLELPLANE Parallel to a plane through a point or at a given distance. % % PL2 = parallelPlane(PL, PT) % Constructs the plane parallel to plane PL and containing the point PT. % % PL2 = parallelPlane(PL, D) % Constructs the plane parallel to plane PL, and lo...
function [roiInd] = getROI(params) % Outputs the ROI indices specifed by `params` inputs % % Usage: % [roiInd] = getROI(params) % % Required: % params.sessionDir = '/path/to/session/directory' % % Defaults: % params.runNum = 1; % first bold directory % params.roiType = 'V1'; ...
function data_trl = AMPX_to_FT_trial_split(cfg_in,evts_in, data_remap_FT) %% AMPX_trial_split_data: converts the iv times for the gamma events to % data trials in the FieldTrip format % % Inputs: % - data_remap [struct]: data in the FT format after the channels % have been remapped. % - evts_in [struct]: ...
function colorize_documentbar(varargin) %% COLORIZE_DOCUMENTBAR Colorize the document bar of the Matlab editor % The file names in the document bar of the Matlab editor are colorized % according to the folders they are stored in. % The colors are chosen to allow maximal distinct. % % Different modes can be sele...
function data=DMSPdatafetchMAD(fileNameStr1,fileNameStr2,fileNameStr3) %% DMSPdatafetch.m DMSP data fetching from MADRIGAL hdf5 file %-------------------------------------------------------------------------- % Input %------ % fileNameStr1 - Name of first hdf5 file of DMSP, sampling frequency of 1 % ...
function N = get_N_dot(sigma,sigma_dot) % Get the time derivative of N matrix for the given MRP % Return N_dot N = -2*sigma_dot'*sigma*eye(3)+2*tilde(sigma_dot)+4*(sigma_dot*sigma'); end
function [error] = Problem5_8_a(tol, figDisp, solver) % odesample.m % Sample code for solving a system of ODEs in matlab. % Solves v'' = v^2 + (v')^2 - v -1 with v(0)=1, v'(0)=0 % with true solution v(t) = cos(t). % Rewritten as a first order system. % From http://www.amath.washington.edu/~rjl/fdmbook/chap...
%@(#) ldptox7.m 1.1 00/11/23 10:09:04 % function ldptox7(refufile, asyid, x, y) if exist(refufile,'file') refu=load(refufile); pool=refu.poolfile; bocfile=refu.bocfile; [bocbuid,mminj]=readdist7(bocfile,'asyid'); [right,left]=knumhalf(mminj); sym=refu.symmetry; ...
function runMedianFilterOnPIVField(input_PIV_path, output_path, median_order) % runMedianFilterOnPIVField(input_PIV_path, output_path) % Runs a median filter on the PIV data located in input_PIV_path and % saves the data to output_path % % Parameters % ---------- % input_PIV_dir : path to directory containing ...
function [time, axindex] = get_time_choice_from_axes(fig, axes) %set(fig, 'Units', 'normalized'); cpnorm = get(fig, 'CurrentPoint'); %figdim = get(fig, 'Position'); %cpnorm = [cpfig(1)/figdim(3) cpfig(2)/figdim(4)]; axindex = 0; xmargin = 0.03;%figdim(3)/20; for i=1:length(axes) axbounds = get(axes(i), 'Po...
classdef (Hidden, Sealed) ReaderGraphVizPlain < graph.reader.Reader %READERMAT Reads a graph problem from a GraphViz plain format file. % This interface reads a GRAPH instance from a plain txt file % generated by GraphViz. % % See also: READER, GRAPH. %=========================...
% % Copyright 2019, Konstantinos A. Tsintotas % ktsintot@pme.duth.gr % % This file is part of HMM-BoTW framework for visual loop closure detection % % HMM-BoTW framework is free software: you can redistribute % it and/or modify it under the terms of the MIT License as % published by the corresponding authors. % %...
load('../data_tokamak/q_profile.mat'); load('../data_tokamak/flux_geometry.mat'); d_radial=0.01; radial_scale=0:d_radial:1; q_profile_radial=interp1(radial_r_value_flux,q_initial_profile,radial_scale); for(r=2:100) shear_profile(r)=(q_profile_radial(r+1)-q_profile_radial(r-1))/(2*d_radial); end shear_profile(1)...
function LV500_format = convert_to_LV500(filename, pattern_string, digital_data); [rows cols] = size(digital_data); count = 1; every_second = 1; if ~isstr(filename) error('FILENAME must be a string.'); end; mellanslag = -1; % Tillfallig struktur, skall goras mer allman senare... digital_data for i = 1:rows L...
classdef ArrayIndexClass < handle %ARRAYINDEXCLASS Summary of this class goes here % Detailed explanation goes here properties array; end methods function this = ArrayIndexClass(init, type) % % switch nargin ...
%Compares orbital elements from STK vs orekit. csv file is assumed to %contain data in the order of "Semi-major Axis (m)","Eccentricity","Inclination (deg)","RAAN (deg)","Arg of Perigee (deg)","Mean Anomaly (deg)" %assumes that the rows are taken at the same time during the simulation <<<<<<< HEAD path = 'C:\Users\SEAK...
function [Wx,Wy,MSE]=trainMLP(E,Ce,S,Ta,alfa,X,D,epocaMax,MSETarget) %E = Numero de entradas %Ce = Numero de camadas escondidas %S = Numero de saidas %Ta = Taxa de aprendizado %alfa = contante [p1 N] = size(X); bias = -1; X = [bias*ones(1,N) ; X]; %Wx e Wy são pesos inicializados com valores aleatorios %MSETemp a...
function [acc,lst,p] = kyu_LR_classify(data,b,RPratio) num_nodes = size(data,1); evidence = cell(1,num_nodes); outcome = data(num_nodes); for k = 1:num_nodes-1 evidence{k} = data(k); end evidence2 = cell2mat(evidence); eta = [evidence2 1] * b; mu = drxlr_invlogit(eta); p = [outcome; mu]; if mu<RPratio RP_predict ...
function varargout = DAQmxFunctionPool(varargin) switch varargin{1} case 'GetCounts' %[meanCounts, stdCOunts] = GetCounts(SamplingFreq,Samples); [varargout{1},varargout{2}] = GetCounts(varargin{2},varargin{3}); case 'WriteVoltage' %[varargout{1}] = WriteVoltage(Device,Voltage); ...
function [pairs triples_view error] ... = cut_chromosome(family_range, kinship, kinship2ex, ... family_genotype, viterbi, posterior, posteriorIBD1, oblist, parameters) error = 0; pairs = []; triples_view = []; time = cputime; [pairs, corrected_viterbi, error] = generate_consistent...
clear; close all; addpath('../matlab_lib'); % filename_list = { % 'PRO_1', 'PRO_2', 'PRO_3', 'PRO_4', 'PRO_5', ... % 'SUP_1', 'SUP_2', 'SUP_3', 'SUP_4', 'SUP_5', ... % 'FLX_1', 'FLX_2', 'FLX_3', 'FLX_4', 'FLX_5', ... % 'EXT_1', 'EXT_2', 'EXT_3', 'EXT_4', 'EXT_5', ... % 'PROSUP_1', 'PROSUP_2', 'PROS...
function objs = dedrift(objs, dispopt) % dedrift : drift correction for tracked objects % % Determines the mean x and y positions of objects in each frame % Median Deltax, Deltay characterize the drift, which is then subtracted % from the x and y positions for the output matrix. % Does not use a linear fitt...
%% ======================================================================== % score function (Multivariate Gaussian) % written by Dongjin Lee (dongjin-lee@uiowa.edu) %% ======================================================================== function [output]=scoreGauss(X, mu, cov) %Multivariate Gaussian score...
% Create diagram function Example figure(1) clf hold on x = [1:10]; plot(x, x + 0.0, 'b', 'LineWidth', 2, 'DisplayName', 'First') plot(x, x + 0.2, 'r', 'LineWidth', 2, 'DisplayName', 'First') plot(x, x + 0.4, 'g', 'LineWidth', 2, 'DisplayName', 'First') plot(x, x + 0.6, 'c', 'LineWidth', 2, 'DisplayName', ...
%% Neural Network using PCA+LDA reduced data % Clear workspace clear close all clc % Load PCA+LDA reduced data and labels. % Change 'PCA_and_LDA' to 'PCA' or 'LDA' to run with different data % reduction methodology of our dimensionality reduction in Step 2. load('Reduced_data_PCA_and_LDA.mat'); load('CW2Data.mat','tr...
% load 10-FMT results load fmtdata % load MovieLens 100K results % load mldata % for 10fmt, let cutf = 5000; for movielens, let cutf = 50000 % cutf is the number of the differences (N) fall into [-10^{-5},10^{-5}] selected for draw histogram. % note that, N is very large, and the number of other differen...
%hw1-1 %first number = 0.03 bit = [0 0 1 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 0 0 1 0 1 0 0 0 1 1 1 1]; ansnum = SngBinToNum(bit); num = 0.03; [ansbit] = NumToSngBin(num); fprintf(1,'The binary representation of %.6f is [',num); for i=1:32 fprintf(1,'%d',ansbit(i)); end fprintf(1,']\nThe decimal representation of [');...
global key InitKeyboard(); x = distance == brick.UltrasonicDist(2); while distance > 12 brick.MoveMotor ('AB', -50); distance = brick.UltrasonicDist(2); disp(distance); if distance < 12 brick.StopMotor('AB') brick.MoveMotor('B', -50) distance = brick.UltrasonicDist(2);...
%% Record data clear, clc, close all addpath('C:\Users\Joe\Dropbox\research\codes\f') Fs = 8e3; recObj = audiorecorder(Fs, 16, 2); disp('Start speaking.') recordblocking(recObj, 15); disp('End of Recording.'); % Play back the recording. play(recObj); % Store data in double-precision array. myRecording = getaudioda...
function [imdb, imdbName] = get_imdb(opts) if ~isempty(strfind(opts.modelType, 'fc')) || opts.imageSize <= 0 imdbName = sprintf('%s_fc7', opts.dataset); else imdbName = opts.dataset; end imdbFunc = str2func(['IMDB.' imdbName]); % complete imdbName imdbName = sprintf('%s_split%d', imdbName, opts.split); if opts...
function [ThermCapacity]= LJThermCapFunc(equilibrium_pos,Temp) global nPeriods cutoff=3; UnitLenght=15; xpos=equilibrium_pos(:,1:25); ypos=equilibrium_pos(:,26:50); V_t=[]; for Time=1:(nPeriods+1-49000) V_point=zeros(25,25); for j=1:25 for i=1:25 if j~=i if abs (x...
function new_image_ = resize_image(image_,new_size_) new_image_ = []; size_ = size(image_); if ndims(size_) < 3 size_ = [size_ 1]; end for z_ = 1:size_(3) new_image_(:,:,z_) = interpn(double(image_(:,:,z_)), ... 1+(0:new_size_(1)-1)'*512/n...
% Name: Main.m % Description: Run the trajectory extraction and classification algorithms % Authors:Meena AbdelMaseeh, Tsu-Wei Chen and Daniel Stashuk % Data: March 23, 2015 %% Prepare the work space clc; clearvars; close all; clear global Settings; %% Read the Settings global Settings; Settings = ExperimentFil...
%%%% % kNN tests with each data set. % Tests can be commented in and out. %%%% % SPIRALS 1 DATA SET TEST: load spiral1_train; load spiral1_test; [spiral1_plot_pts] = knn_k_test(30, inputs_train, target_train, inputs_test, target_test); % SPIRALS 2 DATA SET TEST: load spiral2_train; load spiral2_test; [spiral2_plot_p...
function result = cel1( kc ) %CEL1 Evaluates the complete Bulirsch's elliptic integral of the 1st kind % % inf % | | % | dt % cel1 = | ------------------------------ % | sqrt((1 + t^2)*(1 + kc^2*t^2)) % | | % 0 % % Result: % ...
function r=ksrmv(x,y,hx,z) % KSRMV Multivariate kernel smoothing regression % % r=ksrmv(x,y) returns the Gaussian kernel regression in structure r such that % r.f(r.x) = y(x) + e % The bandwidth and number of samples are also stored in r.h and r.n % respectively. % % r=ksrmv(x,y,h) performs the regression u...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % FDIR Research: Fault Detection Using an Extended Kalman Filter % MATLAB-GAZEBO Simulation % % ROS MASTER Configuration % - NODE1: GAZEBO % - NODE2: MATLAB % This simulation will generate an attack alarm by following steps. % - An EKF-bas...
A1=0.55; A2=0.126; A3=0.158; U1=6.5; U2=7.4; U3=9; A10=0.51; A20=0.106; A30=0.145; beta1=466; beta2=2866; beta3=2246; rho=1021; fprintf('%2.16f\n',1/sqrt(5.^3)) fprintf('%2.16f\n',5.^(-1.5)) tic parfor i=1:1000 data=NewtonRhapson(@(x) splitJunction(x,A1,U1,A2,U2,A3,U3,A10,A20,A30,beta1,beta2,be...
load mp.mat map = robotics.BinaryOccupancyGrid(40,40,1); for y=1:40 for x=1:40 setOccupancy(map, [x y], map2(y,x)) end end show(map);
function [OutputImage,OutputHist,InputHist]=HistMatch_11510714(InputImage,SpecHist) L=256; [M,N]=size(InputImage); % input hist InputHist=zeros(1,L); for m=1:M for n=1:N InputHist(InputImage(m,n)+1)=InputHist(InputImage(m,n)+1)+1; end end sk=zeros(1,L); for j=1:L sk(j)=round((L-1)*sum(InputHist(1:...
% 2nd-order Richardson extropolation for integral approximation % - use three results from trapzoidal to get the integral result with % higher accuracy. %input: % T1,T2,T3 - three results from trapzoidal %output: % result %--------------------------------------------------% R = zeros(3); R(1:3,1) = [T1 T2 T3]'; %--...
%% removeEdge % Method of the cellNetwork class to remove an edge %% %% Syntax % N = removeEdge(N,ne) % %% Description % Remove an edge from a cellNetwork object. % %% Inputs % * N - a cellNetwork object % * ne - a row vector containing the indices of the edges to be removed % %% Outputs % * N - a new cellNetwork o...
function H = TimNormLoo_RSAtoolboxMatrixEoutNanInfAllEv(RowData,SPM) % RowData: raw data from searchlight % this is the original Tim analysis with the area under the curve flagCal = 1; % take out Nan or inf: mRowData = mean(RowData); isNanOrInf = isnan(mRowData) + isinf(mRowData); RowData2 = RowData(:,isNanOrInf==0); %...
function [name]= testResult( tone ) tone_processed = tone(1:20:882000,1); BuffInDir = dir('Data/Process/*.mat'); BuffName = {BuffInDir.name}; resultCell = zeros(length(BuffName),1); parfor i = 1:length(BuffName) fileName = strcat('Data/Process/',BuffName{i}) y = ...
%% Using the m file %Do your work result=rand; %Now create an event telling you your work is done, reporting results and %sending you notices: gcaleventor('username@gmail.com', 'password', 'Finished task',... ['Results were: ' num2str(result)], 'my lab', true, true,0) %% Using the java class directly ...
function [xoptim,yoptim,exitflag]=heOptimise10sa%(xoptim)%(thresh2) %% load('NNs10.mat','NNs10') NNsector=NNs10; load('ddata10.mat','ddata10') %load('GAxoutR1schools.mat.mat','xoptim') %% hospThresh=[18057,1];%38172 53365 74966 82966 % 18057 28115 38172 53365 t0=-59.4613;%Re-fitted as single parameter %-4...
function [ rotVar ] = ErrorEstR3( sensorData, rotVec ) %OPTR Optimize translation based on inital guess %-------------------------------------------------------------------------- % Required Inputs: %-------------------------------------------------------------------------- % sensorData- nx1 cell containing sensor ...
function fnval = findif_var_fun(times,y,p,more) fnval = more.var.fn(times,y,p,more.more); end
tic; average1=0; average2=0; vec=5:5:100; for i=1:30 [T1,Time]=arrayfun( @(x) RGP(x, 1), vec,'un',0); average1=average1+cell2mat(Time); end; average1=average1/30 for i=1:30 [T1,Time]=arrayfun( @(x) RGP(x, 2), vec,'un',0); average2=average2+cell2mat(Time); end; average2=average2/30 x=5:0.1:100; y ...
% This is the demo script for the algorithm LDS proposed in [1]. % Reference: % [1] G. Doretto, A. Chiuso, Y. N. Wu, S. Soatto, Dynamic textures, % International Journal of Computer Vision 51 (2) (2003) 91-109. % Copy the mat file from "..\Experimental Results\2. Video for Test\" for % testing. clear;clc; % Setti...
function G = configuration_goodness(rbm_w, visible_state, hidden_state) % <rbm_w> is a matrix of size <number of hidden units> by <number of visible units> % <visible_state> is a binary matrix of size <number of visible units> by <number of configurations that we're handling in parallel>. % <hidden_state> is a binary m...
function ErrorCorrect(pathLR,pathT,pathAP,filenameLR,filenameT,filenameAP,fig,instructionText,statusText,txtMaxSpeed,txtMaxSpeedLR,txtMaxSpeedAP,txtRegurgitation,buttonNext, action, framerate) %read first image to select startpoint of regiongrowing %select approximite middlepoint of the ascending aorta ...
clc; clear all; close all; delete(instrfind) % Note: Please pair the BT with Windows before running this script: % Windows start button -> Bluetooth & other devices -> Enable Bluetooth and % pair with ESP32.. % % Troubleshooting https://se.mathworks.com/help/instrument/troubleshooting-bluetooth-interface.html %% Creat...
function varargout = C_ImagebProcessing(varargin) % C_IMAGEBPROCESSING MATLAB code for C_ImagebProcessing.fig % C_IMAGEBPROCESSING, by itself, creates a new C_IMAGEBPROCESSING or raises the existing % singleton*. % % H = C_IMAGEBPROCESSING returns the handle to a new C_IMAGEBPROCESSING or the handle to %...
function [newphi acc] = hyperUpdate(obj,lik_old,samps,sig,phi,drscale) newphi = phi; propstep = 0; acc = 0; priorfunc = str2func(obj{1}.VariableSettings.HyperSettings{1}); priorvals = num2cell(obj{1}.VariableSettings.HyperSettings{2}); trialphi = priorfunc(priorvals{:}); if length(...
function [pts] = findFeaturePoints(s1, varargin) defaultOpt.evecs = []; defaultOpt.evals = []; opt = parseOpt(defaultOpt, varargin{:}); if isempty(opt.evecs) || isempty(opt.evals) [opt.evecs opt.evals] = calcLaplacianBasis(s1, 100); end wks1 = calcWKS(opt.evecs, opt.evals, 100); nv = length(s1.X(:)); % 1-ring nei...
function mat = agg(d) % Hierarchical AGG aggregates the parts of a distributed matrix on % the leader processor using an extended binary tree. % HAGG(D) is a generalization of BAGG(D) when Np is NOT a power of two % This functions increments GLOBAL message TAG. % % HAGG(D) is renamed to be AGG(D) % ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% Count the number of keys to each portal %%%%%%%%%%%%%%%%%% % % Counting how many duplicated keys to each specific portal you have, no % matter where you put it (INVENTORY or CAPSULE or KEYLOCKER). % % Main procedure: % -...
function model = ibpmultigpMomentsCompute2(model) % IBPMULTIGPMOMENTSCOMPUTE % IBPMULTIGP if strcmp(model.sparsePriorType,'ibp') if ~model.asFinale % Compute moments for multinomials qki templateqki = zeros(model.nlf); for q=1:model.nlf temp = psi(model.tau2(1:q)) - cumsum(psi...
function symbolic7 syms t w x = heaviside(t+2) - heaviside(t-2); X = fourier(x,t,w); ezplot(X,[-2*pi,2*pi]), axis tight, grid on
function plotFFT(x) if mod(length(x),2) == 1 % x should have an even number of samples x = [x 0]; % if not, pad with a zero end N = length(x); X = fft(x); mag(1) = abs(X(1))/N; % DC component mag(N/2+1) = abs(X(N/2+1))/N; % Nyquist frequency component mag(2:...
clear all; clc ; % ccs directory ccs_dir = getenv('ScriptDir'); % analysis directory ana_dir = getenv('ADir'); % subjects list subs_list = getenv('SubjList'); % func dir name func_dir_name = getenv('FuncDir'); % func rest name rest_name = getenv('FuncName'); % group mask prefix gmask_prefix = 'group_surface'; % freesur...
function Px = px(x) Px = (3 - 2 * (x + 1) + (x + 1) * (x) * (x - 1));
function readarray=smap_read_array(id,offset,duration) %id is uuid %function returns most current reading %offset is how much time before now to start data read (in hours) %duration is duration of data read (in hours) %S4-16 room temp a71dc6d1-420d-56f9-9b02-f63a5d165fcc %Cory weather station ec2b82c2-aa68-50ad-8...
function [t_theo t_shell ft f1 f2 fa fr X N_bolts t_head A_actual pitch Bolt_circle_dia] = PED2(OpPressure,fmax,Di,J,Length,CA,head,Sf,rho,rhoflange,apex,h,m,Ya,N,fpermissible) Wp = (1.1)*OpPressure; %Design pressure is 1.1 times operating pressure% t = (Wp*Di)/((2*fmax*J)-Wp); t_theo = t; if(t<=4) %Minimum thickness o...
% Fig. 5.26 Feedback Control of Dynamic Systems, 5e % Franklin, Powell, Emami %script for Figure 5.26 n=[1 5.4]; d1=conv([1 1 0],[1 7 49]); d=conv(d1,[1 20]); pzmap(n,d) axis([-20 0 -7.5 7.5]) hold on r=roots([1 7 49]); plot(r,'*') title('Fig.5.26 Construction for placing a specific point') z=...
function [w,projc1,projc2] = lda(trainc1, trainc2) % This code implements 2 class LDA % Ref - Pattern Recognition Christopher M. Bishop % Input % trainc1 -class 1 train data in D X N Format % trainc2 -class 2 train data in D X N Format % N - NUmber of training samples % D - Feature Vector Dimen...
%----------------------------------------------------------------------- % Job configuration created by cfg_util (rev $Rev: 3599 $) %----------------------------------------------------------------------- clear all; close all; clcexit cd /Volumes/GT/PedMRI07202016/PreProcData2 n_img = 281; % number of images to be rea...
function Tmatrix = Matrix(gamut, whitePoint) % The program to compute % input 2*4 % [xr,xg,xb,wx;yr,yg,yb,wy] % Here wx and wy is the cooridnates x,y of the reference white point % [X;Y;Z] = Tmatrix*[R,G,B] % Here Y=1 of reference white % Here R,G,B are tristimulus values of three primaries % R,G,B in the specified g...
% ONE-DIMENSIONAL MLS APPROXIMATION clear all % PROBLEM DIFINITION l = 10.0; dx =0.5; % SET UP NODAL COORDINATES xi = [0.0 : dx : l]; nnodes = length(xi); % SET UP COORDINATES OF EVALUATION POINTS x = [0.0 : 0.05 : l]; npoints = length(x); % DETERMINE RADIUS OF SUPPORT OF EVERY NODE scale = 3; ...
function [Ireg,O_trans,Spacing,M,B,F] = image_registration(Imoving,Istatic,Options) % This function image_registration is the most easy way to register two % 2D or 3D images both affine and nonrigidly. % % Features: % - It can be used with images from different type of scans or modalities. % - It uses both a rigi...
function [W] = make_each_F35musc(bo, sigma2_a, sigma2_s, biased_sigma2_s, biased_input, lambda, dt, varargin) % June 2012: var_s scaled by magnitude of each click % July 2013, include biased_sigma2_s % The current code will have less noise for more depressed clicks or more "silenced" clicks. pairs = { ... 'net_in...
classdef road %ROAD class definiton for open drive road in matlab % contains the opendrive fromat with additional information % %---------------------------------------------------------------------- % BSD 3-Clause License % % Copyright (c) 2020, Jonas Wurst, Alberto Flores Fernánd...
clear; addpath(genpath('../..')); set(0,'defaulttextInterpreter','latex'); fig = figure('Name','Interpolazione f(x)', 'Color','white', 'NumberTitle','off'); fig.ToolBar = 'none'; f = @(x) x.*exp(-(x-1).^2); zval = linspace(0, 5, 100); xdata = chebyspace(0, 5, 10); ydata = f(xdata); spval = cubicspline(xdata, ydata, z...
function [R]=codd(H) %these function clear one by one array of a vector between stat and end %these function give array with odd indices q=1; for g=1:length(H) if even(g)==0 R(1,q)=H(1,g); q=q+1; end end
function status = Output2dArr(filename, Arr, formatSpec) % 2018-06-13 % ファイル出力 % filename :出力ファイル名 % Arr :配列 % formatSpec :フォーマット % https://jp.mathworks.com/help/matlab/ref/fprintf.html#btf98dm status = -1; % 異常終了 fileID = fopen(filename,'w'); if fileID == -1 return end fprintf(fileID, formatSpe...
function varargout = uifitpeaks(ax,varargin) %UIFITPEAKS Graphical/interactive version of fitpeaks % Takes all data in axes. User clicks to apply new guesses for peaks and % can modify existing guesses % Inputs (optional): % [Init]: Struct with initial peak guesses. Same format as FITPEAKS % retur...
function [f] = p10bar(y) % global panelty ; % x; % clc % Counter of number of run % load data.mat; % kkk = kkk+1; % save data.mat *kkk; format shortg % TLBO result % y=[]; y=round(y); Sec=[1.62 1.80 1.99 2.13 2.38 2.62 2.88 2.93 3.09 3.13 3.38 3.47 3.55 3.63... 3.84 3.87 3.88 4.18 4.22 4.49 4.5...
function [sigma0vvdB, sigma0hhdB, sigma0vvdBr, sigma0hhdBr] = Karam_Fung_GRG1988(thetaid) % Frequency (GHz) % % High frequency f = 9.6; er = 28.04 - 13.34j; % % Low frequency case % f = 1.5; % Frequency(GHz); % er = 28.52 - 2.13j; %% Vegetation volume backscattering for non-spherical particles % % Radar incidence ang...