text stringlengths 8 6.12M |
|---|
function err = naivePerfusionSSEIntegratorivmP2X4(ton,toff,Ttot,amp,T,I)
%#codgen;
naive=zeros(1,22);
naive(1)=1;
V=-60*10^-3;
err=errorIntegratorivmP2X4(ton,toff,Ttot,amp,naive,T,I,V);
end |
function savepng( handle, name )
% Make changing paper type possible
set(handle,'PaperType','<custom>');
% Set units to all be the same
set(handle,'PaperUnits','inches');
set(handle,'Units','inches');
% Set the page size and position to match the figure's dimensions
paperPosition = get(han... |
function varargout = ManuallySelectSeries(varargin)
% MANUALLYSELECTSERIES MATLAB code for ManuallySelectSeries.fig
% MANUALLYSELECTSERIES, by itself, creates a new MANUALLYSELECTSERIES or raises the existing
% singleton*.
%
% H = MANUALLYSELECTSERIES returns the handle to a new MANUALLYSELECTSERIES or t... |
for n=3:2:15
[ A, b ] = generate_matrix(n);
disp("----- n= ------")
disp(n)
disp("A:")
disp(A)
disp("b:")
disp(b)
[ x ] = jacobi_method(A, b);
disp("x:")
if x
disp(x);
end
end
function [ A, b ] = generate_matrix(n)
A = zeros(n);
for i=1:n
A(i,i) = 3;... |
classdef PulseTrainNIC3Python < FormatNIC3Python & PulseTrain
% PulseTrainNIC3Python < FormatNIC3Python & PulseTrain
%
% Pulse train class for Cochlear devices using NIC3/Python interface:
%
% PulseTrainNIC3Python Properties (PulseTrain class):
% phase_dur_us - Phase Duration (microsec... |
push 1
push 2
push 3
push 4
push 0
push 110
push 0
push 108
push 111
push 111
push 104
push 99
push 83
pstr |
function [A, b, params, iterative] = flow_operator(model, uv3, duv3, data)
%%
%FLOW_OPERATOR Linear flow operator (equation) for flow estimation
% [A, b] = FLOW_OPERATOR(model, UV3, INIT)
% returns a linear flow operator (equation) of the form A * x = b. The
% flow equation is linearized around UV3 with the ... |
function [corr, lags] = corr_activations(acti_1, acti_2)
% acti_1 columns should be smaller than Acti_2 columns
[nr1, nc1] = size(acti_1);
[nr2, nc2] = size(acti_2);
if nr1~=nr2
ME = MException('VerifyInput:InvalidInput', ...
'The Number of rows must be equal');
throw(ME);
end
if(nc1 > nc2)
temp ... |
function RTBoxdemo(scrn)
% This is a demo showing how to measure reaction time using RTBox.
% Run the program. When you see flash on screen, press a button.
% Your RT will be plotted after the assigned number of trials.
% Xiangrui Li, 3/2008
% 160909 Add more comment
if nargin<1, scrn = max(Screen('screens')); end % f... |
function [stateOut,Wm,Wc,useSquareRoot] = unscentedTransformPolar( s0, P0, options, varargin, t)
global mu
% [outMean,outCovar] = unscentedTransform_ang( mean, covar, fcn,
% options, varargin )
% ---------------------------------------------------------------------
%
%... |
function [x1, alp]=gurobi_AntiPreNucl_llp(clv,tol)
% GUROBI_ANTIPRENUCL computes the anti pre-nucleolus of game v using gurobimex.
%
% GUROPI-SOLVER: http://www.gurobi.com
%
% Usage: [x, alp]=clv.gurobi_AntiPreNucl_llp(tol)
% Define variables:
% output:
% x1 -- The anti pre-nucleolus of game v.
% alp ... |
Prompt = 'Enter the Augmented matrix in the form [1 2 3 ;4 2 1; 6 4 3] \n';
Ag=input(Prompt);
[r,c]=size(Ag);
A=Ag(:,[1:c-1]);
B = Ag(:,c);
L = tril(A, -1)
D = diag(diag(A))
U = triu(A, 1)
Xprev = input('Initial guess : in the form [0 0 0] \n');
count = 1;
I=eye(r);
while(1)
fprintf('Iterati... |
function mask = po_mask(polygon, mask_size)
%po_mask: conversion of a closed polygon into a binary mask
% m = po_mask(p, m_size) computes the binary mask, m, of a closed polygon, p.
% Actually, since po_mask calls the Matlab function poly2mask, the polygon is
% automatically closed if not already. The size of... |
%% strategy switching with one group
clear; close all;
%% User input
% analysis list has data name, model name, subject list, number of rows and columns for plotting
analysisList = {...
% {'WalshGluck2016', 'ss_TTBTallyWADDGuess', 1:38, [4, 2]}; ...
% {'WalshGluck2016Aloud', 'ss_TTBTallyWADDGuess', 1:19, [4,... |
classdef Animation < handle
properties
plotfiles
num_files
frames
slice_frames
end
methods
function anim = Animation(base_name, num_files)
anim.num_files = num_files;
for j = 0:num_files
filename = strcat(base... |
function h = supportFunction(polygon, varargin)
%SUPPORTFUNCTION Compute support function of a polygon.
%
% H = supportFunction(POLYGON, N)
% uses N points for suport function approximation
%
% H = supportFunction(POLYGON)
% assume 24 points for approximation
%
% H = supportFunction(POLYGON, V)
% ... |
function [u, v] = util_gen_sampling_pattern(pattern, param)
if ~isfield(param, 'sigma')
% variance of the gaussian for generating measurements
param.sigma = pi/3;
end
if strcmp(pattern, 'gaussian')
sigma_m = param.sigma;
Nm = round(param.p * param.N);
u = sigma_m * randn(Nm, 1);
... |
obsStrikes = [5825,6175, 6225 ,6275, 6325, 6575, 6875 ,7225
5725,6075,6175,6225,6275,6325,6725,7025]; % Directly observed data with columns as Strikes and rows as Expiries
obsPrices = [469.5, 223.5, 195.5, 169, 144.5, 56.5, 10.5, 0.5;
631,378,314.5,284.5,256.5,229.5,72.5,24]; ... |
function example_data = load_example_data( varargin )
% Load example data for testing the MoDT class. Data is downloaded if necessary.
% example_data = load_example_data( ... )
%
% Returns:
% example_data Struct with fields:
% spk_Y [D x N] spikes (N spikes in a D-dimensional feature space)
% s... |
%Booth's function
function val = booth(pop)
val = (pop(1) + 2*pop(2) - 7)^2 + (2*pop(1) + pop(2) - 5)^2;
|
%% Matlab Beginners Course Notes
% Making Choices
%% Challenge 1
% Write code to work out which number is bigger (and try changing the
% values of num1 and num2 to make sure your code always works)
num1 = 40;
num2 = 25;
if num1 > num2
display('number 1 is bigger than number 2')
elseif num1 < num2
display('n... |
I1 = rgb2gray(imread('matricula (1).jpg'));
I2 = rgb2gray(imread('matric2.bmp'));
I3 = rgb2gray(imread('matric3.bmp'));
I4 = rgb2gray(imread('matric4.bmp'));
I5 = rgb2gray(imread('matric5.bmp'));
figure
subplot(3,2,1), imshow(I1);
subplot(3,2,2), imshow(I2);
subplot(3,2,3), imshow(I3);
subplot(3,2,4), imshow(I4);
subp... |
classdef ParticleFilter
%PARTICLEFILTER Constructs a Particle Filter
% This Particle Filter runs concurrent and updates with the update
% method.
properties
NumberParticles;
Particles;
Weights;
Map;
Noise;
Bounds;
end
methods
... |
function out = IAPWS_IF97(fun,in1,in2)
% IAPWS_IF97(fun,in1,in2)
% 102 water functions of water properties, based on the International Association on Properties of Water and Steam
% Industrial Formulation 1997 (IAPWS-IF97), IAPWS-IF97-S01, IAPWS-IF97-S03rev, IAPWS-IF97-S04, IAPWS-IF97-S05, Revised
% Advisory ... |
%% First attempt at MHD system of equations. Initially started with
% Eulers meathod, Implimenting MHDcurl, MHDlaplacian, MHDgradR, and
% MHDgradZ
% Dempsey Rogers 6-4-15
% clc
clear all
clf
% close all
% MHD EQUATIONS
%dB/dt=curl(VxB)+ata*Laplacian(B)
% and
%dV/dt=Jxv+rho*nue*Laplacian(V)-(V d... |
function y = fxn1(x)
y= x.^2.*sqrt(7.*x+1)/(x.^2+1).^2;
end
|
%% Cooperative Model of Colonel Blotto Games %%
% Written By Matthew Dunn and Victoria Kim %
clear variables;
%% System Description %%
np = 2; % Physical Nodes
nc = 4; % Cyber Nodes
% Network connectivity
A = [1 1 1 0; 0 1 1 1];
% How many cyber nodes must be down for each physical node to be down
V = [1;1];
%% Play... |
function pulseTime = apcFineIntegration(x1,y1,x2,y2,decayRate,previousArea,threshold,timeResolution)
%APCFINEINTEGRATION Fine Integrator of APC converter and computes time occurence
% of output pulse with resolution of timeResolution.
% apcFineIntegration.m : Divides time axis into cummulatively increasing chunks
% sp... |
% Evolutionary Programming using Gaussian Mutation
clear all
path(path,'D:\EP\F1\SADE_TEC');
global initial_flag
I_fno=12;
NP=50;
D=10;
if (I_fno==1|I_fno==2|I_fno==3|I_fno==4)
FVr_minbound = -100*ones(1,D);
FVr_maxbound = 100*ones(1,D);
Lbound = FVr_minbound;
... |
function plotTestTrain(net,inputs,outputs,out)
% Inputs
% {'Temperature'} {'RatioSteamC'} {'RatioOC'} {'RatioHC'}
% Outputs
% {'CO'} {'H2'}
predict_outputs = net(inputs{:,:}')';
[ndata,~] = size(inputs);
err = perform(net,outputs{:,:},predict_outputs);
err = sqrt(err);
subplot(2,2,1)
... |
function demo_uncluster(struct_file, Options)
%DEMO_UNCLUSTER Shows the spaghetti plot for raw data
%
%Input:
% -struct_file: stores the MAT-file data in a struct
% -Options: stores the information for the plotting.
figure;
plot(struct_file.Threedif');
ylim([min(struct_file.Threedif(:))-1, max(struct_file.Threedif... |
function [Q,error] = clencurt(funfcn,a,b,n)
%CLENCURT Numerical evaluation of an integral, variable point method.
% Q = CLENCURT('f',a,b) approximates the integral of f(x) from a to b
% using an 11-point Clenshaw-Curtis formula.
%
% Q = CLENCURT('f',a,b,n) uses n+1-point Clenshaw-Curtis integration.
% [Q,error] = CLENC... |
function [centers, radii] = click_centers(p, radii, min_z, max_z)
subplot(1, 2, 1); hold on;
centers = cell(length(radii), 1);
for k = 1:length(centers)
[x, y] = ginput(1);
centers{k} = [x; y];
hold on; mypoint(centers{k}, 'm');
if (p == 1)
[xr, yr] = ginput(1);
r = norm([x - xr, y - yr... |
% Main script for running simulations and analytics
% load and parse quote and trade data
[quotes, quote_str] = xlsread('db_US_10yr_Future_quotes_and_trades.xlsx', 'quotes');
[trades, trade_str] = xlsread('db_US_10yr_Future_quotes_and_trades.xlsx', 'trades');
quote_flds = quote_str(1, 2:end);
trade_flds = trade_str(1... |
function ok = net(net,x,xi,ai,ew,seed)
%NET Run all tests on a network
% Copyright 2010-2012 The MathWorks, Inc.
if nargin == 1
seed = net;
[net,x,xi,ai,t,ew,mask] = nntest.rand_problem(seed);
end
if nargin == 1, clc, end
disp(' ')
disp(['================================ NNTEST.NET(' num2str(seed) ') Testing...'... |
function [result] = findSpots3(frame,method,disk_radius,gaussian, output)
%
% Find candidate (fluorescence) bright spots on images (of cells).
% The candidate spots can later be used as input of function
% "findSpotCentre1frame".
%
%
% INPUTS:
% frame: Input image, a single frame from a recorded sequence.
%
%... |
function bool = issubset(A,B)
% Return true iff A is a subset of B
% e.g.
% issubset(1:3,1:5)
% ans =
% 1
%
bool = all(ismember(A,B));
end |
function [X,Y,residu1,space2]=blockmatchinglog(imageref,decoded_ref,p,quality)
space2(1:10)=zeros;
f_ref(1:300,1:300)=0;
Im=imageref;
f_ref(9:288,9:288)= Im(9:288,9:288);
i22=decoded_ref;
f_ref(9:288,9:288)= i22; %now reference is created as in decoded end 280*280 and dct idct quant dequant but f_ref 300*300
... |
number_of_samples = 500;
%seed_value_rx = 12;
%seed_value_ry = 34;
%seed_value_Xo = 56;
%seed_value_Yo = 78;
mean_rx = 3.1;%3.8;
mean_ry = 3.9;%3.5;
mean_Xo = 0.4;%0.4;
mean_Yo = 0.2;%0.2;
var_rx = 0.05;
var_ry = 0.05;
var_Xo = 0.1;
var_Yo = 0.1;
library_length = [1000];
Bxy = 0.2;%[0:0.01:1];%0.2;%0.02;
Byx = 0.002;%... |
function kappa = curvature(varargin)
%CURVATURE Estimate curvature of a polyline defined by points.
%
% KAPPA = curvature(T, PX, PY, METHOD, DEGREE)
% First compute an approximation of the curve given by PX and PY, with
% the parametrization T. METHOD used for approximation can be only:
% 'polynom', with ... |
% This script defines the subject details for 'fil_mri_organise_batch'
clear;
load('project_params.mat');
%% SUBJECT DETAILS
% subject 1: 01ElEm
subj{1} = struct(...
'scanid', 'MP02934',...
'localiser', 1,...
'structural', 2,...
'functional', [6 8 9 12 ... |
% im_dir = 'text';
% start_row = 1000;
% end_row = 1499;
% start_col = 1600;
% end_col = 2099;
% im_dir = 'mandarin';
% start_row = 500;
% end_row = 999;
% start_col = 1000;
% end_col = 1499;
% im_dir = 'owl';
% start_row = 500;
% end_row = 999;
% start_col = 1700;
% end_col = 2199;
% im_dir = 'stationery';
% start_... |
function Model2DSeq
tic
close all
clc
%-- Flags --%
SubFlag = 2; %-- 1: DB, 2: RM, 3: MW, 4: PB --%
NoWeigh = 1; %-- 1: No binaural weighing of pinna cues --%
CorrFlag = 1; %-- 1: Correlation model; 0: Similarity model --%
ScaleFlag = 1; %-- 1: Z-transform; 0: No Z-transform --%
%-- Variables ... |
function values = opHist(opinions, t)
%OPHIST Plot histogram of the opinion vector at some t
if (t == 0)
t = size(opinions,2);
end
figure;
h = histogram(opinions(:,t), [0 1]);
h.NumBins = 100;
h.FaceColor = rgb('DarkGray');
values = h.Values;
ylabel('#Nodes');
xlabel('Opinion');
grid on;
%title(['t = ' num2str(t)])... |
%% load & process TD file
clear, clc
pathname = '~/LimbLab/Projects/S1-gamma/data';
% filename = 'Duncan_20190524_CObumpmove_10ms.mat';
filename = 'Han_20170203_COactpas_5ms.mat';
load([pathname filesep filename]);
% Smooth spikes, get split TD, get movement onsets, get rid of unsorted units
%Smooth spikes
smoothPara... |
function [ outVal, outGr, outHes ] = DQDRTIC( x0, VGH )
% DQDRTIC (CUTE) function
n = length(x0);
outVal = 0;
outGr = 0;
outHes = 0;
%constants
c = 100;
d = 100;
if VGH(1) > 0
for i=1:n-2
outVal = outVal + (x0(i)^2 + c*x0(i+1)^2 + d*x0(i+2)^2);
end
end
if VGH(2) > 0
outGr = zeros(n,1);
for i=1... |
clear all;
close all;
image = im2single(imread('blurred.jpg'));
image_size = size(image);
deblurred_image = single(zeros(image_size));
% scale up by 2 for super resolution image
% super_scale = 2;
% super_size = image_size * super_scale;
% super_image = single(zeros(super_size));
% proportional gain to multiply erro... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Alunos: Nathalia Felix - 1512130116 %%
%%Ismael Ramos - 1512130077 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Y = unsharp(a,b,c,d)
x = imread(a); %Le a imagem
x = double(rgb2gray(x))/255; %Transforma a imagem colorida em preto e branco
h = ones(b,c)/(b*c)... |
function [ time , G ] = RGP( n , T )
%RGP Summary of this function goes here
% Detailed explanation goes here
n = n;
time = 0;
G = zeros(n);
Esize=0;
Cond = T;
StopFlag = 0;
i = 1;
% Pick random edge 'e'
while StopFlag == 0
if Esize < (n*n-n)
x = round(rand(1,1)*(n-1)+1);
y = round(rand(1,1)... |
Z = fft(z);
plot(abs(Z))
N = 44100
transform = fft(z,N)/N;
magTransform = abs(transform);
faxis = linspace(-fs/2,fs/2,N);
plot(faxis,fftshift(magTransform));
xlabel('Frequency (Hz)')
axis([0 length(faxis)/2, 0 max(magTransform)])
xt = get(gca,'XTick');
set(gca,'XTickLabel', sprintf('%.0f|',xt))
|
function ejercicio1()
%% Definicion de parámetros de simulacion
t_sim = 5;
n_frames = 51;
t = linspace(0, t_sim, n_frames);
delta_t = 0.1;
%% Parametros del robot
% Longitudes de los eslabones
L1 = 4;
L2 = 3;
L3 = 2;
q = deg2rad([10 20 30]'); % Angulos iniciales de... |
function [cores, varargout] = rtr_als(X, ranks, embedding_dims, varargin)
%rtr_als Projection based randomized tensor ring decomposition
%
%cores = rtr_als(X, ranks, embedding_dims, varargin) computes a tensor ring
%(TR) decomposition of the input N-dimensional array X. ranks is a length-N
%vector containing the target... |
function [ h1,h2,h3 ] = Plot_ratioVar_training( r,subj,rows )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
limratio=max([max(r.ratioL_xo(:,subj)) max(r.ratioL_yo(:,subj)) max(r.ratioL_zo(:,subj)) max(r.ratioR_xo(:,subj)) max(r.ratioR_yo(:,subj)) max(r.ratioR_zo(:,subj))]);
h1=figure;
... |
function varargout = UseVirialCorrelations(varargin)
[varargout{1:nargout}] = CoolProp_wrap(427,varargin{:});
end
|
function [A_est time]=SDVMM(Y,N,r)
%=====================================================================
% Programmers:
% Tsung-Han Chan, E-mail: thchan@ieee.org
% Ji-Yuan Liou
% Date: Aug., 2011
%======================================================================
% A implementation of WCR-SVMAX
% [A_... |
function [coeffs,delta,deltaDelta] = normalizedMFCC(signal,Fs,L,R,shouldPlot)
[coeffs,delta,deltaDelta] = mfcc(signal,Fs,'NumCoeffs',13,...
'WindowLength',L,'OverlapLength',L-R,...
'DeltaWindowLength',5,'LogEnergy','Ignore');
coeffs = coeffs'; delta = delta'; deltaDelta = deltaDelta';
% matrixes of size NumCoef... |
function [fsw_data, fsw_bgs, p_fit, vlist] = vna_lock_fsw_scan_no_calib(instrs, CAL,...
center_frequencies, atten, V_cavity, side, fnamesuffix, fswconfig, isfit, n_avg_10dB)
% lock detuning by VNA and FSW scan
% center_frequencies: frequencies to take data on
% CAL: fit info from e.g.: [CAL,F,v1sig,vx,wlsig] = ... |
function [z,e]=oneoutnn(x,iil)
[m,n]=size(x);
d=zeros(m,m);
v=double(x)*double(x');
for i=1:m;
for j=1:m;
d(i,j)=sqrt(v(i,i)+v(j,j)-2*v(i,j));
end;
d(i,i)=10000000000000;
end;
[a,b]=min(d);
e=iil(b');
c=iil-e;
e(:,2)=iil;
z=0;
for i=1:m;
if c(i)~=0;
z=z+1;
end;
e... |
% This provides a solution for a boundary-value problem for a
%first order ODE with one unknown parameter to be determined.
% The ODE ids of the form dy/dx=f(x,k) k is an unknown parameter.
% The boundary conditions are y=Ya for x=a and y=Yb for x=b
% THE FUNCTION f(x,Q) IS PROVIDED AS A myfunc1(q,x) in SCILAB
... |
function [f] = f_funcion(x)
% ECUACIÓN EXACTA
% Ejercicio 1
% f = x + exp(-x);
% Ejercicio 2
% f = (x+1).^2 - 0.5*exp(x);
% Ejercicio 3
f = ( exp(-0.5*x)/13 )*(40*exp(1.3*x)-14);
end
|
classdef MosaikSimulatorTest < matlab.unittest.TestCase
%MOSAIKSIMULATORTEST Unit Test Class for Testing the Matlab High Level
% Mosaik Simulator
% API
properties (Constant)
simConstructorArgs = {'127.0.0.1:1234','debug',true}
end
properties
simulator
end
... |
function [SF,SVI,SV,A] = split_nonmanifold(F,varargin)
% SPLIT_NONMANIFOLD Split a non-manifold (or non-orientable) mesh into a
% manifold orientable mesh possibly with more connected components.
%
% Inputs:
% F #F by 3 list of input tringle indices into some vertex list V
% Optional:
% 'V' follo... |
function ES155P3_plot_cart_System(ic, fignum)
tspan = [0 15]
% compute output
[t, x] = ode45(@(t,x) ES155P3_cart_inv_pend(t, x), tspan, ic);
size(x)
figure(fignum);clf;
subplot(3,1,1)
plot(t, x(:,2))
ylabel('$\theta$', "Interpreter", "latex")
title('$\theta$', "Interpreter", "latex")
xlabel("t", 'interpreter', 'lat... |
% Copyright @2015 MIT License - Author - Harshal Priyadarshi - IIT Roorkee
% See the License document for further information
function legal_moves = get_legal_moves(board,die,userChance)
% get all the legal moves for throw of just one die
% General Knowledge - (3,1) is 1 pair of die which has 2 die
% board - prese... |
%% fixed parameters
T = 10; % Two years of data
dt = (1/(60*6.5))/252; % Frequency one day
n = T/dt;
disp([num2str(n), ' observations in each sample']);
parameters.gamma = [0.5];
M = 50000; % Number of simulated samples for the combination of parameters
%% Parameter sets
kappa = [0.2, 2, 6];
theta = [0.1^2, 0.3^2, ... |
function out = isempty(this)
out = cellfun( @(arg) all(isempty(arg)) , {this.Fields} );
out = reshape( out , size(this) );
end |
%{
#
-> animal.Animal
-> animal.Animal
---
-> animal.Severity
-> animal.Severity
%}
classdef AnimalSeverity < dj.Manual
end |
function s=MapVol(sig,y,K,T)
% in real life a and b below should be calibrated to security-specific time series
a=-.00000000001;
b= .00000000001;
s = sig + a/sqrt(T)*(log(K)-log(y)) + b/T*(log(K)-log(y)).^2; |
% function UAV = range_calculation_2(m_payload,v_cruise,b,AR)
addpath('DontModify'); % Make sure Matlab can see all the functions it needs to call from the folder: 'DontModify'
Modify = 10; % Placeholder! Replace all occurrences of 'Modify' with the proper equations or variables
% load in the airfoil and propeller d... |
function Mu_extrinsic = compute_extrinsic_grassmann_mean(clust_points)
N_pts = length(clust_points);
[m,n] = size(clust_points{1});
Mu = 0;
for i = 1:N_pts
P = clust_points{i};
Mu = Mu + P*P';
end
Mu = Mu/N_pts; %%%% vector space mean
%%%% Project it to manifold
... |
clear all
global w_0 max_intensity;
% Part 2
% a)
data = load('boat_variables.mat');
info = load('wave.mat');
% fetching time and psi_w
time = info.psi_w(1, :);
psi = (info.psi_w(2, :))*pi/180;
% sampling frequency and window size
fs = 10;
window = 4096;
% pxx_e = The PSD estimated
% f = fr... |
function genwav(nume,a1,a2,a3,f1,f2,fs,ts)
%
% functia scrie pe disc un fisier wav cu amplitudinile a1, a2
% si frecventele f1 respectiv f2, cu o componenta continua a3
% cu sampling rate fs si timp specificat in variabila ts.
%
% Sintaxa:
% genwav(nume,a1,a2,a3,f1,f2,fs,ts)
%
[x, t, dt, fs]=testvf1(f1, f2,... |
function Evector = ExpandVec(vector,size)
%example: vector = [1, 2 ,4] size = 3
% Evector = [ 1 2 3 4 5 6 10 11 12];
Evector = zeros(1,size*length(vector));
for i = 1:length(vector)
Evector(i*size - size+1:i*size) = vector(i)*size-size+1:vector(i)*size;
end
end
|
function s=simprl(f,a,b,M)
% Simpson求积公式
% function s=simprl(f,a,b,M)
% Input - f 是被积函数
% - a 和 b是积分的上下界限
% - M 为子区间的个数
h=(b-a)/(2*M);
s1=0;s2=0;
for k=1:M
x=a+h*(2*k-1);
s1=s1+feval(f,x);
end
for k=1:(M-1)
x=a+h*2*k;
s2=s2+feval(f,x);
end... |
%% Function to reduce the dimensionality of the feature matrix
% Current possible types:
% None ('none')
% Principle Components Analysis ('pca')
function [A_hat, num] = featureSelection(featureMatrix, labels, type)
if strcmp(type, 'pca') % add more types by using elseif (build each type in a separate functi... |
function hsv = hsi2hsv(hsi,c,t)
[h,w,tt] = size(hsi);
hsv=zeros(h,w,c,t);
for i=1:c:tt
hsv(:,:,:,fix(i/c)+1)=hsi(:,:,i:(i+c-1));
end
end |
calculate_global_qTAE_electron_damping_final
calculate_global_qTAE_electron_damping_ini
calculate_global_qTAE_ion_damping_final
calculate_global_qTAE_ion_damping_ini
calculate_global_qTAE_drive_final
calculate_global_qTAE_drive_ini
plot_many_n_modes_TAE_growth_rho
|
figure
hold on
Init
draw_Field_v001
Arcade = plot([0 Field.L Field.L 0 0], [0 0 Field.W Field.W 0],'gre');
grid on
% draw_Trajectory(RSMRS);
% draw_Trajectory(RSMLS);
% draw_Trajectory(BSMRS);
% draw_Trajectory(BSMLS);
% draw_Trajectory(Arc);
% draw_Trajectory(Straight);
% draw_Trajectory(RSLCL... |
function [xs_int,spe2] = specialdot2(spe,xs,plotOrNot)
% 计算spe每个能点的截面并梯形积分
% spe 射线能谱,第一列能量,第二列通量
% xs 截面,和spe单位一致
if max(spe(:,1))<min(xs(:,1)) ||min(spe(:,1))>max(xs(:,1))
xs_int = 0;spe2=0;
return
end
xs = [0,0;xs];
[~,dd]=unique(xs(:,1));
xs = xs(dd,:); % 删除重复行
spe = [spe,zeros(size(spe,1),1)];
for i = 2:s... |
function [Check] = Normalize(Z)
Size = size(Z);
N=Size(1,2);
p=linspace(1,N,N);
Mean=[mean(Z(:,p))];
Deviation=[std(Z(:,p))];
Check=(Z-Mean)./Deviation;
end |
% Big-auto-assxnodes
load('C:\Users\CAUA\Desktop\Pre-data\data\Rats\rat1.mat')
% PPC - t3 e t4
%1
%% E0
clear spikes_ts
[t1,t2,t3,t4,t5,t6,t7,t8]= ts_integration(LFP,event,[3 3],1000);
t3= alpha_filt(t3,500);
x_nodos1= [];
y_ass1=[];
for i=3.2:-0.1:1
[nodos]= v_clocalmaximum(t3,1.... |
function [modeshape,k_term] = TangentialMode(n1,n2,l1,l2,rA,rB,r0A,r0B,k)
%-----------------------------------------------------
% Compute the Tangential Mode in a room.
% Syntax: [modeshape,k_term] =
% TangentialMode(n1,n2,l1,l2,rA,rB,r0A,r0B,k)
%-----------------------------------------------------
... |
%%
clear all
%%
% Shape estimation
% Rodger's BAL002 describes a shape that is not very explicit and the
% approximation formulas do not agree with BLR004
% But also, BLR004 does not estimate the cross-sectional area
% Based on the drawing, I will try to approximate the cross-sectional area
% as consiting of a ... |
function out = calc_Y(k1, k2, h1, h2, delta_x1, delta_x2, delta_y1, delta_y2)
beta_c = 1.127e-3;
Ay1 = delta_x1*h1;
Ay2 = delta_x2*h2;
out = 2*beta_c/(delta_y1/(Ay1*k1) + delta_y2/(Ay2*k2));
end |
function G = Grm(r,m)
if r==0
G = ones(1,2^m);
return
elseif r==m
row = zeros(1,2^m); row(1,end) = 1;
G = [ Grm(m-1,m) ; row ];
return
else
x = Grm(r-1,m-1);
G = [ Grm(r,m-1) Grm(r,m-1) ; zeros(size(x)) x ];
return
end
end |
function [ limiar_Pma, limiar_Pmasucc, limiar_equalpPdPfa, limiar_equalPdPfa, limiar_Pdfa, limiar_Pmad, limiar_TNP] = threshold_computation( SNR, lambda, S, p, interfFU5)
% --- Calculo do threshold para Maximiza??o da Probabilidade de Acesso
%[limiar_Pma]= max_Pma( SNR , lambda, S , p);
limiar_Pma = ... |
function arr = myReshape(in1, row, col)
% Finds the size of the input array
[rows cols] = size(in1)
int = []
for r = 1:rows
change = in1(r, 1:end)
int = [int change]
end
int = int'
int2 = ones(row,1)
for rowA = (1:row:col*row)
change2 = int(rowA:rowA... |
function [x,y,x_fil,v_fil,t] = filtro_g_h_0(x0,v,T,N,s_x)
%Aplica un filtro g-h de coeficientes constantes a un móvil con dinámica
%MLU. Se asume un error de medida gaussiano de media nula.
%Parámetros de entrada:
%x0: posición inical del móvil en t=0 (en metros).
%v: velocidad del móvil (en metros por s... |
function [ tok ] = promptTokColor( )
%PROMPTTOKCOLOR Summary of this function goes here
% Detailed explanation goes here
choice = questdlg('', ...
'Choose Token', ...
'Black','White','Black');
% Handle response
switch choice
case 'Black'
tok = -1;
case 'White'
tok = 1;
end
if ~exist('... |
% Train a SVM model on top of fc6/fc7 layer's features extractd by our RealismCNN model.
% This script can reproduce RealismCNN+SVM results in Table 1.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% add paths
SetPaths;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% set... |
function [rhsdepth, rhsdvel] = SWERHS1D(depth, dvel, bc_type, gravity)
% function [rhsdepth, rhsdvel] = SWERHS1D(depth, dvel, bc_type, gravity)
% Purpose : Evaluate RHS flux in 1D Shallow water
Globals1D;
% compute maximum velocity for LF flux
cvel = sqrt(gravity*depth); lm = abs(dvel./depth)+cvel;
% Compute fluxe... |
%#ok<*NOPTS>
% clear all %#ok<CLALL>
close all
options = struct;
options.nodewise_algorithm = 'camd';
options.graph_algorithm = 'standard';
% options.cost_function = @count_resistors;
options.nesdis_opts = [param 0 1 0];
options.verbose = 0;
tic
output = reducer(G, is_ext_node, options)
output.options;
toc
to_info =... |
%% Starting point, clear everything in matlab
tic;
clear all;
close all;
clc;
%% Problem Formulation
FitnessFunction=@(C,g,x,c) TDi_GA(C,g,x,c); % FitnessFunction
nLights=4; % Number of Traffic Lights
nIntersections=1; % Number of Intersecti... |
../esplot_A/esplot_press.m |
function lr_figure3(fname)
%% Analysis
% for A,V, AV experiments by Luuk vd Rijt 13-11-2013
% with 4x1 channel (split), right (Tx1 and 2, Rx1) and left (Tx3 and 4, Rx2) recordings
close all;
% clear all;
clc
%% To Do
% Stim
% Oxy-Deoxy
% Left-Right
%% Load preprocessed data
% obtained with PA_NIRS_PREPR... |
function [ basis, basisAntiderivative ] = getBasis(order)
%GETBASIS Returns a polynomial basis of the specified 'order'
% Returns a basis of the polynomial space of the specified 'order' and
% the corresponding 'antiderivatives' in the sense that the divergence of
% the antiderivative yields the corresponding... |
clear
clc
offsetAngle = -1.09;
robotLag = 0.5;
xmin = 98; xDistance = 400;
ymin = 52; yDistance = 380;
boardCenterX = 200 -xmin + 98;
boardCenterY = 190 -ymin + 35;
boardCenter = [boardCenterX, boardCenterY];
%%%%%%%%%%%%%%%%%%%%%%%%% CONFIGURE VIDEO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
imaqreset;
vid = videoinput('winvid... |
function [rmsx] = rms(X,dim)
% rms calculate the root-mean-square of the columns of input array X
% if X is a (row or column vector), the rms of that vector is returned
if ~exist('dim','var')
if size(X,2)>1 && size(X,1)==1 % if row vector
dim = 2; % take rms of row vector
else
dim = 1; % otherwise do the c... |
function plotLFPbyStm(lfps)
% plot results obtained by 'LFPbyStm.m'
close all;
name = {'drug', 'ps_base', 'ps_drug'};
winlab = {'baseline (-0.2 - 0s)', 'stimulus evoked (0.05 - 0.3s)', 'sustained (0.35 - 2s)'};
leg = {{'baseline', lfps.drugname}, {'small ps (base)', 'large ps (base)'}, ...
{['small ps (' lfps.dru... |
function [E,rbohr] = schrodHydrogen(N, k)
% Schrodinger Equation for the Hydrogen atom
% Hatree units
E0=27.21138505; % Electronvolts
r0=0.52917721067; % Angstroms
% Differentiation matrix
[D,x,w]=lagD(N);
r=r0*x;
w=r0*w;
% Solve eigensystem
B=diag(x);
T=-1/2*(diag(x)*D*D+2*D);
V=-eye(N);
H=T+V;
[S,E]=eig(H(1:end-1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.