text
stringlengths
8
6.12M
function [L_map, Le] = BCJR_Decoder_1(noise_x , noise_p1, La); global prt; alpha_0 = [1 0 0 0]'; % this is alpha_0 , the initialization betta_9 = [1 0 0 0]'; % this "9" correspnds to betta_8 in pdf file, the initialization % first, computer alpha, gamma, beta, for the BCJR decoder gamma = compute_gamma(prt.Co...
close all clear %Position tracking from video file = 'example.mp4'; %Read video file in vidObj =VideoReader(file); vidHeight = vidObj.Height; vidWidth = vidObj.Width; s = struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),'colormap',[]); %future edit: when wanting to do a whole video, use a 'while' loop - while %th...
classdef Files < hgsetget % FILES - A personalized class for storing and managing frequently used files. %% CHANGELOG % Written by Josh Grooms on 20141016 % 20141110: Changed the ColinBrain static property to refer instead to a permanently adjusted Colin Brain data % set, since this is what...
function Yteste = limiar(S, L, m) Yteste = linspace(0,0,m); for i = 1:m if (L < S(i)) Yteste(i) = 1; else Yteste(i) = -1; end end end
function sizeanalysis filename = 'C:\Users\Julia\work\data\150902\size5.rec'; channels = [3]; refchan = 16; for channo = channels chans = readTrodesFileChannels(filename,channo); refchannel = readTrodesFileChannels(filename,refchan); chans.channelData = chans.channelData-refchannel.channelData; da...
image_new = imread ('D:\Image\Training\1\download.jpg'); imshow(image_new); size(image_new) image_new(1:10,1:10) imshow(image_new); image_red= image_new; image_red(:,:,2)=0; image_red(:,:,3)=0; figure(1):imshow(image_red); image_green= image_new; image_green(:,:,1)=0; image_green(:,:,3)=0; ...
function [F_tow] = GetVects(lat,lon,F_fo_w,F_fr_w,F_fo_a,F_fr_a,F_cor,targ_lat,targ_lon,mode,P_max,v_mag) % Tow to next point Ride current/ now towing to next point % Ride current/ now towing to next point dsrd = [targ_lon - lon, targ_lat - lat]; F_rslt = (F_fo_w + F_fr_w + F_fo_a + F_fr_a + F_cor...
function aclEntry = parseAclEntry(entryString, varargin) % PARSEACLENTRY Parses an aclEntry from its POSIX string form % Parses an aclEntry from its POSIX string form. For example: % 'default:user:bob:r-x' % If the ACL string will be used to remove an existing ACL from a file or % folder, then the permission level does...
function zdot = Fp(z) %-------------------------------------------------------------------------- % Project: Hybrid Feedback Control book % Description: 1-DOF juggling system % https://hybrid.soe.ucsc.edu/software % http://hybridsimulator.wordpress.com/ % Filename: Fp.m %------------------------------------------------...
% putting things on the grayscale image close all; img = showimage('pics/bike_small_gray.jpg'); colormap('gray') hold on; % one of the two arrays should have identical values xvals = [350,350]; yvals = [300,450]; plot(0,147,'gx','linewidth',2,'markersize',12) plot(xvals, yvals, 'b', 'LineWidth', 2) ylist = yvals(1):yv...
function[out] = mqGlueWarping(k_images) cell_warping_errors = mq_opticalflow_test(k_images); cell_warping_weights = mq_assignWeightsWarpingErrors(cell_warping_errors); B = mq_normalizeWeightsWarpingErrors(cell_warping_weights); mqRefineWarpingError(B); end
for i = 1:9 for j = 1:9 x(i,j) = i * j; endfor endfor x
%% Test neural net performance %% Neural net script to use netname = 'myNeuralNetworkFunction_49010'; netscript = str2func(netname); singleWell = true; % %% Create x and t % % loadData = true; % runsPerFile = 50; % % if loadData == true % % % Load head data % timeToOpen = '2017-11-09 11:13:33'; % he...
function plotBehaviorSummary(beh,roomlength) outcomeval = [1 2 3]; figure; if nargin < 2 roomlength = 100;%(2nd cell is good trials) end x = -floor(roomlength/2):floor(roomlength/2)-1;%-25:24;% nlastexp = 4; if nargin < 2 outcomeval = 2;%(2nd cell is good trials) end for i = 1:4 for j = 1:5 h(i,j)...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % function [clusters, point2cluster] = cluster_single(p, maxdist) % purpose : cluster pointcloud to isolate objects %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % input...
%% TestNUFTspeed.m % % Testing the speed of several implementations of the matrix-vector % multiplications m = E*x, y = EH*m, and z = M*x, where E is a particular % non uniform discrete Fourier transform matrix, ET is its Hermitian transpose % and M = EH*E (with a specific implementation). % % Copyright, Matthieu Guerq...
path = 'E:\Data\CHBM\HeadModel_CHBM_0\anat\'; subjects = dir(path); compare = struct; for j=4:length(subjects) subject = subjects(j); subject_name = subject.name; disp(strcat("-->> ", subject.name)); cortex_8k = load(fullfile(subject.folder,subject.name,'tess_cortex_concat.mat')); cortex_32k...
function [] = ensembleModelandAccuracy(bestModels,data_test,xtest,ytest) % This function gets 4 inputs - All best models (Decision Tree, SVM, % Logistic Regression), the test set in a table, a double matrix of test % set predictors, a double vector of test set real labels (y). The function % has no output. % At...
function epochs_PSD = get_psd_as_epochs_fast(epochs,baselines,freq,channel_str) epochs_PSD = epochs; epochs_PSD.data = []; if nargin == 3 channelID = []; else channelID = find(ismember(epochs.label,channel_str) == 1); epochs_PSD.label = epochs.label(channelID); end iFreq = ismember(epochs.freq,freq); ...
% ADVISOR data file: ACC_CONV.m % % Data source: % % Data confirmation: % % Notes: % Defines standard accessory load data for use with an advanced conventional- % drivetrain vehicle in ADVISOR 2. % % Created on: 30-Jun-1998 % By: MRC, NREL, matthew_cuddy@nrel.gov % % Revision history at end of file. %%%%%%%%%%%%%%%%%...
% This is a function to simulate photobleaching events in GFP function n = bleach(N,t,tau) % Assume that the process is markovian, Poisson distributed. % n_0 is the initial number of flurophores % t is the time % tau is the timescale % RandStream.setDefaultStream ... % Create random seed: (RandStream('mt19937ar...
%% Paths % AT DTU % Data % addpath('C:\Users\s161286\Dropbox\Master thesis\Data\SampleData') % addpath('C:\Users\s161286\Dropbox\Master thesis\Data\Model1_data\Chb02') % addpath('C:\Users\s161286\Dropbox\Master thesis\Data\Model1_data\Chb04') % addpath('C:\Users\s161286\Dropbox\Master thesis\Data\Model1_data\Ch...
function [X, W, y, A, evs, error] = ELMCLR(X, c, d, k, r, islocal, num_hidden_neurons,alpha) % X: dim*num data matrix, each column is a data point % c: number of clusters % d: projected dimension % k: number of neighbors to determine the initial graph, and the parameter r if r<=0 % r: paremeter, which could be set bo a...
function [param,se,logL] = NEbinML(counts,cutoff) N = sum(counts); % number of observations K = length(counts); % number of categories if length(cutoff) ~= K+1 error('length of cutoff must be +1 of counts') end [param_lN,logL0] = normal_MLbin(counts,cutoff); % CHANGE. OLD VERSION: log(cutoff(2:end)) mu0...
clear all; N = 6; z_ZF = gen_data(N,N); r = ones(1,N);a=2;num_transmit = 3;num_stream_each_transmit = [2,2,2]; H = gen_transmit(N,r,a,num_stream_each_transmit, num_transmit); H_ZF = H_zero_forcing(H,num_transmit); H0F0 = H{1,1}; sum_y_interferance = zeros(N,N); for i = 2:num_transmit HjFj_Zj = H{1,i}*transp...
function [XC, XC2] = extract_features_2layer(X, D, D2, params, params2) % Wrapper for 2 layer feature extraction XC2 = zeros(size(X, 1), 5 * params2.nfeats); XC = zeros(size(X, 1), 14 * params.nfeats); % Break into chunks chunksize = 100; m = size(X, 1); numchunks = ceil(m ./ 100)...
function [ data ] = singlefile_treatment(fileNames) %singlefile_treatment Launch image analysis with single threading disp('Starting image treatment with a single thread...'); nImages=length(fileNames); data={}; %% check folder presence [folder_name,~,~]=fileparts(fileNames{1}); testdir...
classdef NdgQuadFreeWeakFormAdvSolver2d < NdgQuadFreeWeakFormSlver & ... NdgAbstractAdvSolver methods function obj = NdgQuadFreeWeakFormAdvSolver2d( phys ) obj = obj@NdgQuadFreeWeakFormSlver( phys ); obj = obj@NdgAbstractAdvSolver( phys ); end %>...
%CROSSMLS -- Performs MLS projection of each average point on all points in an array % INPUT: % G = {m x n} x N array of data points % h = {scalar} Gaussian parameter % % OUTPUT: % mls_CG = {m x n} array of projected points function mls_CG = crossMLS( Depth_map_set, h ) [m,n,N] = size(Depth_map_set); ...
function [k] = qopen(varargin) % % Create matlab structure for connection to KDB/Q server % port = 5000; host = 'localhost'; if nargin >= 1, port = varargin{1}; end if nargin >= 2, host = varargin{1}; port = varargin{2}; end hs = struct('host', host, 'port', port); % return query lamba...
function [ t_total ] = compute_t(distance,max_speed ) %UNTITLED Summary of this function goes here % Detailed explanation goes here a = 1.3; t = sqrt(distance/a); t_total = t*2; if t > max_speed/a d_acc_dec = a*max_speed^2; d_const = distance - d_acc_dec; t_const_speed = d_const...
imrows = size(Zpavimento, 1); imcols = size(Zpavimento, 2); [J, I] = meshgrid(1:imcols, 1:imrows); [xground,yground,zground] = mydepth2realworld(J,I,Zpavimento); %how many points for LMS regression samples = 16; i_rand = randperm(imrows); i_rand = i_rand(1:samples); j_rand = randperm(imcols); j_rand = j_rand(1:sample...
% fourier stuff for spatial frequency data % matlab doesn't do 0 so the f0 is ft(1) etc % take the fourier transform ft = fft(data); % find the f1 amplitude f1Amp = abs(ft(2))/length(ft)*2; % and the angle f1Ph = angle(ft(2)); f1PhDeg = f1Ph/pi*180; % find the f2 amplitude f2Amp = abs(ft(3))/length(ft)*2; f2PhDeg = ...
function lam = nualpha2lam(nu,alpha) %NUALPHA2LAM converts nu and alpha to unit lambda vector % % INPUT % nu n x 1 vector of Poisson ratios (unitless) % alpha n x 1 vector of angles between fault normal and slip vector, degrees % % OUTPUT % lam 3 x n set of normalized eigenvalue triples, sorted lam1 >...
function [c] = dicomHeader_read(c) % % NAME % % function [c] = dicomHeader_read(c) % % ARGUMENTS % INPUT % c class img2dcm class % % OPTIONAL % % DESCRIPTION % This method access the (ls) first file in c.mstr_dicomInputDir % and stores the meta-data. % % PRECONDITIONS % % o c.mstr_dicomInputDir must define a valid d...
% % projection onto active set % function px = Proj_B(x, lb, ub) ndim=length(x); px=zeros(ndim,1); %#ok<NASGU> px=max(lb, x); px=min(ub, px);
function [value, isTerminal, direction] = launchEvent(z,param) % [value, isTerminal, direction] = launchEvent(z,param) % % Triggers an event that tells ode45 to stop the simulation when the % catapult reaches the launch angle. % % INPUTS: % z = [q; dq] = state % q = arm angle, (rad) measured from pos. horiz. ax...
function global_scale(file, Nsd) % function global_scale(filename, Nsd) % % LHG 9/11/14 % % this function's job is to scale all the images in the time series so that % the mean value for the time series is 1000 inside a mask % % Nsd : number of standard deviations used for the mask threshold % the mask is made by thres...
function outputPv=pvRestHandle(inputPv, useRest, plotOpt) % pvRestHandle: Handle rest in PV for QBSH % Usage: outputPv=pvRestHandle(inputPv, useRest) % inputPv: input PV (pitch vector) % useRest: 0 ===> remove rests, 1 ===> replace a rest by its previous non-rest pitch % Roger Jang, 20040613 if nargin<1, selfdemo; ...
%Author: Alireza Taale %Date: FEB 2,2017 %Purpose: System identification HW1 %Input Excitation: given %UBC Electrical Engineering Department, Vancouver, Canada %Assignment #1 %File Path:C:\Users\Alireza\Google Drive\CourseWorks\Jan-2017\EECE-574\ %12Homework 1 - Due February 11, 2017 %File Name: ass01_a %**************...
function result = rectangle_filter1(vertical, horizontal) % function result = rectangle_filter1(vertical, horizontal) % % creates a rectangle filter of type 1 % (white on the left, black on the right). result = ones(vertical, 2 * horizontal); result(:, (horizontal+1):(2 * horizontal)) = -1;
function [T,a,rho] = getatmos(H) % 获取当地温度,声速,密度 % 温度 T = (288.15-0.0065*H) .* (H <= 11e3) + 216.65 .* (H>11e3 & H <= 20e3) + (216.65+0.001*(H-20000)) .* (H > 20e3); % 密度 Ta = 288.15; rhoa = 1.225; rhotemp = (rhoa*(216.65/Ta)^4.25588); rho = (rhoa * (T./Ta).^4.25588) .* (H <= 11e3) + ... (rhotemp * exp(-(H-11000)/63...
%% Script para el Analisis de Resultados % Imagen addpath('./tools'); addpath('../img'); folder='img'; image='lena.bmp'; file=fullfile(folder,image); img=imread(file); sizetmp=size(size(img)); if sizetmp(2)>2 img=rgb2gray(img); end imginfo=whos('img'); % Compresion con DWT param=[]; aux=[]; w='haar'; for n=1:8;%...
function equilrgb % Sample script equilrgb v1.33 % % This script uses flicker equiluminance to find % the equiluminance point between two colours. % % Usage:- equil global col colx boxx boxy numbox Mode255 FshCtDwn gpd % % Initial colour values are black and white % col = [0 0 0;1 1 1]; % % At this point 0 mouse boxe...
%1.1 %load dataset1 hw3dataset1 = readmatrix('hw3_dataset1.csv'); x1 = hw3dataset1(:,1:2); y1 = hw3dataset1(:,3); figure(1) %plot to visualize the dataset plot(x1(find(y1 == 1), 1), x1(find(y1 == 1), 2), 'ro','MarkerFaceColor', 'y') hold on; plot(x1(find(y1 == 0), 1), x1(find(y1 == 0), 2), 'rs', 'MarkerFaceColor', [1 ...
function [ nodes_struct ] = nodes_to_struct(Nodes) %[ nodes_struct ] = nodes_to_struct(Nodes) % %Convert cell array with the BST to struct data type %Inputs: % Nodes - a cell array with all the nodes from the BST % %Outputs: % nodes_struct - struct array with six fields: A b left_node % right...
function [R,S] = testreginv(Args,Threshold,movie_frame_numbers,moviename,center_point,screen_height,screen_width,y_off,x_off,frame_height,frame_width,num_frames); % Get the gabor function to be convolved with the movie gv=gaborphase(20,15,15,Args.NumPixels); sum_gv = sum(sum(gv.*gv)); if Args.Reps movie_fram...
function [success] = viewAcceptedRejectedCellExtraction(inputImages,inputSignals,valid,inputMovie,varargin) % Plots cell image, peak transients, and image from activity in movie for accepted and rejected cells, useful for publications. % Biafra Ahanonu % started: 2014.01.03 [19:13:01] % inputs % % outputs % ...
function Vec = LCTextWithSpaces2Int(str) % Vec = LCTextWithSpaces2Int(str) % Input: str = a string of lowercase text with spaces % Output: Vec = the vector of nonnegative integers in the range % (0, 1, ..., 25, 26) % under the standard correspondence: % 0 <-> a, 1 <-> b, ..., 25 <-> z, 26 <...
function intensity_noise %% Laser Intensity Noise Coupling for ii=0:1 % Set up Optickle parameters close all par = paramL1; if ii==1 par.mass = inf; end par = paramEligo_00(par); opt = optEligo(par); opt = probesEligo_00(opt, par); opt = addProbeOut(opt, 'AM DC', 'Mod2', 'out', 0, 0); % Frequency grid f = [0 log...
% import parameters function [alphacal,dirMATLAB,outform] = cmdin(filename) % The function will read settings file for the code % Input is text file with attribute and value pairs % Please use the demo for more information about the strcuture if(exist(filename,'file')~=2) error(sprintf('%s does not exist',...
% Build a random modular graph, given number of modules, and link density % INPUTs: number of nodes, number of modules, total link density, % and proportion of links within modules compared to links across % OUTPUTs: adjacency matrix, modules to which the nodes are assigned % GB, Last updated: October 19, 2009 ...
%% Run Starts the Pilot Plant program function Run() clc; PilotPlant.Config(4); global PP_RUNNING; if ~isempty(PP_RUNNING) && islogical(PP_RUNNING) && PP_RUNNING == true error("PilotPlant is either already running, or wasn't shut down properly. Quit Matlab and try again."); end...
function [] = txminer_plot_gmm_fit(X,model,freqrange,minhold,maxhold,fStart,fEnd) %UNTITLED7 Summary of this function goes here % Detailed explanation goes here xx=[min(X):1:max(X)]; %% Plot GMM.fit figure(1); clf('reset'); hold on; box on; set(gca, 'LineWidth', 2, 'FontSize',30);%, 'Position', [.1 .1 3 5]);%,'PlotB...
function [ output ] = pearson_correlation( data,nof ) [m,n]=size(data); data(isnan(data))=0; data=[1:n;data]; m=m+1; crr=zeros(n,n); for i=1:n for j=i+1:n x=data(2:m,i); y=data(2:m,j); c=cov(x,y); c=c(1,2); t=sqrt(var(x)*var(y)); c=c/t; if isnan(...
function edge = edge_detect(img) klaplace=[0 -1 0; -1 4 -1; 0 -1 0]; % Laplacian filter kernel edge=conv2(img,klaplace); % convolve test img with end
function [ mesh ] = makeUniformMesh1d( N, xtick, Mx, bcType ) Nmesh = checkMeshNum( N, xtick, Mx ); [ Nv, vx, EToV, EToR, BCToV ] = makeMesh( Nmesh, Mx, xtick, bcType ); % meshLine = cell(Nmesh, 1); % for m = 1:Nmesh % stdcell = StdLine( N(m) ); % meshLine{m} = NdgMesh1d(stdcell, Nv, vx, Mx(m), EToV{m}, EToR{...
function [theta, J_history] = gradientDescent(X, y, theta, alpha, num_iters) m = length(y); J_history = zeros(num_iters, 1); for iter = 1:num_iters delta = (1/m)*sum(X.*repmat((X*theta-y),1,size(X,2))); theta = (theta' - (alpha*delta))'; J_history(iter)= computeCost(X,y, theta); end ...
rng(mean('hyperalignment')); colors = get_hyper_colors(); sub_ids = get_sub_ids_start_end(); % Carey: 1, ADR: 2; datas = {Q, adr_Q}; themes = {'Carey', 'ADR'}; %% Hyperalignment procedure for d_i = 1:length(datas) data = datas{d_i}; [actual_dists_mat{d_i}, id_dists_mat{d_i}, sf_dists_mat{d_i}] = predict_with_...
function [Yb, dYb_dTheta] = CombustionModel(theta, RunCond) %UNTITLED4 Summary of this function goes here % Yb [-] : Mass fraction of burnt gases % dYb_dTheta [CAD^-1] : Heat release rate deltaTheta = RunCond.CombDuration; % [CAD] Combustion angular duration thetaIgnition = RunCond.SparkAngle; % [CAD] SparkAng...
figure plot(t(2:end),diff(angPos)./dt) hold on; plot(t,gyro_angVel) title('Measured diff Difference'); figure plot(t(3:end),(angPos(3:end)-angPos(1:end-2))./(2*dt)) hold on; plot(t,gyro_angVel) title('Measured center Difference'); % figure % plot(t(2:end),diff(filtered_angPos)./dt,t,gyro_angVel); % title('Filtered ...
function cost = costfunction(y, H) [H,Ts,drone1_info, drone2_info] = drones_info; [mass,inertia_moment,arm_moment,gravitational_acceleration] = parameters; %% Unpacking drones % drone 1 id1_u1 = drone1_info(1,:); id1_u2 = drone1_info(2,:); id1_x = drone1_info(3,:); id1_z = drone1_info(4,:); id1_theta = drone1_info...
close all; clear all; clc; imu = rossubscriber('/drone/sensors/imu_grav', @imuhandler); gnss = rossubscriber('/drone/sensors/gps', @gnssHandler); %% Set static data tf = 300; global dt; dt = 0.01; % Gyro and Acc frequency %% matrices global C; C = [ 1 0 0 0 0 0 0 0 0 0; % 6x10 matrix that defines the parts of the ...
%======================================================================================== % average_connectivity.m % % This script takes the connectivity matrices resulting from % Create_Compiled_Values_Petersen.m (or Gordon) located at: % % ~/Nicco/NIQ/EXPANSION/Probtrack_Subject_Specific/Compiled_Values/{SubjectID...
function uci_test() load uci.csv; label=uci(:,5); uci=uci(:,2:4); [~,~,~,gama]=GMM_EM(7,uci);
function [data, models] = outreg2mat(filename, cols, headerlinesN) % % S. HSIANG % SMH2137@COLUMBIA.EDU % 11/10 % % ---------------------------- % % [coeffs, models] = outreg2mat(filename, cols, headerlinesN) % % ---------ARGUMENTS % filename - string filename [output from Stata's outreg2 command] % cols - number of m...
function elem = atshiftelem(elem,dx,dz) %ATSHIFTELEM set new displacement parameters %NEWELEM=ATSHIFTELEM(OLDELEM,DX,DZ) % %DX: horizontal element displacement %DZ: Vertical element displacement % %See also: attiltelem, atmodelem disp=[dx;0;dz;0;0;0]; elem.T1=-disp; elem.T2=disp; end
%Author: REDJAN F. SHABANI %Universita' degli studi di Roma "LA SAPIENZA" %Ingegneria Informatica - Intelligenza Artificiale %Version: Dec. 2009 %% %DATASETS GENRATION clc; clear; %Class 1 m1=[0;0];%means vector of distribution s1=[1;1];%standard deviations of distribution N1=450;%number of data [x1,y1]=gaussDistrib2(...
walklength=500; rlistx=rand(2,walklength); stepx=rlistx>0.5; stepx=(stepx*2)-1; walk=cumsum(stepx,2); plot(walk(1,:),walk(2,:)) axis equal,xlim([-50,50]),ylim([-50,50]); xlabel('x'),ylabel('y'); title('y vs x');
%% Add the approprate folders to the path %Path of the SOSpikingModel repository %repopath = '/Users/dlevenstein/Project Repos/SOSpikingModel'; %repopath = '/scratch/jmg1030/WeightAnalysis/Data/SOSpikingModel'; repopath = '/Users/jonathangornet/Documents/GitHub/SOSpikingModel'; %repopath = '/home/jmg1030/SOSpikingMod...
function [ns_RESULT, Data] = ... ns_GetAnalogDataBlock(hFile, EntityIDs, StartIndex, IndexCount, scaleFlag) % Usage: % [ns_RESULT, ns_RESULT] = NS_GETANALOGDATABLOCK(hFile, EntityIDs, % StartIndex, IndexCount, scaleFlag) % % Description: % Returns the data values associated with the Analog (continuious) data % f...
function B = ruidoB_caso3(x) % función encargada de calcular el campo B dado alambre infinito con una corriente de 60 A % a unda distancia de entre 2 m a 3 m del loop de calibración. %-------------------------------------------------------------------------- %---Parameters settings--- mu_0 = 4*pi*1e-7; % Permeabilida...
function [header,headersize] = ReadEnvHeader(fid) % [header,headersize] = ReadEnvHeader(fid) % Read the header from .env files [header,headersize] = ReadAIHeader(fid); if (header.type ~= 4) error('File is not .env type'); end header.versionEnv = fread(fid,1,'int16'); header.decimate = fread(fid,1,'int32');
function robj = roboop(conffile, robotname, T_f_base, T_EE_tool) % Syntax % % robj = roboop(conffile, robotname) % robj = roboop(conffile, robotname, T_f_base) % robj = roboop(conffile, robotname, T_f_base, T_EE_tool) % % Description % % Creates a RoboOp robot object from the robot parameters sp...
function Hd = lp5orbt(f,fc) %HD1 Returns a discrete-time filter object. % % M-File generated by MATLAB(R) 7.8 and the Signal Processing Toolbox 6.11. % % Generated on: 09-Feb-2012 06:39:19 % % Butterworth Lowpass filter designed using FDESIGN.LOWPASS. % All frequency values are in Hz. Fs = f; % Sampling Frequency N...
%close all; clearvars; % ******************** % Simulation settings % ******************** controller = 2; run_from_script = 0; plotting = 1; saveplotting = 0; start_time = '0'; end_time = '260'; solver_type = 'Fixed-step'; Ts = 0.1; % ******************** run('hev_parameters') run('hev_drivecycle') load('PWAM.mat...
function Z = feature_zcr(window) %ZCR window2 = zeros(size(window)); window2(2:end) = window(1:end-1); Z = (1/(2*length(window))) * sum(abs(sign(window) - sign(window2)));
function plot_hist(f_bl,f_br,type,chain,order) fin1=fopen(f_bl); fin2=fopen(f_br); % headers h=fgetl(fin1); fgetl(fin2); % load files data_bl=textscan(fin1,'%s%d%s%s%s%d'); data_br=textscan(fin2,'%s%d%s%s%s%d'); fclose(fin1); fclose(fin2); % extract data cdr3_bl=data_bl{5}; vals_bl=data_bl{2}; cdr3_br=data_br{5}; ...
% daqSessionSave.m saves out the full data file (initialized/created by % daqSessionClose.m) % updated 6/18/19 to include 2d ball treadmill data global session % our global variable to store everything if isfield(session.temp,'fulldata') %dlmwrite([session.dataFilename '_matrix.txt'],session.temp.fulldata,'delimi...
function [grades] = checkSubmittedExams(examInfo,ap) cd(ap.Submitted); if exist('checkSubmittedExam.mat','file') load('checkSubmittedExam.mat'); else %% Unzip Exams zfiles = dir('*.zip'); if isequal(length(zfiles),0) warning([newline mfilename ': ' newline 'No Zip-files found in submitted' newl...
function update_param_first (filename, target_param, edited_param) % replace line containing target_param with given edited_param string % % this is a shortcut calling find_str_after(line 0) and % update param % % Syntax : update_param_first (filename, target_param, % edited_param) % % Param : filename, st...
function y=con_leng(matr,len) %the least length of the stem a=length(matr); ind=find(matr==10); tmp_10=[]; %top for i=2*len-1:a tmp=ones(1,ceil(i/2))*((i-1)*a+1)-(0:(a-1):(ceil(i/2)-1)*(a-1)); tmp0=matr(tmp); tmp1=find(tmp0==10); tmp2=(tmp1(1:end-len+1)+len-1)-tmp1(len:end); tmp_10=[tmp_10,tm...
function save_struct_as_table(outname, S, varargin) opt.append = false; opt = parsevarargin(opt,varargin, 3); C = struct2cell(S); colnames = fieldnames(S); ncols = size(C,1); C = flatten(C,2:ndims(C)); for i = 1:numel(C) C{i} = C{i}(:); end if size(C,2) > 1 C2 = cell(ncols,1); for i = 1:ncols C2...
classdef (Abstract) PF_Fc < F_2D & iU_Compositional %PF_Fc Summary of this class goes here % Detailed explanation goes here properties t dWdp end methods function obj = PF_Fc(f) obj = obj@F_2D(f); end end end
function frames = read_frames(video_path) %READ_FRAMES Read the needed frames from a video % % Apr. 2015, Zexi Mao interval = 1; video = VideoReader(video_path); frame_nums = round(1 : video.FrameRate * interval : video.NumberOfFrames); frames = zeros(video.Height, video.Width, 3, length(frame_nums), 'uint8'); for i...
function [SpecLoudness, Cbn] = gene_mainLoudness2density(krn, Nbc, show) %%%%%%%%%%%%% % FUNCTION: % Calculation of loudness of impulsive sounds acording to Boullet's model % LMIS: Loudness Model for Impulsive Sounds % % USE: % [SpecLoudness, Cbn] = mainLoudness2density(krn, Nbc, show) % % INPUT: % ...
function G = evalDHMatrix(a, d, alph, thet); % Transl (d) along z + rot (thet) about z % Transl (a) along x + rot (alph) about x G = [ cos(thet), -sin(thet)*cos(alph), sin(thet)*sin(alph), cos(thet)*a sin(thet), cos(thet)*cos(alph), -cos(thet)*sin(alph), sin(thet)*a ...
function LoadInitialGuess(nlp, init_params) % load initial guess from previous result or simulated trajectory. % input can be the file name of the optimal gait or the structure of % exported data which should include the followings: % * tspan % * states % * params % * inputs ...
function lTable = traverse2(root, adjM, pts) parent = CList(); path = CQueue(); path.push(root); edgeCount = 0; while ~path.isempty() node = path.pop(); parent.pushtorear(node); children = find(adjM(node,:) == 1); for n = 1:length(children) if ~parent.contains(children(n)); ...
%********************************************************************************************** %**************************** CHAPTER 3: RIGID-BODY MOTIONS ********************************* %********************************************************************************************** function T = RpToTrans(R,p)...
% Erick Andres Obregon Fonseca % Analisis Numerico para Ingenieria % Segundo Examen Programado % Semestre II. 2019 % Pregunta 1 % Ejercicio c clear all; close all; % Funcion del ejercicio a function y = f(x) y = x^2*e^(x^2); endfunction % Funcion del ejercicio b function I = NC4(a, b) h = (b - a)/5; I = (5*h/...
function [ ] = erase_roc_results( folder ) dirs=listpath_dir(folder); for i=1:length(dirs) results_struct_folder=[folder '/' dirs{i} '/' 'results.mat']; load(results_struct_folder); for m=1:length(results_struct.metrics) if isfield(results_struct.metrics{m},'roc_all') results_struct.me...
function removeNoiseImage = removeNoise(I) NUM_NOISE_THRESHOLD = 0.05; NUM_NOISE_GRAD_THRESHOLD = 100; %Appy Sobel to extract edge hy = fspecial('sobel'); hx = hy'; Iy = imfilter(double(I), hy, 'replicate'); Ix = imfilter(double(I), hx, 'replicate'); gradmag = sqrt(Ix.^2 + Iy.^2); %figure, image(gradmag,[]), title('...
function [energy_total, time_total, distance_total] = ... compute_energy_time_and_distance_emodel_v2(E_model, E_angle_speed, E_rotate,... waypoints, angles, altitude, old) v_rotate = E_model.v_rotate; energy_total = 0; time_total = 0; ...
clc; close all; n=10; s=1; t=0:n-1; plot(t,s*t); xlabel('Time '); ylabel('Amplitude'); title('Ramp Signal');
%GHTP2NN_GT Graded Hard Thresholding Pursuit Non-Negative (with ground truth) % GHTP2NN_GT(y,A,gt) runs the Hard Thresholding Pursuit started with x0=0 and with % an increasing size of the support % Usage: [ x,S,NormRes,NbIter, Ss, NormRess ] = ghtpnn_gt( y, A, gt, x0, MaxNbIter, tolRes, verboseMode ) % y: column vec...
function y = cellMax(x) % % function y = cellMax(x) % % Compute the maximal of cell vector x % % Input - % x: NxM cell matrix % % Output - % y: scale number % % Example - % >> y = cellMax(x) %% Parameter check if ~iscell(x) error('Error! Cell input needed.') end %% Initialization [m, n] = size(x); y = zeros(m,n);...
function [ x ] = GEM( a,b ) clc; a b tic noofsol=no_of_sol(a,b); timevar1=toc; if (noofsol==1) tic ab=[a b] [m n]=size(ab); Ech_a=EchForm(ab); x=zeros(1,m) for s=m:-1:1 c=0; for k=2:m c=c+Ech_a(s,k)*x(k) end x(s)=(Ech_a(s,n)-c)/Ech_a(s,s) end x...
function alignXAxes( varargin ) % ALIGNXAXES % % Zoom in and out of a 2-D plot with multiple axes while keeping the % x-axes aligned. % % Syntax % % alignXAxes( 'SelectionType' ) % alignXAxes( 'SelectionType', figHandle ) % alignXAxes( 'SelectionType', figHandle, zoomFactor ) % @alignXAxes...
%% NN to arff for weka fid=fopen('xxxx.arff','w'); %epoch 300-450 load('nnfile.mat') dataCount = size(clipSignal,1); dataSize = size(clipSignal,2); fprintf(fid, '@relation xx\n\n'); for i=1:dataSize-1 in = sprintf('@attribute a%d numeric',i); fprintf(fid, '%s\n', in); end fprintf(fid, '@attribute class {0,1...