text stringlengths 8 6.12M |
|---|
x = gdp(:, 3);
y = gdp(:, 6);
plot(x, y, 'k.'); |
function data = mpdottranslate(par,dpar,f)
data = struct;
data.offset = par(1);
data.doffset = dpar(1);
data.f = f - par(2)*f;
data.df = dpar(2)*f;
data.pdot = 2*par(3)/f;
data.dpdot = 2*dpar(3)/f;
data.fdot = -data.pdot*f^2;
data.dfdot = data.dpdot*f^2;
end
|
dir_raw = 'aqxkl_raw';
% DO NOT EDIT BELOW THIS LINE
dir_stabilized = 'stabilized-images';
dir_diff = 'differenced-images';
dir_diff_binary = sprintf('%s-binary',dir_diff);
dir_temp = 'temp';
% list out all files
filenames_raw = dir(fullfile(dir_raw, '*.tif'));
% count number of files
num_files = size(filenames_raw,1... |
function [TR2]=sort_scoring(transitions)
%Sorts chronologically the scoring labels for sleep stages and merges those
%overlapping.
%[transitions]=sort_chronologic(transitions,stage)
%For NREM: stage=3.
[~,I] = sort( transitions(:,2));
transitions=transitions(I,:);
TR2=[];
u=unique(transitions(:,1));
for j=1:size(u,1)
... |
% $Id$
wtf = 0;
if wtf
fid = fopen( 'symtridhh.log', 'w' );
else
fid = 1;
end;
tol = 1e-10;
fprintf( fid, 'TEST SYMTRIDHH\n' );
fprintf( fid, 'We generate symmetrized testmatrices A, and compute tridiag T = Q''AQ,\nwith Q orthogonal. ' );
fprintf( fid, 'We then compute evals of A and T, and display\nthe no... |
function r = SphericalHarmonics(azi, elev, n, m)
%% Function to calculate spherical harmonics based on given azimuths, elevations, ambisonic order(n), and ambisonic degree(m)
Pn = legendre(n,sin(elev));
if n==0
Pmn = Pn;
else
Pmn = squeeze(Pn(abs(m)+1,:,:));
end
%normalization
if m==0
dm = 1;
else
d... |
close all; clc; clear all;
d_prime = 50; % Select d' for PCA
data = PCA(d_prime); % call PCA algorithm for desired d'
x = data(:,2:end)'; % Extract data features as column vectors of matrix x
y = data(:,1); % Extract class information as y vector;
d = size(x,1); % d: number of features
classes = unique(y); % all c... |
% For stable system only
clear all
clc
z=[-0.5 -1-0.8i -1+0.8i -10 -20];
p=[-0.01 -0.5-1i -0.5+i -3 -5 -10];
k=200;
Gs=zpk(z,p,k);
sys=tf(Gs);
[num,den]=tfdata(sys,'v');
n=max(size(den));
if mod(n,2)==1
num_o=num(2:2:n);
num_e=num(3:2:n);
else
num_o=num(3:2:n);
num_e=num(2:2:n);
end
if ... |
%Question3
clear all;clc;
alpha = 0.5;
beta = 0.75;
gamma = 1;
delta = 0;
length = 10000;
varargin = [1,length];
x1 = -1000000:1000:1000000;
X1 = stblrnd(alpha,beta,gamma,delta,varargin);
p1 = length*stblpdf(x1,alpha,beta,gamma,delta,varargin);
x2 = -10000:100:10000;
alpha = 1;
X2 = stblrnd(alpha,bet... |
% Add WGN
rxSig = awgn(txSig, snrdB, 'measured');
% Pad receive vector to twice the FFT Length (note use of txSig as input)
% No windowing or additional filtering adopted
yRxPadded = [rxSig; zeros(2*numFFT-numel(txSig),1)];
% Perform FFT and downsample by 2
RxSymbols2x = fftshift(fft(yRxPadded));
RxSymbols =... |
%{
2) https://www.coursera.org/learn/machine-learning/programming/ZZkM2/k-means-clustering-and-pca/discussions/_9mZd-eDEeSnBSIAC4s0zg
How do you do it without for loop and use a vectorized form.
3) 2.3 what does "In practice, if you were using a learning algorithm such as linear regression or perhaps
neural networ... |
function [xi,fxi,gxi] = newtonsmethod(f,x0,max,c1,tol)
% f - function
% x0 - initial vector starting point
% max - maximum number of iterations
% c1 - Armijo constant
format long
xi=x0;
k=0;
grad = gradient(f);
hess = hessian(f);
while k<max
fxi = subs(f,transpose(symvar(f)),xi);
gxi = subs(grad,t... |
acer=1;
% rat24base=1;
DUR{1}='1sec';
DUR{2}='10sec';
Block{1}='complete';
Block{2}='block1';
Block{3}='block2';
mergebaseline=0; %Make sure base's while loop condition is never equal to 2.
FiveHun=2; % Options: 0 all, 1 current, 2 1000?
%meth=1;
rat26session3=0; %Swaps session 1 for session 3 on Rat 26.
rat27session3=... |
% Rechnerunterstützte Mechanik I
% Wintersemester 2017/18
%
% Übung 4: Zusatzaufgabe
% Differentialoperatoren
% Anwendung auf gewöhnliche Differentialgleichungen
%
clc; % Konsole löschen
close all; % Alle Figures löschen & schließen
clear; % Speicher leeren
disp('Hausaufgabe 2 zur 4. Übung im Fach Rechnerun... |
%Main script for the 1024 point Wishbone compatible FFT-core
%Thanks to Adam Robert Miller
clc;
clear all;
close all;
N=1024;
tbits=16;
twiddlegen_rc(N,tbits); |
%S02_COMPARENEXTSCAN Summary of this function goes here
% Detailed explanation goes here
function [ this_dND, this_I, this_grid_surface, ref_grid_surface] = B_compareNextScan( refFilePath )
%% LOAD REFERENCE FILE
load(refFilePath); % 'frames', 'ref_grid_surface', 'latest_I', 'crop_scale', 'downsample_scale', ... |
%% This files creates/checks every assignment and file
%% Initialisation
clear all; clc; close all; close all hidden; fclose('all');
dbstop if error
addpath(genpath('helpercode'));
global DEBUGOUTPUT; DEBUGOUTPUT = 1;
con = ConstantsClass();
%% ACTION: Select the right BONUSASSNUMBER.
con.BONUSASSNUMBER = 2... |
function [ features,labels ] = get_data_of_feature( root )
% Given root path, return feature of data in this path
% and return the activity label
% add model and util funtions to matlab path
addpath('../model/');
% load trained model parameters
gyro = load('../result/type_GYRO_time_2016_03_02_10_40.... |
function x=zigzag(m)
%input m 2D matrix
%output gives vector after doing zig zag scan in a matrix
[r,s]=size(m);
x=zeros(1,r*s);
c=1;
for i=1:r
for j=1:i
if mod(i,2)==1
x(c)=m(i+1-j,j);
else
x(c)=m(j,i+1-j);
end
c=c+1;
... |
% this script converts all the files in this directory
% from AVW to NII format.
fnames = dir('*.img');
for n=1:length(fnames)
[d h] = read_img(fnames(n).name);
niih = avw2nii_hdr(h);
outname = fnames(n).name;
outname(end-3:end)= '.nii';
fprintf('\rWriting out %s', outname);
write_nii(outname,... |
function h = viscose(g)
% This function calculates the sum of the diffusion terms of g
% the resulting term h excludes boundaries
global viscosityxdt difzdt
h = viscosityxdt .* (g(3:end, 2:end-1, 2:end-1) ...
- 2*g(2:end-1, 2:end-1, 2:end-1) + g(1:end-2, 2:end-1, 2:end-1)) + ...
viscosityxdt .* (g(2:end-1, 3:end, 2... |
function fval = scalernewMatchWageEmplDisp(z_TLTS,emp_targets,rw_targets,disp_target,hw_target,lw_target, mean_l,mean_m,mean_s,corr_lm,corr_ms,corr_ls,AL,AM,AS)
[fval] = newMatchWageEmplDisp(z_TLTS,emp_targets,...
rw_targets,disp_target,hw_target,lw_target,...
mean_l,mean_m,mean_s,corr_lm,corr_ms,c... |
function ref = ASSIGN_ref_arch(varargin)
global params
ref.arch = params.ref_assign_arch.arch;
if ~isfield(params.ref_assign_arch,'programmatic_risk') || nargin>0
disp('Evaluating reference architecture...');
resu = ASSIGN_evaluate_architecture(ref.arch);
fprintf('Science = %f, Cost = %f\n',resu.science,re... |
function [record,recfiles,cells,chandef] = ConvertToCell(stimfile,shapefilename,ctfilename)
% ConvertToCell: convert sorted spikes to Cell File format
% [record,recfiles,cells,chandef] = ConvertToCell(stimfile,shapefilename,ctfilename)
if (nargin == 3) % Load cells defined by crosstalk
fprintf('Loading crosstalk file.... |
% clc
% clear all
% close all
% load ISAtable.mat
%
% addpath('../../jsonlab-1.5/');
% datapath='..\..\data';
% %input variables
%
%
% % load in values from pre aero file
%
% aero_data = loadjson([datapath filesep 'pre_aero_data.json']);
% master_data = loadjson([datapath filesep 'master_data.json']);
% M4= master_... |
function [par] = jcwhichpartochange(highest_error)
highest_error = (highest_error*6)-5;
% which depth ? 1:4
% n = round((rand*4)+0.5);
%
% par = 4*(highest_error-1)+n;
to_change = zeros(1,120);
%highest_error = highest_error + floor(rand*3);
to_change(highest_error:highest_error+5) = 1;
%to_change(highest_error:hig... |
% Arnold Lab, University of Michigan
% Melissa Lemke, PhD Candidate -- Edited by Robby Theisen
% Last edit: August 9, 2021
% plots three IgG1 concentration vs kon IgG1-FcR surfaces with either
% combinded changes, individual changes added together, or the difference
% between the two
clear
close all;
%choos... |
clear
clc
resultFolder = strcat(pwd,'/Pipeline/EXPERIMENT/result/');
dirstruct = dir(strcat(resultFolder,'/SR4K*.mat'));
fprintf('RESULT1 RESULT2 \tavgVal1 \tavgVal2 \t\tFILE\n');
SR4K_N_changeThresh = 5e-3;
SR4K_Y_changeThresh = 20.0;
SENZ3D_N_changeThresh = 0.25;
SENZ3D_Y_changeThresh = 1.0;
for i=1:size... |
function lineasMedias
vL = 115;%kV
longitud = 100;%km
demanda = 100000;%kw
fp= -0.85;
RMG = 0.00895;%m
angulo = 31.79;
resistencia = 13.42;%ohms
radio = 0.0109;%m
dAB=4.2;%m
dBC=4.2;%m
dAC=dAB+dBC;
numConduc =1;
global z;
DMG = nthroot((dAB*dBC*dAC),3);%m
if numConduc == 2
RMG = sqrt(radio * diametro);
elseif nu... |
function [ TP350A,TP350B,TP550A,TP550B,TP850A,TP850B,TP140A,TP140B,TP200A,TP200B ] ...
= TPCORR( INVDIP,MLT,DDD,PF107,P350A,P350B,P550A,P550B,P850A,P850B,P1400A,P1400B, ...
P2000A,P2000B )
%TPCORR TPCORR
%
% SUBROUTINE TPCORR(INVDIP,MLT,DDD,PF107,
% P350A,P350B,P550A,P550B,P850A,P850B,
% ... |
function gaborMatrix = EmbedInNoise2(GaborMatrix, Coherence, ProbabilityGaussian, GaussianMatrix)
%EmbedInNoise2 embeds a gabor matrix in noise. Different from EmbedInNoise in that it does not auto trim into a circle and converts all pixel values with 'n' to noise.
% GaborMatrix - 2D matrix that holds the pixel valu... |
% mode_from_reals, get modem entropy and probability from sample of discrete parameter
%
% Call:
% [m_mode,m_entropy,P,cat]=mode_from_reals(sample,cat,direction);
% [m_mode,m_entropy,P,cat]=mode_from_reals(sample,cat);
% [m_mode,m_entropy,P,cat]=mode_from_reals(sample);
% Input
% sample [n_modelparameters,... |
%% Quantitative
% Here will be a list of available tools to evaluate data.
function [h] = Quants(X, T0, T1, T2)
h = T0 + T0*X(1,:) + T1 * X(2,:) + T2 * X(3,:);
end
function [c] = countCorr(n)
c = n*(n-1)/2;
end
|
%
% Day 21, Advent of code 2017 (Jonas Nockert / @lemonad)
%
% Part one.
[rules2, rules3] = readRulesFromFile('day21.in');
n_iters = 5;
n_pixels_on = getPixelsOn(n_iters, rules2, rules3);
fprintf('Total pixels on after %d iterations: %d\n', n_iters, n_pixels_on);
assert(n_pixels_on == 162)
% Part two
n_iters = 18;
... |
function [base_treino, base_teste, base_validacao] = k_fold (hadron, gama, k, indice)
% Separa a base em treino e teste conforme indice e k
% input:
% hadron: saida composta por dados com label de hadron (0)
% gama: saida composta por dados com label de gama (1)
% k: quantidade de separacoes que serao f... |
r=[0,1;0.5,0.8];
rand_method='norm';
a=0;
b=0.3;
for i=1:10
r=clouds_simulation_FBM(r,rand_method,a,b);
imshow(r);
end
|
function AzureShell(varargin)
% AZURESHELL Invokes the Azure Web Browser based shell
% Cloud Shell enables access to a browser-based command-line experience with
% Azure. It is an interactive, browser-accessible shell for managing Azure
% resources. The shell can be Bash or PowerShell. The system configured browser
% i... |
% Generates boxplots of anger and non-anger moments.
function [angerout, peaceout] = resultmachineinput(anger, peace, graph_id, debate_name, frequency, electro)
group = [ones(size(anger)); 2 * ones(size(peace))];
[h,p] = ttest2(anger, peace);
sprintf("h = %d", h)
if p <= 0.05
sprintf("p = %.3f * ", p)
else
spr... |
function [ sorted_cases ] = case_sort( cases )
fields = fieldnames(cases);
cell_array_ver = struct2cell(cases);
cell_size = size(cell_array_ver);
% Convert to a matrix
cell_array_ver = reshape(cell_array_ver, cell_size(1), []); % Px(MxN)
% Make each field a column
cell_array_ver = cell_array_ver'; ... |
%% init_simple_grad_rand.m
% initialises GA population by using a mix of (slightly shuffled) simples,
% simples with just the machine numbers changed around, simples with
% increasing degrees of shuffles, and randoms.
function [pop_mat, num_jobs, num_machines, jobs_array_aug] = ...
init_simple_grad_rand(input_arra... |
function Bw= my_normalize(I)
%
%
if ndims(I)==3
Gray = rgb2gray(I);
else
Gray = I;
end
%%
Bw = imresize(Gray,[60,20],'nearest');
|
function [capacities, probabilities] = calculateSolarProbabilities(system_info,solar_conf)
full_solar_data = csvread([system_info.project_path, system_info.filesep, solar_conf.feature.path]);
start_day = 1;
probabilities = {};
capacities = {};
for p = 1:system_info.system_period_num/2 %
... |
%% Stelling 21
%
% Het aanmaken van een numerieke vector kan voor een
% Bewegingstechnoloog handig zijn om bijvoorbeeld een
% tijdvector aan te maken (een vector bestaande uit
% tijdstippen).
%
Antwoord = NaN; % vul hier het juiste antwoord in 1 (WAAR) of 0 (ONWAAR)
|
function R_matrix=rot(angle, axis)
% R=rot(angle (rad), axis) returns a 3x3
% rotation matrix for rotating a vector about a single
% axis. Setting axis = 1 rotates about the e1 axis,
% axis = 2 rotates about the e2 axis, axis = 3 rotates
% about the e3 axis. Uses right handed coordinates, so
% rotations are cou... |
function [days, K_disc]=stima_kdiscreti(data,kspan,window,K0_disc,pnt)
%
% [days, K_disc] = stima_kdiscreti(data,kspan,window,K0_disc,options)
%
% Per ogni punto di kspan integro su una finestra, dove i parametri sono
% descritti nella struttura window, e ricavo il valore del parametro di controllo k.
% Trovo ... |
%% LOW RANK RECEPTIVE FIELD FIGURE!
function suppfig_RFs(matroot)
lr = load(fullfile(matroot,'lowrank_fits.mat'));
% choose example dataset and compute RFs for plot
d = 5;
[~, isort] = sort(lr.vtest{d}, 'descend');
% low-rank RFs
[lrRF] = plotLowRankRFs(68, 270, lr.aAll{d}, lr.bAll{d}, lr.cAll{d});
close all;
defau... |
clear all; clc
% Parametrar for Balanduinoroboten
Balanduino.m = 0.38; % [kg] massa for batteri och oversta hyllan med skruvar
Balanduino.M = 0.97; % [kg] massan for resten av robotan
Balanduino.d = 0.18; % [m] avstand mellan hjulaxel och batteriets masscentrum
Balanduino.r = 0.049; % [m] ... |
clear;
clc;
Ntask = 100;
Nworker = 10;
Ndom = 7;
Redun = 5;
ndom = 3;
p0 = 0.05;
p1 = 0.75;
times = 30;
x = 10:5:100;
num = length(x);
MVresultSet = zeros(10,num);
DSresultSet = zeros(10,num);
SEEKresultSet = zeros(10,num);
noKnowledgeSEEKresultSet = zeros(10,num);
for j = 1:times
for i = 1:num
[MVresult,D... |
clear all; close all;
% if this is 1, the user supplies the file via the GUI, otherwise a value
% is set manually in the code. should be 1 except for debugging.
ASK_FOR_FILE = 1;
if ASK_FOR_FILE,
image_file = uigetfile(...
{'*.jpg;*.png;*.bmp;*.tif', 'Image Files'; '*.*', 'All Files'}, ...
'Sel... |
function [] = plot_results(out,out1,method1,out2,method2,out3,method3,out4,method4,out5,method5)
fig = figure(1);
data1 = (out1.f - out) / (out);
semilogy(1:length(data1), max(data1,0), '-.', 'color', [0.1 1 0.1], 'LineWidth',1);
hold on;
data2 = (out2.f - out) / (out);
semilogy(1:length(data2), max(data2,0), '-.', 'c... |
function res = dwbardz(x, y, v, z, d)
res = w(x-y)*g(r(x-y, v))*eye(d);
end
|
% S. Urchs, P. Bellec 2014/03/11.
% Small experiment to test the new "checkerboard" type of simulations and the stability_surf pipeline
clear
psom_set_rand_seed(3);
%path_simu = '/home/pbellec/database/surf_stab/xp_2014_02_24/';
path_simu = '/home/sebastian/Projects/niak_multiscale/local_test/';
if ~psom_exist(path_... |
function trainLength = load_train_length_high_level(folderIndex ,action_length)
trainLength = zeros([] , 1);
testIndex = 1:3;
activityIndex = 1: 10;
counter = 1;
for folder_index = folderIndex
for test_index = testIndex
for activity_index = activityIndex
trainLength(counter , 1) = action_length(... |
% WPJOIN ウェーブレットパケットツリーの再構成
%
% WPJOIN は、ノードの再構成後にウェーブレットパケットツリーを更新します。
%
% T = WPJOIN(T,N) は、ノード N の再構成に対応する修正されたツリー T を出力します。
%
% T = WPJOIN(T) は、T = WPJOIN(T,0) と等価です。
%
% [T,X] = WPJOIN(T,N) は、ノードの係数も出力します。
%
% [T,X] = WPJOIN(T) は、[T,X] = WPJOIN(T,0) と等価です。
%
% 参考 WPDEC, WPDEC2, WPSPLT.
% M. Misiti, Y. Misi... |
clear
ratio = [];
tRange = [0 500];
IC = [1000, 1000, 0, 0, 0, 0, 0, 0, 0];
[T,Y] = ode45(@VectorModel, tRange, IC);
% finds index of val in T which should correspond to the values at time = val
% Used to find values at a specific time point so that we can calculate
val = 5; % minutes
[ d, ix ] = min( abs( T-val ) ... |
% calculate rate of OH + 2-Ethyltoluene -> products
% Updated 6/10/15
% Based on MCM v. 3.3
% rate = kOH2ethyltoluene(T,M)
%
function j = kOH2ethyltoluene(T,M)
j = 1.19e-11; |
function [Hvis] = make_image(Hv, curve, curve_full, st, en)
alp = 0.5;
alp_endpoints = 0;
clr_full = [0 1 0];
clr = [1 0 0];
clr_st = [0 1 0];
clr_en = [0 0 1];
N = size(Hv, 1) * size(Hv, 2);
Hvis = repmat(Hv, [1 1 3/size(Hv,3)]);
Hvis0 = Hvis;
for k = 1:3
if nargin > 2
Hvis((k-1)*N+sub2ind(size(Hv), curve_full(2,:)... |
function r = part2Apple
%% this section is used to load the image
if( ~exist('apples', 'dir') || ~exist('testApples', 'dir') )
display('Please change current directory to the parent folder of both apples/ and testApples/');
end
% Note that cells are accessed using curly-brackets {} instead of parentheses ().
Iappl... |
clc;
clear variables;
select_acv = '51';
select_noise = 2;
select_n_step = 1;
select_fringe = 1;
select_prop = 3;
str_acv = sprintf('.\\ACVMS\\ACV%s.mat', select_acv);
str_rvl = sprintf('.\\ACVMS\\ACV%s_REVAL.mat', select_acv);
load(str_acv);
load(str_rvl);
plotRE_st = squeeze(reval(:,:,select_prop,select_fringe,se... |
% Setting the SIR model
% ------------------------------------
% The variables used are -
% t -- Time-steps
% y -- [S;I]
% dy -- [dS;dI]
% ------------------------------------
function dy = odefunc(t,var,beta,gamma)
global N
dy=zeros(2,1);
dy(1)=-(beta/N)*var(1)*var(2); %dS=-(beta/N)*s... |
function [Fit_Function, gof] = CreateFit(x, y, z)
% CreateFit: Fit function
% INPUTS:
% x: Vector of x Coordinates of Nodes
% y: Vector of y Coordinates of Nodes
% z: Vector of z Coordinates of Nodes ( preload)
% OUTPUTS:
% Fit_Function : a fit object representing the fit.
% gof : structure w... |
%% 初始化
clc;clear;close all
err = 0.5*10^-10; % 误差
maxiter = 100; % 最大迭代次数
%% 二分法计算方程 sin(x)-x^2/2=0
fun = @(x)sin(x)-x^2/2; % 函数
a = 1;b = 2; % 范围
[iter1,result1] = divide2(a,b,fun,err);
%% 牛顿法求求解根
syms x
% 求解xe^x-1=0,x0=0.5
x0 = 0.5; fun = x*exp(x)-1;
[x21,iter21] = netwon(fun,x0,err,maxiter);
% 求解x^3-x-1=0,x0=1
x0 = ... |
%% Parameters for Electrochemical Model from the Literature
% Xin Zhou update from SetParav20.m and para in Joel's code.
%
% Update Log by zhouxinme:
% Nov 4th 2014 - Change all the parameters to what is inside SetPara. The
% name in SetParav20 and in Joel's code is also included in
% t... |
% stateSpaceRCLPF.m
clear;clc;close all;
R = 240e3;
C = 800e-12;
w = 1/(R*C); % angular cut-off freq (rad/sec)
fc = w/(2*pi) % freq in Hz
A = -1/(R*C);
B = 1/(R*C);
D = 1;
E = 0;
[bc,ac] = ss2tf(A,B,D,E);
[H,W] = freqs(bc,ac);
semilogx(W/(2*pi),20*log10(abs(H)));
axis([20 20000 -30 5]);
xlabel('Freq (Hz)'); yla... |
%% EDL Entry Code
% Jasmina Muftic
% Space Vehicle Design Capstone
% Fall 2019
%% Constants
v_atm = 5.94*1000; % Entry velocity [m/s]
gam0 = deg2rad(13); % Flight Path Angle [rad]
m = 700; % Entry mass [kg]
Cd = 1.65; % Drag coefficient of 70 deg sphere-cone heatshi... |
%{
olf.Traces (computed) #
-> olf.Scan
-> olf.TracesOpt
masknum : mediumint #
---
trace : mediumblob # c) filtered traces using opt
ts=CURRENT_TIMESTAMP : timestamp # c) extaction timestamp
quality=null : float ... |
function [f,dfu] = f_forward(u,q,dq,p)
M = six_M(q(2),q(3),q(4),q(5),q(6));
G = six_G(q(1),q(2),q(3),q(4),q(5),q(6));
V = six_V(q(2),q(3),q(4),q(5),q(6),dq(1),dq(2),dq(3),dq(4),dq(5),dq(6));
% [tau_ext_toe,dTau_ext_toe,~,~]=toe_grf(x.',p);
% [tau_ext_heel,dTau_ext_heel,~,~]=heel_grf(x.',p);
% ankle tendon
%
ta... |
function [h ha p pa] = SartaRun(a1,a2,a3,a4,a5,a6,a7)
% function [h ha p pa] = SartaRun(fin,isarta)
% function SartaRun(fin,fout,isarta)
% function [h ha p pa] = SartaRun(h1,h1a,p1,p1a,isarta)
% function SartaRun(h1,h1a,p1,p1a,fout,isarta)
%
% function [sartacmd] = SartaRun('',isarta)
%
% ... |
function varargout = ProjectGui(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ProjectGui_OpeningFcn, ...
'gui_OutputFcn', @ProjectGui_OutputFcn, ...
'gu... |
function [Y]= HPF(A,F,wc)
%initializing Y as a zero array
Y=zeros(length(A),1);
for k=1:length(A)
if abs(F(k))<wc %removing lower frequencies
Y(k)=0;
else
Y(k)=A(k);
end
end
end
|
% $Header: svn://.../trunk/AMIGO2R2016/Preprocessor/AMIGO_default_options.m 770 2013-08-06 09:41:45Z attila $
function inputs_def = AMIGO_default_options()
inputs_def = AMIGO_private_defaults;
inputs_def = AMIGO_public_defaults(inputs_def);
%Options used in amigoCgenerator
end
|
% Histogram Of an Image without using Direct function
clc
clear all
close all
a=imread('cameraman.tif')
subplot(2,1,1)
imshow(a)
title('Original Image')
[r,c] = size(a);
x= 1:1:255
y= (zeros(1,255));
in = 1;
count = 0;
output=zeros(256,1);
NIm=uint8(zeros(size(a,1),size(a,2)));
%Finding Histogram... |
function [ linker,mat_diff_out ] = new_diff_reverse( matrix_gen,mat_diff )
%UNTITLED6 Summary of this function goes here
% Detailed explanation goes here
linker = [];
main_mat = bin_arr(matrix_gen);
diff_mat = bin_arr(mat_diff);
N = 1;
while(N<numel(matrix_gen)+1)
m1 = main_mat(N);
m2 = diff_mat(1);
m3 =... |
function data=Ratio_of_25_to_75(data)
window_size = 128;
totalwindow=length(data);
for windowindex=1:totalwindow
tempwindow=data(windowindex).winSound;
[Pxx,w] = pwelch(tempwindow,window_size);
Pxx=Pxx/sum(Pxx);
total_sum=0;
index_75=0;
while (total_sum < 0.75)
index_75=i... |
function obj = DQVec(aHat)
obj = Dualquaternion;
ar = aHat.realpart;
ad = aHat.dualpart;
obj = Dualquaternion(Quaternion(0, ar.vect), Quaternion(0, ad.vect));
end |
function exampleUsage()
% NOTES
%
% The ground-truth file should be in the format
% frame trackNumber boundingBoxPosition_x boundingBoxPosition_y boundingBoxWidth boundingBoxHeight
%
% The test file should be in the format
% frame trackNumber boundingBoxPosition_y boundingBoxPosition_x boundingBoxWidth boundingBoxHei... |
close all
clear
clc
addpath(cd)
%%
load input
%%
temp=importdata('base.dat',' ',2);
Nz=str2double(temp.colheaders{3});
Ny=str2double(temp.colheaders{5});
z=reshape(temp.data(:,1),Nz,Ny);
y=reshape(temp.data(:,2),Nz,Ny);
v=reshape(temp.data(:,4),Nz,Ny);
w=reshape(temp.data(:,5),Nz,Ny);
clear temp
%%
v_z=diff2d(v,1,1,dz)... |
function [Data] = readData
Data = csvread('data.csv');
end |
clc
clear all
Im1 = imread('boat1.pgm');
Im2 = imread('boat2.pgm');
[matches, scores, fa, fb] = keypoint_matching(Im1,Im2);
imshow([Im1,Im2]);
h1 = vl_plotframe(fa(:,matches(1,1:10))) ;
h2 = vl_plotframe(fa(:,matches(1,1:10))) ;
set(h1,'color','k','linewidth',3) ;
set(h2,'color','y','linewidth',2) ;
for l = 1:size(... |
tic
close all;
clear all;
% Slowly increasing the applied force to the right
Fx = [0:25:6700];
Fy = zeros(1,length(Fx));
F_app = [Fx; Fy];
% Setup of conditions and polymer chain
T = 298;
L = 1;
n = 10;
num_trials = 100;
P_2d_dynamics_force = zeros(2,n,size(F_app,2));
parfor i=1:size(F_app,2) % Increasi... |
function perm_mat = computePermMat( perm_vector )
perm_mat = zeros(length(perm_vector),length(perm_vector));
for i=1:length(perm_vector)
perm_mat(i,perm_vector(i)) = 1;
end
end
|
function [x,y,z,H]=roll(in, B, L)
% vector; [in] are provide in body reference frame
% x,y,z are produced in inertial/earth reference frame
% B is the angle to move from body to earth frame
%check to ensure that in is a 1x3 or vector
M=size(in);
if(M(1)~=3)
printf('Error > Input vector dimens... |
%% the setting of surface trap
Z=1;
q=Z*1.60218*10^(-19); %% use yb 171 + the q=1e
ee0=8.855*10^(-12); %% coulomb force
k_c=q/(4*pi*ee0); %
Omega_rf=19.8*(2*pi)*10^6; %for example 250V 20Mhz
mass=174*1.66*10^(-27); %
U0=1; %U0=(q/(mass*um^2*(Omega_rf/2)^2));
pseudo_C=(q)/(4*mass*Omega_rf^2);
%% initial Da... |
function [C, sigma] = dataset3Params(X, y, Xval, yval)
%DATASET3PARAMS returns your choice of C and sigma for Part 3 of the exercise
%where you select the optimal (C, sigma) learning parameters to use for SVM
%with RBF kernel
% [C, sigma] = DATASET3PARAMS(X, y, Xval, yval) returns your choice of C and
% sigma. You... |
function allData = loadRawData(filenames, channels, times, range)
% FUNCTION d = loadRawData(filenames, channels, times, range)
%
% Loads raw data from the HDF recording file in filename at the given times.
%
% This function is an attempt to provide as close as possible to the same
% API as the `loadaibdata` function, ... |
% get ganges path based on hostname
function [path2ganges] = get_ganges_path()
path2ganges = '';
[~, hostname] = system('hostname');
if ~isempty(strfind(hostname, 'sallyw'))
path2ganges = '/Volumes/';
end
if ~isempty(strfind(hostname, 'darya'))
path2ganges = '/home/deepak/';
... |
Dwork = load('../Result_Data/IndividualFairness/dwork_matrix');
Tau = load('../Result_Data/IndividualFairness/tau_matrix');
Dwork = Dwork.dummykey';
Tau = Tau.dummykey';
Alpha = [0,0.2,0.4,0.5,0.6,0.8,1];
f1=figure(1);
set(0,'DefaultAxesFontSize', 22)
alphaIndex = 0;
for alpha=Alpha
alphaIndex = alphaIndex+1;
... |
clc;clear;
load data.mat; %导入数据
n=size(distance_data,1);
Visit=zeros(1,n); %记录是否找到最短路径,1为找到最短路径,0为没有找到最短路径
Distance=zeros(1,n); %记录从初始结点1到每个结点的最短距离
Parent=zeros(1,n); %沿着最短路径的上一个结点
negloop_exist=0; %检验是否有负权回路,负权回路:图中存在一个环,环上权重之和为负数
for i=1:n
Distance(i)=inf;
Parent(i)=-1;
end
%默认第一个结点为初始结点
Visit(1)=1... |
%% Clase de Teoria Control 23-05-19 Estabilidad Relativa
clear all; close all; clc;
s = tf('s');
% Planta del sistema
g = 8/(s+1)^3;
figure('Name', 'Bode sin regulador');
margin(g);
% Pide error de posicion menor al 5 porciento y Mf de 40 grados
%Los margenes son casi cero, por lo que la respuesta va a oscilar y no ... |
% clear all
close all
rng('shuffle')
%% Initialization
N = 8;
M = 1;
P = 16;
Z = 8;
K = 1;
fa = 1e-3;
var_n = 10.^(-1:-0.1:-2);
var_c = var_n*1e3;
L = 0.5*(0:P-1)';
zt = 0;
zr = Z*rand(N,1);
zr = zr-min(zr);
g = -1:1/Z:1;
N_ = N*P;
%% Initialize steering vectors and Clutter covariance m... |
%PLOT_HEAT plots a heatmap of mean values of measure z at each level of
%varied inputs x and y.
%
% Syntax
% ------
% gr.plot_heat( x, y, z )
% gr.plot_heat( x, y, z, options )
%
% Details
% -------
% gr.plot_heat( x, y, z )
% Creates a default heatmap. Varied measures x and y must be in vector
% for... |
function mst = prepareMst(path2data)
% PREPAREMST Loads master, adds Permno and median price
% Load big master file
commonroot = fullfile(fileparts(mfilename('fullpath')),'..');
commonres = fullfile(commonroot, 'results');
if nargin < 1 || isempty(path2data)
path2data = fullfile(commonroot, 'data\TAQ');
end
loa... |
%--------------------------------------------------------------------------
% Name: tokenize.m
%
% Description: Parses input string from left to right to include only
% a set of the words.
%
% Inputs: inputquery - intput string
% numWords - the number of word... |
function stimuliMatrix = EmbedInEfficientApperature(InnerMatrix, OuterMatrix)
%Calls CreateApperature to make an apperature and embeds 'InnerMatrix' in the center
% InnerMatrix- pixel value matrix of the inner matrix
% Type - 'c' for circle, anything else for rectangle
% SideLengthX - length X of the apperature ... |
function guardar(w,theta)
vo=fopen('pesos_y_umbral_finales.txt','w');
fprintf(vo,'Pesos sinampticos:\n');
for i=1:numel(w)
fprintf(vo,'%d ',w(i));
end
fprintf(vo,'\n\nUmbral:\n%d\n',theta);
fclose(vo);
end |
%% %% (x,y,z) to Latitude and Longitude
%created by Huang Sen
%Email: huangsen1993@gmail.com
function [lon,lat] = XYZtoLGLT(x,y,z,radius)
lt= asin(z/radius);
lg = atan(y/x);
lon = radtodeg(lg);
lon(lon<0) = 180 + lon;
lat = radtodeg(lt);
lat(lat<0) = 180 + lat;
end |
function thisSession = importSession(thisSession, varargin)
% this is a bottom up import of a session. Some things may already have
% been run.
% call by passing in an existing session meta data or by starting from
% scratch
% example calls:
% meta = io.getMetaTable();
%
% io.importSession(meta(10,:)); % run ... |
function [Points, SOut, POut] = irpGenScene(S, P, B, f)
% [Points, SOut, POut] = irpGenScene(S, P, B, f)
% Generiert eine Szene, die aus mehreren Kugeln und mehreren Ebenen
% besteht. Die Parameter der Kugeln können mittels 'S' und die Parameter
% für die Ebenen mittels 'P' frei vorgegeben werden. Punkte, die außerhalb... |
function OUT = LELY_dailydata(cd,FN_MDP,FN_LAC,FN_ANI,cd_H,temp_dir)
% This function produces the 'daily data' from the lely backups
% >>> all software versions
%
%
% INPUTS: cd current directory: folder of txt DATA files
% cd_H current directory headers: forlder of txt HEADER files
% FN_... |
function output = sigmoidFunc(vector)
output = 1 ./(1 + exp(-vector));
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.