text stringlengths 8 6.12M |
|---|
subplot(2,1,1)
a = imread('luanyicp5.png');
imagesc(a);
ax = gca;
set(ax, 'YTickLabel', []);
set(ax, 'XTickLabel', []);
subplot(2,1,2);
xcp5 = [25
12.5
6.25
3.125
1.6
0.8];
ycp5 = [24.02
21.465
14.375
12.48
9.455
8.99];
dose_response(xcp5,ycp5);
axis([.1 100 0 30]);
suplabel('Luanyi TNF-\alpha data, CP', 't')
pause;
b ... |
function [neto,xio,aio] = openloop(netc,xic,aic)
%OPENLOOP Convert neural network closed feedback to open feedback loops.
%
% <a href="matlab:doc openloop">openloop</a>(NET) takes a network and transforms any outputs marked
% as closed loop (i.e. NET.<a href="matlab:doc nnproperty.net_outputs">outputs</a>{i}.<a href=... |
function plotUplinkMask(uplinkEmissions,ant_type, e_as_stn, phimax)
listofstn = unique(uplinkEmissions(:,4));
for stn=1:length(listofstn)
stn_name = char(listofstn{stn});
%Filter e_as_stn by stn_name
filtered = e_as_stn(strcmp(e_as_stn{:,'stn_name'},stn_name),:);
[Gmax,idx] ... |
function [ b1_est, b2_est, sig_stop, sig_nan] = cochannel_approxfg( r, sys, user, Xconst_fctr, h1, h2, sigmasqrd, fg1_ind, fg2_ind, x1_fg_ind, x2_fg_ind, b1_fg_ind, b2_fg_ind )
%COCHANNEL_APPROXFG Factor graph and message passing for cochannel
%detection using the approximate MAP FG method.
% Joint detection of 2 c... |
function glycanBondJava = bondMat2Java(glyBondobj)
%BONDMAT2JAVA convert a MATLAB GlycanBond object to a Java Bond object
%
% bondJava = BONDMAT2JAVA(bondMat) takes an input of Matlab
% GlycanBond object and returns a Java Bond object. It can also be
% written as bondJava = bondMat.BONDMAT2JAVA.
%
% Se... |
function hr = movRIn(src, type, par)
% Obtain the image path for the video source.
%
% Input
% src - wei src
% type - type, 'vdo' | 'flow' | 'vox'
% 'vdo': video frame
% 'flow': optical flow
% 'vox': voxel
% par - parameter
%
% Output
% hr - handl... |
function fillingRF4()
% The idea is to see whether cells in the center are modulated by the
% similarity between center and background.
% I will have the screen divided in center and object.
% Each one will be a grating of a given spatial frequency.
% At each frame both grating are going to have zero mean and intensiti... |
% function takes in a neural net, and a sample in and out to return an
% updated net, alhpa is a scalar denoting the learning rate
% in and out are matrizes whose columns are training samples, each denoting
% input and desired output
% denoting the learning rate
% algorithm from (with alterations): Russel,Norvig -... |
function varargout = magShear(obj,npts,target,varargin)
% MAGSHEAR Computes a magnetic configuration's magnetic shear
% s = MAGSHEAR(obj,npts,target) computes the local magnetic shear for a
% magnetic configuration object (mConf) along a straight path extending
% from the configuration's center to the point descr... |
classdef DgmDist < GmDist
% directed graphical model
properties
CPDs;
% infMethod in GM class
% G field is in parent class
end
%% Main methods
methods
function obj = DgmDist(G, varargin)
if(nargin == 0);G = [];end
... |
syms X Y
jacobian([2*X/(1+X^2+Y^2), 2*Y/(1+X^2+Y^2), (1-X^2-Y^2)/(1+X^2+Y^2)], [X, Y])
|
function [ output ] = energy_value( u )
%ENERGY_VALUE Summary of this function goes here
% Detailed explanation goes here
global tet_num X_g_inv tet_vols tet_mesh amips_s K q c1 c2 d1
q_target = K * u + q;
output = energy_value_mex(tet_num, X_g_inv, tet_vols, tet_mesh.t, q_target, get_energy_type(), amips_s, c1, c... |
function isin = isinside(obj, x0)
%ISINSIDE Check if a point is inside the given hyperrectangle(s)
% isin = = isinside(H, x0)
%
% H can be an array of hyperrectangles, which is the union of the
% individual hyperrectangles.
%
% (C) 2011 by Truong X. Nghiem (nghiem@seas.upenn.edu)
if obj.dims == 0
isin = fals... |
function net = bias(net,i)
%NNET.INTERNAL.CONFIGURE.BIAS
% Copyright 2010-2015 The MathWorks, Inc.
% Configure Size
net.biases{i}.size = net.layers{i}.size;
% Initialize
if any(size(net.b{i}) ~= [net.layers{i}.size 1])
net.b{i} = zeros(net.layers{i}.size,1);
end
if ~isempty(net.initFcn)
net = feval(net.initFcn,'... |
function stackingValTuning_svm_0NN_0_9lambda_pines
[obj,nObj,svmObj,sunObj] = setExperimentParameters();
obj.load_Indian_Pines();
obj.selectXPixPerClass_IncludeXNeighbours(nObj);
obj.extractValidationData();
if(obj.numNeigh > 0)
obj.assembleXTrainData(nObj);
end
cObj = CombineClass... |
%% Проверка глобальной аппроксимации из статьи
clc
clear all
close all
format long
k = 1; N = 4;
n = 0:N+1; m = 0:N;
a = [1 ...
0.2715113138214362780964488 ...
0.0562661238060587633169245 ...
0.0067420740469345689743873 ...
0.0005169505155333205859985 ...
0.0000194771836765773190602];
b = [1... |
%% simulated_image_7b.m
%% creates a graphical simulation of one simulation results
folder = 'D:\Ben\EVOLVER\chromaffin endocytosis' ;
%path1 = 'E:\Ben\neuro-endocytosis\aug 2019 images'; %%output location
%{
movies = load(fullfile(folder,'movies')) ;
movie = movies.movie;
str = strcat('choose mov... |
function theta = wiki_mlat_2D(M,P)
mtoas = M'; %mtoas is a column vector
num_stations = length(mtoas(:,1));
Matrix_Stations = P';
Matrix_Stations = Matrix_Stations(:,1:2);
MS_ref = Matrix_Stations(2:end,:) - ones(num_stations-1,1)*Matrix_Stations(1,:); %The origin of the geographical reference system is the po... |
function [output1] = Js_RightToeJoint(var1)
if coder.target('MATLAB')
[output1] = Js_RightToeJoint_mex(var1);
else
coder.cinclude('Js_RightToeJoint_src.h');
output1 = zeros(6, 20);
coder.ceval('Js_RightToeJoint_src' ...
,coder.wref(output1) ...
... |
%% dimensions
decel = 1.1;
fps = 120;
tstep = 1/fps;
theta_draw=0:pi/50:2*pi;
counter = 1;
tb.fieldw = 1.0;
tb.fieldh = tb.fieldw*1.6;
tb.goalw=0.4;
tb.goalh=tb.goalw*0.6;
r_center = 0.1;
tb.r_puck = 0.018;
tb.r_mallet = 0.03;
fieldx = tb.fieldw/2*[-1 -1 1 1 -1];
fieldy = tb.fieldh/2*[-1 1 1 -1 -1];
edge... |
clear
close all
clc
addpath(genpath(getenv('ARMA_CL')))
addpath(genpath(getenv('ECLDIR')))
cpd_dir=getenv('CPDREG');
organDir=[cpd_dir filesep 'userstudy_data' filesep 'PointCloudData' filesep 'RegAprToCT'];
addpath(genpath('R:\Robots\CPD_Reg.git\userstudy_data\'))
% Bag folder
bagFolder='R:\Projects\NRI\User_Study\Dat... |
function [ Jacobian ] = problem_H_FluxJacobian(q,quadpoint,appdata)
% Evaluates the flux Jacobian for the given problem
% written by data.Pierson Guthrey
% -------------------------------------------------
% INdata.PUTS q
% OUTdata.PUTS Jacobian
% Note: other variables may be %loaded in from the problem parameter ... |
function obj = objectsXML(obj,objects)
%objectsXML Parsing the XML to the corresponding classes and properties
%
%----------------------------------------------------------------------
% BSD 3-Clause License
%
% Copyright (c) 2020, Jonas Wurst, Alberto Flores Fernández
% All rights r... |
%Section 1.2
%Problem 6
%Define function
f= @(x) x-tan(x);
df= @(x)-tan(x)^2;
x = zeros(20,4);
for i=1:20
%Bisection
[x(i,1),~,~,~] = Bisection(f,10.85,10.95,10e-16,10e-16,i,0);
%Linear Interpolation
[x(i,2),~,~,~] = Interpolation(f,10.85,10.95,10e-16,i,0);
%Secant
[x(i,3),~,~,~] = Secant(f,10.85,10.95,10e-16,i,0)... |
function x=p_PropModPreKernel(v,x)
% P_PROPMODPREKERNEL computes from (v,x) a proper modified pre-kernel element using Matlab's PCT.
%
% Source: P. Sudh¨olter. Nonlinear Self Dual Solutions for TU-Games. In Potters J.A.M. Raghavan T.E.S. Ray D. Sen A.
% Parthasarathy T., Dutta B., editor, Game Theoretical App... |
function dsp__correlate_z_behavior()
io = DSP_IO();
pl = ContainerPlotter();
resolution = 'per_day';
base_load_path = fullfile( pathfor('ANALYSES'), '020317', 'ztrans' );
base_save_path = fullfile( pathfor('PLOTS'), '030917', 'behavior', 'ztrans' );
combs = allcomb( { ...
{'common_averaged'} ...
, {'coherenc... |
clear paramsAll;
clear params;
params.Gridjob.runLocal = true;
params.Gridjob.requiremf = 12000;
params.Gridjob.jobname = 'rfsBinary';
params.ApplyWeights.plotPdf = true;
params.ApplyWeights.inActFolder = '../../20131220_MoreImages/labelMeWhite/05june05_static_street_boston/p1010736.jpg';
params.ApplyWeights.inActFile... |
function UpdateIP(hObject, dev, param_edited, varargin)
% hObject is the handle of the object edited
% eventData is various statistics of the callback
% dev is the inputs struct that is being edited
% param_edited is the parameter of the inputs struct that is being edited
% varargin is for handles needed to perform tas... |
function [dpR,dxR,P1,P2,dpL,dxL] = fcn( pH, pTOR, rTOR, ...
pLA1, rLA1, pLA2, rLA2, ...
pRA1, rRA1, pRA2, rRA2, ...
pRL1, rRL1, pLL1, rLL1)
%#eml
pTypeCuboid=struct( 'dim', [0 0 0]',... %dimensions X ... |
function [C2,STATS] = cellTrackerMP(I1,I0,C1,C0,t,fov,dirname,deadEnd)
%[C2,STATS] = CELLTRACKERMP(I1,C1,C0,t,fov,dirname,deadEnd).
%Tracks cells and cell lines from the mother machine. Obtains morphology and
%fluorescence properties of each cell. Saves and reads in cell lines as MATs.
%Input I1 and C1 pertain t... |
function gui_dock_vertical(container, varargin)
% Automatic layout for controls in a container.
%
% Input arguments:
% container:
% container whose controls to lay out
% width:
% width in pixels for the container to dock
% Copyright 2010 Levente Hunyadi
fig = ancestor(container, 'figure');
padding = 3;
width =... |
function tbxStruct = demos
% DEMOS Demo list for Polybase.
if nargout==0, demo toolbox; return; end
tbxStruct.Name='Polybase';
tbxStruct.Type='toolbox';
tbxStruct.Help= ...
{'Functions for Multidimensional Polynomial'
'Interpolation and Approximation'... |
m=1 %mass of vehicle
b=10
k=20
num=1
den=[m,b,k]
plant=tf(num,den)
step(plant)
ki=300
kp=100
contr=tf([kp,ki],[1,0])
sys_ctrl=feedback(contr*plant,1)
t=0:0.01:4
step(sys_ctrl,t) |
% spacial position for number,intesity,duration, size in each pixel during whole track time
clear
clc
%data_path='/Users/hcq/workspace/MCS/Result/run_globalTropical_86-05_1exp3/';
%output_path='/Users/hcq/workspace/MCS_2016_private/data/space/';
data_path='/home/hxm_stu/WORK1/hcq/MCS/Result/run_globalTropical_86-05_1e... |
clc, close all
folder = 'input';
mesh_input_file = 'square10x10';
mesh_output_file = 'square_perturbed10x10';
nodes = sprintf('input/%s.nodes',mesh_input_file)
coor_list = dlmread(nodes);
xl = 0;
xr = 0.1;
yl = 0;
yu = 0.1;
nn = size(coor_list,1);
x_pert = zeros(nn,1);
y_pert = zeros(nn,1);
for ii = 1 : nn
if c... |
function [ IndSameChan, Labels ] = findSameChannels(chanlocs1, chanlocs2, nEl1, nEl2)
% finds and returns the indeces of the corresponding channels when going from 257
% to 204 channels
%
%--------------------------------------------------------------------------
%
% Input:
% 'chanloc1' -[string] - [the name of... |
function [repoDir, jobsDir_local, ...
jobsDir_server_o, jobsDir_server, ...
matlab_startup_dir, username] = ...
getlocaldirs(targetdir, serverid)
% getlocaldirs: collect all local & server directories used by the server_interface.m files
%
% Usage:
% getlocaldirs(targetdir, serverid)
%
% Args:
% targetd... |
[V,C] = hexgrid_voronoi();
close all
for k = 1:10
clf
l =randi(length(C));
i =randi(length(C{l}));
[C,V] = t1swap(C{l}(i),C{l}(mod(i,length(C{l}))+1),0.3,C,V);
for j = 1:length(C)
patch(V(C{j},1),V(C{j},2),j,'FaceColor','w'); % draws hexagons
end
pause(0.3)
end |
% mainRSP(n1, n2, r1, r2, phi_1, phi_2, rj,phi_j,...
% tau,nth1,nth2,nth3,nth4,tau1,tau2,tau3,tau4,varargin)
% calculates the final covariance matrix of the RSP porotocl based on the input:
% n1 -> number of noise photon of JPA1
% n2 -> number of noise photon of JPA2
% r1 ->... |
% MTLMZC.M
% Inversion / sat pulse (Longitudinal mag)
% Called by mtltm
mtlmz = get(mtluimz, 'Value') ;
if mtlmz == 1 ;
set(mtluimz, 'BackGroundColor','white') ;
set(mtluimxy,'Value',0, 'BackGroundColor',...
[0.501961 0.501961 0.501961]) ;
mtlmxy = 0 ;
set(mtluise,'Value',0, 'BackGroundColor',...
[0.501961... |
%% EEG 04 Processing Variables
if exist('/home/knight/','dir');root_dir='/home/knight/';ft_dir=[root_dir 'PRJ_Error_eeg/Apps/fieldtrip/'];
elseif exist('/Users/sheilasteiner/','dir'); root_dir='/Users/sheilasteiner/Desktop/Knight_Lab/';ft_dir='/Users/sheilasteiner/Downloads/fieldtrip-master/';
else root_dir='/Volumes/h... |
function set_bump3
% deuxième optimisation du bump
delai0 =31522244;
voltage0=3000;
r=1.4*1.35
tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigStepDelay',delai0+2);
tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigStepDelay',delai0+6);
tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trig... |
function [ modulation, throughput ] = find_best_mod( power, alpha, jd, ccc_table )
% Find the best modulation using CCC lookup table (ccc_table)
modulation = zeros(1, 2);
if jd == 0
mod_list1 = squeeze(ccc_table.CCCtable_conv_SINRp_alphap_QAMq_QAMp( power(1) + 11, round( 10*(1-alpha(1)) ) + 1, :, :));
mod_lis... |
clear all ; close all ;
%{
currs = {'AUDJPY','AUDUSD','CHFJPY','EURAUD','EURCAD','EURCHF','EURGBP','EURJPY','EURUSD','GBPCHF','GBPJPY','GBPUSD','NZDUSD','USDCAD','USDCHF','USDJPY'} ;
curr = 'EURJPY' ;
cd('C:\Users\Acer\Downloads\market_081916_russell_butler\Market 081916\Forex') ;
fid = fopen([curr,'.txt']) ; ... |
% Command to run.
% (echo "boundary_dir = '../output/epoch-x-test'"; cat eval_edge.m)|matlab -nodisplay -nodesktop -nosplash
% Argument necessary for evaluation
% boundary_dir = '../../nori_training_tmp/hed_xwjabc/exps/debug/boundary';
% class_dir = '../../nori_training_tmp/hed_xwjabc/exps/debug/class';
% boundary_gt_d... |
% MUSI 6202 HW5 - My blocking
% CW @ GTCMT 2015
% objective: partition your signal into overlapping blocks
% xmat = myBlocking(x, windowSize, hopSize)
% x = float, N*1 vector of input signal
% windowSize = int, window size in samples
% hopSize = int, hop size in samples
% xmat = float, windowSize*numBlocks matrix of s... |
close all;
h = -100:.001:100;
C = zeros(size(h));
K = zeros(size(h));
theta =zeros(size(h));
for i= 1:length(h)
[C(i),K(i),theta(i)] = vanGenuchten(h(i),phi);
end
plot(C, h, '.' )
|
function varargout = prediksi_emosi(varargin)
% PREDIKSI_EMOSI MATLAB code for prediksi_emosi.fig
% PREDIKSI_EMOSI, by itself, creates a new PREDIKSI_EMOSI or raises the existing
% singleton*.
%
% H = PREDIKSI_EMOSI returns the handle to a new PREDIKSI_EMOSI or the handle to
% the existing singleton... |
function [mean_po,cov_po]=posterior(x_test,x_ob,y_ob,theta)
% Function 3: Posteriori/Predictive distribution
% return the mean and covariance matrix of the predictive distribution
% computes the noisy kernel using RBF method
Kn=kerneln(x_ob,x_ob',theta);
% kernel between new and old data points
K_tes... |
classdef sample
% Requires that you have a sample with some key information
properties
date % date of evaporation
label % unique identifier given to a sample prior to ink printing
sideLength % side length of electrode square
electrodeType % either cathode (1) or anode (0)
... |
% clc;
% I = imread('roi.png');
% I = rgb2gray(I);
% imhist(I);
% I =[1 1 1 2 2
% 3 4 2 2 3
% 4 4 4 4 4
% 5 5 3 3 3
% 1 1 3 4 5]
% I=uint8(I);
[GLRLMS,SI] = grayrlmatrix(I,'NumLevels',256,'G',[]);
stauts=grayrlprops(G... |
% Wireless Receivers Project:
% Anael Buchegger, Tim Tuuva, David Sanchez
%
% SISO Simulation Framework
% 1 User only (simplest case)
%
% Telecommunications Circuits Laboratory
% EPFL
function BER = SISOsimulator(P)
% Generate the spreading sequence
HadamardMatrix = hadamard(P.HadLen);
% N... |
function [ P ] = testfunction_LegendreDiff(x,n)
% Computes the derivative the nth Legendre Polynomial
% written by Pierson Guthrey
switch n
% First base case
case 1
P = 0*x;
% Second base case
case 2
P = 1+0.*x;
% Recursive Fordata.mula
otherwise
P = ((2*n-3).*testfuncti... |
fileName = "myopia.csv"; %name pf file with data
myopiaDS = dataset('xlsfile', fileName); %load to matlab
%gender=categorical(myopiaDS.gender)=='Female';
x = [myopiaDS.sporthr,myopiaDS.readhr,myopiaDS.comphr,myopiaDS.studyhr,myopiaDS.tvhr,double(categorical(myopiaDS.mommy)=='Yes'),double(categorical(myopiaDS.dadmy)=... |
% example script for BeMoBIL BIDS tools xdf2bids
% required for dataset_description.json
generalInfo.dataset_description.Name = 'Walking task in the young and old';
generalInfo.dataset_description.BIDSVersion = 'unofficial extension';
% optional for dataset_description.json
generalInfo.dataset_d... |
%%% inputs
%% p - probability of being a place cell
%% PC_dist - distribution of PC locations (default: 'uniform')
%% activity - structure with all kind of information about the firing activity
%% offset - height and variance
%% width - width and variance of width of the firing field
%% ... |
classdef SNRCheck < nirs.modules.AbstractModule
%SIGNALSNRCHECK Summary of this class goes here
% Detailed explanation goes here
properties
filenamedigit1=1;
filenamedigit2=2;
channelofinterest=1;
end
methods
function obj = SNRCheck(prevJob)
... |
addpath('../general_functions')
addpath('../../Chapter 1')
%% Figure 5.1 : SQ(2) with various \lambda values.
d=2;
lam_iter = [1-10^(-2), 1-10^(-6), 1-10^(-10), 1-10^(-14)];
N=100;
u=zeros(length(lam_iter), N);
utilde=zeros(length(lam_iter), N);
ultide_quot = zeros(length(lam_iter), N);
for i=1:length(lam_iter)
... |
function visualize_patch(data, patch, w)
img = [];
X = [];
for i = 1:size(patch,1)
X = cat(2, X, reshape(patch(i,:), [w w 3]));
if rem(i,27) ==0
img = cat(1, img, X);
X = [];
end
end
figure, imagesc(img);
im = reshape(data, [32 32 3]);
figure, imagesc(im);
end
|
% import_image_keypoints.m - import image keypoints to do calibration
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unles... |
%function: compdeltatnasa.m
%computes deltat, the difference between Universal Time (UT, approximated
%with Coordinated Universal Time (UTC)) and Dynamical Time (TD))
%in seconds
%inputs:
%year
%month
%output:
%deltat, in seconds
%references: algorithms from https://eclipse.gsfc.nasa.gov/SEcat5/deltatpol... |
function [P] = get_parameters
%% ------------------------------------------------------------------------
% Set the computer-specific parameters.
% ------------------------------------------------------------------------
% computername = getenv('COMPUTERNAME');
% computername = 'STIMULATION'; % ADDED EB 03-Ma... |
classdef Callback < casadi.Function
%CALLBACK Callback function functionality.
%
%
%
%This class provides a public API to the FunctionInternal class that can be
%subclassed by the user, who is then able to implement the different virtual
%method. Note that the Function class also provides a... |
function [logl,pPred,upRT,loRT] = logl_choiceRT_1d(P,choice,rt,coh,ndt_m,ndt_s)
t = P.t;
%convolve for non-decision times
%sanity check
if t(1)~=0
error('for conv to work, t(1) has to be zero');
end
nt = length(t);
dt = t(2)-t(1);
% ntr = length(P.drift);
ntr = length(choice);
method = 2;
switch method
case ... |
function J = sixDofJ(q)
d = [280, 0, 0, 210, 0, 70].';
theta = [q(1)-pi, q(2)+pi/2, q(3)-pi/2, q(4), q(5)-pi, q(6)].';
alpha = [pi/2, 0, -pi/2, pi/2, pi/2, 0].';
a = [0 210 75 0 0 0].';
% A = zeros(4,4,6);
for ii = 1:6
A(:,:,ii) = [ cos(theta(ii)), -sin(theta(ii))*cos(... |
function [xMAP] = plotcorner (x, P, x0, xbnds, count, BurnIn, VarNames)
%
% [xMAP] = plotcorner (x, P, x0, xbnds, count, BurnIn, VarNames)
% plots the outputs of mcmc inversion
%
% INPUTS
% x matrix of model parameters from mcmc [Niter x Nvar]
% P vector of posterior probabilities [Niter x 1]
% x0 ... |
function mwlfcls(n) ;
% Closes unwanted figs
% Called by mmpmain / mwlwm
% Close figures
mwlfigcl(n) ; |
% The single output network for use with the PSS reference signal at an LTE BW of 5 MHz.
function [offset, ccorr, t] = NN1_5MHz_main(rxSig, refSig, fs)
% First, perform Conventional Correlation to get an initial estimate
[ccOff, ccorr, ~] = convCorr(rxSig, refSig, fs, 'Modified', 0);
% shift co... |
%% ME EN 6230 Problem Set 8 Ryan Dalby
% Jacobian Transpose Related Controller Comparison
% close all;
set(groot, 'DefaultTextInterpreter', 'none') % Prevents underscore from becoming subscript
% errors are in meters
% Operational space jacobian transpose controller
jacobian_transpose_slow_rms = [0.000406 0.00... |
function [y]=naiveEval(alpha,x)
y=zeros(size(x));
for k=size(alpha):-1:1
y=alpha(k)+x.*y;
end
end
|
function v = getoptions(options, name, v, mendatory)
% getoptions - retrieve options parameter
%
% v = getoptions(options, 'entry', v0);
% is equivalent to the code:
% if isfield(options, 'entry')
% v = options.entry;
% else
% v = v0;
% end
%
% Copyright (c) 2007 Gabriel Peyre
if nargin<4
me... |
%This script determines the "extracellular robustness" of the network of
%its given Turing conditions. In essence, it determines the proportion of
%diffusion parameters studied actually meet the criteria for Turing
%patterns.
%
%This code will end up looking very similar to IntracellularRobustness.m.
%Similarly, ... |
%zihang zhou
%861090400
%April 30, 2016
%CS 171
%PS 3
function [ W ] = multiclasslogreg( X, Y )
%find how many
max = 0;
for i = 1:size(Y, 1)
if Y(i) > max
max = Y(i);
end
end
max = max + 1;
%add col of 1
X = [ones(size(X, 1), 1) X];
%find w for each possible
w = [];
for i = 1:max
w = [w calllogre... |
function [ss,gg,tt,ff,zo]=ssubmmse(si,fsz,pp)
%SSUBMMSE performs speech enhancement using mmse estimate of spectral amplitude or log amplitude [SS,ZO]=(S,FSZ,P)
%
% Usage: y=ssubmmse(x,fs); % enhance the speech using default parameters
%
% Inputs:
% si input speech signal
% fsz sample frequency in... |
%image reading and printing
image = rgb2gray(imread('index.jpg'));
figure; imshow(image); title('Original Image');
[R , C] = size(image);
s1 = 60;
s2 = 200;
%loops
for i = 1 : 1 : R
for j = 1 : 1 : C
%for pixel values less than 60
if (image( i , j) < 60)
image(i... |
function [ total, numOfRK, rkeigen_perc ] = stat_rk( SM )
total = 0;
numOfRK = 0;
rkeigen_perc = 0;
if SM.hasR
ss = svd(full(SM.getTable));
n = 0;
while n+1 <= length(ss) && ss(n+1) ~= 0
n = n + 1;
end
numOfRK = 1;
total = 1;
... |
function [chordae_flat] = build_2d_trees(params, left_papillary_flat, right_papillary_flat, tree_frac, filter_parmas)
%
% Creates and returns two binary trees of chordae
% The binary trees are fully balanced by definition
% N, the number of internal nodes, must be a power of two
%
% Input
... |
% plot_pfpr_heatmap.m
%
% This function generates heatmaps at the national level for a single year
% based upon the supplied imput file.
% Main entry point for the function, reads the supplied file, and generates
%the heatmaps
function plot_pfpr_heatmap(filename, startDate)
% Load the data and generate the heatm... |
addpath('/Users/jinstone/Desktop/stmsetup/thesis/sw/sinc_filter/');
addpath('/Users/jinstone/Desktop/stmsetup/thesis/sw/subsample/');
addpath('/Users/jinstone/Desktop/stmsetup/thesis/sw/sinc_interp/');
samp = 3E6;
data0 = csvread('0data.csv');
%remove 1.5V offset
ave = mean(data0);
data0 = data0 - ave;
ave;
r = snr(... |
function [ massaged_array, missing ] = problem_4_a_massager(type, cell)
massaged_array = [];
missing = 0;
for i=2:length(cell)
if strcmp(type, 'num')
massaged_array(i-1) = str2double(cell{i});
if isnan(massaged_array(i-1))
missing = missing+1;
end
else
ma... |
% StreamingAI_TDtr.m
%
% Example Category:
% AI
% Matlab(2010 or 2010 above)
%
% Description:
% This example demonstrates how to use Streaming AI with Delay to
% Start Trigger function.
%
% Instructions for Running:
% 1. Set the 'deviceDescription' which can get from system device
% mana... |
%% Here we try and get the Covariance as a function of the distance between maximas(basically we try and see whether the maximas in Pearson corelation correspond to the lag equal to the maximal distance
%load('spn6_45');
for cell_index=1:cell_number, %%which cell we are looking at
pcc_tick=8;
%%the average distance ... |
function out = mtimes(ina,inb)
if isa(ina,'vect')&&isa(inb,'vect')
if size(ina,2)==size(inb,1)
out = mvec_mvec(ina,inb);
elseif or(numel(ina)==1,numel(inb)==1)
out = vec_mvec(ina,inb);
else
error('Matrix dimensions must agree.')
end
else
if isnumeric(ina)||isnumer... |
function [ tr ] = trap( f, a, b )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
syms x;
tr = (subs(f,x,a)+subs(f,x,b))*(b-a)/2;
end
|
function P2=median_shape_all(N_a,u_all,v_all,list,ref,par,pts,th)
N_med = zeros(3*size(u_all,1),pts);
for k = 1: length(list)
Ne = N_a(:,(k-1)*length(ref{k})*pts+1:(k-1)*length(ref{k})*pts+length(ref{k})*pts);
s = sum(abs(Ne'));
idx = find(s==0);
if ~isempty(idx)
Ne(idx,:)=[];
end
% nor... |
function [lost assignment femtoquota]=college(dis,radius,quota)
disind=(dis<=radius);
dis=dis.*disind+1000.*(1-disind);
numuser=size(dis,2);
numfemto=size(dis,1);
assignment=zeros(numuser,1);
femtoquota=ones(numfemto,1)*quota;
asscount=1;
while(asscount>0)
asscount=0;
%user choose the best femto... |
function [c_recovered] = Demod(IQdata,SF,BW,symbol_num)
%% Parameter passing
Fs = BW; % sample frequency
symbol_time = 2^SF / BW;
%% Signal Genneration
t = 0: 1/Fs: (symbol_time - 1/Fs);
f0 = 0;
f1 = BW;
%% design upchirp and downchirp
% upchirp
chirpI = chirp(t, f0, symbol_time, f1, 'linear', 90);... |
function result = f_npMLE(Y,X,grp,sm)
% - distance-based, maximum likelihood estimator
%
% USAGE: result = f_npMLE(Y,X,grp,sm)
%
% Y = matrix of UNKNOWN data (with variables corresponding to those in X)
% X = matrix of TRAINING data (rows = obs, cols = variables)
% grp = column vector of integers specifying gro... |
function railconfig(data)
global t3;
mes_frame(1:4)=uint8(hex2dec('df')); %帧头
mes_frame(5)=3; %消息类型字段
mes_frame(6)=20; %帧长(低字节)
mes_frame(7)=0; ... |
function [answer dc] = get_something(line,string,str_head,number,num_head,separators,comments)
%GET_SOMETHING: use decoding function with mode = 1 to get something from the input line-string.
% dc = decoding(mode=1,line,string,str_head,number,num_head,seperaters,comments)
% mode == 0, then decoding the given "string" t... |
% \begin{mfunction}{cuboid_torque_z_z}
%
% The expressions here follow directly from \textcite{janssen2010-ietm}.
% The code below was largely written by Allan Liu; thanks!
% We have checked it against Janssen's own Matlab code and the two give
% identical output.
%
% Note that despite this verification this code... |
function penvecIMG = penchantsIMG(C,E,nbins)
[tstructE, countsE] = hist_extra(E,nbins);
[tstructC, countsC] = hist_extra(C,nbins);
binUpperE = zeros(1,length(tstructE));
binLowerE = zeros(1,length(tstructE));
binUpperC = zeros(1,length(tstructC));
binLowerC = zeros(1,length(tstructC));
for iter = 1:1:nbins,
binU... |
close
clear
data = load('noiseMeasurement1.mat');
x2 = (data.ans(2,182:1001));
x3 = (data.ans(3,182:1001));
x4 = (data.ans(4,182:1001));
x5 = (data.ans(5,182:1001));
x6 = (data.ans(6,182:1001));
figure()
subplot(221)
pwelch(x2)
title('PSD estimate for pitch measurement')
subplot(222)
pwelch(x3)
title('PSD estimate f... |
function Phi=Epanechnikov_kernel(Phi_tmp,sigma)
invsigma = 1/sigma^2;
Phi = 1 + max(-1,Phi_tmp*invsigma);
|
% ========================================================================
%
% Bivariate kernel
%
% ========================================================================
clear all;
clc;
RandStream.setDefaultStream( RandStream('mt19937ar','seed',12345) );
% Generate data
n = 2; % Dimensi... |
clear all;
clc;
%----------------------- OFDM modulation ------------------------
N_ofdm = 2048; % IFFT
f_delta = 15e3; % subcarrier spacing(NOT used in simulation)
N_block = 1e3; % maximum transmitting block
N_subcarrier = 1320; % Number of subcarrier used ... |
% A main script to test the functions..
%
%
% Author: Brhanemedhn Tegegne
G=[[0,1,1;1,0,1;1,1,0;1,1,1],eye(4)];
sig=uint8(wavread('elen849_1.wav')*255);
%Play the original speech
wavplay(sig,8000);
%Plot the original speech
subplot(2,2,1),plot(sig);
title('Orginal Speech');
encoded=linearencode(sig,G);... |
%%%%% SPLINE INTERPOLATION TO RBF GRID FROM LAT-LON
% hmod=load('dwd/hmodc6_0000_E000605.dat'); % day zero
% hmod=load('dwd/hmodc6_0120_E000605.dat'); % day five
% hmod=load('dwd/hmodc6_0240_E000605.dat'); % day 10
% hmod=load('dwd/hmodc6_0360_E000605.dat'); % day 15
lad = hmod(:,1); thd = hmod(:,2); hd = hmod(:... |
function straight_path = pathStraight(index1,index2,XY,dstep)
% if index1 < index2
% dist = XY(index1,2):dstep:XY(index2,2);
% else
% dist = XY(index2,2):dstep:XY(index1,2);
% dist = flip(dist);
% end
%
% straight_path = [XY(index1,1)*ones(1,length(dist));dist];
n = 3000;
x = linspace(XY(index1,1),XY(index... |
% Q1 Computing Harris Corners
clear all;
I=im2double(imread('simA.jpg'));
H=fspecial('gaussian',[3 3],1);
I_blur=imfilter(I,H,'replicate');
figure,imshow(I_blur);
[rows cols]=size(I_blur);
[Ix Iy]=imgradientxy(I_blur); % Gradient computation
figure,imshow(Ix);
figure,imshow(Iy);
I_adjoin=[Ix Iy];
r=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.