text stringlengths 8 6.12M |
|---|
function rgb = gold
rgb = [1.0, 0.84313, 0.0];
end |
% File Example3_14.m for Example 3-14
clear;
clf
r = input('Enter value of r between 0.01 and 1:');
fo = 1;
B = fo*(1+r);
fl = B*(1-r)/(1+r);
fd = (B-fl)/2;
df = B/50;
% Evaluate and Plot the Frequency Response using Eq (3-69)
f = 0:df:B;
a = zeros(length(f),1);
window = a;
b = a;
window = PULSE(window,f,fl,B);
for... |
%Katelyn Charbonneau
%CPE490 Software Defined Radio Homework 01 Problem 4
clear
clc
format compact
%Generate x and y axes
x = linspace(-10,10,100);
y = linspace(-10,10,100);
[X, Y] = meshgrid(x,y);
f = sinc(X.^2+Y.^2);
%Mesh plot
figure(1)
mesh(X,Y,f)
%Surface plot
figure(2)
surf(X,Y,f)
%The Mesh command plots a... |
function edges = meshEdges(faces, varargin)
%MESHEDGES Computes array of edge vertex indices from face array.
%
% EDGES = meshEdges(FACES);
%
% Example
% meshEdges
%
% See also
% meshes3d, meshEdgeFaces, meshFaceEdges
% ------
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Crea... |
function linearODESSEP2X4Inact1factor(T,I)
global k1 k2 k3 k4 k5 k6 L1 L2 L3 L4 L5 L6 W1 W2 H0 H11 H5 kd1 ks1 H3 H4 g1 g2 E1 E2 r1 r2 r3 v1 v2 v3 rho1 rho2 rho3 gamma1 gamma2 gamma3 delta epsilon mu A J V Acell p0 err Q;
%#codegen
generatorMatrixP2X4Inact1factor();
Nt=length(T);
for i=1:Nt
p0=p0*expm(Q*T(i... |
% Script opens a series of stacks for particle analysis
% Aim is to test the binarisation parameters for particle recognition
% (aps_2-bm_2016_08 experiments).
% Uses DIPImage library to recognize particles and return number of
% recognized particles and a vector of particle sizes.
% number of particles is a vector o... |
function segmentAndTrackMP_spmd(D,doSegment,doTrack)
%SEGMENTANDTRACKMP_SPMD.
%2016-10-29. Segments and tracks cells for the dataset with directory
%structure D (obtained from either getDirsMP or getDirsMP_SSD),
%using PARFOR and SPMD from the Parallel Computing Toolbox.
totTic = tic;
%Get the orientation o... |
compare()
function input_binary = convert_to_bin(input_sequence)
input_binary = '';
for i = 1 : length(input_sequence)
if input_sequence(i) == 'A' || input_sequence(i) == 'T'
input_binary = strcat(input_binary,'0');
elseif input_sequence(i) == 'G' || input_sequence(i) == 'C'
inp... |
%% -*- matlab -*-
function b0r = bkm_b0r(data,S);
[D,N] = size(data);
std_dist = sqrt(trace(S));
% [s,indices] = sort(rand(1,N));
% dists = [];
% for i=1:ceil(N*0.1)
% index = indices(i);
% diff = data(:,[1:index-1 index+1:N]) - data(:,index)*ones(1,N-1);
% dists = [dists sqrt(sum(diff.*diff,1))];
% end
% sor... |
function bamp_behav_model_evidence(options)
%IN
% options
% Function saves model selection results
subjects = [options.controls options.antisocial,...
options.psychopathy];
[models_bamp] = loadBAMPModelEvidence(options,subjects);
[bamp_model_posterior,bamp_xp, bamp_pr... |
y=groundTruth;
n=length(groundTruth);
y=-ones(n,1);
k=1;
y(groundTruth==k)=1;
kernel{1}=getKernel('gaussianAlignment',100);
kernel{2}=getKernel('gaussianAlignment',10);
K=calculateKernel(trajectoriesArray,kernel);
weights1=getWeightsMKL(K,y,'QuiLane2009');
weights2=getWeightsMKL(K,y,'Lanckriet2004a');
weights3=... |
function denoised = NeighShrinkSUREdenoise(noisy, sigma, wtype, L)
% Denoise using NeighShrink SURE (DWT)
%
% noisy: the noisy image to be denoised
% sigma: noise level
% wtype: wavelet type
% L: the number of wavelet decomposition level
% denoised: the denoised image to be returned
%
% Author: Zhou Dengwen
%... |
function [u, mean_resp] = SQ_exp(rho, d, N, lam)
%
if ~exist('N','var')
N=200;
end
if ~exist('lam','var')
lam=rho;
end
u=zeros(1,N);
u(1)=1; u(2)=rho;
for k=2:N-1
u(k+1)=rho^((d^k-1)/(d-1));
end
if lam < 10^(-8)
mean_resp=1;
else
mean_resp=(1/lam)*(sum(u(2:end)));
end
end |
%Program for Peak Signal to Noise Ratio Calculation
%Author : Athi Narayanan S
%M.E, Embedded Systems,
%K.S.R College of Engineering
%Erode, Tamil Nadu, India.
%http://sites.google.com/site/athisnarayanan/
%s_athi1983@yahoo.co.in
function val = psnr(origImg, distImg, max)
origImg = double(origImg);
distI... |
%% marcus Parameters
% Weights
ml = 0.280; % [kg]
m1 = 0.3792; % [kg]
m2 = 0.1739; % [kg]
mw = 0.158; % [kg]
m = ml + m1 + m2 + mw; % [kg] (eq. 24)
% Distances
l1 = 0.1995; % [m]
l2 = 0.1743; % [m]
lw = 0.090; % [m]
h = 0.0298; % [m]
lc = (m1*(l1-l2)+m1*l1-m2*l2-mw*lw)/m; % [m] (eq. 27)
% Inertial parameters
g = 9... |
name= {'Aluminum', 'Copper', 'Iron', 'Molybdenum', 'Colbalt', 'Vanadium'}';
symbol= char('Al', 'Cu', 'Fe', 'Mo', 'Co', 'V');
number= [13, 29, 26, 42, 27, 23]';
weight= [26.98, 63.55, 55.85, 95.94, 58.93, 50.94]';
density= [2.71, 8.94, 7.87, 10.22, 8.9, 6.0]';
structure=char('FCC', 'FCC', 'BCC', 'FBC', 'HCP', 'BCC');
%... |
%plot the neural network training result
close all;
clc;
clear;
set(0,'DefaultTextInterpreter','none');
% enter the file path to ###########################
file_path = '###########################\alexnet_train.log';
fid = fopen(file_path, 'r');
[filepath,name,ext] = fileparts(file_path);
tline = fgetl(fi... |
numClasses = 2;
A_works = [0 1 1 0 0 0; 1 0 1 0 0 0; 1 1 0 0 0 0; ...
0 0 0 0 1 1; 0 0 0 1 0 1; 0 0 0 1 1 0];
A_fails = [0 1 1 0 0 0; 1 0 1 0 0 0; 1 1 0 0 0 1; ...
0 0 0 0 1 1; 0 0 0 1 0 1; 0 0 1 1 1 0];
A = A_fails;
xy = [0 2; 1 2; 0.5 1; ...
0 -2; 1 -2; 0.5 -1];
colorStr = {'b','r','g',... |
% script to set up common properties for panels
set(gca,'Xtick',0:6:48,'Fontsize',16)
set(gca,'FontName','Arial')
xlabel('Time (h)')
% semi-transparent rectangles during dark cycles
rectangle('Position',[12 0 12 100],'FaceColor',[.5 .5 .5 .2])
rectangle('Position',[36 0 12 100],'FaceColor',[.5 .5 .5 .2])
% set line ap... |
function [Gk,T,K]=kalmdec(G)
G=ss(G); A=G.a; B=G.b; C=G.c;
[Ac,Bc,Cc,Tc,Kc]=ctrbf(A,B,C);
nc=rank(ctrb(A,B),eps*100);
n=length(A); ic=n-nc+1:n;
[Ao1,Bo1,Co1,To1,Ko1]=...
obsvf(Ac(ic,ic),Bc(ic),Cc(ic));
if nc<n, inc=1:n-nc;
[Ao2,Bo2,Co2,To2,Ko2]=...
obsvf(Ac(inc,inc),Bc(inc),Cc(inc));
end
[m1,... |
function figure3_YS
%% Plots for figure3. Gal80p and Mig1p deleteions
number = {'01' '02' '03' '04' '05' '06' '07' '08' '09' '10' '11' '12'};
well = {'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H'};
for i = 1:8
for j = 1:12
map{i,j} = [well{i} number{j}];
end
end
th_const = 2.5;
off_peak = 2;
ga... |
function [error] = check_pedigree(pedigree_info)
error = 0;
[nrows ncols] = size(pedigree_info);
if( nrows <= 0 )
disp('empty pedigree data');
error = 1;
return;
end
if( ncols < 7 )
disp('wrong pedigree data format, require at least 7 columns');
error = 1;
return;
end
error = check_integer... |
figure
[U,S,V] = svd(XDAT,0);
stairs(cumsum(diag(S))/sum(diag(S)));
figure
for i=1:10
subplot(2,5,i)
ximg = reshape(U(:,i),n,n);
surf(X,Y,Z,real(ximg),'EdgeColor','none');
view(10,32)
colormap jet;
axis equal
axis off
drawnow
end
set(gcf,'Position',[100 100 1440 450]) |
close all
% fileNames = {'H:\21-10-21_MouseExp\211021_00','H:\21-10-22_MouseExp\211022_00','H:\21-11-01_MouseExp\211101_00','H:\21-11-09_MouseExp\211109_00','H:\21-11-12_MouseExp\211112_00','H:\21-11-16_MouseExp\211116_00','H:\21-11-17_MouseExp\211117_00','H:\21-11-19_MouseExp\211119_00','H:\21-12-03_MouseExp\211203_0... |
syms x y z v
format long g
%%%%%% Analysis of accuracy of computer computation
% main function z
z = ((x) + (cos(y)/3))/((y^2) - (sin(y)/2));
% using functions of error propagation
% that are used to check if my
% calculations by hand are correct
Tx=x/z*diff(z,x);
Ty=y/z*diff(z,y);
zsin=subs(z,sin(y... |
clc, clear all
go = load('results/optimize/inriaParametersGo');
% SVM arguments
% -c cost of C-SVC (default 1)
% -p epsilon (default 0.1)
svmArgs = struct('s',1,'logc',-2,'p',0.1);
method = modifyDescriptor(go.method,'gridType','square window','gridSize',2.5);
data = inriaData;
diaryFile = ['inriaParametersCompact1... |
function F = Ali59MFunctions
F.ShowSaliencyPoints = @ShowSaliencyPoints;
F.CropWithVideoSaliency = @CropWithVideoSaliency;
F.CalculateMeanSaliency = @CalculateMeanSaliency;
F.CreateFlow = @CreateFlow;
end
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function [leaflet valve] = initialize_leaflet_bead_slip(name, ...
N, ...
reflect_x, ...
... |
function mutMatrix2ARM(file_path, pname)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
input_txt = strcat(file_path, pname, '_mutMatrix.txt');
data = csvread(input_txt);
data_2 = data; % if data is not bool, transform to bool (data_2)
% data_2(data_2<=5)=0;
% data_2(data_2>5)=... |
function trans = createLineReflection(line)
%CREATELINEREFLECTION Create the the 3x3 matrix of a line reflection.
%
% TRANS = createLineReflection(LINE);
% where line is given as [x0 y0 dx dy], return the affine tansform
% corresponding to the desired line reflection
%
%
% See also
% lines2d, transf... |
function updateatindex
%UPDATEATINDEX - Updates the AT indices in the MiddleLayer with the present AT lattice (THERING)
global THERING
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Append Accelerator Toolbox information %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Since changes in the AT model could change the AT... |
%% Preiskus Otsujeve metode (Otsu-jeve metode)
I = imread('phone.jpg');
P = double(I(:));
H = hist(P, 256);
I_otsu = im2bw(I);
figure(1);
subplot(1, 3, 1);
imshow(I); axis equal; axis tight; colormap gray;
subplot(1, 3, 2);
bar(H, 'b');
subplot(1, 3, 3);
imshow(I_otsu);
% Otsu-jeva metoda deluje dob... |
function [S, coord, metric, name] = gara(Ns,MCperGlom,name_list,sim,range)
% read raw pattern
name_list = strrep(name_list,' ','#');
rem = name_list;
[token, rem] = strtok(rem,'#');
temp = get_odor(token);
odor = zeros(Ns,size(temp,1),size(temp,2));
odor(1,:,:) = temp;
i = ... |
classdef esp3_cl < handle
properties
main_figure = [];
layers = layer_cl.empty();
current_layer_id = '';
app_path = app_path_create();
process = process_cl.empty();
curr_disp = curr_state_disp_cl();
... |
% M = MATCHIMAGES(I1,I2, match_thresh, show_keypoints, show_descriptors)
%
% Matches keypoints in images I1 and I2 using the SIFT descriptors.
% Uses vl_sift and others from the vl_feat library (http://www.vlfeat.org).
% Corners are detected using the harris corner detector.
%
% Parameters are:
% I1 ... |
function [vals] = scale_fcv_colorbar(data)
high_val = max(data(:));
low_val = min(data(:));
down = floor(low_val) + floor( (low_val-floor(low_val))/0.25) * 0.25;
up = floor(high_val) + ceil( (high_val-floor(high_val))/0.25) * 0.25;
if up/down ~= -1.5
up = down*-1.5;
end
... |
function varargout = drawPolyhedra(varargin)
%DRAWPOLYHEDRA draw polyhedra defined by vertices and faces.
%
% DEPRECATED: use drawPolyhedron instead.
%
% drawPolyhedra(NODES, FACES)
% Draw the polyhedra defined by vertices NODES and the faces FACES.
% NODES is a [NNx3] array containing coordinates of ve... |
function [ angle velocity ] = computeAngleVelocity( p1, p2 )
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
initial = p2 - p1;
angle = initial(2,:) ./ initial(3,:);
velocity = initial(2:3,:);
% sections_all = ;
end
|
function [mu_f, std_f] = gpr_covMaterniso_grid_predict_multi(xstars, logtheta, xgrid, ygrid, alpha)
%Fast version of GP prediction ALL points lie on a grid (with G grid points per dim)
%This version also attempts to do everything in linear memory complexity
%NOTE: Only works with axis-aligned covariance functions ... |
function [ mel_f ] = hz2mel( hz_f )
%[ mel_f ] = hz2mel( hz_f )
% Converts frequency in Hz to frequency in mel
mel_f = 2595*log10(1 + (hz_f./700)); % Hz scale to mel scale.
end
|
function z = getZ(formula,k,n)
if strcmp(formula,'True') || strcmp(formula,' True')
z = 1;
return
end
global Z;
if isnumeric(formula)
formula = strcat('[ ', num2str(formula), ']');
end
formula = num2str(formula);
i = find(strcmp([Z{:}],formula));
if isempty(i)
%create new sdpvar if not created be... |
function [result] = ZDT12(x)
%ZDT12
gx = g(x);
result = gx*( 1-sqrt(x(1)/gx) );
end
function result = g(x)
n= length(x);
result = 1+9*sum(x(2:n))/(n-1);
end |
function IndividualROI = y_CheckIndividualROI(ROIDef, iSub, Flags)
% function IndividualROI = y_CheckIndividualROI(ROIDef, iSub, Flags)
% Check and get Individual ROI
% Input:
% ROIDef - ROIDef, any .txt definition would be checked
% Flags - can be: 'Seed_Time_Course_List:'; 'Seed_ROI_List:'; 'Covariable... |
function obj = meas(varargin)
% Constructor for meas class object.
% You must always pass one argument if you want to create a new object.
if nargin==0 % Used when objects are loaded from disk
obj = init_fields;
obj = class(obj, 'meas');
return;
end
firstArg = varargin{1};
if isa(firstArg, 'meas') % used when... |
function result = runObserverMulti( s, observerType, mapping )
%# time definition ( s, observerType='RLS', mapping='integral-finite' )
time = linspace(0.0, (s.Np-1)*s.Tp, s.Np);
%# input signal
%u = asmatrix(10.0*sign(sin(2*pi*(1.0/8.0)*time)));
u = 10.0*sign(sin(2*pi*(1.0/8.0)*time));
%# D... |
function [Iseg,sep] = otsu(I,n)
%OTSU Gray-level image segmentation using Otsu's method.
% Iseg = OTSU(I,n) computes a segmented image (Iseg) containing n classes
% by means of Otsu's n-thresholding method (Otsu N, A Threshold Selection
% Method from Gray-Level Histograms, IEEE Trans. Syst. Man Cybern.
% 9... |
% create an empty 3 rows x 11 columns matrix to hold our posterior variance
% values and calculations
post_vals = zeros(3, 11);
% our prior and current variances as per example code
ps2 = 4; ls2 = 3;
% store the first prior variance
post_vals(1, 1) = ps2;
for i = 1:10,
Ps2 = (1/... |
clear all;
data = dataPaths();
[~,my_foldername] = fileparts(pwd);
my_path = ['Holger/2018_JR/ConnectomeNoDrivers/' my_foldername];
path_results = fullfile(data.resultsdir, my_path);
if ~exist(path_results)
mkdir(path_results)
end
jobDesc = load( fullfile(data.workdir, my_path ,'temp_Connectome','jobDesc.mat') );
... |
function [neuron] = pick_neuron(I, ROI, szv, win)
%% making sure the final cell size is dividiable by window (used for averaging the video pixels)
%win = 2; % size of pixel step taken on either side of value to average
winLength = length(win-win:win+win);
m1 = mod(length(ROI(1,2):ROI(1,2)+ROI(1,4)),winLength);
... |
function [] = updateSystem(b_scaled,ax,P,V)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
set(P,'xdata',V(:,1));
set(P,'ydata',V(:,2));
set(P,'zdata',V(:,3));
title(ax,['\beta = ',num2str(round(b_scaled,2)*1e-8,3)]);
%set(txh,'String',num2str(beta))
drawnow;
end
|
image_folders = '101_ObjectCategories';
kernels_address = 'conv1_filters';
dir_image_folders = dir(image_folders);
% variables
number_of_windows = 4;
nw2 = number_of_windows * number_of_windows;
image_size = 256;
number_of_kernels = 96;
window_size = image_size / number_of_windows;
counter = 0
for dir_num=1:size(dir_... |
% algorithm
%
% for each couple of consecutive rows check if the ending of the first and the
% beginning of the second are too close. In case, merge (implies diminishing
% the dimension of the matrix of 1 row)
%
% for implementative purposes it is better to start from the last row
%
function aaiMergedTransitio... |
function r = getGlobalx()
global y
r = y;
end
|
plot_info = load('plot_info.out');
output_arq = load('output_arq.out');
time_steps = plot_info(1,1)
delta_t = plot_info(2,1)
nodes_x = plot_info(3,1)
for i = 1:time_steps
x = output_arq( ((i-1)*nodes_x + 1):( (i)*nodes_x ) , 1 )
y = output_arq( ((i-1)*nodes_x + 1):( (i)*nodes_x ) , 2 )
plot(x,y,"linewidth", 1... |
clear all ; close all ;
cd C:\shared\glaucoma\restest ; ls
stims = load('laurenttest_3') ; stims = stims.stimtimes ; stims = stims(1,:) ;
nii = load_untouch_nii('Retinotopic_2016_03_17_WIP_sshEPI_1.5mm_TR2650_SENSE_4_1.nii') ;
nii.img = double(nii.img) ; nimg = nii.img ;
TR = nii.hdr.dime.pixdim(5) ;
sti... |
% Parameters
nDays_short = 0.1; % d
ts_short = linspace(0, 24*nDays_short, 24*nDays_short*10); % Expected units are h
nDays_long = 60; % d
ts_long = linspace(0, 24*nDays_long, 24*nDays_long*10); % Expected units are h
y_init = [0.0; 0.1];
absTol = 1e-5;
%% Input parser default
[ts_short, ys, asleep] = strogatz(ts_sh... |
clear;
type compact;
%initialization
sum=0;
for n=1:1:100%enough to use
sum=sum+n^2;
if sum>1000%whether more than 1000
disp(n-1);%disp
break
end
end
|
function prescription = defaultSMARTSinput(RefAtmos,varargin)
%defaultSMARTSinput - generate input for SMARTS295Main with default values
%
%Required input
% RefAtmos - reference atmosphere to use, options are (case-insensitive):
% 'mlw' - mid-latitude winter
% 'sas' - Sub-Arctic summer
% othe... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NL demand estimation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
newinstruments = false
ces = false;
load painkillers9511main2new;
pk.paracetamol = +(pk.substance =='Paracetamol');
pk.ibuprofen = +(p... |
%=========================================================================
%
% Program to estimate model by full information maximum likelihood
% and do a LM test.
%
%=========================================================================
function linear_fiml_lm( )
clear all;
clc;
t = 500;
%f... |
for i = 1:2:25
disp(i);
end
%for i = [1 2 3 4]
% disp(i);
%end
%b = 1;
%while b < 10
% disp(b);
% b = b + 1;
%end |
function [output, output_blob_names] = caffe_get_output(net)
%
% This file is part of the code that implements the following ICCV2015 accepted paper:
% title: "Object detection via a multi-region & semantic segmentation-aware CNN model"
% authors: Spyros Gidaris, Nikos Komodakis
% institution: Universite Paris Est, Ec... |
clc;
VDD = 2;
Adc = -4;
Id = 0.5E-3;
RL = 1E3;
Ri = 10E3;
L = 0.35E-6;
VBias = [0:0.025:1.8];
W = 0.1E-6;
gm = -Adc/RL;
VDS = VDD - Id*RL;
gm_Id = gm/Id;
figure(1);
plot(VBias,gm_id_nch(1,:,61,9));
grid minor;
grid on;
VGS = interp1(gm_id_nch(1,:,61,9),VBias,gm_Id);
JD = str2double(nch.id(1,:,61,9))/W;
figure(2);
... |
img1 = imread('..\data\part1\hill\1.jpg');
img2 = imread('..\data\part1\hill\2.jpg');
img3 = imread('..\data\part1\hill\3.jpg');
img1Double = im2double(img1);
img2Double = im2double(img2);
img1Gray = rgb2gra... |
%% Homework Beam Elements %%
% For each beam shown in the associated figure, compute the deflection at
% the element nodes. The modulus of elasticity is E = 10 x 10^6 psi and the
% cross section is as shwon in each figure. Also compute the maximum
% bending stress. Use the finite element method with the minimum number... |
%%%%% INTRODUCTION %%%%%
% Please see "RRT.m" for more information about RRT.
% This is the third phase of the RRT path planning project.
% In this program, in addition to a simple RRT, some "forbidden zone" is
% defined. This is to simulate "obstacles" when performing path planning.
% This program deomonstrate th... |
function [ outImage ] = gaussian_noise_cvip( inImage, gaussianArgs, noiseImgSize)
% GAUSSIAN_NOISE_CVIP - Add Gaussian noise to an image.
% The function adds Gaussian noise to an image or creates Gaussian noise
% image.If user wants to add Gaussian noise to the image, the user needs
% to pass only two input argumen... |
clear all;
close all;
fc = 44100;
sinc = 1/fc;
%Creo un segnale con una finestra rettangolare.
y = zeros(1, 1000);
y(100:899) = 0.5-(0.5*cos((1/800*2*pi)*[0:799]));
dur = length(y)/fc;
t = [0:sinc:dur-sinc];
binsize = 10; %passo di campionamento delle frequenze.
F = [-fc/2:binsize:fc/2-binsize];
DFD = zeros (... |
function spheremap(status)
%SPHEREMAP - Map planar points to unit sphere
% This function takes points drawn on x-y axis and maps them to a sphere
% in real time. Click and drag on the planar area to draw.
%
% Michael Hanchak, Dayton, OH, USA 2000-2011
if nargin <1
status = 'build';
end
switch... |
function [M] = compute_extraction_ACNN(shape, params)
nbinst = params.nbinst;
nbinsth = params.nbinsth;
nLBO = params.nLBO;
n_t_th = nbinst * nbinsth;
tt = 2.^[1:nbinst];
th = [0:nbinsth-1]/nbinsth*2*pi;
I = [];
J = [];
V = [];
start_time = tic;
A = calcVoronoiRegsCircCent(shape.TRIV, [sh... |
classdef BaseFunction
properties
Func,
Deriv
end
methods
function obj = BaseFunction(name)
switch lower(name)
case 'linear'
obj.Func = @obj.rbfphi_linear;
obj.Deriv = @obj.rbfphi_linear_deriv;
... |
% demonstrate usage of likelihood functions
%
% See also likFunctions.m.
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch, 2013-01-21
clear all, close all
n = 5; f = randn(n,1); % create random latent function values
% set up simple classification likelihood functions
yc = sign(f);
lc0 = {'likErf'}... |
function [ output_args ] = findSafeConfigs( input_args )
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
close all
load('minccut_configs');
% [theta,rho] = ransac(configs(1:2,:),10,0.01,0);
clusters = clusterdata(mc_configs(:,1:2),'criterion','distance','cutoff',0.7);
[c_freq,c_id]=hist... |
function [INFO] = color_feedback(myWindow, INFO, itrial)
if INFO.T(itrial).Correct_attention == 1
my_optimal_fixationpoint(myWindow, INFO.P.screen.cx, INFO.P.screen.cy,...
INFO.P.stim.fixation_size, INFO.P.stim.fixation_square_color, [0 128 0],...
INFO.P.screen.pixperdeg)
else
my_o... |
function [ dice, Ujoined, Vjoined ] = dice_coef_joined( U, V )
%DICE_COEF_JOINED Joined Dice coefficient.
% Computes the Dice score to assess the similarity of parcellations in a
% scan-to-scan or group-to-group setting. An iterative procedure is
% performed to indentify matching parcels before computing pairwis... |
function [p mlv]=cmlstat(family,x)
%CMLSTAT Estimates copula parameter(s), given sample X.
% [P MLV] = CMLSTAT(FAMILY,X) returns estimated copula parameters and
% value of Logarithm of Maximum Likelihood Function for copula
% determined by FAMILY and bivariate sample X. Extension to n dimensions
% is strai... |
classdef ENV_CLASS_3D < handle & matlab.mixin.SetGet
% 環境設定
properties
name % 例:bldg1
id % 例:
node % 行がnode id ,列が各nodeの座標
surface % 各行が一つの面を表す.列が面を構成するnode id 列
param % parameters
graph
ns = 1; % number of surface cell
end
methods
... |
% initialize ZNB20
znb = ZNB20('address',INSTR.VISA_znb);
% Parameters
bw = 0.1e3; % (Hz)
% pow = 2; % (dBm)
%using 10 dBm, 180717
pow = -10; % (dBm)
avgs = 1; % number of averages
channel = 1;
points = 2001;
% Set the parameters on the VNA.
znb.ch(channel);
znb.power(pow);
znb.bw(bw);
zn... |
function hBuildMenu = open_devname(devObj, count)
if count == 0
prompt = {'Enter the name of the device'};
else
prompt = {'No name entered. Please enter the name of the device'};
end
title = 'Device Name';
answer = inputdlg(prompt,title,[1 40]);
if ~isempty(answer)
if ~isempty(answer{1})
... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function [segStruct, cimages, cnames] = geometricContextFromImage(img, tmpOutputDir, varargin)
% Runs the Geometric Context algorithm on an image.
%
% Input parameters:
% - img: input image
% - tmpOutputDir: temporary directory to store th... |
function [fig, t] = loadingFigure(image_file, figName, varargin)
%LOADINGFIGURE Creates loading figure with text handle at the bottom.
im = imread(image_file);
xlim = size(im,2);
ymax = size(im,1);
fig = figure('numbertitle', 'off', 'name', figName, 'Pointer', 'watch', 'MenuBar', 'None',...
... |
function [C, sigma] = dataset3Params(X, y, Xval, yval)
C = 1;
sigma = 0.3;
c=[0.01; 0.03; 0.1; 0.3; 1; 3; 10; 30];
min=100000;
temp_min=0;
sigma_a=[0.01; 0.03; 0.1; 0.3; 1; 3; 10; 30];
min_err = 1;
for i=1:8,
for j=1:8,
model = svmTrain(X, y, c(i), @(x1, x2) gaussianKernel(x1, x2, sigma_a(j)));
pre... |
function [I3D] = volumeTo3D(images)
I3D = zeros(size(images,1), size(images,2), size(images,4));
for i = 1:size(images,4)
I3D(:,:,i) = images(:,:,1,i);
end
end
|
function [y] = RKDP_adapt(fcn, tspan, y0, n)
% classical fourth order method
% Solve the initial value problem
% y’ = fcn(t,y), t0 <= t <= b, y(t0)=y0
tn_1 = tspan(1);
%t_end = tspan(2);
h = (tspan(2)-tspan(1))/n; % step size.
%t = t0:h:t_end;
tol = 1e-3;
%y = zeros(length(y0),length(t)); % solution vector i... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Template script, allowing to run the simplified popPK workflow.
% Requirements: a dataset in the IQM general dataset needs to be available
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
load E-MTAB-5989_dermal_fibroblasts.mat
%load GSM3204304_lung_airway_epithelial_cells.mat
[lgu0,dropr0,lgcv0,glist0]=i_scmatrix_stat(X0,genelist);
figure;
[d0,xyz0]=i_3dspline(lgu0,dropr0,lgcv0);
[lgu1,dropr1,lgcv1,glist1]=i_scmatrix_stat(X1,genelist);
[d1,xyz1]=i_3dspline(lgu1,dropr1,lgcv1);
%{
[a, b]=view;
loops=l... |
function answer = quiz2Fn2_2( x,n )
answer=0;
for i=0:n
answer=answer+((-1)^i)*x^i/factorial(i);
end
end
|
%xx = x +1 posicao (ajusta novo eixo)
%yy = spline(u,inf,xx) (pega todos os pontos)
%
function y=calcspline(x,y,p)
%y=spline(x,y,p);
eixo_x_novo_para_caber_o_spline = [x(1):1:x(length(x))+1]
valor_spline_no_ponto_p =spline(x,y,2013)
eixo_y_nome_with_spline = spline(x, y, eixo_x_novo_para_cab... |
function [rap]=medii_psd1(nume,extensie,ndata,extgraf,opt)
%
% Functia citeste un fisier de tip ASCII cu numele in variabila
% nume de felul 'c:folder\file.extensie'.
% Afiseza info despre datele din fisier si face ca ndata inregistrari
% sa fie in fiecare felie pe care va calcula media.
%
% fps este r... |
function digitsIIDclassify()
% naive Bayes classifier for digits
%Ntrain=5000, 83 errors in 500, rate = 0.166
load('mnistALL') % already randomly shuffled across classes
% train_images: [28x28x60000 uint8]
% test_images: [28x28x10000 uint8]
% train_labels: [60000x1 uint8]
% test_labels: [10000x1 uint8]
doPlot = 0;
i... |
% Energy calculation for point liek charge systems
% borrowed from Vpmg_qfAtomEnergy
ener = 0.0;
run cell_list
if strcmp(bc, 'focusname.inm')==1
% disp(['dimension fine (shorter) grid = ',num2str(dime(1)),num2str(dime(2)),num2str(dime(3))])
disp(' ')
disp(['rmin fine (shorter) grid = ',num2str(xmin),... |
function [Lat,Long] = Vel2LatAndLong(last_lat_long,avg_vel,t_k,t_k_minus_1,h)
[R_N,R_E] = Radii_of_curvature(last_lat_long(1,1));
Lat = last_lat_long(1,1) + avg_vel(1,1)*(t_k - t_k_minus_1) / (R_N + h);
Long = last_lat_long(2,1) + avg_vel(2,1)*(t_k - t_k_minus_1) / ((R_E + h)*cos(Lat));
end |
function R= Rodrigues(u,varargin)
% 【Input】u, th
% u : unit vector, th : angle (rad)
% th =[] のときは uの長さが回転角となる th = norm(u);
u = u(:);
if isempty(varargin)
th = norm(u);
u = u/th;
else
u = u(:)/norm(u); % 単位縦ベクトルに変換
th = varargin{1};
end
R =... |
function [result] = Scaling(im, N)
if (N == 1)
result = im;
elseif (N < 1)
result = DownScaling(im 1/N);
elseif (N > 1)
result = UpScaling(im, N);
endif
endfunction |
function num = Greedy(Grades)
%GREEDY Greedy policy
% Grades - The critic grades for each possible action
% num - The chosen action's index
% Choose the best action
[~, num] = max(Grades);
end
|
function [nodes, edges] = bnMsgPassInitiate(nodes, edges, root)
% BNMSGPASSINITIATE helper function for lungbayesdemo
% Reference: Neapolitan R., "Learning Bayesian Networks", Pearson Prentice Hall,
% Upper Saddle River, New Jersey, 2004.
N = numel(nodes);
for X = 1:N % for every node
nodes(X).lam... |
function im = jitter(im)
% flips each image with 50% chance
[~, ~, ~, num_images] = size(im);
flipped = round(rand(num_images,1));
for i = 1 : num_images
if flipped(i,:) == 0
im(:, :, :, i) = fliplr(im(:, :, :, i));
end
end |
function data_collect()
global scanstat1;
global scanstat2;
global yt1 yt2;
global startflag;
global hObject1 handles1;
global lidarQuantity;
if startflag==1
% 进入扫描状态
data(1)=255;
data(2)=1;
data(3)=0;
data(4)=2;
data(5)=40;
data(6)=0;
crcb=sum(data(2:6));
if(crcb>255)
crcb=mod(crcb,256);
end
data... |
function [t, r_r, t_zero] = evaluate_dde(lgn_struct, in_struct)
% EVALUATE_DDE - Function to evaluate a linear/nonlinear DDE with a
% given drive function. This function is only needed for feedback models.
%
% Input parameters are:
% in_struct - struct with fields:
% form: 'vec', 'fnc' or 'ilfnc'
% ... |
function N = get_N(sigma)
% Get the N matrix for the given MRP
% Return N
N = (1-sigma'*sigma)*eye(3)+2*tilde(sigma)+2*(sigma*sigma');
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.