text stringlengths 8 6.12M |
|---|
count=0;
go_calib_optim
%Obtains the focal length of the camera
intrinsics_fc=fc';
fprintf('The focal length is:\n')
intrinsics_fc
%Obtains the Principle point of the camera
fprintf('Principle Poinr is: \n')
intrinsics_cc=cc';
intrinsics_cc
%Obtains the skew
intrinsics_alpha_c=alpha_c;
fprintf('Skew is:\n')
intrinsics_... |
function pa_cortex_RTandFR
close all hidden
clear all
cd('E:\DATA\Test');
load AllInfo
whos
D1 = plotrt2(RP500,'k','o');
hold on
rt = [RP1000.rt];
sel = rt>225;
D2 = plotrt2(RP1000(sel),'b','s');
sel = rt<225;
D3 = plotrt2(RP1000(sel),'r','d');
x = 0:0.4:2;
whos D1 x
h4 = plot(x,D1(:,2)+D3(:,2),'k:'... |
N = 100; % filter order
Fp = 20e3; % 20 khz passband-edge frequency
Fs = 96e3; % 96 khz sampling frequency
Rp = 0.00057565; % Corresponds to 0.01 dB peak
Rst = 1e-4;
eqnum = firceqrip(N, Fp/(Fs/2), [Rp Rst], 'passedge')
fvtool(eqnum, 'Fs', Fs, 'Color', 'White')
N2 = 200; % Change filter order fr... |
function [Template, TemplateMask, TemplateTip, Theta] = tracking_generateTemplateInformation(testIm, template, templateMask, templateTip, LP)
[m, n] = size(testIm);
nTip = size(templateTip{1,1,1},1);
nLeaf = size(LP, 1);
Template = cell(nLeaf, 1);
TemplateMask = cell(nLeaf, 1);
TemplateTip = zeros(nLeaf, nTip... |
function lineNum = getVarLine(varFile, varName)
lineNum = setxor(find(not(cellfun('isempty', strfind(varFile, sprintf([varName '\t']))))),...
find(not(cellfun('isempty', strfind(varFile, ['#' sprintf([varName '\t'])])))));
|
%%
% There are two types of controls:
%
% * Dirichlet boundary conditions, where the pressure is given on selected external faces.
% * Neumann boundary conditions, where sources/sinks are included at given cells. We have thus not
% included well models.
%
% The controls locations have been hard coded here, but they can... |
x=[143 145 146 147 149 150 153 154 155 156 157 158 159 160 162 164]';
X=[ones(16,1) x];
Y=[88 85 88 91 92 93 93 95 96 98 97 96 98 99 100 102]';
[b,bint,r,rint,stats]=regress(Y,X);
rcoplot(r,rint)
figure(2)
z=b(1)+b(2)*x
plot(x,Y,'k+',x,z,'r') |
% 1. Error Probability for BPSK Modulation in AWGN Channel - Part3
% Author: Seyed Mohammad Mehdi Hosseini (Smmehdihosseini@gmail.com)
clear;close all;clc;
num_bits=1000;
M=2;
db_snr=0:12;
ber1_snr=zeros(1,length(db_snr));
for iteration_snr=1:length(db_snr)
erroro_total1=0; iteration=0;
while iteration<1... |
tic;
kokokj= toc
cdecdwf= toc
|
function [kernel_name, para]=choose_kernel_1vRest(data_name, c_list, folds)
str1=['data/',data_name,'/Gaussian_'];
label_path=['data/labels/label_', data_name,'.mat'];
load(label_path);
if strcmp(data_name,'glass') || strcmp(data_name,'svmguide4')
label_vector(label_vector>3) = label_vector(label_vector>3)-1;
en... |
function [dTip,dTilt] = alignAutoTipTilt(bench, gain, pupillDiameter, timeout)
% timeout in second default is 60
if nargin<2; gain = bench.config.pupillTipTiltAlignGain;end
if nargin<3; pupillDiameter = bench.config.fullPupillDiameter;end
if nargin<4; timeout = 60; end
% convert time out in da... |
function [ topology ] = hybrid_topology(Arch,duty,opt)
%% hybrid_topology: Create topology of a floating hybrid cell
%
% dickson_matrix_hybrid( n_caps,duty,opt)
% n_stages: number of capacitors
%
% Returns: topology structure with all the relevant functions to model
% the behaviour of a Hyrbrid Switched Cap... |
clc
clear all
Find_Plate('TOPHER_ANPR_IMG_20151007_for_upload.jpg');
Find_Sign('parent_drop_off_01_for_upload.jpg');
|
% MHSBESQ.M
% Plots Beff^2 of HS pulse in kHz^2
g = 42.67 ;
t = (mpgdtmu:mpgdtmu:mpgdtmu*length(mpgb1))/1000 ;
freqsq = ((2*pi)^2)*(500/(mpgdtmu*pi)*gradient(unwrap(angle(mpgb1)))).^2 ;
b1sq = ((2*pi)^2)*(g*abs(mpgb1)).^2 ;
befsq = freqsq + b1sq ;
% *********
figure
plot(freqsq)
title('FREQSQ')
figure
plot(befsq... |
function plotPanelsActivation(model)
global baseParameters exp1 exp3 exp10 exp32 exp100 exp3ca exp10ca exp32ca exp100ca exp320ca
%this matches the experimental conditions of fig 1
% from Anmar's JGP paper
m_cal=17.953218701151055;%1;
baseParameters('C')=0;
%
% plotActivation(exp1.activation... |
function [hr,arhr] = LorSLIM(Trainn,test,test_zhong,tol,maxIter,z,ro,lambda,beta)
%% Problem
%
% min 1/2|| X-XW||_F^2 + 1/2 beta * ||W||_F^2 + lambda * ||W||_1 +
% z*||W||_{*}
% s.t. W >=0
% diag(W)=0
%
%% Reformulation
%
% min 1/2||X-XW||_F^2 + 1/2 beta * ||W||_F^2 +
% lambda * ||W||_1+z*||W||_{*}+<V,W-S... |
%% Task7: GDP Predition using 'fitlm'
% Load required data
load FREDData_Clean.mat
array_FREDDATA = timetable2table(FREDDATA);
%'fitlm'by default considers the last coloumn dataset as target variable
GDP_lastclmn_FREDDATA = [array_FREDDATA(:,1:8),array_FREDDATA(:,10:13),array_FREDDATA(:,9)];
GDP_pre_coeffients... |
% Data loaded from MAPS_irr_lang.txt
% load maps_data.mat
load('/projects/p30906/data/maps_bds/maps/maps_data.mat')
load('/projects/p30906/data/maps_bds/bds/bds_data_02.17.20.mat')
warning off
% Want to grab the ids for those that are high/low on language and
% irritability
%%%% MAPS %%%%
% fit a linear model
disp('%... |
clear;
par = struct('test', 'galew', 'n', 6400, 'fd', 31, 'ep', 2.7, 'order', 4, 'gamma_c', -0.05);
mt_plot(par, getsol(par, 600));
figure
par = struct('test', 'tc5', 'n', 6400, 'fd', 31, 'ep', 2.7, 'order', 4, 'gamma_c', -0.05);
mt_plot(par, getsol(par, 900));
|
% extend SRLM over the subiculum
% This portion of the code was used in the original publication, but future
% work will define the (dummy label) SRLM over subiculum separately.
% Finds surfaces (where label 0 and label 1 meet). The largest connected
% surface component is lateral, second largest sits on top of the s... |
function [L,B,ib] = buildL(FV,space,boundary,value,str)
% This function builds the L matrix operator
% To build L, the finite volume laplacian formulation that is already
% available form sessions 4-6 of the course is used
% If the script is being called for the first time generate stencil files
if isfile('build_inner... |
function m = ref(a)
% Script for Row-Echelon Form
% ----written by----------------------------
% Muhammad Rafiullah Arain
% Department of Mathematics
% COMSATS Institute of Information technology - Lahore
% Pakistan.
% ------------------------------------------
% ref(a) defination and use
% -------------------... |
%data prep!
load erp.mat
erp.data = erp.data(any(erp.data,2),:); %removes all zeroed-out channels
%clear erp;
dir = cd;
%sub_dir = char(dir(length(dir)-1:length(dir)));
%datafile = [dir,'/',sub_dir,'_monkey_human_pd.rdf'];
ninputchan = 18;
%convert raw file!
%erp.data = Cajal_data.eeg(1:ninputchan,:);
%erp.data = er... |
function answer = empty_array(value)
% File: empty_array.m
% Author: Ioannis Filippidis, jfilippidis@gmail.com
% Date: 15.07.2009
% Language: MATLAB R2009a
% Purpose: Generate Answers for FEMI Optional Project's Answers
% Copyright: Ioannis Filippidis, 2009-
answer = 1;
if (v... |
classdef ArbelaezRegistry < mlpatterns.Singleton
%% ARBELAEZREGISTRY
% $Revision$
% was created 15-Oct-2015 16:31:41
% by jjlee,
% last modified $LastChangedDate$
% and checked into repository /Users/jjlee/Local/src/mlcvl/mlarbelaez/src/+mlarbelaez.
%% It was developed on Matlab 8.5.0.197613 (R2015a)... |
function y = encoder_manchester(x,osf)
x = reshape(x,length(x),1);
a = repmat(x,1,osf/2);
b = a;
b(b==1) = -1;
b(b==0) = 1;
a(a==0) = -1;
y = [a b];
y = reshape(y',1,size(y,1)*size(y,2));
end |
function out = g_nginput
% G_NGINPUT
%
% OUT = g_nginput Use ginput on a timeseries and copy the x-coordinate
% to the clipboard
%
% Gunnar Voet, APL - UW - Seattle
% voet@apl.washington.edu
%
% Created: 05/12/2014
% Get input data
[x,y] = ginput;
% Write to output variable
out.x = round(x)... |
clear all
load params
load econDynamicRough3
load engDynamicRough3
econDynamicRough = econDynamic;
engDynamicRough = engDynamic;
params.r = @(t) 1 - .5*cos(pi*t/3);
h = .01;
T = 30;
nControlPts = 151;
econDynamic = cell(1,3);
for i=1:3
sprintf('Solving for solution %d of EconomicProblem\n\n', i);
econDynamic{i}... |
function [peRes] = mainRunPE(fit_res, fit_dat, flag, tmpth, s)
fit_res.inputs.PEsol.global_theta_guess = tmpth;
fit_res.inputs.model.par = tmpth;
if fit_dat.iter == 1
for j =1:fit_res.inputs.exps.n_exp
switch fit_res.system
case "PL"
fit_res.inp... |
function [m_632p,CI,m_list] = kyu_632plusbootstrap_prob(m_trn,m_test,Pev)
% calculate 632+ bootstrap estimate of a probability estimate
% m_trn is a probability estimate of a model trained/tested in the entire
% data (a single value)
% m_test is a (Nx1) vector of out-of-bag P from N bootstrap samples
% Pev : average e... |
p0=1.615637530235447;% baseline, all zeros
n_train=[641,800,1000,1400,1800,2000];
load('./data_g/10ntrain_train_step200.mat')
for i=1:numel(n_train)
figure('Position',[0,0,700,331.5789])
[val, idx]=max(outputs(1:n_train(i)));
input=inputs(idx,:,:);
h=heatmap(squeeze(1-input)','CellLabelColor','none'... |
function [contar] = contar_ocorrencias(alfabeto, fonte)
%Conta as ocorrências do alfabeto na fonte
%Devolve uma matriz com a contagem
contar = zeros(length(alfabeto),1);
for l=1:length(alfabeto)
i = find(fonte==alfabeto(l));
contar(l)=length(i);
end
%output= contar;
end
|
function f=obeb(a,b)
if (b==0)
f=a;
else
f=obeb(b, mod(a,b));
end
function func=periyot(m, a, c)
ikiTabanindaUsselMi=false;
i=1;
while(i<m)
i=i*2;
if (i==m)
... |
function [Att] = metainfo( MetaObj )
%EXTRACTMETAINFO Return info (struct) derived from a meta.object
%
% Att = metainfo( MetaObj )
%
% Useful properties of meta[.class/.property/.method] object 'MetaObj' are
% copied to the fields of struct Att
%
%TODO : restructuring of meta.Validation.Size
SUPPORTED_TYPES = ... |
function [Bcum, Mcum, r] = findthickmpoleraddifm(rin, PolynomA, PolynomB,L, irho, E0, max_order,num_steps)
%FINDTHICKMPOLERADDIFFM
% Fourth order-symplectic integrator constants
persistent DRIFT1 DRIFT2 KICK1 KICK2
if isempty(DRIFT1)
DRIFT1 = 0.6756035959798286638;
DRIFT2 = -0.1756035959798286639;
KIC... |
function fis=set_fuzzy(para_in1,para_in2,para_out)
fis=readfis('fuzzy_con_tem');
%para_in1=[min max NB1 NB2 NB3 NB4 NS1 NS2 NS3 ZE1 ZE2 ZE3 PS1 PS2 PS3 PB1 PB2 PB3 PB4]
NB3=(para_in1(6)+para_in1(5))*para_in1(1);
NB4=para_in1(5)*para_in1(1);
NS1=NB3;
NS2=NB4;
NS3=0;
ZE1=NB4;
ZE2=0;
... |
function varargout = OregonatorGUI(varargin)
% OREGONATORGUI M-file for OregonatorGUI.fig
% OREGONATORGUI, by itself, creates a new OREGONATORGUI or raises the existing
% singleton*.
%
% H = OREGONATORGUI returns the handle to a new OREGONATORGUI or the handle to
% the existing singleton*.
%
... |
%% An example showing how to make mp4 animation
%
x = linspace(-10,10,1000);
dt = 0.1;
fig = figure;
vidobj = VideoWriter('wave_writevideo_2.mp4', 'MPEG-4');
open(vidobj);
y = exp(-x.^2);
h = plot(x, y);
drawnow
frame=getframe(fig);
writeVideo(vidobj, frame);
for k = 1:50
time = k*dt;
y = exp(-(x-time).... |
function fvs_find_regions(varargin)
%FVS_FIND_REGIONS(videoFile, outDir, landmarksFile, segmentationFile,
% 'verbose', verbose):
% videoFile - Path to input video file
% outDir - Path to output directory
% landmarksFile - Path to the landmarks model file or landmarks cache
% file (.pb)
% segmentationFile - ... |
function u = tvdenoise(f,lambda,varargin)
%TVDENOISE Total variation image denoising.
% u = TVDENOISE(f,lambda,noise) denoises grayscale, color, or arbitrary
% multichannel image f using total variation regularization. Parameter
% lambda controls the strength of the noise reduction: smaller lambda
% implies s... |
function y = LoadWeatherData(filename)
global nummins starttime formatIn formatIn2 formatIn3 inc_min_step offset_time current current_end min_quality
global search_region max_search_time prev_time alldataset dataset newdataset step_behind
global indFrictionValue indFrictionQuality ind1PrevDistFriction ind... |
% %真解
% t = 0:0.1:1;
% y = 4/pi^2*sin(pi/2*t);
% y1=0;
% y1(2:11) = Finite_element(10);
% plot(t,y1,':o',t,y,'-*');
% legend('离散区间n=10有限元法','真解')
%%%%%%%%%%%
% %真解
t = 0:1/3:1;
y = 4/pi^2*sin(pi/2*t);
y1=0;
y1(2:4) = Finite_element(3);
plot(t,y1,':o',t,y,'-*');
legend('离散区间n=3有限元法','真解')
|
%% ---------------------------------------------------------------
% 轴箱轴承动态信号仿真平台 v1.2
%
% 西安交通大学,赵明, 01/09/2017
% -------------------------------------------------------------------------
% 该平台结合滚动轴承监测领域最新研究成果和算法,自动生成滚动轴承的全息动态信号数据,
% 可用于算法功能测试,性能测试以及科学研究和教学培训... |
function [datatwo,pnew,h] = TTOhuff2(data)
%连续两个符号进行哈夫曼编码(基于像素点取值概率)
%data是量化后转换成十进制的行向量的图像数据
datanew = [];
p=[];
databaoliu=data;
while length(find(data~=-1)) >0
xuhao = find(data~=-1);
no = data(xuhao(1));
datanew = [datanew no];
p = [p length(find(data==no))];
data(find(data==no))=-1;
... |
function ShowDetectResults(FilePath_Raw, DefaultFileSpec_Raw,allPts,varargin)
if nargin == 4
GridCoords =varargin{1};
GridCoordsX = GridCoords(:,:,1);
GridCoordsY = GridCoords(:,:,2);
end
DefaultPath = '.';
[FileList_raw, BasePath_raw] = LFFindFilesRecursive( F... |
function metrics = processStringIREP(dataStruct,desiredForce,plotOption)
numExperiments=max(dataStruct.string_status.data);
if numExperiments~=10
warning('Experiment Does not have 8 string experiments!')
end
pullIndex=0;
for ii=2:length(dataStruct.string_status.data)
if dataStruct.string_status.data(ii)>dataS... |
function d = base2ind(baseRepresentation, b)
%BASE2IND Convert base-B representation to a decimal number.
% BASE2IND(D,B) returns the decimal (base-10) equivalent of a base-B
% representation B. If B is a matrix, BASE2IND returns a vector whose
% I-th element is the decimal representation of the I-th row of B... |
% signal length
N = 1024;
% number of spikes in the signal
T = 50;
% number of observations to make
K = 512;
% uniform spike signal
rng(101);
x = zeros(N, 1);
q = randperm(N);
x(q(1:T)) = sign(randn(T, 1));
% hint from
% https://www.mathworks.com/matlabcentral/fileexchange/26606-compute-n-x-n-dft-matrix
% Orthorno... |
function[df,dg]=gfun43(fun,x,indgradf,indgradg,nprob,iutil,rutil) ;
df=[]; dg=zeros(4,0);
df(1)=2*x(1)-5;
df(2)=2*x(2)-5;
df(3)=4*x(3)-21;
df(4)=2*x(4)+7;
df=df(:) ;
dg(1,1)=2*x(1)+1;
dg(1,2)=2*x(1)-1;
dg(1,3)=4*x(1)+2;
dg(2,1)=2*x(2)-1;
dg(2,2)=4*x(2);
dg(2,3)=2*x(2)-1;
dg(3,1)=2*x(3)+1;
dg(3,2)... |
% <ENG 6, SQ16 Lab 004>
% <Chengeng, Xiao>
% <913186040>
% <A07>
%% Problem 1:
avgEC = [200, 170, 150, 260, 120, 430, 300, 320, 340, 460, 310, 370, 380, 50, 430, 180, 400]; % Set Average Energy Consumed Each Month(kWh)
EG = 400; % Set energy generated every month (kWh)
RF = 25; % Set rental fee per month
SB = 5... |
function mkhtml(name, checkvisu)
%MKHTML Create individual HTML help file from a matlab file
%
% Syntax: mkhtml( basename , checkvisu )
%
% basename = name of the function without the .m extension
% checkvisu = optional argument allowing to decide wether
% mkhtmldoc opens the html file in... |
function [H, L] = storeQ( F, levelF, colorF, o, H, L)
%------------------------------------------------------------------------------
%
% Gridfunction F is supposed to correspond to elements of one colour of
% an extended gridfunction. As such, F is a two-dimensional grid-
% function. This function stores F into H for ... |
function [M2 S2] = eliminateAffineAmbiguity(M1, S1)
% Get the number of frames; M1 is of size 2F x 3
F = size(M1, 1) / 2;
% Compute all the odd rows of M1
A = M1(1:2:end-1, :);
% Compute all the even rows of M1
B = M1(2:2:end, :);
% Compute the G matrix
G = [ A(:, 1).*A(:, 1) A(:, 1).*A(:, 2) + A(:, 2).*A(:... |
clc
clear all
close all
format long
%% Points of the ROLL ANGLE - CAMBER GAIN curve
% Load the file. The first column contains roll angle data (in °),
% while the second column contains camber gain data (in °)
load Camber_Model.txt;
roll_angle = Camber_Model(:,1);
camber_gain = Camber_Model(:,2);
figure(1)
plot(r... |
%% initialize background
myfig=figure(1);
clf;
redguy = imread('redpacman.png');
blueguy = imread('bluepacman.png');
width = 1030;
height =1030;
axis([0 width 0 height]); % figure is 500 units wide and 375 tall
grid off;
hold on;
axis('off')
set(gcf,'color', [0 0 0]);
%% intitial text
Opening= ... |
function cellnorm = normCellVector(cellvec)
% this function calculates the second norm of a cell vector field
%
% SYNOPSIS:
%
%
% PARAMETERS:
%
%
% RETURNS:
%
%
% EXAMPLE:
%
% SEE ALSO:
%
% Written by Ali A. Eftekhari
% See the license file
% check the size of the variable and the mesh dimension
d = cellvec.domain.di... |
function [ result ] = Newtown( initial )
%NEWTOWN Calculate the value of sqrt(115)
Real = sqrt(115);
x = zeros(1, 1000);
x(1) = initial;
k = 1;
times = zeros(1, 1000);
errors = zeros(1, 1000);
tic;
while k < 1000
x(k+1) = x(k) - ( x(k) ^ 2 - 115 ) / (2 * x(k));
... |
function [U,V,alpha,result] = prob_mat_nan(Y,Z,alpha_true,metric,varargin)
% Poisson N-mixture model with a probabilistic NMF
% This file can handle nan in Y; it is for testing the cases where we have
% unobserved entries in Y
% coded by Xiao Fu (xiao.fu@oregonstate.edu)
% Read the optional parameters
if (rem(l... |
function [ MInv, mu ] = getRInvBlocks( lambda, t, n, l )
Sigma = (t.^-1).*lambda;
EBar = Sigma(n+2:end);
MInvs = cell(n,1);
for j = 1:n
EInv = EBar(1+(j-1)*l:j*l).^-1;
beta = Sigma(j)/(1 + Sigma(j)*sum(EInv));
MInvs{j} = sparse(diag(EInv) - beta*(EInv*EInv'));
end
MInv = ... |
function R = Power(name, d, eps)
output_precision(6);
fid = fopen(name, "r");
N = fgetl(fid);
N = str2num(N);
w = zeros(1, N);
M = zeros(N);
A = zeros(N);
L = zeros(1, N);
u = ones(N ,1);
P = zeros(N);
R = ones(N, 1);
R = R.*1/N;
y = ones(N,1);
%A = adjacency matrix, L = link vector
for i = 1:N
w = fgetl(fid);
w = st... |
function nowa_komorka = zmiana_komorki(suma, stan_komorki, stany)
[row, col] = size(stany);
ill = [1 2 3 4 8 11 14 16 18];
ill_alive = [1 2 3 4 8 11 14 16];
death = [18];
health = [6 7 10 12 13 17];
recovered = [5 9 15 19];
non_exist = [20];
list = [];
for n=1:col
if stany(stan_komorki, n) == 1
list = [list... |
%in barnamei baraye REGION GROWING ast,BARAYE
%EJRAYE BARNAME HAME BARNAME RA ENTEKHAB KARDE(Ctrl+A & Ctrl+C)VA DAR Command
%Window MATLAB PASTE KONID.
clc;
clear all;
close all;
Img = im2double(imread('7.tif'));
figure;imshow(Img);title('tasvire vorudi');
%seed point
m=50; n=50;
TR=0.1;
if (exist('reg_maxfas','var')... |
function [ delta_rad, Fx_N ] = me227_controller( s_m, e_m, deltaPsi_rad, Ux_mps, Uy_mps, r_radps, modeSelector, path )
% me227_controller( s_m, e_m, deltaPsi_rad, Ux_mps, Uy_mps, r_radps, modeSelector, path )
% Include your names in the comments at the top of the function. The
% state and controls follow the notat... |
function tb = getSubclasses(rootclass,rootpath)
% GETSUBCLASSES Display all subclasses
%
% GETSUBCLASSES(ROOTCLASS, [ROOTPATH])
% Lists all subclasses of ROOTCLASS and their node dependency.
% ROOTCLASS can be a string with the name of the class, an
% object or a meta.class().
%
% It looks for... |
%rhsta simulates the examples of Sections 3.2.3 and 3.3.4
% ____________________________________________________________________
% /Program: rhsta.m \
% / Description: This program runs the simulation of the Rhors example \
%| found in sections 3.2.3 and 3.3.4 of the text. The program allow... |
function [output_test,P,H2,p_index]=p_value_function(input,label,p_range,method)
% clear output_test
% clear input_b
% clear input_m
% clear input
% clear P
% clear H
% clear H2
output_test=[];
i_b=1;
i_m=1;
[n_x,n_y]=size(input);
% Feature normalization [-1,1]
for i=1:n_y
% X_norm 138*155
input_scale(:... |
%% Load file
clear all;
root_path = 'C:\Users\Virginia Casasnovas\Documents\Virginia\Data\MINISCOPES\HeadFreeTreadmillMiniscope\';
experiment_folder = '20190510 - miniscopes adaptation RF';
filesep = '\';
addpath(genpath(root_path));
raw_main = 'TM RAW FILES';
registered_main = 'TM PROCESSED IMAGING FILES';
... |
FN = load('result_Ybus.txt')
FN_VA = load('FN_VA.txt');
FN_VM = load('FN_VM.txt');
FN_PG = load('FN_PG.txt');
FN_QG = load('FN_QG.txt');
FN_lam = load('FN_lam.txt');
FN_mu = load('FN_mu.txt');
FN_z = load('FN_z.txt');
MLP_VA_total = load('MLP_VA_total.txt');
MLP_VM_total = load('MLP_VM_total.txt');
MLP_PG... |
function [x,w]=Gauss_Hermite(n)
% integral(x = -inf to inf)[f(x)*exp(-x^2)*dx] = sum(i = 1 to n)[w(i)*f(x(i)]
% for f(x)=1, sum(w(i))=sqrt(pi)
i=1:n-1;
a=sqrt(i/2);
CM=diag(a,1)+diag(a,-1);
[V,L]=eig(CM);
[x,ind]=sort(diag(L));
V=V(:,ind)';
w=sqrt(pi)*V(:,1).^2;
% Modification of GaussHermite.m by:
%
% Co... |
function retVal = numPossibilities(A)
%Returns number of non-zero integers in vector A
retVal = 0;
for i = 1:length(A)
if A(i) ~= 0
retVal = retVal + 1;
end
end
end
|
function g_toolbar
% G_TOOLBAR Toggle toolbar on current figure
%
% Gunnar Voet
% gvoet@ucsd.edu
%
% Created: 02/12/2015
% Get current toolbar status
cs = get(gcf,'toolbar');
if ~strcmp(cs,'none')
set(gcf,'toolbar','none')
elseif ~strcmp(cs,'figure')
set(gcf,'toolbar','figure')
end |
function [] = LengthHist(SP)
load(SP)
F = IMS.Fibers;
figure
whist([F(:).Length])
xlabel('Fiber length (nm)')
ylabel('Total length of fibers of length x')
end |
%{
#
-> acquisition.Session
-> acquisition.Session
---
-> reference.TrackingSystemSetup
-> reference.TrackingSystemSetup
%}
classdef SessionTrackingSystemSetup < dj.Manual
end |
function test_demo(pulsestr)
% clear all;
close all;
p.NumBowties = 49;
% p.NumBowties = 25;
% number of rows
p.row = 7;
% p.row = 5;
% number of columns
p.col = p.NumBowties/p.row;
p.REmitter = 1; % 1 ohm
p.RCollector = 1; % 1 ohm
%p.Area = 0.0001; % need to actually get a reasonable estimate
p.Area = 5e-18; % ... |
close all;
clear all;
% Problem 3 (a)
% Retangualr window with N = 21
N = 21;
h = sin(pi/4*([0:N-1]-(N-1)/2))./(pi*([0:N-1]-(N-1)/2)); % Time-shift
h((N-1)/2+1) = 1/4;
figure(1);
stem([0:N-1],h);
axis([0 N-1 -0.1 0.3]);
title('Impulse response - Rectangular window with N=21');
figure(2);
H = fft(h... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function [files, directories] = getFilesFromSubdirectories(basePath, subDirectories, extension)
% Gets a list of all the files inside a list of subdirectories
%
% Input parameters:
% - databasePath: path to the database
% - subDirectorie... |
function [x]=parking(Xc,Yc,R,Lc,DR,W)
c = W/2;
b = DR;
a = Lc-DR;
[dis_AM dis_BM] = deal(sqrt(a^2+c^2)); %定义车辆四个角点到后轴中点M距离dis_XM
[dis_CM dis_DM] = deal(sqrt(b^2+c^2));
%定义汽车从左前方开始俯视图顺时针遍历四个角点为ABCD
if Xc > 0
for theta = 0:0.05:pi/2
xc_d = Xc - R*sin(theta);
yc_d = Yc - (R - R*cos(theta));... |
% Script to generate noisy data, dark and open images, to write these
% files to disk, and to open, correct and display them.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PREP
% Start up:
clear
close all hid... |
function [ output_args ] = AppendData( input_args )
%APPENDDATA Summary of this function goes here
% Detailed explanation goes here
end
|
% WorkingP='C:\STRDCE\John\Database\DCEOut\RuYe_20091224\';
% DataP=[WorkingP 'AutoArtBAT' filesep];
% a=load([WorkingP 'PKM3D.mat']);
RSSIdxs=7:10;
NParams=[0 2 3 4];
%%
% MAD=median(abs(diff(CTC2DBigGood,[],2)),2);
% SSig=(MAD/0.67).^2;.*repmat(SSig,[1 4])
AIC=(0*log(nVols)+1*2)*repmat(NParams,[size(PKs,1) 1])+nVols*... |
function I = boundPoint(x)
% compute an interval to include all points
%
% Syntax:
% I = boundPoint(x)
%
% Inputs:
% x - input points
%
% Outputs:
% I - interval matrix
% Author: Weiming Xiang
% Written: 02/25/2019
% Last update: 02/25/2019
%------------- BEGIN CODE --------------
[dim,~] = size(... |
n = 512;
x = rand(1,n);
dft_len = [];
dft_tim = [];
fft_len = [];
fft_tim = [];
for i = 1:n/2
dft_len = [dft_len 2*i];
t = tic();
a = forward_dft(x(1:2*i)');
t = toc(t);
dft_tim = [dft_tim t];
fft_len = [fft_len 2*i];
t = tic();
a = fft(x(1:2*i)');
t = toc(t);
fft_tim = [fft_tim t];
endfor
hold... |
load('Y:\Github\DATA\Comparison\siyahlar\Data_with_2parasitic');
ts=time(2)-time(1);
fs=1/ts;
number_of_sample= fs/50;
starting=1+1*number_of_sample;
ending= 1+3*number_of_sample;
figure('name','Load Current')
plot(time((starting:ending)),load_cur_A(starting:ending));
hold on;
plot(time((starting:ending))... |
function audPipe(param)
%
%R1 11/23/17 Do Gaussian-smoothing first than top-hat
%R2 11/24/17 Do top-hat first than do Gaussian
%R3 11/24/17 Change the way to do df/f (Now doing intra-grouped-video df/f) see class movieData
%R4 12/01/17 Major change to enclose parts of the code into Integration class
%!!!NOTE THAT a... |
function [ priormean, priorvar, a, sigma0 ] = get_priorsNW( p, shrink, Y )
%This is my NW priors, using roughly Banbura, Giannone and Lenza
%written by Katerina
%in this application, data is in growth rates, so prior mean is zero
[T,N]=size(Y);
K=N*p+1;
priormean=zeros(K,N);
priorvar=zeros(K,1); %this has a... |
absC=1;
omega0=[2*pi 4*pi -2*pi 2*pi];
r=[1 1 1 -1];
t=0:.1:10;
theta=2*pi;
for z = 1:4
C=absC*exp(j.*theta);
a=r(z)+j*omega0(z) ;
xenvu=abs(C)*exp(r(z)*t);
xenvd=-abs(C)*exp(r(z)*t);
func= C.*exp(a.*t);
figure(z)
plot(t,real(func),t,imag(func),'k:',t,xenvu,'k--',t,xenvd,'k--')
title(... |
close all
clear all
clc
clf
%% mesh plot the refine 2 var angles via energy
%
da=load('../data/ANN_input_out_file_find_err/out_eng_mesh.txt');
x_ran=load('../data/ANN_input_out_file_find_err/range_16H_13O_12C');
y_ran=load('../data/ANN_input_out_file_find_err/range_13O_12C_7C');
[X,Y]=meshgrid(x_ran,y_ran);
for ... |
classdef CatheterSavitzkyGolay2018
%% CATHETERSAVITZKYGOLAY2018
% $Revision$
% was created 26-Aug-2018 00:39:33 by jjlee,
% last modified $LastChangedDate$ and placed into repository /Users/jjlee/MATLAB-Drive/mlarbelaez/src/+mlarbelaez.
%% It was developed on Matlab 9.4.0.813654 (R2018a) for MACI64. Copy... |
%%% Boot strap filter fot indoor navigation%%
clc;
clear all; rand('state',0);randn('state',0);
%%%%%%%% The same parameters that used in kalman filter code %%%%%%%%%%%%
%%%%%%%%%Program constatnts %%%%%%%%%%%
samples=100000; % number of samples
a=0.25;
%%%%%%%%Room Dimensions %%%%%%%%%%%
width_x=5; ... |
function [Popini] = GeraPop(Pmax, Pmin, NumPop,P_load)
%GeraPOP - Creates the 1st population
% Generates the 1st population using the lower limit off production ...
% to which is added a random number
NumGenerators = 4;
for n=1:NumPop
for i=1:NumGenerators
Generator(i,n)=Pmin(1,i)+randn*40;
... |
classdef OpticalSurface
properties
c double % curvature
t double % thickness
glass OpticalGlass % OpticalGlass object
ah double % aperture height
asph_type char % asphere polynomial type (power series, qcon, qbsf)
asph_coef d... |
xx = input('input first valname = ','s');
hh = input('input second valname = ','s');
B1=linspace(0,0,10);
C1=linspace(0,0,10);
B2=linspace(0,0,10);
C2=linspace(0,0,10);
eval(['load ' xx '.txt;']);
eval(['load ' hh '.txt;']);
len= length(xx);
for i=1:len-1
t=xx(i+1);
xx(i)=t;
end
xx(len)='';
xx(len-1)='';
len= l... |
% TODO handling the signal inaccuracies
%
function Plot( tSignal, aafAdditionalXYZTriplets, iFigureNumber )
%
if( nargin < 2 )
%
aafAdditionalXYZTriplets = [];
%
end;%
%
if( nargin < 3 )
%
if( numel( tSignal.iSignalID ) > 0 )
%
iFigureNumber = tSignal.iSignalID * tSignal.iDeviceID;
%
else%
... |
classdef ConnectomeEnvelope < Gridjob
%ConnectomeEnvelope Summary of this class goes here
% Detailed explanation goes here
properties
Fs
end
methods
%% Subclass Constructor: initialize standard parameters:
function this = ConnectomeEnvelope(varargin)
% Call superclass con... |
function plotConfusionMatricesOverTime(modelResults, ...
modelField, humanField, classes)
if ~exist('modelField', 'var')
modelField = 'correct';
end
if ~exist('humanField', 'var')
humanField = modelField;
end
if ~exist('classes', 'var')
classes = getCategoryLabels();
end
% human
humanResults = load('dat... |
% d ata fmt
%
% #first sample
% 1300557889 300 620 M
% 1300557889 110 111 F
%
% #first sample
% 1300557890 320 597 M
function data_gen
n = 0;
%filename = 'points_blacksquare.csv';
%n = generate(filename, [120 300 100 0.1; 200 350 75 0.3; 400 10 150 0.2]);
%fprintf(1, '%d users generated for %s', n, f... |
clc;
clear all;
close all;
n=input('enter the number of summation terms');
k=1:n;
p=2*(k-1);
x=pi/4;
for i=1 : length(p)
f(i)=((-1)^(k(i)-1)*(x^p(i))/factorial(p(i)));
end
res=sum(f); |
%% Load behavioral data and prepare it for the toolbox
% Data: Yb , Yn
load('example_a.mat');
% Yn - logarithm of reaction time
ind = find(~isnan(Yn));
Yo = Yn(ind)/1000;
Yn = log(Yn(ind)/1000);
% Yb - decision (0/1)
Yb = Yb(ind); N = length(Yn);
% Input - 1 xi
In = zeros(N,2);In(:,1)= 1; In(:,2)= 1;
... |
function [O,Plog] = filterPoints(x,y,O,L,method)
% Given a n-by-n set of points, a position (x,y), and a distance L, remove
% all points that are not within the [-L,L]^2 box, or not in the L-radius
% super-ellipse. The 5th input parameter can be either 'rect' or an even
% number specifying the degree of... |
clear all
close all
clc
b=1.595;
a=1.430;
uc=20;
cr=96000;
cf=80000;
i=4132;
m=2325;
k1=3.9795;
k2=-2.9163;
k3=113.5779;
k4=22.3271;
A=[(-cf-cr)/(uc*m)-cf*k1/m (b*cr-a*cf)/(uc*m)-uc-cf*k2/m -k3*cf/m -k4*cf/m;(b*cr-a*cf)/(uc*i)-a*cf*k1/i (b*b*cr-a*a*cf)/(uc*i)-a*cf*k2/i -a*cf*k3/i -a*cf*k4/i;0 1 0 0;1 0 uc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.