text stringlengths 8 6.12M |
|---|
clear
clc
global xmean xsd xcov corrMatrix xr
global codeFolder reviseFolder
xmean = [8000 38 1-0.2863 4641 2.00E-05*1.03e-6];
xsd = [4000 6 0.065 8808 1.55E-05*1.03e-6];
xcov = xsd./xmean;
corrMatrix=[1,0,0,0,0
0,1,0,0,0
0,0,1,0,0
0,0,0,1,0
0,0,0,0,1];
xr = corrMatrix;
codeFolder = 'F:\... |
function y = Fault_decision_wg1_t2(u)
global st12
% Using model defined by the structure st12 to make decision about type2 wg1 fault
res=u(1);u=u(2:end);
if res>0.5
sker=st12.x2sup+u'*u*ones(st12.Nlsup,1)-2*st12.xsup*u;
y=(st12.w)'*exp(-sker./(2*(st12.sigma).^2))+st12.b;
else
y=0;
end
if y>=0.05
... |
%Mamdani
global X mu_X mu_xi ;
altsinir_x=-10; ustsinir_x=1000; altsinir_y=-30; ustsinir_y=30; altsinir_z=-30; ustsinir_z=30;
xi=600; yi=-11; zi=0;
%İrtifa üyelik fonksiyonları
ucgen(altsinir_x,0,0,500,ustsinir_x,xi); x_S=X; mu_S=mu_X; mu_xi_S=mu_xi;
ucgen(altsinir_x,0,300,800,ustsinir_x,xi); x_A=X; mu_A=... |
function [shape_chehra_intraface] = get_lfpw_shape_measure_histogram(path)
%
clc;
%
load([path '/common_data/fids_mapping/chehra_deva_intraface_rcpr_common_fids.mat']);
load([path '/lfpw_data/facemap.mat']);
load([path '/lfpw_data/chehra_fids.mat']);
load([path '/lfpw_data/intraface_fids.m... |
% ----------------------------------------------------------------------
%
% Dinecsionless formulation and scaling, May 2014, MN
% Scaled quantities:
% -- charactersitic length L (largest space length)
% -- characteristic coefficient factor M_char = max(E)
% -- characteristic stress S_shar = 1
% -- charac... |
function [out,idx] = getd(in_tsd,target_field)
% function [out,idx] = getd(in_tsd,target_field)
%
% tsd/ts helper function to return data corresponding to label target_field
%
% MvdM 2014-06-24
idx = find(strcmp(target_field,in_tsd.label));
if isempty(idx)
error('target field not found.');
else
if isfield(in_... |
function price=Black_Scholes_call_price(s,tau,K,r,sigma);
%************************************************
% I modified your class code to a call price using put-call parity.
%************************************************
d1=(log(s/K)+(r+0.5*sigma^2)*tau)/(sigma*sqrt(tau));
d2=d1-sigma*sqrt(tau);
put_price=-s... |
function plot_rotation( R, label, color )
%plot_rotation plot rotation matrix R
plot3([0 R(1,1) nan 0 R(1,2) nan 0 R(1,3)],...
[0 R(2,1) nan 0 R(2,2) nan 0 R(2,3)],...
[0 R(3,1) nan 0 R(3,2) nan 0 R(3,3)],color);
hold on
text([R(1,1) R(1,2) R(1,3)], ...
[R(2,1) R(2,2) R(2,3)],...
[R(3,1) R(3,2) R(3,3)]... |
function [nodes,res ] = mtLMS( nodes,neighbors, syn_param, options )
%REGMTL Summary of this function goes here
% Detailed explanation goes here
nodenum = numel(nodes);
[nsample,nfeat] = size(nodes{1}.data);
% tuning parameter
maxiter = options.max_iters;
mu = options.mu;
... |
function [T] = testm(M)
%TEST Test the model
tic
fprintf('Testing response ... ');
[T.RESP.t,T.RESP.En,T.RESP.E0] = testresp([0 1.5e-3],M);
fprintf('done.\n');
fprintf('Strength-Duration Curce ');
T.M = M;
[T.SD.R,T.SD.T] = SDstat(M,0);
fprintf('done.\n');
fprintf('Threshold Electrotonus ');
T.TE.TD = 1e-3*[0 10 20 3... |
clear all;
close all;
Nt = 5000;
R = [];
T = [];
N = 100000; %number of moves for the particle in the protein phase
%Rd = 9*rand(1,1) + 1; %Randomly generates a droplet between 1 and 10 um
Td = 1.5/1000; % Doxo... |
%CASSIELOG Interface class for handling Cassie log files
%
% Syntax:
% log = CassieLog(fileName, logType)
% Copyright 2017-2018 Agility Robotics
classdef CassieLog < LogReader
% CONSTANT PROPERTIES ========================================================
properties (Constant)
% Motor name list
motorN... |
persons_data.feature_values(:,:,1)= [1,2;1,0;1,0];
persons_data.feature_values(:,:,2)= [3,2;2,0;2,3];
persons_data.feature_values(:,:,3)= [3,1;2,1;1,3];
persons_data.feature_values(:,:,4)= [3,1;2,2;3,4];
persons_data.feature_values(:,:,5)= [1,2;1,0;1,0];
persons_data.feature_values(:,:,6)= [3,2;2,0;2,3];
person... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File: halge.m
% Usage: the utility function to learn matrix W by HALGE algorithm
% Input: feature matrix X and graph matrix S
% Output: weight matrix W
% Author: Fei Han
% Email: fhan@mines.edu
% Date: 12/15/2017
%%%%%%%%%... |
close all;
clear all;
clc;
conn = database('contingencia','argel','contargel',...
'Vendor','PostgreSQL',...
'Server','132.248.8.238');
tables = {'cont_otres'};
compoundTitle = {'Ozono'};
ppbLimit = 166;
try
%for idx = 1:1
sqlquery = [
' SELECT count(*), mes, anio ' ..... |
function y = md(num)
fid = fopen('D:\temp.txt','w');
fprintf(fid,'%d',num);
y = md5('D:\temp.txt');
fclose(fid);
delete('D:\temp.txt'); |
classdef HsvTresholds < handle
properties
HueHigh;
HueLow;
SaturationHigh;
SaturationLow;
ValueHigh;
ValueLow;
end
end |
clc; clear variables; close all;
N = 1e6; % number of channel tap
NNN = 1000; % number of Monte Carlo
K = 7 % number of cluster (number of user = 2K)
NN = 256; % number of information bit
N1 = NN;
N2 = NN;
Pt = 20:2:30; %Transmit Power in dBm
pt = (10^-3).*db2pow(Pt); %Transmit Power (linear scale)... |
function export_STL_txt(fileName,stlStruct)
% ------------------------------------------------------------------------
% function export_STL_txt(fileName,stlStruct)
%
% This function generates an STL file using the input structure stlStruct.
% Multiple solids are supported as cell entries within the structure.
... |
% This code calculates 2D spectroscopy using the HEOM in the exciton basis
% for an excitonic system with a spectral density of underdamped and
% overdamped brownian oscillator modes on each side.
%clear old response functions and perm dipole shifts
clear R1 R2 R3 R4 R5 R6 pdm_shift pdm
if ~exist('params_for_wra... |
%Exemplary use B13maxbrzuchlr1=draw(B13maxbrzuchlr1)
function [emg] = draw(emg, inserting)
%inserting = 0-> display , 1-> insert data
%Display one chart at a time
if inserting == 1
figure(1);
set(figure(1),'Units','Normalized','OuterPosition',[0 0 1 1]);
else
%Display all charts at once
fi... |
function [xs,ys,zs,cs]=plotEllipsoid(V1,e1s)
%output x,y,z, and cmap coordinates for plotting an Ellipsoid using M1, a
%CTERun License
%Copyright (c) 2012, The Kriven Research Group. All rights reserved.
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided... |
% Example:
%
% 2D Sampling and grayscale quantization
%
% Computer Vision Course
% (c) Domingo Mery (2014) - http://dmery.ing.puc.cl
close all
i = input('Test image: 1> Mandrill, 2> Chicago, 3> Drops, 4> Apple, 5> Pattern: ');
switch i
case 1
[X,map] = imread('mandrill_bw.bmp');
case 2
[X,map]... |
function plotFig4(save_fig)
%PLOTFIG4 Plots activated axons overlaid on morphologies for monophasic PA
%and AP TMS in single L2/3 PC, L4 LBC, and L5 PC populations
%
% REQUIRES 'CURVE FITTING' MATLAB TOOLBOX FOR MAKESLICES
% AUTHOR : Aman Aberra
%%
if nargin==0
save_fig = 0;
end
mat_dir = addPaths;
% Simulat... |
function [ unwrapped ] = UnwrapMatlabFC( fase )
% Utiliza la funcion unwrap de matlab para desenvolver primero las filas y luego las columnas
[f, c] = size(fase);
unwrapped = fase;
for j = 1 : f
unwrapped(j, :) = unwrap(unwrapped(j, :));
end
for i = 1 : c
unwrapped(:, i) = unwrap(unwrapped(:, i));
end
end
|
function points = calcSegmentPoint(seg)
% points = calcSegmentPoint(seg, segIds)
% This function calculates the three indices of the
% point with highest distance from the borders for
% for each segment.
%
% seg
% Three-dimensional segmentation value. The segments
% must be num... |
function q=RK4(step,nSteps,x0,y0,z0,t0);
x(1)=x0; y(1)=y0; z(1)=z0;
t=t0:step:(nSteps-1)*step+t0; p2=step/2;
p6=step/6;
for k=2:nSteps;
n=k-1;
% *****************************************
Dx1=FunX(t(n),x(n),y(n),z(n));
Dy1=FunY(t(n),x(n),y(n),z(n));
Dz1=FunZ(t(n),x(n),y(n),z(n));
%-------'--primeir... |
function ccc
% simplification of clear; close all; clc
evalin('base','clear');
close all
clc |
function qcltdi(input_path, outfile, dy, background)
DNoiseDir = 'D:\ir images\IR Images\ir-short-path\1st-test\noise\1502\sbf161_img_000_1600.mat';
load(DNoiseDir);
DNoise = s;
BACKGROUND = false;
if(nargin > 3)
BACKGROUND = true; %flag for calculating a background ratio
... |
function SP = YBSimpleSeg(File,Dim)
%YBSeg Yanowitz-Bruckstein image segmentation with fiber unentanglement
% SP is the structure path
% File is the file path from current active dir
% Dim is the image dimension in nm
%% Preprocessing
DotInd = FindLastDot(File); % Last dot in filename before extension
... |
function M=rotM(t)
M=[cosd(t),sind(t);-sind(t),cosd(t)]; |
clear;
clc;
M=6;
clear theta_minus theta_plus betta XX event
LB=[0 0 0 0 0];
UB=[15 15 15 15 15];
%LB(6:10)=0.01;
%UB(6:10)=1.5;
LB
UB
% Genetic algorithm approach
mutationRate = 0.4;
options = gaoptimset('MutationFcn', {@mutationadaptfeasible, mutationRate},'TolFun',1e-2,'TolCon',1e-2,'generations',40,...
... |
% n9: Weight – Horsepower
clear;
load carbig;
% del_from_HSPWR = [];
% for i = 1 : length(Horsepower)
% if isnan(Horsepower(i)) %== NaN
% del_from_HSPWR = [del_from_HSPWR, i];
% end
% end
%
% i = length(del_from_HSPWR);
% while i > 0
% Horsepower(del_from_HSPWR(i)) = [];
% end
%
% del_from_WEIGT... |
%
% Suite au changement majeur dans la structure des matrices de Analyse,
% on fait une vérification des différentes variables et on transforme la matrice
% DTCHNL(3D) en autant de matrice (2D) qu'il y a de canaux.
%
% EN ENTRÉE
% obj --> objet de type CFichier ou par héritage CFichierAnalyse
% entrad... |
clear all; clc
IC_str = '_front';
%load best-fit params, data, and initial condition
if strcmp(IC_str,'_gauss')
load(['advection_rates' IC_str '_IC_all_3_26.mat'])
load(['advection_art_data' IC_str '_all_3_26.mat'])
elseif strcmp(IC_str,'_front')
load(['advection_rates_autoreg' IC_str '_IC_rev.mat'])
... |
function tobj = loadDataStruct(datadir)
cellCenters = load(fullfile(datadir, 'meansmat.mat'));
cellCenters = cellCenters.means;
imNames = load(fullfile(datadir, 'Ro150129_s86a_FreeViewPicpiclocations.mat'));
imNames = imNames.piclocations;
spikeCounts = load(fullfile(datadir, 'Ro150129_s86a_FreeViewPicspikecounts.mat'... |
function [h, outputids, inputids] = impulseresponse(sfg, N, p_plot, title_str);
% This function returns the impulse response.
% Check number of input arguments
if nargin < 2
error('Not enough input arguments');
end
if nargin > 4
error('Too many input arguments');
end
if nargin < 3
p_plot = 0;
end
% Set a ... |
% Test matrix definition - test cases
% See create_test_suite_basic.
testcases = dir(fullfile('test_suites', 'basic', '*.mat'));
testcases = testcases(4:end);
tc_count = length(testcases);
% Test matrix definition - reduction params
testMatrix_costFuncs_empty = {[]};
testMatrix_costFuncs = {@count_resistors, @cost_nnz... |
function cm_vwfaPreproc( EEG,currentSub,iSub )
%Simple preprocessing in EEGLAB using parameters in RUN (created Oct '15 by CCM in MAXLAB)
% RUN.preproc contains several ways of preprocessing
% Output can be saved then loaded for further analysis
global RUN
%% Filter - currently in EEGLAB
%EEG = pop_eegfi... |
%*******************************************************************************
%* Program: plot_bperp.m
%* Description: Plotting routine for perpendicular magnetic field
%* Author: Andrew Kercher
%-------------------------------------------------------------------------------
%**************************************... |
% ----------------------------------------------------------------------
% Explicit solution of Alpha by UADE method with Delayed rhom (Gastaldo)
% alphaEqn
phiAlpha=rhomPhi;
% Final flux, PISO part
fluxAlpha=rhomPhi.*fvc_interpolate(Alphag0, w, xC, xF);
% UADE stabilization with full upwind/downwind
directionFlux=f... |
function [l, s] = plotShadedError(x,y,err,style,lw)
% plotShadedError Plot curve with error range shaded underneath
%
% [l, s] = plotShadedError(x, y, err, [style],[lw])
%
% x, y basic curve
% err if size of y, error range is y +/- err
% if 2 rows size of y, directly specifies top... |
clc
clear all
close all
signal = [] ;
order = [5 6 7 8] ;
period_length = 2.^order -1 ;
N = 1024 ;
Band = [0 1];
Range = [-1,1];
num_per = 4 ;
signal1 = fft(idinput([period_length(1),1,num_per],'prbs',Band,Range));
signal2 = fft(idinput([period_length(2),1,num_per],'prbs',Band,Range));
signal3 = fft(idinput([period_l... |
function [Dh, Dl] = train_coupled_dict(Xh, Xl, dict_size, lambda, upscale)
addpath(genpath('RegularizedSC'));
hDim = size(Xh, 1);
lDim = size(Xl, 1);
% should pre-normalize Xh and Xl !
hNorm = sqrt(sum(Xh.^2));
lNorm = sqrt(sum(Xl.^2));
Idx = find( hNorm & lNorm );
Xh = Xh(:, Idx);
Xl = Xl(:, Idx);
... |
function [ys, awake, bounds] = borbely(ts, y_init, awake_init, pars, forcing)
%BORBELY Simulates the two-process sleep-wake
% As described in in Skeldon AC, Dijk D-J, Derks G. Mathematical Models for Sleep-Wake Dynamics:
% Comparison of the Two-Process Model and a Mutual Inhibition Neuronal Model.
% Available from: h... |
function C = SIFTPoolingCells(patchsize,nr_cells,nr_scales,nr_orientations)
%FUNCTION generates SIFT pooling cells to perform local spatial pooling of the feature
%map
%
% C = SIFTPoolingCells(patchsize,nr_cells)
%
% INPUT :
% patchsize - pixel size of the local image patch to be pooled, i.e. a patchsize x patc... |
% File: SA1_1.m for Study-aid Example SA1-1
clear;
% This illustrates how the antemma height affects the LOS distance.
h1=input ('Enter the transmit antenna height in feet. ');
h2=input ('Enter the receive antenna height in feet. ');
% d is distance in miles
d = sqrt(2*h1) + sqrt(2*h2);
fprintf('The LOS distance ... |
%MAIN -- trajectory optimization
%
% This script sets up a trajectory optimization problem for solving the motion
% for block moving.
% In line 29 & 30, costFunctionType determines the optimization for different
% objective function:
% 'minNorm' solves the optimal trajectory with min-norm control (fixed terminal t... |
function procData = filterEKGData(EKG,sampleRate,fileName)
close all
rawEKG = EKG(:,2);
t = EKG(:,1);
rawEKG=filloutliers(rawEKG, 'center','mean', 'ThresholdFactor', 4);%this takes out any large artifacts
% process EKG data
% fpass = [300,(sampleRate/2)-1]; % Hz
fpass = [70,200]; % Hz
trialDuration_sec ... |
function p_min = minimum_detectable_signal(system_temperature, bandwidth, noise_factor, losses, signal_to_noise)
%% Calculate the minimum detectable signal based upon the SNR at the output of the receiver.
% :param system_temperature: The system temperature (K).
% :param bandwidth: The operating bandwidth (Hz).... |
%% Affine Rectification
% We shall take two lines that are parallel in the 3d space in the image and will select points such that we have
% two lines.
% I = imread('test_images/building2.jpg');
% I = imread('test_images/Crop_circles.jpg');
% I = imread('test_images/UCF SU.jpg');
% I = imread('test_images/home.jpg');
I... |
function plot_rev_corr(ax,data,model,varargin)
dR = data(2).rev_corr_r;
dL = data(2).rev_corr_l;
mR = model(2).rev_corr_r;
mL = model(2).rev_corr_l;
t = data(2).tax;
M = { dR dL mR mL};
clrs = { [1 0 0] [64 128 0]/255 [252 161 164]/255 [128 254 0]/255};
set(ax,'NextPlot','add');
for px=1:2
lb = nanmean(M{px},... |
function num_cen=get_num_cen(rn)
% num_cen=rbf_net_base.get_num_cen(rn)
%
% G. Raetsch 1.6.98
% Copyright (c) 1998 GMD Berlin - All rights reserved
% THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of GMD FIRST Berlin
% The copyright notice above does not evidence any
% actual or intended publication of... |
clear all; close all; clc;
alphabet = 1 : 100;
alphabet2 = 101 : 200;
cnt = 0;
prob1 = [0.7 0.1]; prob2 = ones(1, 98); prob2 = prob2 .* (0.2 / 98); prob = [prob1, prob2];
rand('seed',0);
a = zeros(1, 1e3);
b = zeros(1, 1e3);
for i = 1 : 1e3
a(i) = randsrc(1,1,[alphabet; prob]);
b(i) = randsrc(1,1,[alphabet2;... |
function OverlayHeader=w_ExtendHeader(OverlayHeader)
OverlayHeader=w_ReadDF(OverlayHeader);
OverlayHeader=w_ReadFWHM(OverlayHeader);
OverlayHeader.CSize=0;
OverlayHeader.RMM=18;
OverlayHeader.IsSelected=0;
OverlayHeader.ThrdIndex='';
OverlayHeader.MaskFile='';
OverlayHeader.Mask=true(OverlayHeader.dim);
OverlayHeader.... |
function sv=simple_game(w_coal,n)
% SIMPLE_GAME computes from a list of winning coalitions the
% corresponding simple game.
%
% Usage: sv=simple_game(w_coal,n)
% Example:
% Let w_coal=[10 12 7 11 13 14 15] be a set of winning coalitions, then
% sv=simple_game(w_coal,4);
% computes the corresponding simple game.
%
%
% ... |
tic;quadgk(@(x) sin(50 * x).* cos(50 * x),0,20),toc;
tic;quadl(@(x) sin(50 * x).* cos(50 * x),0,20),toc;
tic;quad(@(x) sin(50 * x).* cos(50 * x),0,20),toc;
tic;integral(@(x) sin(50 * x).* cos(50 * x),0,20),toc;
|
clear
clc
height=input('input the height of the tree:');
maxv=1+2*(height);
Blank=(maxv-1)/2;
while (1)
clc
pause(0.5)
fprintf('%1$*2$s \n','*',Blank);
for j =1:(height-1)%level
k=1+(j)*2;%k=number of stars in that row
fprintf('%1$*2$s','*',(Blank-j));
for i=1:(k-1)
... |
clear;
clc;
format compact;
close all;
filePath = '/Users/mattmcpartlan/Desktop/';
prompt = 'File name on Desktop (Dont include extensions): ';
fileName = input(prompt, 's');
readPath = [filePath fileName '.dpt'];
isSquare = input('Press return if spectral map is square: ', 's');
if (~isempty(isSquare))
rowLengt... |
clear all
close all
functions = csvread('input_data_numeric.csv');
functions(:,1) = [];
all_targets = [[-1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1],
[1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1],
[-1, -1, 1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1],
[1, -1, 1, 1, -1, -1, -1, -1,... |
clc;
clear;
clear all;
im = imread('lowContrastPollen.jpg'); %uint8unsigned integer 8 bit olarak hesaplanır
im=double(im);
[rows,cols]=size(im);
h=zeros(1,256);
for i=1:rows
for j=1:cols
pixel=im(i,j);
h(pixel+1)=h(pixel+1)+1;
end
end
pdf= h/(rows*cols);
cdf=zeros(1,256);
... |
%% Random graph
clear all; clc; n = 10; p = 0.3; %f = 0.1;
%% remove random
clear all; clc; n = 100; p = 0.1;
average = zeros(n-1,1);
for i = 1:40
toPlot = [];
disp(i)
A = triu(rand(n) < p,1); A = A + A';
for f = 1:n-1;
fraction = f/n;
A_g = removeRandom(A,fraction);
toPlot = ... |
function [ hist_bin_edge, hist_bin_center ] = GetHistBin( hist_bin_center_lo, hist_bin_center_hi, bin_size )
% GetHistBin takes in the first bin center, the last bin center and bin
% size, and return hist bin location in format of edges and centers
hist_bin_center = hist_bin_center_lo:bin_size:hist_bin_center_hi;
... |
%718091 Stefan Benox
%715023 Tobias Falk
%funktion generiert Ton abhaenig von der Tastennummer keynum und kann
%punktweise multipliziert werden
function [tone] = note(keynum,relDuration,fullDuration,fs,A)
tone = createWaveform(440*(2^(1/12))^(keynum - 49),fs,relDuration*fullDuration,1).*A;
end |
function [seq,bas] = chrnuc_chimp(chrid,startn,endn)
if (nargin<3), endn=startn; end
if (isa(chrid,'memmapfile'))
chrmm=chrid;
else
%mmFilename=sprintf('Y:/chimpaln/mmFilenamechr%d',chrid);
mmFilename=sprintf('C:/biodata/Alignments/chimpalnPanTro2/download/seq/mmf/alnPanTroIIchr%d.mm',chrid);
chrmm = m... |
function gUpd = updateStageGPS(XvPred, YvPred, XvObs, YvObs, alphaP)
XvUpd = (1 - alphaP)*XvPred + alphaP*XvObs;
YvUpd = (1 - alphaP)*YvPred + alphaP*YvObs;
gUpd = [XvUpd, YvUpd];
end
|
function commonSubmitArgs = getCommonSubmitArgs(cluster)
% Get any additional submit arguments for the Slurm sbatch command
% that are common to both independent and communicating jobs.
% Copyright 2016-2019 The MathWorks, Inc.
commonSubmitArgs = '';
% Append any arguments provided by the AdditionalSubmitArgs field ... |
function [sampling,newImage] = HW3_pro1(filename) %the newImage is the sampled and quantized image
%Ruomei Ye A99074215
pepper = imread(filename);
%subplot(1,3,1);
imshow(pepper); %this line will print the original image;
%since this function should only return sampled and quantized images, I did
%not add this image ... |
function loadWaveforms(duration)
WaveGen = BpodAudioPlayer('COM4');
WaveGen.TriggerMode = 'Normal';
WaveGen.SamplingRate = 96000;
WaveGen.AMenvelope = (0.005:0.005:1);
%Load waveform 1
Frequency = 6000;
Amplitude = 1;
t = 0:1/WaveGen.SamplingRate:duration;
wave1 = Amplitude*sin(2*pi*Frequency*t);
WaveGen.loadSound(... |
% SPLIT Divide SignalGroup into Signal objects
%
% This method breaks up a SignalGroup object into a collection of Signal
% objects.
% >> [object1,object2,...]=split(object)
%
% See also SignalGroup, gather
%
%
% created November 22, 2013 by Daniel Dolan (Sandia National Laboratories)
%
function varargout=split(ob... |
function mtcnn_detector = setup_mtcnn()
%minimum size of face
minsize=100;
%path of toolbox
caffe_path='E:\caffe-master';
pdollar_toolbox_path='E:\toolbox_pdollar';
caffe_model_path='.\face detection\MTCNNv2\model';
addpath(genpath(caffe_path));
addpath(genpath(pdollar_toolbox_path));
%use cpu
caffe.set_mode_cpu();... |
% getlte returns an lte signal structure for a specific configuration.
% Input arguments:
% 'getltecfg' - lte configuration structure.
% 'getltecfg.bw' - lte BW
% 'getltecfg.snr' - SNR of received signal
% 'getltecfg.ct' - reference signal type
% 'getltecfg.cin' - coherent integration number
% 'getlt... |
% Plot the link margin to BER curve and Eb/No to BER curve.
% load data files
% structure of Outputvec
% Row 1: Eb/No
% Row 2: BER
% Row 3: Link Margin
load results_Nsim100_8PSK_R3_5
SimResults_8PSK_3_5 = Outputvec;
load results_Nsim100_8PSK_R3_4
SimResults_8PSK_3_4 = Outputvec;
load results_Nsim100_8PSK_R8_9
SimResul... |
function D = dist2(C, im, r1, c1, S, m, eim, We)
% Squared spatial distance
% ds is a fixed 'image' we should be able to exploit this
% and use a fixed meshgrid for much of the time somehow...
[rows, cols, chan] = size(im);
[x,y] = meshgrid(c1:(c1+cols-1), r1:(r1+rows-1));
x = x-C(... |
this script tests RandomUnitary1
N=50;
M=60;
hold on
for l=1:3
for i=1:3
x=zeros(1,M);
for k=1:M
for j= 1:N
x(k)=x(k)+Fidelity(GHZ(l,0), RandomUnitary1(2^l,1.5*k/M,20*i*M/k)*GHZ(l,0));
end
x(k)=x(k)/N;
end
plot(x)
end
end
hold... |
clc
close all
clear all
%% data
%BFG33 = load('BFG33.DAT');
BFG44 = load('BFG44.DAT');
t = BFG44(:,1);
U = BFG44(:,2);
y = BFG44(:,3);
% t = BFG33(:,1);
% U = BFG33(:,2);
% y = BFG33(:,3);
Ts = t(2)-t(1);
lu = length(U);
figure(1)
subplot(2,1,1);
plot(t, U);
title('U(k)');
subplot(2,1,2);
plot(t,y);
title('y(k... |
function Plot_Spikes_aux(handles,classes,i)
USER_DATA = get(handles.wave_clus_figure,'userdata');
par = USER_DATA{1};
spikes = USER_DATA{2};
spk_times = USER_DATA{3};
clu = USER_DATA{4};
%classes = USER_DATA{6};
%classes = classes(:)';
inspk = USER_DATA{7};
temp = USER_DATA{8};
ls = size(spikes,2);
par.to_pl... |
classdef project_app < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
GridLayout matlab.ui.container.GridLayout
LoadClassesButton matlab.ui.control.Button... |
function [score] = NSS(map1,map2)
% map1: Saliency map
% map2: Fixation pts
% normalize saliency map
map1 = (map1 - mean(map1(:)))/std(map1(:));
% mean value at fixation locations
score = mean(map1(logical(map2)));
end
|
function C=maxchroma(mode,varargin)
% MAXCHROMA(MODEL,{CHANNELS})
% returns the maximum chroma for color points to stay within sRGB gamut
% can be used for chroma normalization (HuSL/HSY) or truncation prior to conversion
%
% MODEL specifies the color model to use
% 'ypp' uses polar YPbPr
% ... |
% Please kindly cite the paper Junyi Guan, Sheng Li, Xiongxiong He, and Jiajia Chen,
%"Peak-graph-based fast density peak clustering for image segmentation,"
% IEEE SIGNAL PROCESSING LETTERS, 2021,Doi:10.1109/LSP.2021.3072794
% The code was written by Junyi Guan in 2020.
clear all; close all; clc;
%% loading data
loa... |
% Running for values b = 4, 8, 12, 16
quantize(@(x)sin(x), 4);
quantize(@(x)sin(x), 8);
quantize(@(x)sin(x), 12);
quantize(@(x)sin(x), 16); |
% Test for Homework 2 Part 1
% This is a test script to show that Part 1 of the homework is working,
% without parsing the text input. Thus here, the transition probabilities
% are given.
%
%
% Look at the Homework2 main file
% i,j is the probability of ending up in state j, if you start on state i,
% and take actio... |
function mcs = getMCSlonlat(fin,fout,season)
display('Specify fin as filename without the path, file path should be defined in this function manualy')
tic
%%%%%%%%%%%%%%%%%%%%%
% Paths %
%%%%%%%%%%%%%%%%%%%%%
% time = fin(end-18:end-3); % get the time of nc file
% compset = 'm2005';
% case... |
function val = displayget(options,name,varargin)
%DISPLAYGET get DISPLAY OPTIONS parameters.
%
% VAL = DISPLAYGET(OPTIONS,'NAME') extracts the value of the named property
% from options structure OPTIONS, returning an empty matrix if
% the property name is not specified in OPTIONS. It is sufficient to type
% only t... |
function res = DetermineStepSize(rk, grid, solu, g, N, d, sigma, limitA)
s=1;
[solxA, solyA] = rk.solve_forward_equation(solu - s*g);
kA=0;
while phi(solxA, N, d, grid)> phi(rk.solx, N, d, grid) - sigma*s*spsolu(g, g, N, d, grid) && kA<limitA
s = s*0.5;
[solxA, solyA] = rk.solve_forward_equation(solu - s*g... |
function IGD = IGD_Function(PF, truePF)
q = 2; %the parameter of IGD
%STEP 1. Obtain the maximum and minimum values of the Pareto front
m1 = size(PF, 1);
m = size(truePF, 1);
maxVals = max(truePF);
minVals = min(truePF);
%STEP 2. Get the normalized front
normalizedPF = (PF - repmat(minVals, m1, 1)) ./ repmat(maxVals ... |
function imgout = ICV_convolve(imgin, mask, matConst) %needs to work on a square matrix of size 3,5,7
width = size(imgin,1);
height = size(imgin,2);
maskwidth = size(mask,1);
maskheight = size(mask,2);
output = zeros(width-((maskwidth-1)),height-((maskheight-1)));
for x = 1+((maskwidth-1)/2):width-((maskwid... |
addpath(genpath('/Applications/MATLAB_R2018a.app/toolbox/Psychtoolbox/'));
addpath(genpath('/Volumes/Denali_4D2/Brandon/code/git/')); |
function [dev,kerr]=a_pmisc(inputs,dev)
global REF CONST
kerr=0;
% REF.t set in a_rdev.m
REF.chi=inputs.misc.ip(1).set(1);
REF.nc=inputs.misc.ip(2).set(1);
REF.nv=inputs.misc.ip(3).set(1);
REF.eg=inputs.misc.ip(4).set(1);
REF.ks=inputs.misc.ip(5).set(1);
REF.ni=sqrt(REF.nc*REF.nv)*exp(-REF.eg/(CONST.kb*R... |
function [objects, cam2toW] = track3D_part2(imgseq1, imgseq2, cam_params)
%clear all
%close all
%prepare parameters and access to functions
run('VLFEATROOT/toolbox/vl_setup');
addpath('hungarian_method/');
imgsd_1 = zeros(480,640,length(imgseq1));
xyz_depth_1 = zeros(480*640,3,length(imgseq1));
rgbd_1 = zeros(480,64... |
function [A,B]=analyse(a,M)
N=size(a,1); % minták száma
F=fft(a); % diszkrét fourier transzformáció
A=abs(F)*2/N; % amplitúdó spektrum
B=angle(F); % fázisspektrum
A=A(2:M+1); % az els? M frekvenciakomponens megtartása
B=B(2:M+1);
end |
function y = polyn(x)
y = x.^0;
end |
close all;
clearvars;
commandwindow;
% Setup PTB with some default values
PsychDefaultSetup(2);
% Seed the random number generator.
rng('shuffle')
prompt = {'Subject''s number:', 'group'};
% Skip sync tests for demo purposes only
Screen('Preference', 'SkipSyncTests', 1);
%-----------------------------------------... |
function y = CDF_GEV(S,Mean,sigma,phi)
z = (S-Mean)/sigma;
y = exp(-(1+phi*z)^(-1/phi));
|
p.NumBowties = 100;
p.REmitter = 1; % 1 ohm
p.RCollector = 1; % 1 ohm
p.Area = 50000e-18; % 5 nm^2
p.Beta = 25; % enhancement factor
p.Distance = 10; % 10 nm
p.workFunction = 5.1; % work function of gold
p.CemitterCollector = 2; % nano farad
p.Cparasitic = 0.05; % 0.1 nano farad
p.Radius = 10; % 1 nm
p.taby = csv... |
% MATLAB
digits = load('digits.txt');
% Remove the column average from the images:
image_averages = mean(digits,1);
digits2 = digits - repmat(image_averages,784,1);
% Normalizing to unit norm
digits3 = [];
for i = 1:1000
digits3(:,i) = digits2(:,i)./norm(digits2(:,i),2);
end
% Remove the row average from the da... |
% mecCURVE.m
% Simulation of a car going around a curved road.
% DOING PHYSICS WITH MATLAB:
% https://d-arora.github.io/Doing-Physics-With-Matlab/
% VISUAL PHYSICS ONLINE
% http://www.physics.usyd.edu.au/teach_res/hsp/sp/spHome.htm
% Documentation
% http://www.physics.usyd.edu.au/teach_res/hsp/sp/mod5new/mod52... |
function [context_pred, log_prob] = predictContext2(signal, time, model, pred_lag, max_duration)
%PREDICTCONTEXT Summary of this function goes here
% Detailed explanation goes here
import brml.*
% Feature model
feature_model = model.feature_model;
% HMM Model
p_trans = model.hmm_model;
% Gamma Process Model
gamma... |
f = @(x) x^5 - 5*x/(2*8^(1/5)) + 1; % la funzione f(x)
a = -2; % estremo sinistro
b = 0; % estremo destro
i = 0; % numero di iterazioni eseguite
while abs(f((a+b)/2)) > 1E-15 % il ciclo continua fino al raggiungimento della condizione di arresto
p = (a+b)/2; % si calcola il punto medio
if f(a)*f(p) < 0
b =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.