text stringlengths 8 6.12M |
|---|
% exciting_colormaps
img = reshape(1:64, 8, 8)
image(img); colormap(gray(64));
axis square
axis off
drawnow
pause
for i=1:200;
pp=rand(64, 3)
colormap(pp)
drawnow;
end |
clear all;
load('/Users/GailLee/Documents/GI2016_GEOMETRY_VIDEOS/exp6/exp6_test8/savedFiles/antData.mat');
img = imread('/Users/GailLee/Documents/GI2016_GEOMETRY_VIDEOS/exp6/exp6_test8/00001.jpg');
imshow(img);
[refX, refY] = ginput(4);
movingPoints = [refX, refY];
fixedPoints = [refX(1) refY(1); refX(1) refY(2);...
... |
%%%%% SIMULATE TUMBLING AND TRANSLATION %%%%%%
% Author: Abin Alex Pothen
% Student ID: 101095128
% Carleton University, Ottawa ON.
clear all
close all
%% variable initialization
%
% axang = [[1 1 1]/sqrt(3) pi/3];
% omega0 = [1 -1 0.5]';
J = diag([1.3626 1.5333 0.3848]);
% initial quaternion
% q0 = axang2quat(axan... |
addpath(genpath('../toolbox/'));
% Load both features and training images
load train_feats;
load train_imgs;
% %% --browse through the images, and show the feature visualization beside
% % -- You should explore the features for the positive and negative
% % examples and understand how they resemble the original ima... |
clc; clear all; close all;%clearvars -except s R
load('s.mat')
load('R.mat')
% s=read_v('carphone.avi');
% for i=1:size(s,2)
% R(:,:,i)=s(i).RGB(:,:,1);
% end
%% DWT3 transform
depth_1d=3;
n=floor(size(R,3)/depth_1d);
WT_level1=[];WT_level2=[];WT_level3=[];WT_level4=[];
H=[];
parfor kk=1:n
k=(kk-1)*depth_1d+... |
classdef (Sealed) Ccir559754Registry < handle & mlnipet.StudyRegistry
%% CCIR559754REGISTRY
%
% Created 22-Feb-2023 23:34:44 by jjlee in repository /Users/jjlee/MATLAB-Drive/mlraichle/src/+mlraichle.
% Developed on Matlab 9.13.0.2126072 (R2022b) Update 3 for MACI64. Copyright 2023 John J. Lee.
... |
clc;
clear all;
close all;
GER(1).img = im2double(imread('dataset/GER7/GER1.bmp'));
GER(1).int = imread('dataset/GER7/GER1.bmp');
GER(1).name = 'GER1';
GER(2).img = im2double(imread('dataset/GER7/GER2.bmp'));
GER(2).name = 'GER2';
GER(2).int = imread('dataset/GER7/GER2.bmp');
GER(3).img = im2double(imread('dataset/GER... |
clear all
close all
NDBC_Dir ='/Users/hroarty/data/NDBC/44009';
NDBC_Files = dir([NDBC_Dir '/*.txt']);
% NDBC_Path = dir2cell(NDBC_Files , NDBC_Dir );
%
% %% preallocate the variables so you can cat them in the loop
% TME=[];
%
%
% for jj = 1:length(NDBC_Path)
% [tme,data] = load_noaabuoy(NDBC_Path{jj});
% ... |
function Q = fibonacci_sphere_sampling(P,phi)
% FIBONACCI_SPHERE_SAMPLING Generate P points on the unit sphere using a
% fibonacci spiral.
%
% Q = fibonacci_sphere_sampling(P,phi)
%
% Inputs:
% P number of points to generate
% phi golden ratio {(1+sqrt(5))/2}
% Outputs:
% Q P by 3 list of ... |
function FigNum=w_Compatible2014bFig(Fig)
FullMatlabVersion = sscanf(version,'%d.%d.%d.%d%s');
if (FullMatlabVersion(1)*1000+FullMatlabVersion(2)>=8*1000+4) && ~isnumeric(Fig)
FigNum=Fig.Number;
if isempty(FigNum)
FigNum=-0.1;
end
else
FigNum=Fig;
end |
Screen('BeginOpenGL', hwInfo.MYSCREEN.windowPtr(1));
ar=hwInfo.MYSCREEN.screenRect(1,4)/(hwInfo.MYSCREEN.screenRect(1,3));
glEnable(GL.LIGHTING);
glEnable(GL.LIGHT0);
glLightModelfv(GL.LIGHT_MODEL_AMBIENT,[0.5 0.5 0.5 1]);
glEnable(GL.DEPTH_TEST);
glMaterialfv(GL.FRONT_AND_BACK,GL.AMBIENT, [ 1 1 1 1 ]);
load(expInfo.EX... |
function [Pos Seeker FLAG_FASTER] = presentTrial(Pos,Seeker,FLAG_FASTER,colorFlags,MRI,block,a,b,postjitter,imagetex,w,standardImHeight,standardImArea,oval2imRatio,arrow_duration,anchor,inputDevice,pahandle,wave,fid,L_arrow_tex,R_arrow_tex)
% updated 1-8-15 to standardize area instead of height
tc=(block-1)*8*16+(a-1)*... |
function [features,time]=exfeature(data)
num=55;
window=16;
%window_m1=window-1;
window_2=window*2;
label_size=10;
labelList=zeros(label_size,1);
data_size=size(data,1);
% ?9?
di_data=zeros(data_size-window,12);
sq_data=zeros(data_size,3);
features=zeros(data_size-window_2+1,num);
time=zeros(data_size-window_2,1);
%... |
% Q1D exact solutions
sol = 'sub'; % Specify exact solution type: 'sub' -- Isentropic Subsonic-subsonic
% 'super' -- Isentropic Subsonic-supersonic
% 'shock' -- Internal shock
% Isentropic Sub-Sup
k = ceil( (imax+1... |
clc;
clear;
D = 3;
%% Hand model
input_path = '_my_hand/tracking_initialization/'; semantics_path = '_my_hand/semantics/';
load([input_path, 'centers.mat']); load([input_path, 'radii.mat']);
load([semantics_path, 'tracking/blocks.mat']); [blocks] = reindex(radii, blocks);
load([semantics_path, 'palm_blocks.mat']); loa... |
% Function performs demodulation of time signal and returns I and Q for every demodulated frequency
% Funcion is also performing a window shift on which FFT is done and compensating for the phase shift
% that is the result of such method. In that way ISI is avoided.
%
% !!! Symbols in signal must have CYCLIC prefix du... |
function bin2image(infile,outfile)
if(nargin==1)
outfile=[infile(1:max(strfind(infile,'.'))),'png'];
end
fprintf('Input file = %s\n',infile);
fprintf('Output file = %s\n',outfile);
fid=fopen(infile,'rb');
ndim=fread(fid,1,'int');
nchan=fread(fid,1,'int');
dim0=fread(fid,1,'int');
dim1=fread(fid,1,'int')... |
function [fibo] = myFunc(inp1,inp2)
fibo = [inp1,inp2];
while (fibo(end)<200)
fiboNew = fibo(end)+fibo(end-1);
fibo=[fibo, fiboNew];
end
fibo=fibo(1:end-1);
|
%%%%%% FEM Assignment Main File %%%%%%%%%%% Vidit Gupta- 61442
%%%%%%% Please choose
%%%%%%% Question number value
%%%%%%% and Number of element
clear all;
clc;
question =1; %%%% Enter the Choice
%%%% Question 0 Elastic Covergence for different graph
%%%% Question 1 Elastic Covergen... |
function [x1,y1,z1] = greaterThan(x,y,z)
x1=0; y1=0; z1=0;
if x>y && x>z
x1=1;
elseif y>z
y1=1;
else
z1=1;
end
end
|
function [relevance, error] = allele_source1family(family)
relevance = [];
error = 0;
if( isempty(family) )
error = 1;
disp('empty family');
return;
end
[rows, cols] = size(family);
if( rows <= 0 || cols < 12 )
error = 1;
disp('error in family structure... |
%% 去掉分段线性趋势实验
% sigData:无线性趋势的信号
% treData:两段线性趋势
% mixData:信号数据+趋势数据
sigData = [0 1 -2 1 0 1 -2 1 0 0 1 -2 1 0 1 -2 1 0];
treData = [0 1 2 3 4 3 2 1 0 0 1 2 3 4 3 2 1 0];
mixData = sigData+treData;
%--断点在第[5 9 10 14]个元素-------------------------
detData = detrend(mixData,'linear',[5... |
function x = perform_histogram_equalization(x,y,options)
% perform_histogram_equalization - perform histogram equalization
%
% x = perform_histogram_equalization(x,y,options);
%
% Change the values of x so that its ordered values match
% the ordered values of y.
%
% You can set
% options.cols=1 to operat... |
% calculate whether or not a number is prime
num = 5; % number to be checked
if(num==1) % base case display not prime and terminate
disp('is not prime')
return
end
isNotPrimeFlag = 0; % 0 = prime, 1 = not prime
for n=2:num-1
if(rem(num,n)==0) % check if remainder for all divisions of num/n=2:num-1
... |
function [dead_time A]= XuCalcDeadTimeParaWithPlot(count, tube_current, exposure_time)
recorded_count_rate = count/exposure_time;
Y = log(squeeze(recorded_count_rate)./squeeze(tube_current));
X = squeeze(tube_current);
X_linear_plot = (X-mean(X))*1.1+mean(X);
P=polyfit(X,Y,1);
dead_time = - P(1)/ exp(P(2));
A=exp(... |
function shifted_cellmask = shiftMask(curr_cellmask,curr_x,curr_y)
% % shiftMask %
%PURPOSE: Takes a bitmap mask, shifts it by x and y, pad the rest with zero
%AUTHORS: AC Kwan 170518
%
%INPUT ARGUMENTS
% curr_cellmask: The original bitmap mask
% curr_x: How much to shift in x
% curr_y: How m... |
% m = 2*8/4/2*3
%
clear global
% % ans = 8/(1/2)*2;
% % guess=[85*pi/180 asin(1/2)+pi/180]
%
%
% %
% % guess=[85*pi/180 asin(1/8.81)+pi/180]; % ????Guess function is used to solve for numerical solution, needto define a interval.
% % beta=fzero(@ThetaBetaSolve,guess,[],6,8.81);
%
% % eq := ode((1-M^2)/(1+(ga... |
function xr_z(source, event)
global xr_t;
xr_t(3) = source.Value;
% fprintf('The X pos of robot is %f \n', xr_t(3));
plot_xr_xg([0.4, 0.4, 0.4]);
end
|
function [newC,newV] = couzin(C,V,n,Rr,Ro,Ra,v,dtheta,sigma,aa)
%this function determines the new positions C and direction vectors V
%according to a 2-dimensional self organising model based on couzin et al.
persistent distmatrix x1 x2 y1 y2 Vx Vy fsh2fshTHETA Prefdir
[x1,x2]=meshgrid(C(1,:));[y1,y2]=meshgrid(C(2,:... |
% Author: Pilar Zhang Qiu
% Module: Robotic Research Project - Medical Percussion
% Imperial College London, Dyson School of Design Engineering
% Latest Update: 31/Jan/2021
clc;
clear all;
%% ======================================== Read multiple audio files ========================================
% Different Dept... |
function hBuildMenu = openBuildMenu(devObj)
% opens build menu using class' current properties
% If newCheck == 0, user is editing a preexisting device and object
% parameters are not empty/ don't need to set defaults
% If newCheck == 1, user is creating a new device and therefore the
% defaults need to be set.
% crea... |
function [lpConc] = toConcate(expArray,clusterArray)
if length(clusterArray) == 1
clusterArray = ones(1,size(expArray,2))*clusterArray;
end
if size(expArray,2)~= size(clusterArray)
error('all arrays should be line vectors, and in the same length')
end
lpArray = [];
for i = 1:size(expArray,2)
[exp... |
clear
% grid
hycom_domain = 'GSH';
read_HYCOM_grid;
% vel m/s
thcks = ncread('modeldata_mpo624.nc','layers_thcks');
mld = ncread('modeldata_mpo624.nc','mixlay_depth');
ssh = ncread('modeldata_mpo624.nc','ssh');
u = ncread('modeldata_mpo624.nc','uGS');
v = ncread('modeldata_mpo624.nc','vGS');
ugeo = ncread('modeldata_... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2010 - 2015 Moon Express, Inc.
% All Rights Reserved.
%
% PROPRIETARY DATA NOTICE:
% The data herein include Proprietary Data and are restricted under the
% Data Rights provisions of Lunar CATALYST Space Act Agreement
% No. SAAM ID#... |
function val = transformby(val, transmat, doTranslate)
%
if nargin < 3
doTranslate = 1;
end
n = sqrt(numel(transmat));
if numel(val(1,:)) ~= n
val = [val ones(size(val,1),1)];
if ~doTranslate
transmat(end,1:numel(val(1,:))-1) = 0;
transmat(end) = 1;
end
val = val * transm... |
function [edge_conflict, num_split_cameras] = compute_edge_conflict2(...
split_camera_task, camera_observations, camera_observation_segments, camera_pair_segments,...
visibility_matrix, image_folder, camera_data)
if ~exist('image_folder', 'var')
image_folder = '';
camera_data = [];
end
split_camera_pa... |
global im_v_pos
global im_v_neg
p = im_v_pos(:,:,3);
py = im_v_pos(:,:,2);
px = im_v_pos(:,:,1);
n = im_v_neg(:,:,3);
ny = im_v_neg(:,:,2);
nx = im_v_neg(:,:,1);
pz = p(p~=0);
pxz = px(px~=0);
pyz = py(py~=0);
nz = n(n~=0);
nxz = nx(nx~=0);
nyz = ny(ny~=0);
mp = mean(pz);
mpx = mean(pxz);
mpy = mean(pyz);
mn = m... |
function a=XuGetAFromZ(z)
z_and_a=importdata('z_and_a.txt');
a=z_and_a(round(z),2); |
function data_w_verify(ln, dataset)
% data_w_verify(ln, dataset)
% 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 this work... |
%%%%%%%
%Simulates the transmition of sequence s through a canal.
%params: s, column vector. The sequence.
%return: r, column vector. What you receive.
function r = transmit(s)
global H;
global L;
global sigma;
r = H*s;
r = r + sigma*randn(size(r));
endfunction |
function x = lower_solve(L,b)
% Usage: x = Lower_solve(L,b)
%
% This routine solves the lower-triangular system Lx=b using column-oriented
% forwards Substitution.
% Inputs: L lower-triangular matrix
% b right-hand side vector
% Output: x solution vector
%
% Aaron Krauss
% Math3315 / CSE3365
... |
%26Apr19
%Hi-Fi Audio Production Instrument
%Clay Sauter and Austin Pohlman
%This code will recieve input data from CSV files...
%...and compute the FFT for frequency-domain analysis
%NOTE THAT DATA MUST BE TAKEN AT 5MS/s with 100ms in time window
%This equates to 10Hz/sample resolution, 500000 data points
clc
... |
function [ gama ] = gamaf(obs, a, b, alfa, Beta)
% gama(i, j, t) - probability that at moment t
% there is a transition between state i and j
% given the set of observations obs(t)
T = size(obs, 2); % nr of observations
N = size(a, 1); % nr of states
gama = zeros(N, N, T);
for i = 1:N % pot face mai vec... |
X = linspace(0,pi/3);
R = 0.5*sqrt(3)/3;
y1 = @(x) R*cos(pi/3-x);
y2 = @(x) 1-R*cos(x);
hold on;
plot(X, y1(X));
plot(X, y2(X));
axis([0 pi/3 0 1]);
xticks([0 pi/12 pi/6 pi/4 pi/3])
xticklabels({'0', '\pi/12', '\pi/6', '\pi/4', '\pi/3'})
xlabel('\vartheta'); ylabel('y', 'Rotation', 0);
hold off; |
function dataout=modeDRAEC_BSS(nummics, numrefs, datain)
%
% Perform dr and aec together, then bss.
% nummics: no. of mic channels
% numrefs: no. of reference channels
% datain: input data
% dataout: output data
%
%% perform stft
addpath('stft2');
config;... |
function [delta_SA_ntp, delta_CT_ntp, delta_p_ntp, p_bar] = gsw_ntp_bottle_to_cast_gradients_EDITED(SA_bottle,CT_bottle,p_bottle,SA,CT,p,drho)
% gsw_ntp_bottle_to_cast Absolute Salinity, Conservative Temperature
% and pressure on a neighbouring cast using
% ... |
% Copyright (C) 2013 Quan Wang <wangq10@rpi.edu>,
% Signal Analysis and Machine Perception Laboratory,
% Department of Electrical, Computer, and Systems Engineering,
% Rensselaer Polytechnic Institute, Troy, NY 12180, USA
%
% You are free to use this software for academic purposes if you cite our paper:
% Qu... |
function fft_filter = design_filter2(model,sigma_filter)
% Design a Gaussian filter for smoothing between forward and backward
% advection
%
% %% Get parameters
% sigma_filter=model.advection.sigma_filter;
%% Grid
sigma_filter = sigma_filter/sqrt(prod(model.grid.dX)); % 0.36 degre
% fft_filter = (2*pi* sigma_filter^2... |
%% CNN for inverse problem of Cricle reconstruction;
% The input is the results reconstructed by Bp with 5% noise, and output is groundtruth;
% Wirtten by Wei Zhun at ECE NUS on 20th, Nov, 2017;
clc;clear all;close all;
% data_generate_Circle_Es; % generate scattering field
% Data_generate_Circle_BP; % Back... |
clear all;
close all;
clc;
path = 'D:\LoRaPrj\data';
% path = 'F:\YH_PRJ\LoRa_MAC';
NumSample = 40960;
[Y] = GetRxData(path,NumSample);
% plot(real(Y(1,1:1000)));
BW = 250e3; % 7.8, 10.4, 15.6, 20.8, 31.2, 41.7, 62.5, 125(-132dbm), 250(-129dbm), 500(-126dbm)
SF = 12; % range from 6 to 125
Fc =... |
function ClusterFunc_AddLimit(self)
% Convex Hull clsuter add limit
MCC = self.getAssociatedCutter();
[xg,yg] = DrawPolygonOnAxes(MCC, true);
plot(xg,yg,'-', 'color', self.color);
drawnow;
MCC.StoreUndo('Add Limit');
% get axes
xFeat = MCC.get_xFeature();
yFeat = MCC.get_yFeature();
iL = self.findLimit(xFeat, yF... |
%% Hidden Markov Model
% Load preprocessed sonnets in sonnet.mat and train an unsupervised HMM.
%
% Contains
% sonnet_list {cell}: A 604 row cell array where each row contains a
% input sequence, either a complete quatrain, volta, or couplet
% For example, sonnet_list{1} is a 32 token cell array cont... |
function [ output_args ] = delnewtonian( input_args )
%DELNEWTONIAN Summary of this function goes here
% Detailed explanation goes here
[~,length]=size(input_args);
output_args=zeros(length,length);
output_args(1,:)=input_args;
for i=2:length
for j=1:length-i+1
output_args(i,j)=output_args(i-1,j+1)-output... |
function Clear( tSignal )
%
tSignal.afTimes = [];
tSignal.afValues = [];
tSignal.afInaccuracies = [];
%
end %
|
%(a)
%vinput(t)=vc(t)+RC(vc(t))'
clear all;
clc;
%(b)
R=10e+3;
C=100e-6;
%vc(t)'=(vinput(t)-vc(t))./(RC)
dt=1e-4;
num=10./dt;
vc0=0;
for i=1:num
t(i)=i.*dt;
vc(i)=vc0+dt.*((vinput(i.*dt)-vc0)./(R.*C));
vc0=vc(i);
end
plot(t,vc);
xlabel('time(s)');
ylabel('V(v)');
figure;
%(c)
vc0=0;
for i=1:num
vc(i)=v... |
function [output] = lowpassfilter(input)
%LOWPASSFILTER filtro passa-baixa (pag. 403 do Roads)
%input deve ser um vetor (Nx1)
%output eh um vetor (Nx1)
tmp = [0; input]; % adicionei um zero para facilitar o calculo de y[1]
out = tmp;
pp = size(tmp,1); % apenas debug
for i = 2 : (size(tmp,1)); %itere por todos... |
function [shist,histmax] = statehist(varargin)
% STATEHIST state occupancy FRET histogram
%
% S = STATEHIST( DWT, DATA, options ) where
% S is a collection (in cols) of FRET histograms for each state, as
% calculated from the DWT file. The first col specifies the bins.
% DWT is the filename of the idealizat... |
%{
Localization of the test & control lines
Input: filename - filename of the subject image
Procedure:
1. Call the find_ref_func to locate the reference rectangle
2. Call the apply_homography_func to locate the test & control lines
3. Call the interp_func to interpret the test & control lines
Output: res - ... |
function [w, T] = cp_kolda(X, dims, K)
% X is a 1D array in fortran (matlab, not numpy) order
% We pass dims to Tensor as well as reshape, since reshape ignores
% trailing dimensions of size 1.
if (length(dims) >= 2)
T = tensor(reshape(X, dims), dims);
else
T = tensor(X, dims);
... |
% % %%read data from files
clear all
% % tic
[train_img_X,delimiterOut0]=importdata('train/images_train.txt');
[train_Y,delimiterOut1]=importdata('train/genders_train.txt');
[train_words_X,delimiterOut2]=importdata('train/words_train.txt');
[train_image_feature_X,delimiterOut3]=importdata('train/image_features_train.t... |
function [ QRS_true_candidates_idx,QRS_true_dist_avg ] = FiltFalsePositives( QRS_candidates_idx ,QRS_dist_med)
%FiltFalsePositives gets the indices of the best candidates for the
%QRS's indices and filters out the false positives using an assertion
%over the distances between them. it then returns only t... |
function [L,U,P] = luFactor(A)
% lup factorization with partial pivoting
% [L,U,P] = lup(A) returns unit lower triangular matrix L, upper
% triangular matrix U, and permutation matrix P so that P*A = L*U.
n = length(A)
L = zeros(n)
U = zeros(n)
P = eye(n)
for k=1:n
% find the entry in the ... |
function generateGnuplotData(gnuplotFile, exp_results, exp_cmaes_results, maxfunevals)
fid = fopen(gnuplotFile, 'w');
[mData, q1Data, q3Data] = statisticsFromYEvals(exp_results.y_evals, maxfunevals, 1);
[mCmaes, q1Cmaes, q3Cmaes] = statisticsFromYEvals(exp_cmaes_results.y_evals, maxfunevals, 1);
fprintf(fid, '... |
function calka
% calka nieoznaczona calka(1/x)
syms x
s=1/x;
int(s,x)
return
|
function [Y,S] = f_grubbs(X,ave,alpha,span)
% - Grubbs test for spike elimination (outlier removal)
%
% USAGE: [Y,S] = f_grubbs(X,ave,alpha,span);
%
% X = input data matrix (rows = observations, cols = variables)
% ave = replace spikes with a moving average (= 1) or NaN (= 0) (default = 1)
% alpha = significance... |
clear
A = imread('C:\Users\pc\Desktop\CS_Rectest\MC\ce_svt\im.bmp') ;
x = rgb2gray(A);
x = double(x);
[M,N] = size(x);
% F = zeros(120,200,3);
% F(:,:,1) = x;
% F(:,:,2) = y;
% F(:,:,3) = z;
% F = uint8(F) ;
% imshow(F)
% imwrite(A,'C:\Users\pc\Desktop\CS_Rectest\MC\ce_svt\colorbox.bmp','bmp')
P =... |
% Extract data from pout file to look at how we approach (or don't
% approach) steady state. Mainly useful for seeing if we oscillate about a
% steady state.
clear all;
close all;
%Options
plotRestarts = false;
timestepInterval = 1;
minTStep = 1;
pout_file = '/home/parkinsonjl/convection-in-sea-ice/MushyLayer/execS... |
function analyze_SEL2_scanner_sim_prep_onsetsPrePost()
% A meta-function to run the function 'analyze_encoding' on multile files
% See below for details about 'analyze_encoding' function
subs= {...
% '200615TF';...
% '230615ZD';...
% '230615EF';...
% '230615RE';...
% '270615SA';... ... |
clear all;
N=100;
dim=10; %no of dimensions
run=1;%no of runs
num=16;
bound=5;
fbias=120;
a1=sqrt(N);
b1=sqrt(2*a1);
t1=1/b1;
t2=1/sqrt(2*N);
range=repmat([-bound bound],dim,1); % range
iter=1000; %no of iterations
dwnsrch=range(:,1);
upsrch=range(:,2);
FEs = 0;
b=1;
y=0;
q=10;
si=0.8/sqrt(N);
NP... |
%-------------------------------------------------------------------------%
% 1. feat_extraction.m
% 2. classficiation_using_DB.m %---current code---%
%-------------------------------------------------------------------------%
% developed by Ho-Seung Cha, Ph.D Student,
% CONE Lab, Biomedical Engineering Dept. Hanyang ... |
function Iq = leak_current(z, D, Cmv, Cbody, L, S)
% Concentrations in mM
% Surface and length in um^2 and um
% D in um^2/sec
% Current Iq in pA
F = 96500; % Faraday constant in C/mol
Iq = 1e-6*z*F*D*(S/L)*(Cmv - Cbody);
|
% File: Example3_07.m for Example 3-7 and Fig. 3-12
% Binary Signaling
clear;
t = 0:0.05:8;
k = 0:1:7;
Tb = 1;
Ts = Tb;
w = [0 1 0 0 1 1 1 0];
x = -5*Ts:0.05:5*Ts;
% Generating w2(t), sin(x)/x Pulse shape used
w2 = zeros(length(t),1);
for (i = 1:1:length(k))
w2 = w2 + w(i)*SA(pi/Ts * (t - (k(i)*Ts + 0.5*Ts)));
en... |
function [Cov] = MakeBandedCov(d,NN,a)
%Input:
% d: dimension
% NN: number of neighbors to have dependecies with on each side (2*NN off diag bands)
% a: the off-diagonal weight for the nonzero elements
Cov = sparse(d,d);
Cov = Cov + sparse(eye(d));
for i=1:NN
Cov = Cov + sparse(diag(a*ones(1,d-i),-i))+sparse(diag(... |
% bus:23, car:12, ferry:20, metro:10, train:21, tram:56
clear all
close all
type={'bus';'car';'ferry';'metro';'train';'tram'};
lengarr=[23,12,20,10,21,56];
dir = './test_sim_traces'
cd(dir)
for typeidx=1:length(type)
t=cell2mat(type(typeidx))
leng=lengarr(typeidx);
for i=1:leng
plotname=strcat(... |
clc;
clear;
close all;
a=5;
while 1
a=a+5;
if a==100
break
end
end
disp(a) |
function [acr,hd,dbindi]=load_acr1(nume,ats,diametre,nlags,nbindi,optsav);
%
% functia preia matricea cu serii temporale, ca variabila, care trebuie
% citita in prealabil de pe disc sau transmisa de load_ts36, care contine
% seria pe cate o coloana pentru fiecare diametru
%
% Calculeaza functia de autocorelatie p... |
function itot=levich_fit(bo,ovp)
ko=bo(1);
%D=bo(2);
n=1;
F=96490;
R=8.314;
T=298;
A=pi*(0.5/2)^2;%cm2
rot_rat=2*pi*500/60;%angular fre
scr=10e-3;%V/s
Co=20e-6;%mmol/cm3
%iL=1.14e-3;
D=4.511e-6;
%iL=0.62*n*F*A*D^(2/3)*rot_rat^(1/2)*scr^(-1/6)*Co;
kf=ko*exp(0.5*F*ovp/R/T);
%ik=F*A*kf*Co;
%itot=ik*iL./(ik+iL);
itot... |
%% plot phase portrait of the FollowerStopper on 2D plane (d_rel, v_rel)
clear all
clc
%%
d_rel = 0:10:50;
v_rel = -10:2:10;
v_AV = 0:2:30;
[XX,YY,ZZ] = meshgrid(d_rel,v_rel,v_AV);
vec_x = zeros(size(XX,1),size(XX,2),size(XX,3)); %\dot{v_{rel}} : relative acceleration
vec_y = zeros(size(XX,1),size(XX,2),size... |
function filename = cleanFileName(filename)
filename = strrep(filename,'"','');
filename = strrep(filename,' ','');
filename = strrep(filename,'\',filesep);
filename = strrep(filename,'/',filesep);
filename = strrep(filename,'\\',filesep);
|
function [net, tr] = neural_net(X_tr, y_tr, eval, layers, X_te, y_te)
%net = patternnet([125 125 100 100 75 50 10]);
%net = patternnet([125 100 75 50 10]);
net = patternnet(layers);
disp(layers);
net.trainFcn = 'traingdm'; % Momentum
net.trainParam.max_fail = 15;
net.performFCN = 'crossentropy';
%[net, tr] = train(ne... |
function result = EllipticF( X, K )
%ELLIPTICF Jacobi's form of the elliptic integral of the 1st kind.
% ELLIPTICF(X,K) is the Jacobi's form of elliptic integral of the
% 1st kind F of elements of X and modulus K. X and K must be real and
% of the same size or any of them can be real scalar.
%
% See also
%... |
function [] = analyzeOFstats(param)
%% extract parameters
ctrlIndx = param.ctrlIndx;
exptIndx = param.exptIndx;
% preIndx = param.preIndx;
% postIndx = param.postIndx;
statspath = param.spath.stats;
figpath = param.spath.fig;
p = param.p;
%% initialize
% numExpt = size(preIndx,1);
edge_time_all = cell(2,... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2021, Diogo Costa, diogo.pinhodacosta@canada.ca
% This file is part of WebCrawler tool.
% This program, WebCrawler tool, is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public Licens... |
function imps = loadAllStimuliPatches(fnms, np, sz)
if nargin < 2
np = 27;
end
if nargin < 3
sz = 729; % all images are the same size
end
assert(floor(sz/np) == sz/np); % must divide evenly
n = (sz/np)^2;
imps = nan(numel(fnms)*n, np^2);
for ii = 1:numel(fnms)
im = load(fullfile('..', 'data', fnms{ii}));
... |
function [xc, fEvals] = Newton(f, x0, delta, fEvalMax)
% f is a HANDLE to a continuous function, f(x), of a single variable.
% x0 is an initial guess to a root of f.
% delta is a positive real number.
% fEvalsMax is a positive integer >= 2 that indicates the maximum
% number of f-evaluations allowed.
%
% Newton's metho... |
function [dRdq, dqdv_sim, dRdv_sim] = expmapderi2()
syms x y z w real % quaternion
syms v1 v2 v3 real % exponential map parameters and its length
syms theta real % sqrt(v1^2 + v2^2 + v3^2)
syms cx cy cz real % translation part
q = [ x y z w]';
R = [ 1-2*y*y-2*z*z 2*x*y+2*w*z 2*x*z-2*w*y cx... |
function trainer = createTrainerFactory(env,agent,trainingOptions)
% CREATETRAINERFACTORY
%
% Create a trainer object given env, agent, and training options
% Revised: 8-22-2019
% Copyright 2019 The MathWorks, Inc.
if trainingOptions.UseParallel
popts = trainingOptions.ParallelizationOptions;
p... |
function [N] = fn_calc_adj_NN(ptsN3,x)
digits = 1e4;
[nverts,y] = size(ptsN3);
D = zeros(nverts);
for m = 1:nverts %Compute distances between vertices.
for n = (m+1):nverts
D(m,n) = sqrt((ptsN3(m,1) - ptsN3(n,1))^2 + (ptsN3(m,2) - ptsN3(n,2))^2 + (ptsN3(m,3) - ptsN3(n,3))^2);
D(n,m) = D(m,... |
function coef = fit_galvo_drive_feedback(drive_waveform, feedback_waveform)
% galvo feedback signals lag behind the actual drive signal. The amount is
% mostly constant but seems to vary a bit with galvo speed. The feedback
% signal is also shifted and scaled a bit. This function finds the optimal
% scaling coefficient... |
% poisson2.m -- solve the Poisson problem u_{xx} + u_{yy} = f(x,y)
% on [a,b] x [a,b].
%
% The 5-point Laplacian is used at interior grid points.
% This system of equations is then solved using backslash.
%
% From http://www.amath.washington.edu/~rjl/fdmbook/chapter3 (2007)
clear all; close all;
a = 0;
b = 1;... |
function [time] =assign1(n,T)
mat=zeros(n);
time=0;
if (T==1) %Attribute T1
while (checkT1(mat,n)==0)
if(sum(sum(mat))~=n^2-n) % check if the graph is complete
cell=randi(n^2);
i=mod(cell,n)+1;
j=ceil(cell/n);
... |
% mec_chaos_01.m
% Runge-Kutta Solutions to Equations of Motion
% Modelling the motion of a SIMPLE PENDULUM
% Ian Cooper
% email: ian.cooper@sydney.edu.au
% School of Physics, University of Sydney
% 180813 / Matlab version R2018a
% DOING PHYSICS WITH MATLAB
% https://d-arora.github.io/Doing-Physics-With-Matlab/... |
function glycanNetFileViewer(glycanNetFileName, varargin)
%glycanNetFileViewer read an SBML file of a glycosylation network and return a graphical
% representation
%
% glycanNetFileViewer(FILENAME, GLYCANFORMAT) reads a file name in the string
% input argument FILENAME using a sequence format specified with the
% i... |
function [all_theta] = oneVsAll(X, y, num_labels, lambda)
% Some useful variables
m = size(X, 1);
n = size(X, 2);
all_theta = zeros(num_labels, n + 1);
X = [ones(m, 1) X];
fprintf("THe size of num_labels is %i", size(num_labels));
for i = 1:num_labels
c = i* ones(size(y)) %here, you want to make it a vector of y, ... |
Kr=1;
Dr=0.8;
Kn=0.1;
Kg=0.25;
Dg=0.75;
N=[Kr -Kr*Dg 0];
D=conv([1 -Dr], [(Kg+Kn) -Kn*Dg]);
N
D
|
addpath(genpath('../'))
example_uv_init
mlbfgs_lcp_split_solver(u_n, 1);
|
function nlevp_example(fname)
%NLEVP_EXAMPLE Run POLYEIG on PEP problems from NLEVP.
% NLEVP_EXAMPLE solves all the not-too-large PEP problems in NLEVP
% by POLYEIG, sending output to the screen.
% NLEVP_EXAMPLE(fname) directs partial output to the file named fname
% (intended for generating output for NLEVP paper).
... |
function exportfile(S,foldername)
[nrows,ncols] = size(S);
for row = 1:nrows
sign = cell2mat(S(row))';
fileID = fopen(strcat(foldername,'/',num2str(row),'.csv'),'w');
formatSpec = '%.6f;%.6f';
for i=1:size(sign,1)
temp = num2str(sign(i,:),formatSpec);
temp = strrep(temp, '.', '... |
%% Unstructured Grid
% This examples shows how to use ConstructProjector2D on unstructured
% grids. Two sets of points are generated randomly.
clear;clc;
%% Initializing Part I
disp('- Initializing')
rSource=2*pi;
rDestination=rSource*1.05; % This slightly bigger radius causes some points
% ... |
function [J]=OmniJacobian(q)
% finds jacobian of Phantom Omni given joint angles q
% Based of: http://www.academia.edu/22070087/PHANToM_OMNI_Haptic_Device_Kinematic_and_Manipulability
% INPUTS:
% q - 3x1 vector of joint angles IN DEGREES
% OUTPUTS:
% J - 3x3 jacobian matrix
% Setting up parameters
assert(length(q)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.