text stringlengths 8 6.12M |
|---|
%% Function for error calculation
% function called by main_opt_glob_options_v3
function err_total = GlobBA_v4_WithC_LoopClosure_JointOpt(parm, size_err, R_RGB_Tango, t_RGB_Tango, pix_Cord_Arr, Num3DPts, NViews_3D_Arr, Merge3DProps, switch_constraints, switch_var_size)%Merge3DProps
%% Init
err_total = ze... |
clear all;
close all;
figure;
f1 = gca;
% run result_avg_lyap_t1.m;
% index=1:1:size(lya_avg_delay(),1);
% plot(index,lya_avg_delay(:,1)','--r'); hold on;
% run result_avg_lyap_t2.m;
% index=1:1:size(lya_avg_delay(),1);
% plot(index,lya_avg_delay(:,1)','--b'); hold on;
%
run result_avg_lyap_t3.m;
index=1:1:size(lya_... |
function [struct_1, struct_0, struct_1_features, struct_0_features] = singleimage_process_with_label(brain, annotation, intensity_mean)
% Labeled data
% Extract Head Region
%%
if isempty(brain)
struct_1=[]; struct_0=[];
struct_1_features=[]; struct_0_features=[];
else
num_... |
function [ output_args ] = dataNormal( input_args )
%DATANORMAL Summary of this function goes here
% Detailed explanation goes here
end
|
%% BUS+SuS: Ex. 1 Ref. 1 - Parameter identification two-DOF shear building
%{
---------------------------------------------------------------------------
Created by:
Felipe Uribe (felipe.uribe@tum.de)
Engineering Risk Analysis Group
Technische Universitat Munchen
www.era.bgu.tum.de
---------------------------------... |
function [num] = trigger_DMM(COMdmm)
%trigger DMM this function returns a reading from the reference detector
% prepare_DMM must be executed before this
writeline(COMdmm, '*TRG')
end
|
function [ ImgFin ] = Traitement( ImgPreTrait, showSteps )
% * Fonction de traitement de l'image
% * Prend en argument l'image renvoyee par le pre-traitement et renvoie une
% * image ne contenant que les voitures
Marqueur = ImgPreTrait; % Marqueurs
s = strel('rectangle', [9,11]); % Element structurant
for k=1:1 % Para... |
clearvars
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%parameters to vary
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define all days, then remove those in the wrong part of the year
% Days = datenum(2002,1,242):1:datenum(2019,1,297);
DaysPerRun = 5;
Days = [datenum(2002,9,1):DaysPerRun:datenum(2019,12,31)];
[~,m,~] = datevec... |
%% SCENARIO ROBOTICS PSR KINEMATICS
syms B1L r12L r23L theta1L theta2L IBx IBy thetaB
syms B1R r12R r23R theta1R theta2R
addpath Utilities
% Link Vectors
r_IIrB = [IBx;IBy;0];
r_BBr1R = [0;-r12R;0];
r_11r2R = [r12R;0;0];
r_22r3R = [r12R;0;0];
r_BBr1L = [0;-r12L;0];
r_11r2L = [r12L;0;0];
r_22r3L = [r12... |
%mducng/SoC/D2/G2touch
% to check FFT power
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc;
clear;
close all;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Fs = 64;
dT = 1/Fs;
f1 = 10;
f2 = 10.2;... |
function [p_sd] = xform(p_poser,par,front,align);
% this function is the transformation from poser to sd/fast
%
% Input:
% p_poser........XYZ coordinates in the poser model
% par............Parameters of the transformation
% 1-3: translation
% 4: scaling
% ... |
%%
cen = flyTracks.centroid;
padding_sz = 15;
frame_rate = 15;
save_dir = 'D:\decathlon_data_and_analysis\decathlon_analysis\bout_movies\';
fh=figure;
fh.Color = [1 1 1];
ah1 = subplot(1,2,1);
ah2 = subplot(1,2,2);
hold(ah1,'on');
imh = imagesc(zeros(1,1),'Parent',ah1);
colormap('gray');
uistack(imh,'bottom');
lh1 ... |
% MATLAB Script
x = 1;
y = 2;
z = x + y;
disp(z)
% Test function
z = func(z);
disp(z)
% Test new function
for i = 1:10
z = func(z);
end
disp(z)
% End comment |
function [Par,StrROI] = TPA_PreviewROI(Par, ImStack, StrROI, FigNum)
% TPA_PreviewROI - show ROI data on image.
% Inputs:
% Par - different params for use
% Cmnd - command - what to do
% ImStack - nR x nC x nTime x nZstack image in the directory
% StrRoi - old ROI is exists
% Outputs:
% ... |
function [height, width] = glo_drawArrow(outwindow, direction, cords, size_arrow, color_it)
% Program Written by: Alec Mather
%
% This program draws an arrow on the screen at a specified location.
%
% Inputs:
%
% outwindow(int) == outwindow
% direction(string) == which direction... |
function args=fsc_initial(args)
args.Weight=lstm_setup(args.layer);
args.Mom.Weight=lstm_mom_setup(args.layer);
end |
clc; clear;
% load('incremental_image.mat');
A = imread("../dataset/colorchecker/1D/1_8D5U5524.tiff");
input_image = imresize(A,[1080 1920]);
%fid = fopen('test_image.txt','w');
fid = fopen('tt.txt','w');
[col, row, ~] = size(input_image);
for i=1:1
for j=1:row
inrgb = input_image(i,j,1);
if(inrgb... |
function [allpairs, events1_wo, events2_wo] = timevp_extract_pairs(filename1, filename2, timing_relation, savefilename, mapping, args)
NUM_DEFAULT = 150;
if ~exist('args', 'var') || isempty(args)
args = struct();
end
if ~isfield(args, 'files_numheaders')
args.files_numheaders = zeros(1, 2);
end
if ~isfield(... |
%addpath '..\matlab_bgl';
% in: nnAncient, numsAncient
% degree
disp('Calculate: Degree')
tic
degreeAncient=sum(nnAncient>0);
toc
% Betweenness centrality
% disp('Calculate: Betweenness Centrality')
% tic
% ss=sparse(nnAncient);
% [btwcEAncient,~]=betweenness_centrality(ss);
% btwcEAncient=btwcEAnci... |
function MUA_population_size_nolight
% SOM and PV
animalids = {'150331', '150401','150527','150529','150602','150603','150625','150825','150831','150902','150907','150909', '150915', '151023', '151027', '151109', '151110', '150629', '150730', '150731', '150804', '150818', '150820', '150823', '150824', '151104'};
bloc... |
function C = scan_clustering_coefficient(Whist,year)
frame = size(Whist,3);
N = size(Whist,1);
C = zeros(frame,1);
for t=1:frame
A = 1*(Whist(:,:,t)~=0);
active = sum(A)~=0;
[c C(t)] = get_clustering_coefficient(A(active,active));
end
plot(C);
title(strcat('Clustering coefficient for year:',num2str(... |
function [] = fanfan2(tt,ttt)
%FANFAN2 Summary of this function goes here
% Detailed explanation goes here
global deltaM1 INMatrix;
global INx INy
% INMatrix=ones(INx,INy);
% tempSum=mycon(INMatrix);MSum=abs(tempSum).^2;Norm_Sum=Norm(MSum);
% deltaM1 = sum(sum((Norm_Sum-Norm_AIM).^2/prod(size(Norm_Sum)))... |
% FN adapted from C:\Users\fnajafi\Documents\repoland\playgrounds\anne\optical\opticalStimLogisticRegress.m
%
% David Raposo
% Updated Sep 16, 2015
%
% Z = B0 + G * (rate(t) - boundary) + Bf * failure(t-1) + Bs * success(t-1)
%
% OUTPUT: B = [B0_aud, B0_mult, B0_vis, G_aud, G_mult, G_vis, Bs, Bf]
%
% "separate... |
function myhoughline(image,rho, theta)
x = -500:500;
y = (rho - x* cosd(theta) )/ sind(theta);
imshow(image)
title("Houghline on Original picture")
hold on;
plot(x,y,'r')
return
|
function [ dataset ] = Prepare( filepath,varargin )
%PREPARE Read Ripple data by Ripple neuroshare API, experimental data and prepare dataset
% Detailed explanation goes here
p = inputParser;
addRequired(p,'filepath');
addParameter(p,'datatype',{'Spike','LFP','Hi-Res','Stim','Analog30k','Analog1k','Digital'}); %'Raw... |
function ReviewInfo=Test_ReviewFunc(ReviewInfo)
MaskData=ReviewInfo.MaskData;
figure, plot(MaskData(:, 1), MaskData(:, 2), 'm');
ReviewInfo.Test=1; |
clear all;
load('F:\Documents\MATLAB\Data\Kyoto\training_data.mat');
%datanum = cell2mat(data');
%% preparing target labels
% train targets
train_labels = zeros(2,size(training_data,1))';
for i=1:size(training_data,1)
if training_data(i,size(training_data,2))==1
train_labels(i,1) = 1;
else
train... |
function g = gravity(h)
g0 = 9.80665;
g = (g0*(6371000/(6371000+h))^2);
end |
function [varargout] = OneMeasReal_2DMap_SubBkgrdMin_Y(Data, SweepVals,ParamNames,MainParam,MeasurementName,AX,IsPreview)
% plot function for data:
% OneMeasReal_2DMap_SubBkgrd_Y plots 3D spectrum data to a 2D map with color scale
% for the third dimension, subtract background((minimun value) along the y axes(... |
clear;
close all
set(0,'DefaultFigureWindowStyle','docked'); % makes figures dock into the same window
folderResults = 'C:\Users\bastien\Documents\internship\Data\recordingONOFF';
folderName = uigetdir(folderResults);
% Load parameters
ONOFF_test_params;
loadStateCodeStr = 'ONOFF_test_load_state_code';
saveProcess ... |
function [theta,y_hat_train,y_hat_test,cm,sens,spec] = logistic_regression(dataset,train_frac,thresh,metrics_flag)
% LOGISTIC_REGRESSION performs classification for a 2-class dependent
% variable using unconstrained optimization routine (fminunc)
%
% [theta,y_hat_train,y_hat_test,cm,sens,spec] = LOGISTIC_REGRESS... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Functia calculeaza valoarea polinoamelor %
% formate de matricea tridiagonala. %
% %
% %
% GEORGESCU ALEXANDU IONUT ... |
function [ CriticalPath, PathLen ] = FindCriticalPath( AEST, ALST, NodeCount)
%FindCriticalPath 给定任务DAG找到关键路径
%输入:
% - AEST: the average earliest start time
% - ALST: the average lastest start time
% - NodeCount: DAG图中节点数目
%输出:
% - CriticalPath: 按AEST递增排序的关键路径; [1,i]:节点i编号; [2,i]:节点i的AEST(关键路径的节点AEST=ALST)
% ... |
function [sim_data] = sim_HT(cfg_in)
% Last 2.4 second, dt = 50ms, or last 41 bins (after all choice points) for TC
cfg_def.w_len = 48;
% Number of neurons; set to different random number for each session if not specified.
cfg_def.n_units = 30;
cfg_def.sample_real_data = 0;
% Number of iteration... |
%% Run a single example for figures and little tests
%
%%
disp('**** EI Single Example')
nTrials = 1000;
nBasis = 40;
% Integration time
% Captures eye movements up to 100HZ
% Adequate for absorptions (ms)
tStep = 10;
% Scene FOV. Larger than usual to show the continuing pooling
sceneFOV = 0.4;
% Cone ... |
function [segmentInfo, templateModel, runningTemplateData] = segmentModifyZvcMethod_train(mansegLoadMode, observationNew, inputSegmentInfo, model, runningTemplateData)
% now, if the dataset is training, we can replace it with an
% semi-supervised method, but the 'testing' should remain
% consistent.
if ~isempty(observ... |
function result=GetTimeDomaimFeatureSet(csidata)
[m,n]=size(data);
D=[];
DA=[];
for i=1:1:m
d=data(i,:)
d=d(~isnan(d));%remove NAN
ave=mean(d);%mean
u=std(d);%std
time=length(d);%time
theta=var(d);%var
area=sum(abs(d));
maxv=max(d);
minv=min(d);
[dd,minp,maxp]=premnmx(d); %get ... |
function psi = psiIsoMap(layer, wavelengths, kx_t, n0)
epsilon = materialLibIso(layer{1},wavelengths).^2;
Ndir = size(kx_t, 2);
Nwl = length(wavelengths);
psi = zeros(4, 4, Ndir, Nwl);
% the vectorized code below is equivalent to this
for j = 1:Nwl
for k = 1:Ndir
q = sqrt(epsilon(j) - (n0(j) .* kx_t(1,k)... |
function [ x_locations, y_locations ] = find_colocation_points( ...
x_panels, y_panels, location )
%FIND_COLOCATION_POINTS_3QUARTER returns the location of the colocation
%points at the three-quarters panel point. For use with Lump Vortex.
% inputs:
% x_panels: array of ... |
A=[10 -7 0; -3 2 6; 5 -1 5];
b=[7;6;4];
det(A)
rank(A)
rank([A b])
lu(A)
% LU = PA.
|
function Q = loadNev_Generic(filename, varargin)
type = [];
version = [];
par.trialSegmentationInfo = [];
par.analogInfo = [];
par.eventInfo = [];
par.trialIdFn = [];
par.type = []; % gets assigned as .type to each element of Q
par.version = []; % gets assigned as .version to each element of Q
par.spikeWindowPre = 0;... |
clear all;
clc;
filename='PerspexModel.stl';
stlread(filename);
p = p(1:6:end,:);
scatter3(p(:,1),p(:,2),p(:,3),5,'k')
|
function [distanceBetweenCoordsInMeters] = GetDistanceFromLatLonInMeters(lat1,lon1,lat2,lon2)
EarthRadius = 6371;
DifferenceLat = DegreeToRadian(lat2-lat1);
DifferenceLon = DegreeToRadian(lon2-lon1);
hav = Haversine(DifferenceLat,DifferenceLon,lat1,lat2);
distanceBetweenCoordsInMeters = EarthRadius * hav * 1... |
function GWcalcNet = makeGrappaNet (kx, ky, kz, data, dim3, CalRadius)
% function GWcalcNet = makeGrappaNet (kx, ky, kz, data, dim3, CalRadius)
%
% first determine a ceter region for calibration assuming that this
% center region is well sampled.
%
% kx, ky, kz is the trajectory (cm*-1)
% data is the signal
% dim3 is n... |
function [ cData ] = createContextFeatures( data, noFramesAround )
%CREATECONTEXTFEATURES Summary of this function goes here
% Detailed explanation goes here
noFrames = size(data,1);
reducedData = compute_mapping(data,'PCA',1);
context = zeros(noFrames, 2*noFramesAround);
for i=1:noFrames
... |
function str = ASSIGN_arch_to_str(arch)
orbits = RBES_get_parameter('orbit_list');
norb = length(orbits);
rhs_nodes = cell(2^norb - 1,1);
for dec = 1:2^norb - 1
bi = de2bi(dec,norb);
rhs_nodes{dec} = StringArraytoStringWith(orbits(logical(bi)),'&');
end
str = StringArraytoStringWithSpaces(rhs_nodes(arch));
end |
%generate random variables as the TS stream and random it for energy
%dispersal
function [a,b,c,d,e,f,g,h] = sp_rd
%generate 188byte MUX packet
%define 1 sync-word byte
sync = [ 0,1,0,0,0,1,1,1 ];
dsync = [ 1,0,1,1,1,0,0,0 ];
a1 = randsrc(1,1516,[0,1]);
a = cat(2,dsync,a1);
b1 = randsrc(1,... |
fprintf('\n Wait simulation is in process. \n')
VF = 400; rF = 0.4; iF0 = VF/rF;
f = 60; w=2.*pi*f;
d = 0; d=d*pi/180;
t0 = 0 ; tfinal = 0.80;
i0 = [0; iF0; 0; 0; 0 ]; % Initial currents
%[t,i] = ode45('symshort',t0,tfinal,i0); % use for MATLAB 4
tspan = [t0, tfinal]; ... |
function filter(year1, setNo)
% Filter
%{
constructs a variable that contains indices for persons passing filter
Checked: 2015-07-01
%}
cS = const_cpsearn(setNo);
dbg = cS.dbg;
% This was created before progs are run
fltS = output_cpsearn.var_load(cS.vFilterSettings, [], setNo);
fltS.validate;
disp(' ');
fprintf(... |
% $Header: svn://.../trunk/AMIGO2R2016/Preprocessor/AMIGO_check_runident.m 923 2013-09-11 08:24:30Z evabalsa $
% AMIGO_check_runident: Checks that results folder has not been already
% used
%
%******************************************************************************
% AMIGO2: dynamic modeling, optimization and con... |
v1=[-1,0,2];
v2=[1,0,5];
v3=[0,1,4];
v4=[0,-1,3];
plot3(-1,0,2,'o','LineWidth',6);
hold on;
plot3(1,0,5,'o','LineWidth',6);
hold on;
plot3(0,1,4,'o','LineWidth',6);
hold on;
plot3(0,-1,3,'o','LineWidth',6);
hold on;
plot3([-1,1,0,0,-1],[0,0,1,-1,0],[2,5,4,3,2]);
hold on;
fill3([-1,1,0,0,-1],[0,0,1,-1,0],[2,5,4,3,2],'r... |
function newBadROIs = findBadROIs_strict(mouse, imagingFolder, mdfFileNumber);
% Redefine good ROIs out of ~badROIs01 using stricter thresholds for
% fitness and highlightCorr.
%
% Output: newBadROIs is of size sum(~badROIs01) x 1, and equals 1 for
% badROIs using stricter thresholds.
%
% Below for example includes sti... |
function reference_vector = SelectNormalREF_quad(EF_sides_SELEC,REF_VECT,coord_n_MACRO,smooth_dalpha_ELEM)
% FUNCION PARA DETERMINAR LA NORMAL AL TRACKING PATH
% **************************************************
%El REF_VECT sirve para obtener una dirección perpendicular a un plano formado por una cierta dirección s... |
function [sol] = hsvHistogram(path_to_image, count_bins)
% aici citesc imaginea
img = imread(path_to_image);
% initializez vectorul sol
% realizarea vectorului care cuprinde intervalele valorilor
% pixelilor pentru H (care ia valori intre 0 si 360)
t = linspace(0, 1.01, count_bins + 1);
% realizarea vecto... |
function init(obj)
% This method is called after the object is created.
% OBJ is the device object.
% End of function definition - DO NOT EDIT
% Extract the interface object.
interface = get(obj, 'Interface');
fclose(interface);
% Configure the buffer size to allow for waveform transfer.
set(interface, 'InputBufferS... |
%Sistemas de ecuaciones no lineales
%metodo de newton rapson 2x2
function [N,x,ea] = nr2x2
syms x1 x2
x0=input('Digite un vector fila con los valores iniciales de x0= ') %ecuación x0
tol=input('Tolerancia del sistema= ')
N=input('Numero maximo de iteraciones= ')
F(1)= input('Digite la ecuacion 1 =') %ecua... |
fs = 20000;
ones = zeros(40000,2);
for i = 1:10
sound = record_sound(2,fs,8,1);
[f,X,f_c,X_c] = dft(sound,fs);
ones(:,i) = X_c/norm(X_c);
end
HY = mean(ones,2);
one = figure();
plot(f_c,abs(HY));
axis([-2000 2000 0 .09]);
title('Average "ONE" signal');
saveas(one,sprintf('ONES.png'));
twos = zeros(4000... |
%% BME 790.01F13 Engineering Programming and Signal Processing
%% Homework 5 Kanishk Asthana ka112@duke.edu
%% Part 3
%% (b)
close all;
clear;
b= [ 0 0 0 0.04]
a=[1 15 50 0]
[r,p,k]=residue(b,a)
r
p
k
% Defining time vector for plotting result
dt=0.01;
t=0:dt:2;
cpt= 0.008-0.0016*exp(-5*t)+0.008*exp(-10*t);
plot(t,c... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% This script runs the stationary smoothness simulations
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% prepare workspace
clear all
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function [pf,J_pf_f,J_pf_p] = toframe2D(F,p)
T = [F(1);F(2)]; %coordenades punt
th = F(3); %angle
R = [cos(th) -sin(th); sin(th) cos(th)];
pf = R'*(p-T); %coordenades globals a coordenades locals
px = p(1);
py = p(2);
x = T(1);
y = T(2);
J_pf_f = [...
[ -cos(th), -sin(th), cos(th)*(py - y) - sin(th)*(px - x)]
[ ... |
function y = Model1psi(t, eta, sigma, c, tau)
y = (eta/sigma) * integral(...
@(x)(((t+x).^sigma - x.^sigma).*x.^(tau-sigma-1)), 0, c);
end |
% Test Cases:
[out1] = runeScape(charStruct1, itemStruct1);
[out1_soln] = runeScape_soln(charStruct1, itemStruct1);
% out1 => bob needs 29185661 more experience points to use the rune platebody.
%
[out2] = runeScape(charStruct2, itemStruct2);
[out2_soln] = runeScape_soln(charStruct2, itemStruct2);
% out2 => ~epicK... |
function out=check_balance(source_object,target_object,name,classes,target_labels,blocks_in,channels,time,W)
S=source_object;
T=target_object;
c1_rate=[];c2_rate=[];
b=-4:.1:4;
for bias=b
%tmp=S.apply_classifier( T,'name',name,'classes',classes,'target_labels',target_labels,'blocks_in',blocks_in,'channels',channels,'t... |
% Run CK+ native landmark data import and run svm
%% Get CK+ Landmark Data
frames = 3; % specify how many expressive frames to include (1 === peak expression only)
% for frames = 1:3 %loop through all frame options
fprintf("Expressive Frames: %d\n",frames)
data = ckFileNavigator(frames);
data = ckDataInit(data);
%%... |
function [bestCallToLong, bestPutToLong, bestCallToShort, bestPutToShort] = BestOptionToTrade(priceTable)
tickerNames = priceTable.Properties.RowNames;
CallIndexes = contains(tickerNames,'C');
PutIndexes = contains(tickerNames,'P');
[value_call_short,index] = max(priceTable.OverValuedDiff(CallIndexes));
if ~isempty(v... |
function [processors, tasks, entries, actProcs, requesters, providers] = parseXML_LQN(filename, verbose)
% PARSEXML_LQN parses an XML file containing an LQN model
%
% Parameters:
% filename: location of the XML file to parse
% verbose: 1 for screen output
%
% Output:
% processors: actual description of th... |
function p = fhpkg_cvpr06_full_params(q)
% P = fhpkg_cvpr06_full_params(Q) returns a parameter set defining the "full"
% model used in [Mutch & Lowe 2006]. Similar to fhpkg_cvpr06_base_params; see
% that function for more detail.
%
% See also: fhpkg_cvpr06_base_params.
%**********************************************... |
function this = build(this, opt)
% build Build or rebuild model object.
%
% Backend IRIS function.
% No help provided.
% -IRIS Macroeconomic Modeling Toolbox.
% -Copyright (c) 2007-2017 IRIS Solutions Team.
%--------------------------------------------------------------------------
this.Quantity = build(... |
%% run clustering test
p = size(data1, 2); q = size(data2, 2);
thre = 1e-3;
eval = [];
lda = [];
if ~exist('nolda')
% lda - init
disp('lda - init');
lda.s = s; lda.t = t; lda.eval = [];
[lda.P, lda.cluster1] = lda_exe(data1, lda.s, 1, 50/s);
[lda.Q, lda.cluster2] = lda_exe(data2, lda.t, 1, 50/t);
... |
function uav_loc = Emulate_UVA_Move_To_Target(uav_start, uav_end, uav_params, varargin)
% uav_start = [0;0;30;-pi/4];
% uav_end = [-50;-100;30;0];
% uav_params = model.uav_params;
%% ---Input Parser
Parser = inputParser;
%% ---Setup parsing schema
addParameter(Parser,'UseAcceleratio... |
function [tru1,tru2,u1,u2] = compute_trace_solutions(model,model_data,utilde1,utilde2)
mu=model.get_mu(model);
model.decomp_mode = 1;
[A,r] = model.operators(model,model_data);
model.decomp_mode = 2;
[Acoeff,rcoeff] = model.operators(model,model_data);
A1_diff = Acoeff{2}(1)*A{2}{1};
A1_adv = Acoeff{2}(3)*A{2}{3};
A... |
% testing for Rectangular Pulse
close all;clear ; clc;
Fs = 122880000/2;
t = 0:1/Fs:128/Fs;
x = -64/Fs:1/Fs:64/Fs;
Pulse = 8.1915e+03 *( Step(t+10) - Step(t-10) ) + 3.2768e+04;
hil_pulse = hilbert(Pulse);
in_pulse = Pulse .* cos(1919870 * 2 * 3.14 * t) + hil_pulse .* sin(1919870 * 2 * 3.14 * t);
qu_pulse = hil_pu... |
function reg = regFun(model, t)
lab1 = model.options.lab1;
pcurr = model.result.pcurr;
pprev = model.result.pprev;
pinit = model.result.pinit;
dt = t(end) - t(1);
if t(end) == 0
reg = zeros(1, length(pcurr));
else
reg = (pcurr - pprev) ./ pinit ./ dt * lab1;
end |
function output = mtimes(dcf,input)
% Multiply k-space data with DCF
dims=size(input);dims(4)=size(input,4);
W=repmat(dcf.w,[1 1 1 dims(4) 1]);
output=input.*W;
% END
end
|
function [LGstrain] = strain2D(xdisp,ydisp,mask,spc)
for tt = 1:size(xdisp,3)
fprintf(['Now Evaluating between Frames 1 & ',num2str(tt),' \r']);
for i = 1:size(xdisp,1)
for j = 1:size(xdisp,2)
imin = max([i-spc 1]);
jmin = max([j-spc 1]);
im... |
function Pos = GetqzPos(obj,qzval)
% This function calculates the position in pixel for a given q-z
% Parameters are:
% qzval : q-z value
%
% The function returns:
% ---
%
% Copyright & Questions: Laboratory of membrane and protein dynamics, McMaster University,
% Sebastian Himbert (himberts@mcmaster.ca)
... |
clc; clear all;
addpath('../spca', '../svd');
%ouput mat file for query results
QueryRSFile = './QueryRS.mat';
class_name = {'Normal',...
'Neoplastic Astrocyte','Neoplastic Oligodendrocyte',...
'Reactive Endothelial','Microglia','Mitotic Figure',...
'Reactive Astrocyte','Junk'};
%load query results for lo... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Handytec
%
% Ejemplo: Wave Equation (Visualizacion de resultados)
%
% Problema: dphi/dt = v dphi/dx
%
% Metodo: Finite Difference Method with second order central differences
% and Fourth Order Runge-Kutta Method, parallelized with MPI
%
... |
%gui_threshold_ripples
%% Select rat
prompt = {'Select a Rat ID'};
dlgtitle = 'Rat ID';
definput = {'26'};
RatID = inputdlg(prompt,dlgtitle,[1 40],definput);
RatID=str2num(RatID{1});
%% Find location
close all
dname=uigetdir([],'Select folder with Matlab data of trial');
cd(dname)
%%
answer_print = questdlg('Print pl... |
function [ ga ] = aggregateTimelocks (experiment, ~, force, forceGA)
SessionInfo = ph1valid00_setup;
SessionInfo.outDir = fullfile(SessionInfo.dataDir, 'processed', 'EMG_GrandAverages');
em = {'AN', 'HA'};
valid = {'val', 'inval'};
musc = {'cor', 'zyg'};
l = 1;
for i = 1:length(em)
for j = 1: length(valid)
... |
sigma =0.1000;
ki = 0.5000;
kp = 3.8720;
kd = 5.7216;
P = tf([.2],[1 0.1 .6])
C_pid = tf([(kd+kp*sigma),(kp+ki*sigma),ki],[sigma,1,0])
figure(1)
% bode(P)
% bode(series(P,C_pid))
bode(P*C_pid/(1+P*C_pid))
hold on
margin(series(P,C_pid))
% bode(tf([1],[1 0]))
legend('Plant','PID')
|
% Syntax
% [Value, err] = PS_GetStimPatternDuration(StimN, ChN)
% Description
% Gets duration of the whole stimulation pattern.
% StimN - stimulator number to query (starts from 1)
% ChN - channel number to query (starts from 1)
% Returns:
% Value - duration of the stimulation pattern in micro... |
function signal = correct_and_align_imgs(signal,dark)
net_offset = [0,0];
ctr = 0;
for im_idx = 1:numel(signal.fnames)
ctr = ctr + 1;
cli_header('Loading image %u',im_idx);
this_img = im2double(imread(fullfile(signal.dir.name,signal.fnames{im_idx})));
% that_img = im2doubl... |
function [ bp ] = beampatternAt( ux, r, ux_ref, r_ref, P, f_c )
%BEAMPATTERNAT Used for example for SLL and beamwidth.
% ux and r are scalar variables in this function.
c = physconst('Lightspeed'); %[m/s]
kappa = -2j*pi/c;
%% 1. Construct matrix
% Size of dense signal space (received signal at antenna)
N_f_c = le... |
function SVR_NFolds_ForSGE(Subjects_Data_Path, Subjects_Scores, Covariates, FoldQuantity, ResultantFolder)
%
% Subject_Data:
% m*n matrix
% m is the number of subjects
% n is the number of features
%
% Subject_Scores:
% the continuous variable to be predicted
%
% ResultantFolder:... |
function paths= localPaths()
% --- dependencies
% refer to README.md for the information on dependencies
workdir = pwd;
paths.libReljaMatlab= strcat(workdir,'/','relja_matlab/');
paths.libMatConvNet= strcat(workdir,'/','matconvnet/'); % should contain matlab/
% If you have instal... |
function [ elg ] = DRegion( z,it,f,vKp,f5SW,f6WA )
%DRegion D region parameters
%
% Subroutine DRegion(z,it,f,vKp,f5SW,f6WA,elg)
%-----------------------------------------------------------------------
% Reference: Danilov, Rodevich, and Smirnova, Adv. Space Res.
% 15, #2, 165, 1995.
%
% Input: z - so... |
clear;
betac = pi/20;
VelocityInToroidalCoordinates;
save('Velocity_b9_s2_p1.0.mat');
clear;
betac = pi/6;
VelocityInToroidalCoordinates;
save('Velocity_b30_s2_p1.0.mat');
clear;
betac = pi/3;
VelocityInToroidalCoordinates;
save('Velocity_b60_s2_p1.0.mat');
clear;
betac = pi/2;
VelocityInToroidalCoo... |
%%
%读取图像
close all;
clear all;
filename = 'motion_blur.jpg';
I = imread(filename);
figure
imshow(uint8(I));
title('原图');
%%
%模糊距离
h=fspecial('sobel');
img_double=double(I);
J=conv2(img_double,h,'same');
IP=abs(fft2(J));
S=fftshift(real(ifft2(IP)));
figure
plot(S);
%%
%模糊角度
F = fft2(I);
H = log(1+abs(F));
Hc = fftshift(... |
function varargout = calc_cos2_v2(amps,probs_JM,t_ip,t_free,consts)
% consts rotational constant 'B' in [1/cm] and centrifugal distortion 'D'
% in [1/cm] with the format: consts = [B D]
fprintf('Calculating <cos^2(theta)>')
qE=1.60218e-19;
a0=5.29e-11; % [m]
eps0=1/4/pi;
c_au=1/137;
t_scale=24.188e-18; % [s]
... |
%% Wavelet Analysis of Physiologic Signals
% This example shows how to use wavelets to analyze physiologic signals.
%
% Physiologic signals are frequently nonstationary meaning that their
% frequency content changes over time. In many applications, these changes
% are the events of interest.
%
% Wavelets decompose sig... |
for ind_subjects = 1:size(filepath_subject)
for ind_files = 1:size(filelist{1})
filepath_mocap = [filepath_base filepath_subject filelist{1}{ind_files}];
filepath_fp = [filepath_base filepath_subject filelist{2}{ind_files}];
filepath_mvn = [filepath_base filepath_subject filelist{3}{ind_files}];
... |
function z = bark(freq)
z = 13*atan(0.76*(freq/1000)) + 3.5*atan((freq/7500).^2); |
classdef TestBinaryDescriptorMatcher
%TestBinaryDescriptorMatcher
properties (Constant)
fields = {'queryIdx', 'trainIdx', 'imgIdx', 'distance'};
end
methods (Static)
function test_matcher
%TODO: something in this test is causing memory corruption and
%TODO: cras... |
% myexp.m
%
% auxiliary logistic-class function used for ion channels
%
% $Revision:$
%
function me = myexp(V_m, g, V_h, V_c)
me = g *exp((V_m-V_h)/V_c);
|
function updatedRegister = yGate(qregister,qubitIndex)
%singleQubitGate - Apply Y to the qubit in the ith position
%
% Syntax: updatedRegister = yGate(qregister,qubitIndex)
%
updatedRegister = singleQubitGate(qregister,qubitIndex,standardGates.Y);
end |
function W = approx_Wigner3j(J123,M123)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
if J123(2)==2 && M123(2)==0 && M123(3)==-M123(1)
J=J123(1);
M=M123(3);
if J123(3)==J123(1)
W=(-1)^(J-M)*2*(3*M^2-J*(J+1))/sqrt((2*J+3)*(2*J+2)*(2*J+1)*(2*J)*(2*J-1));
... |
function [x,y, wsz,ssz] = cpivGetPoints(gd, fr, pass)
wsz = gd.WindowSize(pass,:);
ssz = gd.SearchSize(pass,:);
[x,y] = meshgrid(gd.Start(pass,1) + ceil(wsz(1)/2) + ...
(0:(gd.NPt(pass,1)-1)) * gd.Offset(pass,1), ...
gd.Start(pass,2) + ceil(wsz(2)/2) + ...
(0:(gd.NPt(pass,2)-1)) * gd.Offset(pass,2));
%... |
function [finalsig] = CreFinSig(Psignal)
%It creates the final speech signal
%using the predicted version(lpc) of
%the initial windowed signals and the
%OverlapAdd method.
%Input:
%Psignal = PredictedSignalMatrix
%Output:
%finalsig = FinalSpeechSignal
%Usage:
%FinalSig = CreFinSig(pSignal);
finalsig = zeros(... |
function [Normalized]=F_data_normalize(ps, CNT, A1, A2, A3, A4)
for z=1:CNT
Normalized(z,1) = ps(z);
Normalized(z,2) = A1(z,1)/A2(z,1);
Normalized(z,3) = A2(z,1)/A2(z,1);
Normalized(z,4) = A3(z,1)/A2(z,1); %QR
Normalized(z,5) = A4(z,1)/A2(z,1);
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.