text stringlengths 8 6.12M |
|---|
function [data_X,data_X_missing] = kyu_preprocess(data_raw,data_raw_missing,labels,pts_to_include,varargin)
% creates a data matrix from the raw data imported from spreadsheets
% inputs
% data_raw: struct array from kyu_readphysical and kyu_readbiomarkers
% labels: array of variables names chosen by a user from the in... |
% donne le vecteur unitaire (ur) sortant de la reflexion
% ui : vecteur unitaire du
% ni : vecteur normale unitaire (sortant de la surface)
function ur = Reflexion (ui, i)
% Eq (7.13)
ur = ui - 2 * i * dot(ui, i);
end
|
function d3sensorcheck(filename)
%
% d3sensorcheck(filename)
%
X=d3parseswv(filename);
% pressure and voltage
figure(1)
subplot(321),plot(X.x{19}*6),grid,title('Battery, V')
subplot(322),plot(X.x{11}*3),grid,title('Thermistor, V')
subplot(323),plot(X.x{12}*6),grid,title('PB+, V')
subplot(324),plot(X.x{13}*3),gri... |
% X are points. Shape (n,d)
% the rest are the params
% descriptors is of shape n,k with k = nbBins_theta * nbBins_r
function descriptors = sc_compute(X, nbBins_theta, nbBins_r, smallest_r,biggest_r)
[n, d] = size(X);
assert(d == 2, int2str(d));
descriptors = zeros(n, nbBins_theta * nbBins_r);
r_bins = linspace(smal... |
clear all
close all
addpath('../MRF/');
% addpath('../Chan-Vese/');
%% Algorithm constants
lambda = 1;
beta = 1;
Epsilon = 1;
superpixel = 0;
%% Load Data
load('../data/prior/shapePriorShift.mat');loadDataFruitfly;
%generateData;
% Create graph
edgeStruct = createImgStructure(X,nStates);
%% Prior Pre-processing... |
N = 10000;
R = 3:0.01:4;
x = zeros(N,length(R));
x(1,:) = 0.2;
y = zeros(1,N);
y(1) = 0.01;
d = 0.1;
X = zeros(100,length(R));
for r=1:1%length(R)
for i=1:N-1
%x(i+1,r) = R(r)*x(i,r)*(1-x(i,r));
y(i+1) = y(i)+0.01*(y(i)*sqrt(d) + (d*y(i)*y(i)) - (y(i)^3));
end
X(:,r) = hist(x(:,r),100);
end... |
function G = Solver(G)
Nz = size(G.Grid,1);
N = sqrt(Nz);
G = getPossibilityGrid(G);
% drawSudoku(G,grid);
k = waitforbuttonpress;
SIGMA = sum(sum((G.Stat(:,:) == 'L')));
while SIGMA < 81
% Probability
G = getProbabilityGrid(G);
X = max(max(max(G.Prob(:,:,:))));
i = 0;
for ID = 1:Nz
... |
%FUNCTION: GET DATA DIRECTORY
%Get directory where the data directory is stored
function directory = getDataDirectory()
directory = fullfile('');
end
|
%% Main Script for TFs
%% Mouse
specific_path = '/home/jhow/Documents/OfficialRents/';
addpath(genpath(specific_path))
mouse_net_path = strcat(specific_path, 'DataSets/TranscriptionFactors_data/MouseTFs_data/Mouse_Networks');
cd(mouse_net_path)
list_files = dir('*.txt');
% Loop through all species, and process
for t ... |
function [node_component_id, A] = proximity_components(x, r)
%PROXIMITY_COMPONENTS Connected components of mobile network.
%
% usage
% [node_component_id, A] = PROXIMITY_COMPONENTS(x, r)
%
% input
% x = node point coordinates
% = [#dim x #nodes]
% r = communication radii for nodes
% = [1 x #no... |
function val = m10(F)
%------------------------------------------------------------------------------
%
% Integrates interpolated gridfunction F times x,
% interpolation is assumed piecewise constant.
% The result corresponds to a first order moment.
%
% See also: m00, m01, mupq
%
% Design and implementation by:
% Dr. ... |
function dy = irSIR(~, y, params)
dy = [ ...
-params.beta * y(1,:) .* y(2,:); ...
params.beta * y(1,:) .* y(2,:) - params.nu * y(2,:) .* y(3,:); ...
params.nu * y(2,:) .* y(3,:) ...
] .* params.N0;
end |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 本程序是用于对一个文件夹里面特定类型的文件名进行批量提取,然后进行批量 %%%%
%%% 修改。即先读取指定路径下的特定类型文件的全部名字,并把名字存在数组变量 %%%%
%%% 中,然后把数组变量写到Excel文件中去,方便自己来修改。%%%%%%%%%%%%%%%%%%%%
%%% author:yetwanng; date:2018-07-14%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%... |
function out = hessian_str(ina,varargin)
t = 1;
ref = ina.nzr;
% for i=1:size(ref,1)
% for j=1:size(varargin{w}.nzr,2)
% if any(varargin{w}.nzr(i,j)==ref(i,:))
% out.ddV(i,:) = varargin{w}.ddV(i,j)*(varargin{w}.nzr(i,j)==ref(i,:))+ina.ddV(i,:);
% [~,k,n] = find(ina.ddV(i... |
clc; % Clear command window.
clear; % Delete all variables.
close all; % Close all figure windows except those created by imtool.
imtool close all; % Close all figure windows created by imtool.
workspace; % Make sure the workspace panel is showing.
fontSize = 16;
% Read in a standard MATLAB gray scale demo... |
% Michael Seung %
% Statistical Connectomics %
% Final Project %
clear all;
url='https://www.dropbox.com/sh/idt3d0gylplyo31/AAAecrQu5UV0DV8EXbnbI64Ia/mseung.zip?dl=0';
cmd=['wget ' url ' -O "mseung.zip" --no-check-certificate'];
system(cmd);
unzip('mseung.zip');
addpath('mseung');
fig=importdata('dat.mat');
fig_mixe... |
clear all
close all
dataset = voc(fullfile('ImageSets', 'Main', 'trainval.txt'));
class = dataset{1};
data = dataset{2};
img_widths = [data{:, 1}];
img_heights = [data{:, 2}];
img_areas = [data{:, 3}];
% class_list = cell(1, length(class));
class_list = repmat({zeros(0,5)},1,5);
for i = 1:size(data, 1)
... |
%Begin in the baseFolder
baseFolder = 'C:\Users\Harry\Desktop\DataSun\2016_06_08'; %change this
roundFolders = dir([baseFolder,'\Round*']);
for i = 1:size(roundFolders)
cd(roundFolders(i).name);
trialFolders = dir([baseFolder,'\',roundFolders(i).name,'\Trial*']);
for j = 1:size(trialFolder... |
function [final_matrix] = similarity_matrix(X, C, normalize, distance_type)
% reconstruction for W input
% matrix = zeros(size(W));
% cluster = unique(C);
% num = 0;
% id = [];
% for i = 1:size(cluster, 1)
% id = [id; find(C == cluster(i))];
% end
% for i = 1:size(matrix, 1)
% matrix(:, i) = W(id(i), id);
% end
... |
% network test code
clear all;
close all;
%% 1. Input Setting
load('network_set.mat');
testImage = imread('TestSet/1.jpg');
testLandmark = load('TestSet/1.mat');
%% 2. Landmark Selection
selectLandmark = [];
rates = [];
patch = zeros(25, 25, 3, 33);
% evaluate inner landmark only
for i = 10:42
network = lm_net{... |
% MRGAF.m
% Fahim Mannan (fmannan@cim.mcgill.ca)
function [Afinal, im1final, im2final] = MRGAF(im1_orig, im2_orig, params)
% Multiresolution Global Affine Flow
nLevels = params.nLevels;
scale = params.scale;
innerloop_threshold = 1e-6;
maxIter = 10;
if(isfield(params, 'InnerLoopThreshold'))
innerloop_threshold = pa... |
function [ Tavg ] = AverageT( test_case )
%AverageT :get the average T without the influence flowing liquid
% generate all the four input channel
% get the average
fid=fopen('case_name','w');
fprintf(fid,test_case);
fclose(fid);
Ttotal=zeros(101);
for i=1:4
channel=GenerateChannel(i);
... |
%%%%%%%%%%%%%%% media del PRNU
clear all; close all; clc;
start_time = cputime;
%% mena prnu
PRNU=load('prnu_Camera1.mat');
PRNUblue=PRNU.prnu(:,:,3);
PRNUgreen=PRNU.prnu(:,:,2);
PRNUred=PRNU.prnu(:,:,1);
PRNUmean=(PRNUblue + PRNUgreen + PRNUred)/3 ;
%% Image reading
img = imread('c1_3.tif');
red = img(:,:,1)... |
function f = smoothcauchy(x)
%SMOOTHCAUCHY Cauchy function.
% F = SMOOTHCAUCHY(X) returns the infinitely differentiable but not
% analytic Cauchy function F = EXP(-X.^(-2)).
%
% See also SMOOTHHUMP, SMOOTHSTEP.
% Author: Oren Livne
% Date : 06/23/2004 Added comments.
f = exp(-x.^(-2));
|
function u = fDeformToU( SDeform, iDir )
% SDeform struct to flow matrix u
% Fixed --- forward field --> Moving
% Moving --- backward field --> Fixed
if(nargin < 2)
% iDir == 1 (forward), iDir == 2 (backward)
iDir = 1;
end
if(~isempty(SDeform(1).dFx))
iSize = size(SDeform(1).dFx);
elseif(~isempty(SDeform(... |
%% Example file for MTEX2prisms
% This script is an example illustrating how EBSD can be converted to a mesh
% suitable for PRISMS-Plasticity. It generates two files:
% - the mesh
% - the tabular file specifying the orientations of each grain, using the
% Rodrigues convention.
%% Load EBSD data
mtexdata copper... |
classdef group < handle
% GROUP - A class to store all subjects (and simulations) for a specific population group
%
%
% Created by Megan Schroeder
% Last Modified 2014-03-28
%% Properties
% Properties for the group class
properties (SetAccess = private)
... |
function data = correct_recordingfilter(x, cutoff)
%%
% Correct filtering artifact by recording system
%
% NOTE that this function assumes that the recording system uses the 4th
% order butterworth filter (0-500Hz) to obtain LFP signals
%
% INPUT: x ... 1D vector LFP
% OUTPUT: data ... corrected LFP
%
% https://github... |
%% Computer Exercises 4 and 5
im1 = imread('cube1.JPG');
im2 = imread('cube2.JPG');
load('P1.mat');
load('P2.mat');
%% 4 - SIFT
[f1 d1] = vl_sift( single(rgb2gray(im1)), 'PeakThresh', 1);
[f2 d2] = vl_sift( single(rgb2gray(im2)), 'PeakThresh', 1);
figure
imagesc(im1)
hold on
vl_plotframe(f1);
[matches ,scores] = vl... |
function [ T,TAU,PI,P ] = TurbinaBaixaTP(T,alpha,CP,f,ETA,gam,P,PI,TAU, T0)
theta0 = T.t0/T0;
thetat = T.t4/T0;
TAU.tL = 1/(TAU.c*theta0)*(theta0*TAU.c*(theta0-1)+thetat)/(thetat+theta0-theta0*TAU.c);
PI.tL=tau2pi(TAU.tL,gam.hot);
% P.t5=P.t45*PI.tL;
PI.t=PI.tL*PI.tH;
TAU.t=TAU.tH*TAU.tL;
T.t5 = TAU.tL*T.t45;
end
|
function [intermediateResult, resultInfo]=do_Job(refDataInfo, commonData, precursor, indicators, x, y, nx, ny, ...
precName, mathIndex, splitResult)
% function [intermediateResult, resultInfo]=do_Job(refDataInfo, commonData, precursor, indicators, x, y, nx, ny, totalCells, ...
% optimizerValues, optimizerCondit... |
function [ out_s ] = Downsample( in_s , step )
% thins out vector field taking every 'step' vector
% won't effect any derivatives....
%
% Inputs:
% - in_s: vector field
% - step: the step to take along the vector field
% Output:
% - out_s: the thinned out vector field
iIn = 1;
iOut = 1;
while iIn <= in_s.N... |
clear all;
%% Part 1: Classical XOR
disp('Inputs x1 and x2');
x1=[-1 -1 1 1];
x2=[-1 1 -1 1];
disp('Target values [t]');
target=[-1 1 1 -1]
disp('Threshold and learning rate values');
learning_rate=0.1
threshold=0.001
zk=[0 0 0 0];
deltaJ=0;
itr=1;
flag=0;
disp('Randomly Initial Weight Values');... |
%Image retrieval function
image_foldername='data';%'chen1000';
%Assuming for result calculations that the query image is from the folder
queryimage_number =1;
queryimage_name =strcat('sample_',int2str(queryimage_number),'.jpg');
%extract names of image files
filenames=dir(fullfile(image_foldername,'*.jpg'));
filename... |
% Erzeuge beispielhafte Roboter mit Struktursynthese, die Beinketten
% mit freien alpha- und theta-Parameter enthalten
% Ketten zum Testen:
% * S5RRRRR10V1 - Delta-Roboter (P3RRPRR10V1G2P2A1) - ein Parameter (alpha2)
% * S5PRRRR8V1 - ein Parameter (theta1)
% * S5PRRRR8 - zwei Parameter (theta1,alpha2)
% * S5RRRRR12 - ... |
clc;
clear all;
x='F:\2Cannon_ERP\2CannonERP_20150903\data\ERPdata\avgf\200ms_lvbo100\200group'
y='F:\2Cannon_ERP\2CannonERP_20150903\data\ERPdata\avgf\200ms_lvbo100\'
% cd(x)
files = dir(x);
for i = 3:length(files)
[signal]=loadavg([x,'\',files(i).name]);
%21-FZ,20-FCZ,15-CZ,14-CPZ,4-PZ
%21-FZ
data(5*(i-3)+3).... |
function [eigVec,R,V,H,covErr]=getSystemMatricesSampled(nodeCoordAll,devAll,...
sigmaMes,nu,iMnp,nBasis)
% All outputs vectors and matrices correspond to the key points given as
% input in iMnp
%
% nodeCoordAll = n x 3 matrix of point coordinates in the same order as defined
% in the domain of the part
% devAll... |
close all; clear all; clc
%% Data
Muo=10; %cp
phi=0.20;
k=@(x)((1.5*x+100))/10*(x<100)+((-1.4*x+390))/10*(x>=100 && x<=200); %md
L=200; %ft
Nx=10;
prd_x=7;
Pi=3500; %psi
Ct=20e-6; %psi^-1
A=500; %ft^2
Swi=0;%0.25;
Bo_0=1;
h=sqrt(A);
dy=sqrt(A);
%% calculated parameters
Max_days=100; %days
dt=0.05; %da... |
% function to get adjacency matrix from edge data
function ret=get_adj()
|
%% Initialize
tmp = matlab.desktop.editor.getActive;
cd(fileparts(tmp.Filename));
%% Define variables
syms p1 p2 p3 dp1 dp2 dp3 ddp1 ddp2 ddp3 q0 q1 q2 q3 o1 o2 o3 real
syms u u1 u2 u3 u4 T1 T2 T3 T4 real
syms m l jx jy jz gravity km1 km2 km3 km4 k1 k2 k3 k4 real
syms R r11 r12 r13 r21 r22 r23 r31 r32 r33 real
... |
% Nom du fichier d'output a analyser
repertoireOut = 'application1';
filename = 'RK2';
repertoireExe = './'; % Chemin d'acces au code compile (NB: enlever le ./ sous Windows)
executable = 'Exercice2'; % Nom de l'executable (NB: ajouter .exe sous Windows)
input = 'configuration.in'; % Nom du fichier d'entree de base
%%... |
function color_rgb = moccasin
color_rgb = {'color', [1.0, 0.89411, 0.7098]};
end |
function rate=omega_r(a,k)
rate=k.wr*a/(a+k.theta_r);
end |
% TNM034 - ADVANCED IMAGE PROCESSING
% Isabell Jansson isaja187
% Ronja Grosz rongr946
% Christoffer Engelbrektsson chren574
% Jens Jakobsson jenja698
% 2015-12-11
%------------------------------------
function EyeRegion = FindEyeRegion( FaceRegion, im )
%Detect the eyes in the im... |
% 数字带通滤波器
% 通频带 0.25~0.45p 通带最大衰减为3db
% 阻带: < 0.15p || > 0.55p 阻带最小衰减为15db
% 使用butterworth和ellip模拟低通滤波器
clear;
clc;
clf;
rp = 3;
rs = 15;
wp1 = 0.25*pi;% ---ws1---wp1---wp2---ws2
wp2 = 0.45*pi;
ws1 = 0.15*pi;
ws2 = 0.55*pi;
T = 0.001;
wp1 = wp1/T; % 脉冲响应不变法转换
wp2 = wp2/T;
ws1 = ws1/T;
ws2 = ws2/T;
wp = [wp1, wp2];... |
%% Script to make parcels from a dataset
% First get a cell array with the full path to each individual subject file
PROJECT_DIR = '/Users/tlscott/make_parcels/';
FILENAMES = {};
for i = 1:20
FILENAMES{i} = [PROJECT_DIR 'data/NWR_4-1syl/s' num2str(i) '_zstat1.nii.gz'];
end
options = struct( ...
'SET_FREESURFE... |
% function [Data, Frame_ind]=HL_DLCUtil_readCSV(csv_fn)
% function to read in output files from DLC analyze videos (.csv files)
%
% INPUT:
% csv_fn: .csv file fullpath
% OUTPUT:
% Data: -struct with subfields as the object names
% .(part_name).x, .y, .Likelihood
% Frame_ind: frame index of the movie/video... |
function [MATRIX,LOAD] = chopOff(MATRIX,LOAD)
disp("Chopping Off Data");
% % Early Data Set
% MATRIX([26961:end],:) = [];
% LOAD([26961: end]) = [];
% Later Data Set
MATRIX(1:27129,:) = [];
LOAD(1:27129) = [];
MATRIX(39267,:) = [];
LOAD(39267,:) = [];
end
|
function dataroot = getDataRoot
dataroot = 'data';
|
function shiftedOperator = shiftOperator(operatorVector)
%Shifts a symmetric operator by half its length so that middle -> front.
%
%Given an operator vector, this function shifts it so that all values are
%"rotated" through, causing the middle element to become the first, and the
%second element to become the las... |
function [y,isterm,dir ] = option_fun_ish_mean_on(t,x)
% event function for isham model occurs if mean exceed
% set value - event is shown by change in y value from y=-1 to y=1.
%set global variables
global phi alpha mu_M p r u1 tu MT VT T_start
dx_m=@(t,x)isham(t,x);
% if treatment has not just ended
if t>... |
function [Subject_name, Subject_Path, WM_mask_absolute_path, Art_Mask, Vein_Mask, After_CTC_mat, DCECoregP, Brain_Extract_path] = ReadRealData()
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
Subject_name = 'PeNe';
%Subject_Path = '\\fmri-t9\users\Moran\Stereotactic_... |
clc; clear all; close all;
x=input('Enter output, for 1x enter, [1 0], i:');
y=input('Enter input, for 2x+5 enter, [2 5], j:');
G=tf(i,j);
subplot(2,1,1)
%frequency response
bode(G) %linearSystemAnalyzer('bode',G)
subplot(2,1,2)
nyquist(G) %linearSystemAnalyzer('nyquist',G)
|
% **************************************************************
% pkRC7_run.m runs a single estimation with variations in simulation
% Output is rendered by pkRC_output.m
% **************************************************************
clear
tic
input.repetitions = 10;
input.fn = 'test.xls';
input.marketdraws ... |
function model_TREE = trainTREE(Xtrain,Ytrain)
model_TREE = treefit(Xtrain,Ytrain,'method','regression');
% Uncomment this if you want to perform xval pruning ...
[c,s,nn,best] = treetest(model_TREE,'cross',Xtrain,Ytrain);
model_TREE = treeprune(model_TREE,'level',best);
|
function [PeakLocations,PeakWidths]=GetResolution(obj,x,y)
% [~,InterpolatedBackground,~]=BackgroundSubtractPlot(obj,x,y);
% y=y-InterpolatedBackground;
[~,PeakLocations,~,PeakWidths,~]=obj.TryFit(x,y,length(obj.KnownWavelengthLines),0,20,'FitSpeed','Slow');
figure
u=plot(PeakLocations,PeakWidths,'k');
u.Marker='... |
function Gs = lp_trfia(freq,A,B,C,D,E)
%
% Computes the transfer function for systems
% .
% E*x = A*x + B*u
% y = C*x + D*u
%
% on the imaginary axis (more precisely, on the points
% sqrt(-1)*freq(i), where i = 1,...,length(freq) ). This routine can only
% be applied to systems, where th... |
%test side2side
clear;
n = 50;
dens = 1;
wiggle = 0.1;
ratio = 1; % length / width of shoal
C = zeros(2,n);
V = C;
figure(1)
set(1,'NextPlot','ReplaceChildren','color',[0.9 0.9 0.9],'position',...
[1 31 1024 662], 'DoubleBuffer','on')
axis ([-20 20 -20 20])
shape = [dens ratio];
[C,V,state] = burst(C,V,'init');
... |
function [hRect,api] = imrectLite( hParent, pos, lims, ar, varargin )
% A 'lite' version of imrect [OBSOLETE: use imrectRot].
%
% There are significant problems using imrect in a larger GUI, mostly
% due to the fact that imrect is such a heavy object. This creates a
% simple, fast, and in some ways nicer version of im... |
function parse_rangefinder( message )
%PARSE_ODOMETRY Parses odometry message and store data on
%ME.odometry matrix.
% Converts binary variables to MATLAB doubles an stores them.
global ME
measurements = zeros(1,16);
for k=1:16
measurements(k) = double(typecast(uint8(message(k*2-1:k*2)), 'uint16'));
% Dis... |
function popSize=dnf_calcLogGrowth(params,t)
%QUESTION 2 SECTION H
%the function calculates population size to a given population in during
%different time points. The data for each population is given in the "params" struct.
%Inputs: params - contains the data for each population. The struct has
% con... |
function [MATRIX] = Pz(dist)
MATRIX = [
1 0 0 0;
0 1 0 0;
0 0 1 dist;
0 0 0 1;
];
end |
function X = center_data(X,dim)
% subtract mean of either rows or columns, for dim=1 or dim=2,
% respectively
if dim == 1
X = X - repmat(mean(X,2),1,size(X,2));
elseif dim == 2
X = X - repmat(mean(X,1),size(X,1),1);
else
error('Unexpected dim');
end |
tic
readMNIST;
treeNum = 3;
treeSet = cell(1, treeNum);
for index = 1:treeNum
treeSet{index} = BuildTree(allTrainSet, 3, 0.01, 10);
['tree ' num2str(index) ' train complete']
end
% treeArray = BuildTree(allTrainSet, 3, 0.01, 10);
right = 1;
wrong = 1;
for loop = 1:200
num = ceil(rand() * 10);
index = ... |
function y = EvaluadorFourierPeriodoArbitrario(funcA,vectorX,terminoN,error)
m = length(vectorX);
y = size(vectorX);
ak=m;
bk=m;
T=vectorX(length(vectorX))-vectorX(1);
for i=1:m
sum=0;
for k=1:terminoN
integrandoAk=@(x) funcA(x) .* cos((2*pi*k*x)/T);
integrandoBk=@(x) funcA(x) ... |
%test01
%vertical line test (no error)
close all
clear
clc
diary 'test_results'
diary ON
% import basic test data
linearDataSetGenerator;
xvals = x_2; %change these to change test data
yvals = y_0to10;
%plot raw data
plot(xvals, yvals, 'rx'); %mark all true data values with red x
%plot our line approximation
er... |
%% README
% This function is used during the analysis of RATA data for the mechanical
% test rig with soft-tissue impemented on the body segments as well as for
% RATA data from human subject testing. This function takes the output of
% importData_fxn.m as one of its inputs.
% Another input is a 1xn vector
%con... |
% load settings
% setting_up;
skip_coding = 0;
% total spatial bins
dimFea = size(feature1,1);
tBins = sum(pyramid);
dimFeaUnit = dimFea/tBins;
warning off;
mkdir(DIST_DIR);
warning on;
fprintf('Compute the distances of ISPM codes of the meshes... \n');
% spatial levels
pLevels ... |
function u_est = CG_MultiScale_LAP(I1, I2, Level_Num, Nf)
% The function implements a multi-scale framework for the LAP optical flow
% algorithm. Instead of downsampling the images, the framework changes the
% size of the all-pass filters used in the LAP algorithm. The filter basis
% used in the LAP algorithm spans t... |
global VarCheckPrg ScalingFactor
SP_main();
|
clc;
clear all;
num = 40;
x = rand(num,num);
[gx, gy] = gradient_xy(x);
s = [-gx(:)';-gy(:)';ones(1,num*num)];
z = reconstructDepthMap_adapted(s, [num,num]);
tx = reshape(z,[num,num]);
[gxx, gyy] = gradient_xy(tx);
tx = gx - gxx;
ty = gy - gyy;
cccc =0; |
function [Uq, Sq, Vq] = qsvds(Q, k)
% convert the quaternion matrix into an equivalent complex matrix
A = qua2com2(Q);
% do SVD of the complex matrix A
[Uc, Sc, Vc] = svds(A,k*2);
% get half singular values of the diagonal
if(size(Sc,1)>size(Sc,2))
Sq = sum(Sc,1);
else
Sq = sum(Sc,2);
end
Sq = Sq(... |
function [output] = conv_layer_forward(input, layer, param)
% Conv layer forward
% input: struct with input data
% layer: convolution layer struct
% param: weights for the convolution layer
% output:
h_in = input.height;
w_in = input.width;
c = input.channel;
batch_size = input.batch_size;
k = layer.k;
pad = layer.p... |
function PDF_Check_PDFmatrix(aTheta, aPhi)
load('osn_pdf_output.mat');
oy = [0 1 0];
oz = [0 0 1];
sectorWidth = 1 / 180 * pi;
aSectors = sectorWidth:sectorWidth:pi/2;
v = [0 0 0];
for k = 1:length(aTheta)
[v(1), v(2), v(3)] = Sph2Cart(1,aTheta(k),aPhi(k));
alfa = acos(dot(oz, v)/norm(v));
beta = ac... |
%% Fonction phi
clear all ; close all ;
phi_num = [9590];
phi_denum = [1 31.3 -1780 -5.57e4];
FCT_phi = tf(phi_num,phi_denum);
% spécifications du client
MP = 5;
Ts = 0.03;
Tp = 0.025;
Tm_10_90 = 0.02;
Err_echelon = 0;
temps = linspace(0,0.4,100000)';
echelon = ones(size(temps));
% Traduction en terme d'ingénierie
... |
figure1 = figure;
colormap(jet);
% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');
% Create mesh
% mesh(y,x,RL1k,'Parent',axes1);
mesh(y,x,RL2k,'Parent',axes1);
% Create zlabel
zlabel('Resitance($\Omega$)','FontSize',15,'Interpreter','latex');
% Create ylabel
ylabel({'Normalized Frequen... |
%% Math 566 (Fall 2014)
%% Network from AMO Figure 7.21(a), page 243
data = [1 1 2 3
2 1 3 3
3 1 4 2
4 2 5 4
5 3 4 1
6 3 6 2
7 4 2 1
8 4 6 2
9 5 4 1
10 5 6 1
];
T=data(:,2);
H=data(:,3);
C=data(:,4);
m=length(T); #edge
n=max(max(T), max(H)); #node
function adqueue = ADqueue (data)
T=... |
% ASR NODES 2020
% The non-linear mid-point method
% SOLVES y'(x)=q(x,y)
% g(y(a),g(b)) = 0
%Ex 6
%EOC
format long;
close all;
clear all;
Nf = 800;
Kn=[0.068, 0.5];
[x1f, y11f, y12f, y13f, y14f] = ass2(Nf,Kn(1));
[x2f, y21f, y22f, y23f, y24f] = ass2(Nf,Kn(2));
mesh = [25,50,100,200,400]';
ratio =2... |
% BENG420/520
% Homework #4 - apply ANN on cancer gene expression classification
% Data is from [Phan et al., Nature, 2001]
% qwei
% 4/1/2020
clear all
close all
% load data
load h4_data.mat
% YOU: convert class labels properly to Matlab format
%Encode label vectors
train_y = encode(tumortypeTrain);
test_y = encode... |
clc; clear all; close all
% Generate Training data
x = exam4q1_generateData(1000);
% Split in to 10 folds
data_f = zeros(10, size(x,2)/10);
labels_f = zeros(10, size(x,2)/10);
for k = 1:10
data_f(k, :) = x(1, (100*(k-1)+1):100*k);
labels_f(k, :) = x(2, (100*(k-1)+1):100*k);
end
% We will test N percep... |
function value=getTrigger(object)
communicate(object);
fwrite(object.VISA,'TRIGGER:EDGE:SOURCE?');
value.Source=strtrim(fscanf(object.VISA));
fwrite(object.VISA,'TRIGGER:EDGE:SLOPE?');
value.Slope=strtrim(fscanf(object.VISA));
command=sprintf('TRIGGER:LEVEL? %s',value.Source);
fwrite(object.VISA,command);
temp=strt... |
%% Power at radar example
% Created by: Lee A. Harrison
% On: 7/2/2018
%
% Copyright (C) 2019 Artech House (artech@artechhouse.com)
% This file is part of Introduction to Radar Using Python and MATLAB
% and can not be copied and/or distributed without the express permission of Artech House.
clear, clc
% Peak transmit... |
clear
close
clc
rho=1000; %kg/m^3
g=9.81; %m/s^2
Delta_Z=0.3; %z2-z1 in m
Import_Red_1250
%Convert to SI for calculations
QB=GPM*6.309e-5; %convert GPM to m^3/s
P1=P1*6894.76; %psi to Pa
P2=P2*6894.76; %psi to Pa
Torque = Torque * 1.35581795 + 8.83 ; %ft*lbs to Nm + calibration
w=RPM*2*pi/60; %RPM to rad/s
for i=1:... |
[ nombre, ruta ] = uigetfile( '*.bmp', 'Abrir' );
imagen = imread( [ ruta, nombre ] );
figure;
imshow( imagen );
[ n, m ] = size( imagen );
[ nombreTxt, rutaTxt ] = uigetfile( '*.txt', 'Abrir' );
texto = fopen( strcat( rutaTxt, nombreTxt ) );
caracteres8Bits = fread( texto, '*uint8' );
longuitudTexto = length( caracter... |
function varargout = DlgComLless(varargin)
% CLLESS MATLAB code for CLless.fig
% CLLESS, by itself, creates a new CLLESS or raises the existing
% singleton*.
%
% H = CLLESS returns the handle to a new CLLESS or the handle to
% the existing singleton*.
%
% CLLESS('CALLBACK',hObject,eventData,han... |
function h = plot_cf(pose)
pqr = pose(1:3);
R = pqr2R(pqr);
origin = [0,0,0]';
x = R*[1,0,0]';
y = R*[0,0,-1]';
z = R*[0,1,0]';
cx = origin + x; % new vector c = origin ~ xyz
cy = origin + y;
cz = origin + z;
starts = [pose(1) pose(2) pose(3);
pose(1) pose(2... |
clc, clear all
S{1} = reshape(1:100,10,10);
S{2} = -reshape(1:100,10,10);
sigmaS = [1 2];
F = [2,2,1; 4.9,4.9,2; 2,8,1];
cellOffsets = [0 0; 0 1];
type = 'gaussian';
sigmaFactor = [1/3 1/3];
r = [1 1];
[X,W] = scaleSpaceRegions(S,sigmaS,F,cellOffsets,type,sigmaFactor,r) |
function [ analysis ] = inspect_experience()
data = load('../kesh/experiments/all.mat','xids');
xids = data.xids;
clear data;
for x=1:2
for g=1:4
for s=1:9
try
gamedata = xids{x}.game{g}.subj{s};
states = gamedata.state;
... |
function [ nn ]= neuralNet_get_nnSuperSet(refData)
nn = refData.nnSuperSet;
end
|
%% PlateLoader Class
% Matlab Colony Analyzer Toolkit
% Gordon Bean, May 2013
%
% This object is used to load plate images. It can be extended to create
% custom image-loading functionality.
%
% Syntax
% PL = PlateLoader();
% PL = PlateLoader('Name', Value, ...);
% plate = PL(img);
% plate = PL.load(img);
% plate = Pla... |
y=@(x)x.*exp(-x);
yf=quadgk(y,0,inf) |
function [fr] = dense(im, dx, dy)
%--------------------------------------------------------------------------
%
% Copyright (c) 2014 Jeffrey Byrne
%
%--------------------------------------------------------------------------
[U,V] = meshgrid(dx:dx:size(im,2)-dx, dy:dy:size(im,1)-dy);
fr = [V(:) U(:)]';
fr = [fr; ones(... |
function runPileSimInMapLooNorm_SL29subFSLcleaned(nsb,dirT,nFiles,areaM,dirL,nameSL,sizeL,isPC)
runN = 'pSimM1';%2;
% path definitions:
rsa_tool_path = 'rsatoolbox';
if isPC==0
based = '/home/smark/fMRI_ana';
spm_path = '/data/smark/spm';
data_path = '/data/smark/fmri_sub_preproc_dir/';
cleaned_data_pa... |
function myeb(Y,S,options)
%
% myeb(Y,S,options);
%
% This function makes nice coloured, shaded error bars. Exactly what
% it does depends on Y, and on whether you give it one or two inputs.
%
% If you only pass it Y, and no other arguments, it assumed you're
% giving it raw data.
%
% myeb(Raw_Data)
%
% .... |
%Spectra viewer
function y= Spectra_viewer(spec_l,spec_r,Snd_Azi_Ele)
if nargin <3
fprint('input the locations')
return;
end
if size(spec_l)~=size(spec_r)
fprint('left and right impulse need to be same size')
return;
end
Fs=48828.125;
fig=figure;
subplot(3,1,1)
plot(Snd_Azi_Ele(:... |
function out=img2gray(img,t1,t2)
[M,N]=size(img);
out=zeros(M,N);
for m=1:M
for n=1:N
if img(m,n)<t1
out(m,n)=0;
else
if( img(m,n)>t1 && img(m,n)<t2)
out(m,n)=127;
else
out(m,n)=255;
end
... |
% Feedback Particle Filter (FPF)
|
function [PKS,LOCSE] = fourier1(n,dt, vector)
v_fft = fft(vector);
v_fftplot = abs(v_fft);
sampling_period = dt;
sampling_freq = 1/sampling_period;
xt = 0:sampling_freq/(length(vector)):sampling_freq-sampling_freq/(length(vector));
%xt = sampling_freq/(length(vector)):sampling_freq/(length(vector)):sampling_freq;... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2012 Analog Devices, Inc.
%
% 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:/... |
function [ Upsilon ] = compute_projected_entropy_R2( uh, varargin )
%UNTITLED8 Summary of this function goes here
% Detailed explanation goes here
projection_time = 1;
projected_pg = compute_pg_projection_R2(uh, projection_time, varargin{:});
Upsilon = compute_pg_entropy(projected_pg);
% Upsilon = compute_kl_div(proj... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.