text stringlengths 8 6.12M |
|---|
function [lny,sigma,tau,phi] = Macedo2019(To,M,~,mechanism,region,Vs30,func,varargin)
% Conditional Model for Arias Intensity
% M = Moment magnitude
% func = function handle to Sa model
% mechanism = 1 for interface earthquakes
% 2 for intraslab earthquakes
% un = units of IM
% Vs30 ... |
%% Student Name = Hüseyin Çapan Student Number = e213544
clc ; clear ; close all;
%% Open the Hyperspectral image in MATLAB
x = hdfinfo('C:\Users\capan\Desktop\METU1.2\561DigitalImageProcess\assg1\EO1H1770392009349110KV\EO1H1770392009349110KV.L1R');
sds_info = x.SDS;
hyp_img = hdfread(sds_info);
%% Hyperspectra... |
function varargout = calculate(varargin)
% CALCULATE MATLAB code for calculate.fig
% CALCULATE, by itself, creates a new CALCULATE or raises the existing
% singleton*.
%
% H = CALCULATE returns the handle to a new CALCULATE or the handle to
% the existing singleton*.
%
% CALCULATE('CALLBACK',hO... |
f_opt= 8.568546470949960e+3;
f_lb= 8.568544079948495e+03;
ASGARD_fc_svm_ijcnn1m= importdata('../IPALM/results/DLRCSGR2_SVM_outer_ijcnn1tau_23',' ');
DLRCSGR_eps_svm_ijcnn1m= importdata('../IPALM/results/DLRCSGR3_SVM_outer_ijcnn1tau_1',' ');
SMART_CD_svm_ijcnn1m= importdata('../IPALM/results/PDCD_SMSVM_SVM_outer_ijc... |
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ---[ I. Basic MatConvNet skills ]--- %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Go to the matlab directory: cd (YOUR_DIRECTORY)\DL_session1
% First we run vl_setupnn (change path if necessary)
run ./../../MatConvNet/matlab/vl_setupnn
% Have a closer look at a network... |
function out = list_electrodes(subj_list)
% LIST_ELECTRODES returns electrode labels for a given subject(s)
% Will also print out a summary of the label prefixes.
% Usage:
% list_electrodes({'D14', 'D15'});
recondir = get_recondir();
if ~iscell(subj_list)
subj_list = {subj_list};
end
out =... |
function [Seff bmg]=sortsets(effij,n)
% SORTSETS sorts a set of coalitions (coal,n) that reflects the
% unique integer representation of sets used in Matlab
% according to their power set representations, that is,
% the coalitions will be sorted according to their cardinality.
% Smallest coalitions coming first.
%
% Ex... |
classdef flanger < handle
% MEMORY
properties
input_blocksize; % self explanatory
max_delay;
max_delayunits;
sampling_rate;
pi_cnt;
pi_reset;
sin_term;
sin_inc;
output_buffer;
delay_buffer;
wr_ptr;
time_shift_idx... |
function [ pseudo_local_minima ] = find_pseudo_local_minima(pseudo_extremum,local_max_ind,local_min_ind,param)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
pseudo_local_minima=[];
d=0;
if (strcmp(param,'border')==1)
for i=1:1:size(local_min_ind,1)-1
ind_p ... |
% AMATH 585 HW 1
% 1.2 a
%A= [ 1, 1, 1, 1, 1; -2, -1, 0, 1, 2; 2*h^2, 0.5*h^2, 0, 0.5*h^2, 2*h^2; -8/6*h^3, -1/6*h^3, 0, 1/6*h^3, 8/6*h^3]
A= [ 1, 1, 1, 1, 1; -2, -1, 0, 1, 2; 2, 0.5, 0, 0.5, 2; -8/6, -1/6, 0, 1/6, 8/6; 16/24, 1/24, 0,1/24, 16/24]
b = [0;0;1;0;0]
W = [1, 1,1; 0,-1,-2;0,1/2,2]
y= [0;1;0]
clear all... |
clear;
close all;
clc;
% Macros
MC = 1000; % Size of the monte-carlo ensemble
N_MC = 1;
M = 50; % Number of antennas at base station
K = 75; ... |
function readTableIntegers(src,eventdata)
data=get(src,'Data');
row=eventdata.Indices(1);
column=eventdata.Indices(2);
try
value=eval(sprintf('[%s]',eventdata.EditData));
assert(all(value==round(value)),'ERROR');
data{row,column}=sprintf('%d ',value);
catch
data{row,column}=eventdata.PreviousData;... |
% ------------------ MEDIDOR DE VELOCIDAD DE VEHICULOS ------------------ %
% --------------------- DANIEL FELIPE OSPINA PEREZ ---------------------- %
% ---------------------- MARIO ANDRES GARCIA TORO ----------------------- %
% ------------------ PROCESAMIENTO DIGITAL DE IMAGENES ------------------ %
% ------... |
clear all;
body = 'Earth';
[r, mu, ~, ~, soi, rgb] = orbital_constants(body);
para(1) = r;
para(2) = 500;
para(5) = 1.5;
para(6) = mu;
para(9) = soi;
[radius, para, time] = orbit_calc(para, 1);
Mh = mu^2/(para(2)*para(7))^3*(para(6)^2 - 1)^1.5*t; |
function [x,y] = correct_position(x,y,row, col)
% when using circulate boundary condition, this function can help correct
% positions
x(x < 1) = x(x < 1) + row;
y(y < 1) = y(y < 1) + col;
x(x > row) = x(x > row) - row;
y(y > col) = y(y > col) - col;
end |
function cosinorCollector = acrophaseWithPlot
%RUNMODEL Runs the pacemaker model on data collected from CMR2 App
fclose('all');
close all
clear
clc
%% Dependencies
addpath('C:\Users\jonesg5\Documents\GitHub\HealthyHomeBlackBox')
addpath('C:\Users\jonesg5\Documents\GitHub\HealthyHomeBlackBox\defines')
%% File paths
t... |
function outputs = func_outputs(inputs,ratio,A,A_q,d,coord_list,query_mask_list,qtotal,draw)
if ismatrix(inputs)
inputs=reshape(inputs,1,size(inputs,1),size(inputs,2));
end
iter=size(inputs,1);
inputs=reshape(inputs,iter,[]);
N=size(inputs,2);
outputs=zeros(iter,1);
%%%%%%%%%% get the string for interpolation
ex... |
clc
clear all
close all
% ident
exp_file="./spab/exp_259.csv";
M = readtable(exp_file);
input = M(:,14);
input = input{:,:};
% 11 - node 7
output = M(:, 11);
output = output{:,:};
inputx = M(:,15:20);
inputx = inputx{:,:};
disp(inputx)
trim_start = 100;
input = input(trim_start:length(input),:);
output = output(tri... |
function [fluxFlat]=alphaEqnUmFluxFlat(uFlat,Um,V0,rhol,rhog,a)
% Gives the flux for alphaEqn in mixture model with Um term
% u flatten version (u has plain data)
%
% [fluxFlat]=alphaEqnUmFluxFlat(u,V0,Um,rhol,rhog,a)
%
% fluxFlat: obtained flux
% u: independent unknown as a vector (no BC's)... |
function [f_lb, f_ub, S] = frangepower(x_t, fs, w0, dt)
A4 = 440;
dc = 10;
beta = 0.1;
eps_u = 0.7;
eps_l = 0.075;
f_min = 25;
f_max = 4000;
[s, f] = logscaleset(A4, dc, w0);
omega = angfreqset(x_t, fs);
gm = morlet.scaledspectrum(omega, w0... |
%%Lab 3
clear
clc
%%
x = [0.2:0.5:2.2];
fxdx = 0;
n=length(x)-1;
h=2/n;
for i = 0:n
if mod(i,2) == 0
if (i == 0)|| (i == n)
fxdx = fxdx + fx(x(i+1));
else
fxdx = fxdx + 2*fx(x(i+1));
end
else
fxdx = fxdx + 4*fx(x(i+1));
end
end
fxdx = h/3*fxdx;
dis... |
function [xi_est, yi_est, ss_var, rho_opt, sig1]=getSScores(res, x, t_x, y, t_y, nsvd, error, method, shrink, regular, rho)
mu_x=getVal(getVal(res,'xx'),'mucopy');
sc_x=getVal(res,'sc_x');
lambda_x = getVal(res,'lambda_x');
sigma_x = getVal(getVal(res,'xx'),'sigma');
out1x = getVal(res,'out_x');
... |
function [x,y]=dioph(a,b,c,nx,ny,show)
%
% usage: function [x,y]=dioph(a,b,c,nx,ny)
%
% solve the polynomial equation:
%
% c = a*x + b*y
%
% where nx and ny are the orders of x and y. c will eventually be
% padded with zeros to obtain a solution.
%
% Sylvester version.
% Program... |
function R = crosscorrcoef(a, b)
[m, n] = size(b);
N = numel(b);
box = ones([m, n]) / N;
Ea = conv2(a, box, 'valid');
Eaa = conv2(a .* a, box, 'valid');
SDa = sqrt(Eaa - (Ea .* Ea));
Eb = mean(b(:));
SDb = std(b(:));
valid = @(x) x(m : end-m+1, n : end-n+1);
C = valid(xcorr2(a, b)) / N;
R = (C - Ea * Eb) ./ (SDa * SDb... |
function X = f_dummy(Y,trim)
% - dummy coding of categorical variables
%
% USAGE: X = f_dummy(Y,trim)
%
% Y = column vector of integers specifying factor levels or group membership;
% trim = trim last column to avoid a singular matrix (default = 1)
%
% SEE ALSO: f_dummy2cat, f_xMatrix, f_helmert, f_designMatrix, f... |
function proj3_mrf(y_all, y_all_stacked, sz, i_component, str_components, nc, MHsigma2)
% Neighbourhood
neighbours1 = [0 1 0;
1 0 1;
0 1 0];
neighbours2 = [1 1 1;
1 0 1;
1 1 1];
neighbours3 = [0 0 1 0 0
0 1 1 1 0;
1 1 0 1 1;
... |
close all, clear all;
scenario = 81;
wind_performance
wind_review_mc
plot_mtv_winds_mc_results
|
%image=imread('image.png');
%A=imread('skinit.jpg');
%%YCbCr=rgb2ycbcr(image);
%%imshow(YCbCr);
fis=readfis('fuzzy.fis');
%%Y=evalfis(YCbCr,fis);
%%Y = evalfis(YCbCr,fis);
%%R=YCbCr(:,:,1);
file='data.txt';
[A,delimitorOut]=importdata(file);
%C=unique(A,'rows');
B=A(:,1);
G=A(:,2);
R=A(:,3);
RGB=[R(:)... |
%
% query2: str = query(A, cmd);
%
function [str msg] = query2(A, cmd)
if (A.connected)
serialport(1, cmd);
pause(0.001);
[s msg] = serialport(2, '', A.timeout);
if (msg(1) == 0)
str = char(s);
else
% Timeout
str = '';
... |
function [ output_args ] = testDialog( input_args )
%TESTDIALOG Summary of this function goes here
% Detailed explanation goes here
% prompt = {'Enter matrix size:','Enter colormap name:'};
% dlg_title = 'Input';
% num_lines = 1;
% def = {'20','hsv'};
% answer = inputdlg(prompt,dlg_title,num_lines,def);
prompt = 'Do ... |
function [ h_wc ] = alturaConoAguaMaximo( q_o, B_o, mu_o, r_e, r_w, k_f, rho_diferencia, cementado )
%alturaConoAguaMaximo - Calcula la altura maxima de conificación de agua en la correlación de Pérez-Martínez para un ycaimiento con una formación carbonatada fracturada.
% h_wc = ( 2.963 + F_bc ) * ( ( q_o * B_o * mu_o... |
% load in notes
insts = {'piano','violin','flute','trumpet','bass'};
NFFT = 2^15;
for j=1:length(insts)
varname = [upper(insts{j}),'_FFTS'];
dirname = ['samples/',insts{j},'/'];
files = dir(fullfile(dirname, '*.aif*'));
FFTS = zeros(NFFT/2+1, length(files));
for i=1:length(files)
file = file... |
function [ y sd fintitle lodzerolpvalues ukholder] = beadfigure(methodI,methodSD,zeroI,zeroSD,conc,exposures,groupselected,drtype,erbarvalue,uklp,uklpsd,comp)
% Created by Evan Brooks, evan.brooks@wpafb.af.mil
%
% Adaptation of scrollplotdemo by Steven Lord:
% -> Created by Steven Lord, slord@mathworks.com
% -> Uploade... |
function C = strainStressLaw(E, v)
% Generate stress-Strain law matrix from Hooke's law in 3d
% Vicente Cholvi Gil
ci = E/((1+v)*(1-2*v));
C1313 = [1-v, v, v;
v,1-v, v;
v, v,1-v];
C4646 = eye(3)*(1-2*v)/2;
C = zeros(6,6);
C(1:3,1:3) = C1313 * ci;
C(4:6,4:6) = C4646... |
%% Recreate FIgure 1 from paper
%
% This script loads in the processed data from this paper:
%
% Winawer J, Witthoft N, Frank MC, Wu L, Wade AR, Boroditsky L. Russian
% blues reveal effects of language on color discrimination. Proc Natl Acad
% Sci U S A. 2007 May 8;104(19):7780-5. doi: 10.1073/pnas.0701644104. Epub
... |
function ys = shuffle(xs)
% Shuffle an array
ys = xs(randperm(length(xs))); |
function [ valid ] = occlusion_is_valid( x, left_a, right_a, occl_side, geometry )
%OCCLUSION_VIS_ALID Summary of this function goes here
% Detailed explanation goes here
%int occl_axis = occl_side < 0 ? left_a : right_a;
if occl_side < 0
occl_a = left_a;
else
occl_a = right_a;
end
%int occl_vpt_col = geom-... |
function [fdcomm, radar, cov] = tsp_UL_subgradient_wc(fdcomm, radar_comm, radar, cov, ii,k)
% UL subgradient method
% update P_ui within the sub-gradient method
tu_max = fdcomm.tu_max;
t = 1;
lambda_ui_k_t = 1;
% mu_i_k_t = fdcomm.mu_UL(ii,k);
mu_ui_k_t = 1;
%% Initialization
fdcomm_temp = fdcomm; % to track
radar_t... |
function [ rm ] = change_sigma_to_rm( sigma )
%The charm file format has a different set of parameters to the OPLS format
%this function changes the sigma from OPLS to rm charm format
rm = (2 * ( sigma^(6) ))^(1/6) /2; %division by 2 as rmin/2 in charm file
end
|
function [nlml, dnlml] = gp_grid_posterior(x, likefun, priorfuns)
% priorfuns - a structure .indices = hyperparameter indices, .func =
% @priorfunc()
%
%
% SANITY CHECK - gradient of cov function,
% gp_grid_posterior - PASSED
% checkgrad('gp_grid_posterior', hypers_init, 1e-3, loglikefunc,gpmodel.logpriorfuns)... |
function [t, z, fs, ggs, ts] = proj_w(p, w, x, xwr, varargin)
if nargin == 5
niter = varargin{1};
else
niter = 100;
end
c1 = 1; % maximum step size
% initial guess
normw = sqrt(innerprod_TpM_spd(w,w,p));
uw = w/normw;
if isempty(xwr)
error('Not Implemented... |
function xi_wedge = SE3_wedge(xi)
%SE3_WEDGE generates a 4x4 matrix given a 6-vector in the twist coordinates
%
% SYNOPSIS: xi_wedge = SE3_wedge(xi)
%
% INPUT xi is a 6-vector in the twist coordinates, i.e. xi = (v, w) where
% v is for the 3-vector translation and w is for the 3-vector
% axis-angle rotation... |
% SPECIFY THE OBJECT MOTION (IN THE FUTURE CAN USE EXPERIMENTAL MOTION TRACKER)
% discretize and describe the body motion in space, including position and velocity (speed and direction) for each element.
% render the body motion animation?
% This object motion spans the length of physical time.
function [X,... |
function Show_EWT2D_Curvelet(ewtc)
%==========================================================================
% function Show_EWT2D_Curvelet(ewtc)
%
% This function displays the curvelet coefficient obtained by the Empirical
% Curvelet Transform (one figure per scale)
%
% Inputs:
% -ewtc: output of the empirical ... |
function lh = arrow(X,Y,ArrowType,ArrowWidth,ArrowColor);
% arrow(X,Y,ArrowType,ArrowWidth,ArrowColor);
%
% Adds an arrow in vectors X and Y to the current axes.
% The arrow head is plotted in the end point of the line.
%
% If X and Y are matrices the same size, a multisegmented
% arrow is plotted with one arrow he... |
function [ s ] = Define_sstate_input( )
% define g_y, z_y, b_y, h_ss, a_ss,
s.h_ss = 0.25;
s.b_y = 0.4;
s.g_y = 0.140532846;
s.z_y = 0.177825702;
s.a_ss = 1;
s.betta = .97;
end
|
function x=ResolverMetodoLU(A,b)
n=length(A);
L=size(n);
U=size(n);
y=zeros(n,1);
x=zeros(n,1);
[L,U]=EncontrarLU(A);
%Dado que L es triangular inferior, hay que rotarla de lado a lado y de
%arriba a abajo, asi como tambien el vector b y el resultado
%rot90(L,2) es equivalente a fliplr(flipud(L))
y=flipud... |
function P = DctWrite(Im,Im0,k)
%Im obraz do ktorego dopisuje ,może być kolorowy
%Im0 obraz ukrywany moze byc kolorowy ale zostanie zamieniony na czarnobialy
%algorytm bedzie dzialać tylko na blokach 8x8 z wzgledu na kwantyzacje
%k to stopien zagnierzdzenia
N=8;
T = dctmtx(8);
dct = @(block_struct) T * block_struct.da... |
function [ s ] = fitscaleparameter(xdata, ydata, mu, sig, uest, sest, m)
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
nn = 1/1024;
xdata = (round(xdata./nn)).*nn;
ydata = arrayfun(@(x)mean(ydata(xdata==x)),unique(xdata))';
if length(ydata) > 204
bins = nn:nn:(max(xdata)+0.1);... |
function d=rdCylTrainingAna(varargin)
% analyse the training data.
% if input is empty, it just plots data.
%
% input 1 : fit yes or no (1 or 0)?
% input 2 : other functions (opens dialog)
%
if nargin==0 || varargin{1}==0
fit=false;
elseif varargin{1}==1
fit=true;
end
if nargin==2
[c,sr]=GUI;
end
fnames=... |
function beam = simple_euler_beam_solver(beam)
if strcmp(beam.lb, 'fixed') && strcmp(beam.rb, 'fixed')
A = zeros(beam.N-2, beam.N-2); % the first node and last node are excluded
A(1,1:3) = [7 -4 1];
A(2,1:4) = [-4 6 -4 1];
A(3,1:5) = [1 -4 6 -4 1];
for k = 1 : beam.N-7
A(k+3,:) =... |
figure(1)
x=[-2:0.5:2];
subplot(2,3,2)
plot(x,x,'r-',x,exp(x),'b*-')
legend(['y=x';'y=e^x'])
subplot(2,3,4)
plot(x,x.^2)
title('y=x^2')
subplot(2,3,5)
plot(x,x.^3)
xlabel('Axe x')
subplot(2,3,6)
plot(x,sqrt(x))
figure(2)
x=linspace(0.1,exp(2),100);
plot(x,log(x)); |
function [] = KF_multiple_similar_sensors_1d_withvel()
[dt,t,n,signals,velocity,clean] = KF_INPUT_DATA();
[X,P,X_arr,Q,F] = setX_P_Xarr_Q_F(n,dt);
H = [1 0;
0 1];% observation matrix
%% fusion
for i = 1:n
if (i == 1)
[X, P] = init_KF(X, signals(1).sig(i, 1)); % initialize the state using the 1st senso... |
function idx = bfind(A, num, len)
% BFIND Binomial search of sorted vector
%
% Searches the vector A for the value 'num' and returns the index of 'num'.
% Note: If multiple instances of 'num' are present, it is not defined which
% instance's index will be returned.
%
% IDX = BFIND(A, NUM) Searches A for the value num.... |
LyotRadius = 0.8;
%% mask1
maskpara = linspace(0.5, 2.0, 100);
for i=1:100
fn = sprintf('Lyot-%.2f-%s-%1.3f', LyotRadius, 'mask1-Lband', maskpara(i));
HR8799(LyotRadius, 'mask1', maskpara(i), fn);
end
%% mask2
maskpara = linspace(0.3, 0.95, 100);
%for i=1:100
% fn = sprintf('Lyot-%.2f-%s-%1.3f', LyotRadius... |
% return the Euclidean matrix from a realization K x n matrix
function [D] = eucldist(x)
D = sqeucldist(x).^(1/2);
end
|
folderID = '';%'F:\ventilation_simulations\3_2_2016_10X10_dataset';
%cd(folderID)
pathCSTR = [folderID,'\Tamb_30_size_*50.mat'];
file_list = dir(pathCSTR);
figure('color','w')
for i = 1:10
h(i) = subplot(2,5,i);
end
for i = 1:10
load(file_list(i).name)
subplot(h(i))
plot([s.order_paramete... |
function sigclean=waveclean(signal)
%waveclean=WAVELET-USING FUNCTION CLEANER
%function to automatically clean a function using wavelets, function
%should be length 2^J, where J is a positive integer
%
% Appropriate citation:
% Prause, N., Williams, K., & Bosworth, K. (2009). Wavelet denoising of
% vaginal puls... |
function [mn files]= mk_testGradVar
% filePath = 'C:\zxk\Research\monkey\monkey_cppPrj\testHOG\FPpatches';
filePath = 'C:\zxk\Research\monkeyData\Camera3_labeledVideos_Patch_Neg';
files = dir([filePath '\*.png']);
hy = fspecial('sobel');
hx = hy';
mn = zeros(length(files),1);
for i=1:length(files)
I = imread([fi... |
%--------------------------------------%
% Código relativo ao 3.3 %
% %
% permite observar contornos canny com %
% vários valores de threshold e de %
% sigma %
%--------------------------------------%
clc
clear
close all
[ha, pos] =... |
function mri_surf2surf(srcsubject,trgsubject,sval,tval,hemi)
% Uses Freesurfer's 'mri_surf2surf' command to project from a surface
% volume from one surface to another
%
% Usage:
% mri_surf2surf(srcsubject,trgsubject,sval,tval,hemi)
%
% Written by Andrew S Bock Nov 2015
%% Project surface
system(['mri_surf2surf... |
%% generate Gaussian peak
rng(20151029);
N=50;
x=linspace(-1,+1,N);
x=x(:);
y=exp(-x.^2/(2*0.25^2))+0.05*randn(size(x));
data=[x y];
figure;
plot(x,y,'.');
%%
fit=@(p,xb,yb) [x p(1)+p(2)*exp(-(x-p(3)).^2/(2*p(4)^2))];
guess=nan(4,1);
guess(1)=min(y);
[guess(2),index]=max(y);
guess(2)=guess(2)-guess(1);
guess(3)=x(in... |
%Katelyn Charbonneau
%CPE490 Software Defined Radio Jan22Classwork
clear
clc
format short
format compact
Fs = 5000;
Ts = 1/Fs;
fm = 5;
fc = 40;
Ac = 1;
Am = 1;
mu = 0.5;
t = [0:Ts:2-Ts];
DSB_Amp_Mod(Fs, fm, fc, Am, Ac, mu, t);
%ct = Ac*cos(2*pi*fc*t);
%mt = Am*cos(2*pi*fm*t);
%AM
%st = Ac.... |
% playMusic
function action = playMusic( action,player)
switch action
case 'play'
action
resume(player);
clear action;
action = 'pause';
pause(1)
return;
case 'pause'
action
pause(player);
c... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Assume that lambda is the exponential parameter, and T the truncation point.
% Generate TRUNCATED EXPONENTIAL RV
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [truncated_variables] = truncated_exprnd (mu... |
% Some testing script
%
% -Currently designed to empirically assess what future threat calculation
% procedure to use
%
% Written by Joseph Kim
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc; close all; clear;
%% SCENARIO PARAMETERS
% Countermeasure effective table
% -CM order: [decoy, flare, chaff, laser]
gl... |
function binary_table = quantize_columns(profile_table)
%reading each column
tweets_per_day = profile_table.tweets_per_day;
rt_per_day = profile_table.rt_per_day;
tweets_during_weekday_per_week = profile_table.tweets_during_weekday_per_week;
tweets_during_weekend_per_week = profile_table.tweets_duri... |
function [t, s] = mvmTime(A, n)
%mvmTime Sparse Matrix-vector multiplication timing test.
% [T,S]=mvmTime(A,N) computes the time required to evaluate A*x where A =
% sparse matrix. N random experiments are performed. T=mvmTime(A)
% performs 10 experiments. If two output arguments are requested, S holds
% t... |
# initial position x, v, a
x0=[0;0;1];
# acceleration modifies velocity, velocity modifies position
A=[0 1 0;
0 0 1;
0 0 0];
h=0.01;
x=[];
x(:,1)=x0;
IhA=eye(3)+h*A;
for i=1:100
x(:,i+1)=IhA*x(:,i);
endfor
figure
axis([-1 1 -1 1 0 1])
hold on
for ii=1:100
plot3 (x(1,ii),x(2,ii),x(3,ii),'*');
pa... |
function lml = evalLgMrgLkl( Xv, Yv, covStr, GP )
% function: lml = evalLgMrgLkl( Xv, Yv, covStr, GP )
%
% Evaluates log marginal likelihood of observed real dynamics Yv across Xv
% for a given GP with covariance structure covStr.
%
% covStr is a structure with fields { 'NGP', 'kFun' }.
%
% GP is a structur... |
function display(obj)
%DISPLAY Displays the NXTUSB object
disp(' ')
disp(obj)
disp('NXTUSB information')
disp(' ')
switch obj.CurrentState
case 0
c.CurrentState = 'NXT_NOT_FOUND';
case 1
c.CurrentState = 'NXT_OPEN_FAILED';
case 2
c.CurrentState = 'NXT_GET_NAME_FAILED';
case 3
... |
% Plot the contours of a 2d Gaussian as well corresponding 1d marginal and
% conditional Gaussians. Written by Matthew Dunham
function plotGauss2dMargCond
fig = figure('Color','w');
mu = [0.5 0.5];
sigma = [0.018 0.01 ; 0.01 0.011];
plot2d;
plotMarginal;
plotConditional;
annotate;
function plot2d ... |
var = load('vars/assets.mat');
data = var.assets(:,[2 5 6 7]);
% y = F(x1, x2)
x1 = table2array(data(:,2)); % PRICE
x2 = table2array(data(:,3)); % VOLUME
y = table2array(data(:,4)); % RETURN
% Differentiate - this method can be improved
dt = 1;
n=length(x1);
for j=2:n-1
x1dot(j-1)=(x1(j+1)-x1(j-1))/(2*dt);
x2dot(... |
% Simulation and Virtual Reality Parameters
% Simulation Parameters
TS = 0.001; % base sample rate [sec]
PWM_BL = 99; % pwm value to detect backlash [%]
% simulation stops when TIME_STOP_SIM have passed after NXT SCARA stopped
TIME_STOP_SIM = 10 * 1e3; % simulation stop threshold [msec]
% propo... |
function [KA,Weights,name] = HoughSelfcalib1_svdopt(TF,w,h,numparams,corrs)
%this function , given a camera center and a focal length and a fundamental
%matrix computes the error with respect to a fundamental matrix
if(numparams~=2)
error('function only works with 2 parameters, aspect ratio and focal length');
... |
%%
cd C:\Users\Cedric\Documents\SD.git\trunk\user_sandbox\Cedric\Simulation\BPSK_controller_Modulator
%%
clc; clear;
DrDelete = fopen('nrz_test_data.txt', 'w');
fclose(DrDelete);
MrWriter = fopen('nrz_test_data.txt', 'a');
for n = 1 : 100
r = randi(2,1,1) - 1;
fprintf(MrWriter, '%d\n', r);
end
fclose... |
%%% EEG-MICROSTATES NEUROFEEDBACK %%%
%%% This code runs the single NF run, receives preprocessed signal,
%%% calculates the microstates occurence in trial and sends via TCP/IP the
%%% time, spent in a certain microstate to the Client
clear;
addpath([fileparts(which('step_05_Server_HardTiming.m')) '\functions\']);
%%%... |
function F = automate_gk_eqns(f,R)
% automate_gk_eqns Equations for calculation of scrambling coefficients
%=========================================================================
% automate_gk_eqns Version 1, Aug 28, 2017
%
% USAGE: [v,fval] = lsqnonlin(@automate_gk_eqns,x0,lb,ub,options,R(n,:));... |
function Mat = Vect2Mat(Vect,i)
[ n , m ] = size(Vect);
n=round(sqrt(n));
Mat=zeros(n,n);
if( (i<=m)&(i>0) )
Mat(:)=Vect(:,i);
else
return;
end;%if
Mat=Mat';
|
function ShowAverageWaveform(iClust,varargin)
% ShowWaveformDensity(iClust)
%
% INPUTS
% iClust
%
% OUTPUTS
%
% NONE
% TO USE WITH MCLUST, put this in the MClust/ClusterOptions folder
% ADR 2003
%
% Status: PROMOTED (Release version)
% See documentation for copyright (owned by original authors) and warranties (no... |
classdef TuPrn < TuSol
% TUPRN creates the subclass object TuPrn to perform several computations for retrieving
% and modifying game data. It stores relevant game information and
% the pre-nucleolus obtained by overloading functions from various solvers.
%
% Usage: clv = TuPrn(v,'gtype','gformat')
%
% Define variables... |
% Author: Housam Binous
% Non-Newtonian Fluid Model Determination (for Bingham fluid)
% National Institute of Applied Sciences and Technology, Tunis, TUNISIA
% Email: binoushousam@yahoo.com
function Q=volflowrate(x)
dPg=x(1);
tau0=x(2);
nu=x(3);
R=0.01;
% expression of volumetric flow rate for Bi... |
function g=filth(I)
%I=A;
F=fft2(I);
Fc=fftshift(F);
%figure;
g=log(abs(Fc)+0.0001);
%imshow(log(abs(Fc)+0.0001));
%H=eye(size(I));
%G=H.*Fc;
%gi=ifft2(ifftshift(G));
%g=real(gi);
end |
%IM_RESIZE Mapping for resizing object images in datasets and datafiles
%
% B = IM_RESIZE(A,SIZE,METHOD)
% B = A*IM_RESIZE([],SIZE,METHOD)
%
% INPUT
% A Dataset or datafile
% SIZE Desired size
% METHOD Method, see IMRESIZE
%
% OUTPUT
% B Dataset or datafile
%
% DESCRIPTION
% The obje... |
% This script takes in a cleaned count matrix from the RadiationCalibration
% workspace and calculates the CPM over 8 different 15-second intervals
% (assuming that the data are spaced evenly with respect to time). The
% average CPM is also computed.
% The name of the input matrix should go here:
inputFile='CleanCount... |
%%%%%%%%%pitchDistr%%%%%%%%%%
function pitchDistr = getpitchDistr(nS,nPPS,nSPP,minPitch,sigmaYinPitchAttack,sigmaYinPitchStable)
%get mu(the mean of the distribution)
nS = 69; %number of semitones
nPPS = 3; %number of pitch per semitone
nSPP = 3; %number of states per pitch
iPitch = 0:1:nS*nPPS-1; %every step o... |
function [prob,q] = viterbi(hmm, O)
%Viterbi 算法
%输入:
% hmm -- hmm 模型
% O -- 输入观察序列, N*D, N 为帧数,D 为向量维数
%输出:
% prob -- 输出概率
% q -- 状态序列
init = hmm.init; %初始概率
trans = hmm.trans; %转移概率
mix = hmm.mix; %高斯混合
N = hmm.N; %HMM 状态数
T = size(O,1); %语音帧数
% 计算 log(init);
ind1 = find(init>0);
ind0 = find(init<=0);
init(ind0) = -i... |
% Función que utiliza el Método de Integración de Romberg y lo aplica a
%la función propuesta en el TP2.
%
% POST-CONDICIONES
% Se muestra por consola el resultado de la integración.
function tp2MetodoDeRomberg()
format longG
% Especificaciones
funcion = @tp2EcuacionRomberg;
a = 0;... |
function retorno=h(z)
retorno=z.^(2/3)-2; |
classdef ik < handle
% IK - A class to store Inverse Kinematics results from OpenSim.
%
%
% Created by Megan Schroeder
% Last Modified 2014-03-19
%% Properties
% Properties for the ik class
properties (SetAccess = private)
Time
Data
... |
classdef BernoulliMixture < handle
% Bernoulli Mixture model
% Bernouli Mixture model class and methods including EM
properties
K % number of bernoulli-distributions in the mixture
N % dimension of data
P % should be a N*K matrix indicates the probabilities in the Bernoulli
... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NAME: Alexander Price
% Jack Cochran
% Michael O'Malley
% JMU-EID: priceat
% cochr2jr
% omall2mp
% DATE: February 21, 2013
%
% PROGRAM: plotGoldbach.m
% PURPOSE: To plot a graph showing the number of pairs of pri... |
A=magic(3);
disp('load║═save├Ř┴ţ▓Ô╩ď');
disp(A);
|
clc
clear all
close all
% fs=200;
% fc=0.5;
% t=0:0.1:10;
% a=5;
% x=a*sin(2*pi*fc*t);
% x(47:65)=5*rand(1,19,'single');
% x=movmean(x,5);
fs=30;
load('C:\Users\Allan\Desktop\JRF\Depth_Arduino\Allan_Belt_6.mat')
% Filter(55:100)=0.77+(0.7719-0.77).*rand(46,1);
x=Force;
% x=Force;
x=movmean(x,3);
t=l... |
%**************************************************************************
% Ustawienia skryptu
%**************************************************************************
clc; % Czyszczenie konsoli
clear; % Usuwanie danych
close all;
addpath('./klasyfikatorNM');
addpath('./obliczanieBledu');
ad... |
classdef CountPixelsFeatureExtractor
%HOGFEATUREEXTRACTOR Summary of this class goes here
% Detailed explanation goes here
properties
threshold = 0.4;
end
methods
function features = getFeatures(this, image)
if ~islogical(image)
... |
function RPV01 = rpv01(Term,Settle,RPV_Dates,Basis,LIBOR,probfun,b)
%RPV01 Computes the "Risky PV01", ie, the expected present value of the
% premium leg at 1 bp
RPV_Time = yearfrac(Settle,RPV_Dates,Basis);
PaymentTimes = [RPV_Time(1);diff(RPV_Time)];
RPVQ = probfun(RPV_Time,b);
RPVDF = LIBOR.getDiscountFacto... |
y0 = gen_wave(1, 1);
y1 = gen_wave(2, 1);
y2 = gen_wave(3, 2);
y3 = gen_wave(2, 1);
y4 = gen_wave(1, 1);
y45 = gen_wave(2, 1);
y5 = gen_wave(5, 3);
y6 = gen_wave(1, 1);
y7 = gen_wave(-7, 0.5);
y8 = gen_wave(1, 1);
y9 = gen_wave(4, 1);
y10 = gen_wave(3, 3);
y11 = gen_wave(1, 1);
y12 = gen_wave(-7, 1);
y13 = g... |
Useful commands for spike analysis:
[exp] = readExpDescFile(pwd); fileindx = __
lp = initLightParam(exp, fileindx, 1); lp = readLpData(lp, [-10 10], [1 1 1], 1);
hotSpotMap
toMclust(lp)
Mclust
plotSelectedRubrics(lp, [], 50, [-400 600]);
plotSelectedStaPattern(lp, STAevents, 0, 1);
drawWV([file cluster], [row c... |
function [distancefee,timespan,remuneration] = rsm( chrosm,cus,Qt,j )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
%每条染色体的每条路线都要算出来
% distancefee = {zeros(25,10)};
% distancefee = repmat(distancefee,1,100);
distancefee = zeros(1,10);
%持续时间
% timespan ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.