text stringlengths 8 6.12M |
|---|
% Max 정규화 보정 스펙트럼
function [YY] = Max_normalize (x)
[XS YS] = size(x);
YY = zeros(XS, YS);
for i = 1:XS;
YY(i,:) = x(i,:)'/max(x(i,:));
end |
%script to produce swath profile and projected swath profile
%Needs Topotoolbox
%addpath(C:\Program Files\MATLAB\topotoolbox-master)
%JRA September 2018
clear all
close all
bearing_for_profile = -13; %degrees
%Here is a basic TopoToolbox set of commands to get started:
DEM = GRIDobj('output_hh.tif');
info(DEM)... |
% Make a simple inversino recovery experiment.
t_del = [0.2 0.2 0.2:0.2:2]'
t_adj = 10*ones(size(t_del));
doAS = zeros(size(t_del));
isSel = doAS;
save t_delays.txt t_del -ascii
save t_adjusts.txt t_adj -ascii
save isVelocitySelective.txt isSel -ascii
save doArtSuppression.txt doAS -ascii
|
function varargout = StaticAO(varargin)
% STATICAO MATLAB code for StaticAO.fig
% STATICAO, by itself, creates a new STATICAO or raises the existing
% singleton*.
%
% H = STATICAO returns the handle to a new STATICAO or the handle to
% the existing singleton*.
%
% STATICAO('CALLBACK',hObject,ev... |
function outEOG = preproallEEG(tasksettingM)
%This function is used to do some prepocessing for all the EEG data stored
%in .bdf (Biosemi) files using FieldTrip. EOG data is extracted and stored
%in the generated file EOG.mat as variable EOGv, which is a structure
%stored 4 pieces of information in its 4 fields:
% 1.... |
classdef Colorspace
% COLORSPACE -
%% CHANGELOG
% Written by Josh Grooms on 20150218
enumeration
HSL
HSV
RGB
end
end |
%POPULATE_LISTS calls the functions responsible for populating various list
% boxes in the interface.
%
% Syntax
% ------
% ui.populate_lists( sim, gr );
%
% Details
% -------
% Enters available plot types, user-defined measures, and measure and plot
% type combinations into their respective list boxes in th... |
% This program is the test of Saturated Vapor Pressure
% clc
% clear
var_name = 'phi';
% var_name = 'phit';
% var_name = 'zonal_wind';
% var_name = 'meridional_wind';
% var_name = 'vorticity';
it = 241;
gravity = 9.80616;
nc_file = '..\run\output.nc';
% nc_file = 'F:\case_result\WENO_case5\output_5th_0p125.nc'... |
function LR_Test()
%TEST FÜR N 0 5, 10, ..., 25
for n = [10:5:25]
%STUETZSTELLEN
x = transpose(((n-1):-1:0)/ n);
%B = [1, 1..., 2, 2..., 2]
b(1: floor(n/2)) = 1;
b(ceil(n/2):n) = 2;
%VANDERMONDE-MATRIX
V = vander(x)
%AUFRUF DER METHODE ZU BESTIMMUNG DER LR ZERLEGUNG
LR = LR_... |
function probVec = forwardPass(inImg, parameters, biasvectors)
%inImg: 32 x 32 x 3
%parameters: filterbanks 1 x 18 cell
%biasvectors: 1 x 18 cell
%nomalize input img
img = imgNormalization(inImg);
%layer 2 convolve
filters = parameters{2};
bias = biasvectors{2};
img = conv... |
function w = rowToWavelength(N)
%
% N = size of first dimension in hyerspectral data cube
% w = wavelength of each element
%
x = [1:N]';
x1 = 519;
x2 = 613;
y1 = 600;
y2 = 700;
A = [x1 1; x2 1];
v = inv(A) * [y1; y2];
w = [x(:) ones(size(x(:)))] * v;
return;
|
%% Declaration of Authoriship
% This code was written by Jason K. George
% for the purpose of his final year project at Stellenbosch University
% in partial completion for the subject Project (E) 448
%% Code
d_trans = [];
d_trans(1) = 2;
i = 2;
desired_length = 6;
d = zeros(1, desired_length);
while length(d_trans) ~=... |
function Boolean=ColorConditionNorm(Act,Var,ColorVector,thresholdNorm)
% this function computes the norm between the two vectors in the RGB
% color space
%first we want to retrive the vector color from the ColorVector
Col1=ColorVector(1:3,Act);
Col2=ColorVector(1:3,Var);
%now we compute the cross product between ... |
function [Gate_Cost_Table,Pr_Input_State_Mtx,Next_Initial_State,Next_Dest_State,Cost] = Find_Minimum_Cost_Transition(Pr_Input_State_Mtx,W_D,W_O,SPSD_Observed_States_Numbers,SPSD_Stable_State_Numbers,Num_var,Pr_Gate_Mtx)
Next_Dest_State = [];
Next_Initial_State = [];
Stable_Observed_State = [];
%Find the gate that are... |
clc; clear all; close all;
% This code is to RUN DSI for Geisel Library
%fs=100 %input=lbba(basement), %output:other three
tic
%% step 1: load data from station
station = {'lbba','lbse','lbno','lbsw'};
%e stands for east, n stands for north, z stands for vertical
dir = {'e','n','z'};
path = 'C:\Users\think\Desk... |
d = [];
for i = 0:180
d = [d; distance(1.25, .5, i)];
end
plot(d) |
function XYZ = pixelToXYZ(pixels,matched_cam_edges,vertices)
% This function converts a pixel location to XYZ coordinates.
%
%Created by: Jaco Verster (versterrie@gmail.com)
%
%Inputs: pixel location: [col row], [X,Y]
%Output: XYZ coordinate for pixel.
%Clear the workspace variables and close everything
%clc, clear , ... |
Z = peaks;
figure('Renderer','zbuffer');
surf(Z);
axis tight manual;
F = struct('cdata',[],'colormap',[]);
set(gca,'NextPlot','replaceChildren');
for j = 1:20
surf(sin(2*pi*j/20)*Z,Z)
F(j) = getframe;
end
movie(F,2) % Play the movie twenty times |
%% Evaluate behavioral results from SpExCue Exp. 3
fnPath = '../data';
% subjects
tmp = load('SpExCue_Exp3eeg_subjects.mat');
subjects = tmp.subject;
% subjects = subjects(2:4,:); disp('only S21, S15, and S28')
fnext = '_30deg_test.mat';
% fn = dir(fullfile(fnPath,'*_30deg_test.mat'));
seqsel = {1,2:3,1:3};
seqLbl ... |
num=xlsread('verify.xlsx')
x = num(:,1)
y = num(:,2)
z = num(:,3)
h = num(:,4)
b = num(:,5)
e = num(:,6)
plot(x,y,'-*',x,h,'-o',x,b,'-^',x,e,'-d'),axis ( [0 1100 0 500] ),xlabel('数据的数量'), ylabel('平均验证时间(ms)'),legend('DFHMT-11','B-DIS','DFHMT-4','DFHMT-8') |
close all; clear all; clc;
tic
%generate data
% load features.train
% Y = features(:,1);
% X = features(:,[2 3])';
[X, Y] = DataToXY('features.train');
% N = length(Y); %number of samples
% D = length(X(:,1)); %dimension of features
[D,N] = size(X);
T = 1000; %maximum iterations
w = zeros(D,1); %w is a D * 1 vect... |
function count = findnum(M,x,n)
count=0; % Counting variable is initially set to 0
for j=1:n+1
for i=1:n+1
if(M(i,j)>x)
count=count+1; % If the given number is greater than the element in the matrix, increment count
% Loop check... |
%% Read stuff in
toSub = 'skeri0055_fs4'
fromSub = 'skeri0044_fs4'
freesurfDir = getpref('freesurfer','SUBJECTS_DIR');
[lm,rm] = mne_read_morph_map(fromSub,toSub,freesurfDir);
toSubSrcSpaceFile = fullfile(freesurfDir,toSub,'bem',[ toSub '-ico-5p-src.fif']);
fromSubSrcSpaceFile = fullfile(freesurfDir,fromSub,'bem',[ ... |
clear;
figure(1);
clf;shg;
warning('off');
m = 1;
iter = 1;
x0 = [1 pi/3 pi/6];
xt = [1 pi/3 pi/6];
n_p = 10000;
n = 100;
t_max = 2*pi;
t_interval = 0.1;
% s_x = [];
% s_cov = [];
%
% for i = 1:n
% [x,cov] = simu(m,iter,x0,xt,t,n_p);
% s_x = [s_x; x];
% s_cov = [s_cov; cov];
%
% end
%
% x1 = x0(1)*s... |
load Full_3d_VIM_locs_2009Feb.mat
nTC = 490;
nCER = 233;
nCTX = 233;
nRN = 233;
nTIN = 113;
NTOT = nTC+nCER+nCTX+nRN+nTIN;
% Arrange potentials from COMSOL by cell order
load Pop1XYZPhi_vim_0.2_UMFPACK.txt
PHI_CM1 = Pop1XYZPhi_vim_0(:,4);
PHI_NRN1 = cell(100,1);
Drop_ax1 = ones(5,100);
load Drop1_ind.mat
for nc=1:... |
clc;clear;close all;
%-------- load & init--------%
map = openfig('testmap.fig','reuse');
load('testpoints');
load('radiomap_kalman');
k = 3;
weight = 0.54;
result = cell(1,1);
%-------improved wknn -------%
testqty = size(testpoints, 2);
tempcell = cell(size(radiomap_kalman));
for i = 1:testqty
%----------- 计算欧式距离... |
%% --------
% QC_02_04_bValue(MeasCat, Mc)
% Computes and displays the b-value of dataset
% The b-value estimated according to Aki K (1965). Maximum Likelihood Estimate of b in the Formula logN = a - bM and its confidence limits.
% Bulletin of the Earthquake Research Institute, 43, 237-239.
% Input: MeasCat - Measur... |
function [K,w_jk,mu_jk,sigma_jk,A1] = estimate_num_comp(Y, A, ...
sizes, shrink_size, max_num_comp, options)
%ESTIMATE_NUM_COMP Summary of this function goes here
% Detailed explanation goes here
if nargin < 6
options = [];
end
thresh = 0.99;
ignore_small_prior = 0.1;
[N,M] = size(A);
K = ones(1,M);
w_jk = ... |
function [ clusters ] = create_clusters(cell_au, targets)
clusters = cell(6,1);
for i = 1:length(targets)
clusters{targets(i)} = [clusters{targets(i)}; cell_au(i)];
end
for i = 1:length(clusters)
clusters{i} = create_cluster_cases(clusters{i}, i);
end
end
|
classdef Csv
%CSV Summary of this class goes here
% Detailed explanation goes here
properties (Constant = true)
LogPath string = "logs";
end
properties (SetAccess = private)
LogFile string = "";
Initialised logical = false;
end
properties... |
De standaard Matlab functie find() geeft de waarde van het element terug
als dat is gevonden (zie onderstaand voorbeeld).
======= Code =======
varA = 22:33;
WaardeElement = find(varA==24);
======= Code ======= |
function J=TV(im);
%renvoie la variation totale d'une image
% (phi=t dans le formalisme du TP)
n=norm_grad_im(im);
J=sum(sum(n));
|
clear all; clc; close all;
AA = read_video_no_plot('moving_sinusoids/sin_a_st_c_10_fx_1_ft_4.avi', 0, 25);
aa1 = imresize(double(AA)/255, [32 32]); clear AA;
BB = read_video_no_plot('moving_sinusoids/sin_a_st_c_10_fx_1_ft_10.avi', 0, 25);
aa2 = imresize(double(BB)/255, [32 32]); clear BB;
CC = read_video_no_plot('mo... |
function [Q R] = Householder(A)
% Aceasta este functia care imi rezolva sistemul
% am folosit elemente din implementarea de la curs
% (de pe acs) si de la laborator
[m n] = size(A);
Q = eye(m);
% in acest for voi aplica reflectorii Householder
% asupra matricei A si voi forma Q si R
for p = 1 : min(m - ... |
function z = effectiveRankDist(M, q, rankDist)
% EFFECTIVERANKDIST Transform the raw rank distribution into one that takes
% into account the effect of generator matrix.
%
% Input:
% M - batch size
% q - number of finite field element
% rankDist - The rank distribution of the transfer matrix H. A vector of
% lengt... |
function main()
%Main runner for the program.
close all
clc
clear all
global test_debug_flag
global drill_present
global gerb_present
global gerber
global source_binary
global rgb_gerber
global rgb_source
global render_sf
test_debug_flag = 0; % Toggles debug output. one for on, zero for off.
drill_presen... |
function [output,state]=conv_encoder(G,K,input,state)
% generates the output sequence of a binary convolutional encoder
% G : N x LK Generator matrix of a convolutional code
% K : Number of input bits entering the encoder at each clock cycle.
% input: Binary input sequence
% state: State of the convolutional enco... |
%% Top-K prediction
% Written by Yu Wang
% Modified by Hong Zhao
% Modified by Shunxin Guo
% 2018-11-29
%% Inputs:
% input_data: testing data without labels
% model:
% tree: the tree hierarchy
% train_data: each fold of the training sample
% k: select the number of nodes
%% Output
% function [predict_lab... |
clear all;
clc;
srcFiles=dir('F:\lbp\pics1\*.jpg');
for i = 1 : length(srcFiles)
filename =strcat('F:\lbp\pics1\',srcFiles(i).name);
x=imread('mandela.jpg');
x = imresize(x,[256 256]);
%imshow(x,[]);
%figure;
x1=rgb2gray(x);
%imshow(x1,[]);
%figure;
x1=double(x1);
[a b]=size(x1);
dia=zeros(a-2,b-2)... |
classdef ModelMock < handle
%MODELMOCK Summary of this class goes here
% Detailed explanation goes here
properties
addedPeople;
end
methods
function obj = ModelMock()
obj.addedPeople = List();
end
function addPerson(obj, person)
... |
%% =========== Returns the gradient of the tanh function =============
% tanh x = 1 - tanh2 x
function g = tanhypGradient(z)
% g = zeros(size(z));
%
% g = 1 - (z.^2) ;
g = zeros(size(z));
g = 1 - (tanh(z).^2) ;
end
|
function [X] = sampleFromArbitraryP(p,gridX,N)
% inverse transform sampling scheme
% function [X] = sampleFromArbitraryP(p,gridX,N)
% This function samples from an arbitrary 1D probability distribution
% IN:
% - p: pX1 vector (the density evaluated along the grid)
% - gridX: pX1 vector (the grid over which th... |
clear;
filedir = dir(['A244_boost simulations_*']);
load(filedir.name);
com_id = 33;
fcr_id = 1;
for i = 1:length(all_run_rand)
baseline_data(:,i) = squeeze(all_run_rand{i}(fcr_id,1,:,com_id))';
high_affinity_data(:,i) = squeeze(all_run_rand{i}(fcr_id,2,:,com_id))';
end
change_in_com_form = high_affinity_dat... |
function [mDotCorr, PR, effIs] = ...
convCorrectedComp(mDot,pIn,pOut,TIn,TOut,FIn)
mDotCorr = mDot*1e5./pIn.*sqrt(TIn/298);
PR = pOut./pIn;
[~,hIn,~,~,~,~,~,~,~,~,~,~,~,CpIn,~,KIn] = ...
GetThdynCombGasZachV1(pIn,TIn,FIn,0.0683);
[~,hOut,~,~,~,~,~,~,~,~,~,~,~,CpOut,~,~] = ...
GetThdynCombGasZachV1(pOut,TOut... |
function mdpSave(filename,index,delayTime,framesSkipped)
% mdpSave Saves current figure window and outputs it as .gif
% Variations:
% mdpSave(filename,index,delayTime,framesSkipped)
%
% Required Inputs:
% filename = outputted file name ending with .gif
%
% index = current index for which to save ... |
%generating array of x values ranging from -10 to 10 with increments of 0.001 and
%0.1
x1 = (-10:0.001:10);
x2 = (-10:0.1:10);
%plotting U(x-2)for both increment values
plot(x1, (x1-2)>=0);
hold on
plot(x2, (x2-2)>=0);
hold off
%labels for axes
xlabel('x')
ylabel('U(x-2)')
%legend
legend('increments of 0.001 ','in... |
classdef OptMemberSlave3D < OptObjectSlave
properties
optNodeA
optNodeB
forceVariable
end
methods
function obj = OptMemberSlave()
end
function [matrix, obj] = initialize(self, matrix)
self.forceVariable = matrix.addVariable(-inf,... |
function [f00,f0,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13] = fk_test(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
%UNTITLED2 Summary of this function goes here
%t1
% Detailed explanation goes here
p2=17.5*0.001; % Translation in hip roll joint y axis
p3=64.727*0.001; % Translation in hip roll joint z axis
p4=63.9... |
format short g;
format compact;
%% load images
GT = imreadgroundtruth('img/DDC1_GT.png', true); % loads ground truth of first frame
ALL = loadtiff('img/DDC1_all.tif'); % loads tiff stack into 3D image matrix
xrange = 50:150; yrange = 50:150; zrange = 1:10; % crop data set
ALL = ALL(yrange, xrange, zr... |
classdef ColorImage < handle
properties
xNum;
yNum;
width;
height;
blocks;
choose;
data =[];
end
methods
function obj = ColorImage(xNum, yNum, blockWidth, blockHeight, choose)
% xNum:ºáÏò¿éÊý
% yN... |
function [ setsOut ] = SetJoiner( setsIn )
%SETJOINER Summary of this function goes here
% Detailed explanation goes here
n = size(setsIn);
n = n(1,1);
setsOut = setsIn;
for i=1:n
A = setsIn{i,1};
for j=(i+1):(n-1)
B = setsIn{j,1};
if ( ~isempty(intersect(A,B)) )
C... |
function [coeff] = Data2Coeff(~,pc,data)
%Data2Coeff Summary of this function goes here
% Detailed explanation goes here
coeff = pc' * data;
end
|
% f = @(t,x) ... % EDO test.
% [-x(2); ...
% x(1)];
clc;
tend = 20;
%h = 0.001;
Theta_0 = pi/6;
Omega_0 = 5*pi/9;
b = 0.5;
l = 1;
m = 1;
%[t, x] = ode45(f, [0 tend], x0); % Runge-Kutta.
%[t, x, s] = pendulum(tend);
% if (~s)
% return;
% end % fi
%
% close all; plot(t, x(:,1)... |
function [Hs, cam_dets_gnd, cam_region_gnd] = homography_algorithm(matchings, inplanes, ground_plane_regions, homog_solver, N, rho_r, rho_d, debug, min_delta)
%-----------------------------PREAMBLE---------------------------------
cam1_region_cam = inplanes{1};
cam2_region_cam = inplanes{2};
cam1_region... |
% Loads data out of specific folder and formats them:
% 1 cell element for each folder
% 1 struct within cell element for each trial (file)
path = '../Data/july26/static/';
addpath(path)
%% Load files from each folder (each height)
% go in each folder in 'static'. Grab height based on regex. Or brute force
% it
file... |
%compute correlation coefficients of variables,
%giving out vector that give the correlations
%in a single vector with no variances or repetitions
%(for plotting histograms etc.)
function corrvector=computecorrelations(X)
%compute correlation coefficients, using transpose of input vector
corrmatrix=corrcoef(X');
%th... |
function scans = updateInterleavedSpikeTimes(scans)
singleDelay = 0.2;
trainDelay = 0.8;
if nargin == 0
scans = loadLineScans;
end
for i=1:length(scans)
isi = scans(i).expParams.trainISI;
scans(i).expParams.spikeTimes(1) = singleDelay;
scans(i).expParams.spikeTimes(2) = trainDelay;
scans(i)... |
function startMIJ(ijPath)
%check parameters
if(nargin<1)
ijPath = [];
end
%check class path
classList = javaclasspath('-all');
mijLost = ~any(~cellfun(@isempty,strfind(classList, '\mij.jar')));
ijLost = ~any(~cellfun(@isempty,strfind(classList, '\ij.jar')));
%add class ... |
function moveDx(btn3, handle3)
global vrep clientIDdouble jointHandle1
vrep.simxStartSimulation(clientIDdouble,vrep.simx_opmode_oneshot);
[~]=vrep.simxSetJointTargetVelocity(clientIDdouble, jointHandle1, -1, vrep.simx_opmode_oneshot_wait);
[~]=vrep.simxSetJointTargetVelocity(clientIDdouble, jointHand... |
function answer = plot_t_func( a, b )
answer = t_func(a, b);
plot(abs(answer((length(answer)/2):length(answer))));
print -dpng freq.png;
plot(angle(answer((length(answer)/2):length(answer))));
print -dpng phase.png;
endfunction
|
function cmd = set_pose(obj,tgt_pose,path_type,axis_no_rotate)
%% move the robot to the target pose defined in the robot base coordinate system
% tgt_pose: [x,y,z,ax,ay,az] m and radius. target tcp pose in robot base coordinate system
% path_type :'cart' : generate trajactory in Cartesian sapce
% ... |
load('probe_beh_vars.mat')
close all
clear filename
filename(1) = {'PC1_wo25.mat'};
filename(2) = {'PC2_wo25.mat'};
%filename(1) = {'PC1_OFC_collected_aligned_.mat'};
%filename(2) = {'PC2_OFC_collected_aligned_.mat'};
bin = .25;
sortthreshold = 3; % remove neurons w/ deviation less than 3x noise
clr=[0 0 0;... %eve... |
function saveAnnotFile(source,~,pth)
gui = guidata(source);
bhvpic = gui.data.bhv;
labels = gui.data.lbls;
cmap = gui.data.cmap;
rast = gui.data.rast(:,2:end-1);
fname = uiputfile([pth '*.mat']);
save([pth fname],'bhvpic','labels','cmap','rast'); |
%% Stelling 15
%
% Wanneer je bij de functie strcmp() een 0 als antwoord krijgt,
% is wat je vergelijkt hetzelfde.
%
Antwoord = 0;
|
%% calcPresVel
% calculates the pressure induced change in velocity
% DeltaU and DeltaV at the cell surfaces after a
% timestep of length DeltaT
function [DeltaU, DeltaV]=calcPresVel(P,DeltaT,Rho,DeltaX)
% Initialisation
[Ima,Jma]=size(P);
DeltaU=zeros(Ima,Jma);
DeltaV=zeros(Ima,Jma);
% Calculation
DeltaU(2:Ima-... |
function [idx1 idx2 img] = renderLineMulti(pts, sz)
% (POZN: mozna chyba, ze idx1/2 na vystupu nerespektuje sz, takze to vraci vzdy absolutni souradnice ktere nemusi korespondovat s vyrenderovanym obrazkem)
% Renders line or sequence of lines as image. Simple, no antialiasing.
%
% pts - (N,2) sequence of points (at... |
function findcrosstalk
[ctfile,ctpath] = uiputfile('ct.txt','Crosstalk file');
fid = fopen([ctpath,ctfile],'at');
cancel = 0;
while (cancel ~= 1)
[datafile,datapath] = uigetfile('*','Pick raw data file');
if (datafile == 0) % User hit cancel
fclose(fid);
return;
end
%Load data for thresholds
%ldata:loaded da... |
clear;clc;close all
% Parameter settings
nSubj = 20; % number of subjects (replications)
nVoxs = [50 60]; % number of voxels in ROI1 and ROI2
mVoxs = min(nVoxs);
nRuns = 2; % number of runs. MVPD requires at least 2 runs.
sigma = 1; % std of Noise in ROI1 and ROI2
% Optional parameters
opt... |
function yhat = maxPrediction(obj,x)
% For some input data get mixture model prediction
% i.e. y_n = sum_k (weights_k,n * y_n,k)
if strcmpi(x,'val') || isequal(x,obj.x_val)
gamma = obj.gamma_val;
ypred = obj.ypred_val';
elseif strcmpi(x,'test') || isequal(x,obj.x_test)
gamma = obj.gamma_test;
ypred = ... |
function param = default_pami_param()
param = default_fast_param;
param.mapWidth = 64;
% DIO is better, but change to CIO for more faithful implementation
param.channels = 'CIO';
param.useMultipleCenterScales = 1;
param.surroundSig = [ 2 8 ];
param.useNormWeights = 1;
|
% Create beta distributions
clear all;
clc;
X = 0:.01:1;
b1 = betapdf(X,2,7);
plot(X,b1)
b2 = betacdf(X,2,7);
plot(X,b2);
|
function tpmdiff_test(img)
%test file of tpmdiff
img=reshape(img,128,128);
bdctimg=blkproc(img,[8 8],@dct2);
bdctimg=abs(round(bdctimg));
T=4;
tm=tpm1(bdctimg,T,1);
N=400;%test time
result=zeros(N,1);
for i=1:N
bdctnew=bdctimg;
tmsig=tm;
for row=1:128
for coli=1:25
%col... |
function [h] = findax(fig)
% function [h] = findax(fig)
%
% FINDAX returns a vector 'h' with the handles of all axes, that are
% situated in the figure with the handle 'fig'.
%
% (c) Lehrstuhl fuer allg. Elektrotechnik und Akustik
% Ruhr-Universitaet Bochum
% (p) 09.09.1994 Joerg Schmatter
h = [];
... |
% Simulation of a plane wave hitting a planar interface using snell's law
circd = @(radius,deg_ang,xo,yo) [radius*cosd(deg_ang)+xo; radius*sind(deg_ang)+yo];
lambda = 500;
n0 = 1.45;
n1 = 1.0;
theta_ref = 0;
lradius = 2000; % in nm
c = 3E+8; %c = 3E+8 m/s x 10+9 nm/m x 10-9 ns/s = 3E+8 nm/ns;
k0 = 2*pi*n0/lambda;
... |
classdef SimpackCOM
%SIMPACKCOM Wrapper class to deal with Simpack's COM interface. More
% details about Simpack can be found on [1]. Run SimpackCOM.view_COM_methods() to
% view all the methods provided by Simpack's COM interface. More info
% about it at [2].
%
% [1] https://www.3ds.com/products... |
function dX = PennyForDAYZZZ( T,X )
global m R g I_t I_a;
%temp = [0;0;0; att_o(:,i);0;0;0;omega_o(:,i)];
%b frame
%Euler Rotational Kinematics
dX(10)=((I_a)^-1)*(R*m*g*sind(X(5))-m*X(10)*R^2);
dX(11)=-((I_t)^-1)*((I_a-I_t)*X(10)*X(12)+m*X(11)*R^2);
dX(12)=-((I_a)^-1)*((I_t-I_a)*X(10)*X(11));
a_b = [dX(11)*... |
clear all; clc; close all;
%[y,Fs] = audioread('music1.wav');
[y,Fs] = audioread('music2.wav');
tr_piano=length(y)/Fs; % record time in seconds
plot((1:length(y))/Fs,y);
xlabel('Time [sec]');
ylabel('Amplitude');
title('Mary had a little lamb (piano)');
v = y'/2;
a = 100;
L = length(v)/Fs;
k = (2*pi/(2*L))*[0:lengt... |
% for PKDD paper
% function postBLDA(pttfile)
% do simple ranking based coverage with blda results pttopic file
%% input selection
inputpath = '../new20conf/';
outputpath = '../new20conf/wp1.0/nobg';
% outputpath = '../new20conf/wp1.0/bg';
prepare_dblp;
% inputpath = '../news/';
% outputpath = '../news/wp1.0/'... |
clc
clear
%%short_path_find test's
len = 5;
high = 5;
save_flag = 0;
load_flag = 0;
path_to_file = 'test2x2.mat';
[net, mc] = generate_manhatan(len, high, save_flag, load_flag, path_to_file);
[net_pairs, arc_last_num] = enumerating_function(mc);
%% testing with different time vector.
delta = 0;
... |
function y= get_p(datumM, distM, tails, high)
% Copied from https://gitlab.erlichlab.org/erlichlab/elutils.git/stats
% p= stats.get_p(datum, dist)
% p= stats.get_p(datum, dist, tails, high)
% p is the prob that datum comes from dist.
% tails is by default 2
% if tails == 1 , then p is the prob that datum
% is higher (... |
function image = InvUniQuant(qImage, bits)
% Input : qImage (Quantized Image)
% : bits (bits available for representatives)
%
% Output : image (Mid-rise de-quantized Image)
ds = 256/(2^bits);
image = round((qImage + 0.5) *ds);
end |
t=(1:116)/128;
s_delay=diag( ones( 1 , 116 - 8 ) , 8 );
u60_delay=diag( ones( 1 , 116 - 16 ) , 16 );
u150_delay=diag( ones( 1 , 116 - 27 ) , 27 );
u240_delay=diag( ones( 1 , 116 - 39 ) , 39 );
ax=[0 0.9 -6 6];
%%%real
as60u_jp=djp.default.plot('classes',{11},'blocks_in',1:200,'channels','Fz'),title('Real AS60U, JP'),... |
function A = Axyz(a1, a2, a3)
A = Ax(a1)*Ay(a2)*Az(a3);
end
|
function out = spread(res,amp)
pdf = amp./sum(amp);
% The mean doppler shift
meanSpread = sum(res.*pdf); % Sum of each input in the pdf and res
varSum = sum(res.^2.*pdf);
varSpread = varSum - meanSpread^2;
out = sqrt(varSpread);
end
|
function aprx = aprx_mult(a,b)
sign = 1;
total = 16;
frag = 7;
a_fi = fi(abs(a),sign,total,frag); % convert a to 16-bit Q15 signed fixed point
b_fi = fi(abs(b),sign,total,frag); % convert b to 16-bit Q15 signed fixed point
lzc_a = lzc(a_fi.bin); % calculate the leading zero count of a
lzc_b = lz... |
% omega
syms w1 w2 w3 real
w = [w1; w2; w3];
syms w_hat1 w_hat2 w_hat3 real
w_hat = [w_hat1; w_hat2; w_hat3];
% external torque (modelled as white noise)
syms t1 t2 t3 real
t = [t1; t2; t3];
% t = [0; 0; 0];
% inertia tensor
syms I11 I22 I33 I12 I23 I13 real
% I = [I11, I12, I13;
% I12, I22, I23;
% I13, I2... |
function feature = MDF_feature(data_TimeWindow)
Window_L = length(data_TimeWindow);
power_spectral = abs(fft(data_TimeWindow, Window_L).^2)/Window_L;
L = length(power_spectral);
Fs = 2000; % Sampling frequency
f = Fs/2*linspace(0, 1, L/2)';
feature = medianfrequency(f, power_spectral(1:L/2));
% bisection search... |
CloseMaster
direct.engine = [ cd '\' ];
options.resetPort = 0;
AddDirectories
SetupPort
load 'DataResults\recordingSettings.mat';
channelLabel = [ labels {'Trigger'} ];
BufferConfig.hosted = [ false ];
ConfigNetworkRA
%%
scheme = { 'cobalt.prf' 'darksteel.prf' 'matrix.prf' 'oblivion.prf' 'solarized-light.prf' 'vi... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Homework 5 MATLAB Script
% Author: Robert Loiacono
% Date: 2/14/20
% UID: 305106844
% Code for Problems 1 and 2
% Problem 1's goal is to create two functions that will subdivide and
% smooth the edges of a square to for... |
close all
dayImg = imread('JPEGImages/liebao_0006.jpg');
blurImg = imread('JPEGImages/liebao_0005.jpg');
figure
subplot(221)
imshow(dayImg)
subplot(222)
imshow(blurImg)
subplot(223)
H = fspecial('motion', 20, 45);
motionBlur = imfilter(dayImg, H, 'replicate');
imshow(motionBlur)
subplot(224)
H = fspecial('motion',... |
function [ Y ] = reshapematrix( X, rows )
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
Y = reshape(X, rows, size(X, 1) * size(X, 2) / rows);
end
|
function ViewVol(vol)
fig = figure('tag','ViewVolFigure',...
'name','ViewVol',...
'color','white',...
'numbertitle','off',...
'MenuBar','None',...
'KeyPressFcn',@btnpress);
sqr = ceil(sqrt(size(vol,3)));
clim(1) = min(reshape(vol,[],1));
clim(2) = max(reshape(vol,[],1));
for i = 1:size... |
% Script for realigning axial position
% (C) Copyright 2019 The Huang Lab
%
% All rights reserved Weldon School of Biomedical Engineering
% Purdue University
% West Lafayette, Indiana
% USA... |
function setPhaseMoles(self, n, moles)
% SETPHASEMOLES - set the number of moles of phase number 'n' to
% 'moles' (kmol).
%
mixturemethods(7, mix_hndl(self), n, moles);
|
function [Anew,pnew] = updategraph(A,t,p,chosen_task_idx)
workers_per_task = 1;
%% create A new
Anew = A;
%% for each chosen_task_idx sample worker
num_task_chosen = numel(chosen_task_idx);
for i=1:num_task_chosen
task = chosen_task_idx(i);
set_rem_workers = find(A(task,:)==0);
selected_workers = sample_w... |
%Inserts the vector containing point coordinates in CATIA
%Parameters:
%xz : contains x and z coordinates of the rib
%y : y coordinate is decided by the user input
%chord_length : scales x and z according to the chord length
function func_insert_vector_of_points(xyz)
%obtain number of rows and columns of the coord ... |
function zval = calc_zvalues(data,dim,mu0)
if nargin<3
mu0 = 0;
end
data_mean = nanmean(data,dim);
data_std = nanstd(data,[],dim);
n = size(data,dim);
zval = (data_mean-mu0)./(data_std/sqrt(n));
% error('Z-scores not calculated correctly - should be: (data-mu)/std')
|
function [ matchSet minDist ] = icp_match( q, p )
M = size(p,2);
N = size(q,2);
matchSet = zeros(1,M);
minDist = zeros(1,M);
for ki=1:M
d = zeros(1,N);
for ti=1:3
d = d ...
+ ( q(ti,:) - p(ti,ki) ).^2;
end
[minDist(ki), matchSet(ki)] = min(d);
end
minDist = sqrt(minDist);
end... |
% Authors: E. Ulises Moya-Sánchez, Bonell Manjarrez Marcela
% Date: Jun 2015
clear all; close all;
% Read videos
leap_motion_video = VideoReader('data/leap-motion.mp4');
infrared_video = VideoReader('data/infrared-original.avi');
depth_video = VideoReader('data/depth-original.avi');
% Videos information
fprintf('Fra... |
%
% Proyecto 2
%
% Prof. Zeferino Parada
% Optimización Númerica
%
% Omar Trejo Navarro, 119711
% Juan Pedro Luengas Garcia, 119493
% Natalia Orozco Urquijo, 111008
%
clear all;
close all;
res_fmin = zeros(2, 4);
res_prop = zeros(2, 4);
opciones = optimoptions('fmincon', 'Display', 'off');
%
% Probamos con 10 y 20 p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.