text stringlengths 8 6.12M |
|---|
% Clean
% load NoiseCollection
% noiseTray=[];
% for i=1:size(NoiseCollection,2)
% noiseTray=cat(1,noiseTray,NoiseCollection{1,i});
% end
%
% posesPerImage=16;
% randomidx=randi([1 size(noiseTray,1)],posesPerImage,1);
%
% noise_array=noiseTray(randomidx,:,:);
%
% tiledNoise=Create_tile_for_Noise1(noi... |
function theoryDataCells = doubleVesselFixVChangeV1V2(V1,varargin)
%在总体积固定情况下迭代体积V1和v2
% 总体积V会根据param计算
% massFlowE1 经过fft后的质量流量,直接对质量流量进行去直流fft
% 长度 L1 l Lv1 l L2 l Lv2 l L3
% __________ __________
% | | | |
% -----------| |----... |
function launchMulticoreSlaves(hosts, nbProcesses, gitRepos, varargin)
% Launches a bunch of multicore slaves for parallel processing
%
% launchMulticoreSlaves(hosts, nbProcesses, gitRepos, ...)
%
%
%
% See also:
% startmulticoreslave
% killMulticoreSlaves
%
% ----------
% Jean-Francois Lalonde
% whether to d... |
function [ ] = plotTimeCourseHistograms( data1, data2)
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
num_bins = 100;
%lims = prctile(randsample(cat(1, data1{:}, data2{:}),10^4),[1 99]);
lims = [min(randsample(cat(1, data1{:}, data2{:}), 10^4)), max(randsample(cat(1, data1{:}, data2{:... |
% complete set of tests for BIE3D. All should produce small numbers &
% occasional figures and tables.
% Barnett 7/19/16 for panel stuff; updated 8/22/19 for global quad stuff.
% utils (directory)
checkgrad
interpmat_1d
tensorprod_interp
peri2dspecinterp
intxperiinterp
intxperiinterpmat
showsurf
showsurffunc
setupdoub... |
[ q_o, B_o, mu_o, r_e, r_w, k_f, rho_diferencia, cementado] = datosAleatorios();
q_o_vector = intervaloDatos('q_o');
k_f_vector = intervaloDatos('k_f');
n = length(q_o_vector);
h_wc_vector = zeros( n, n );
for i = 1: n
for j = 1: n
[ h_wc_vector( j, i ) ] = alturaConoAguaMaximo( q_o_vector(i), B_o, mu_o, r_e, r_w... |
function [delta,beta,yhat,mos,diff] = findrmse5(iqa,mos,str,str2,str3,xxx,yyy,ind,zzz)
%x = iqa;
%y = mos;
%temp = corrcoef(x,y);
%if (temp(1,2)>0)
%beta0(3) = mean(x);
%beta0(1) = abs(max(y) - min(y));
%beta0(4) = mean(y);
%beta0(2) = 1/std(x);
%beta0(5) = 1;%0;%1;
%else
%beta0(3) = mean(x);
%beta0(1) = -abs(max(y) ... |
function E = lagrangeErrors(a,b,P,f)
%LAGRANGEERRORS Lagrange Interpolation Errors
% E = lagrangeErrors(a,b,P,f) will computes (an approximation to)
% the error for a range of polynomial degrees P.
% The output will be a vector E of length l input f
% is a function mapping from [a,b] to R, P is the
% order... |
change.linw = 3; % line width graphs in function file
sample(1,:)=var.age.x0;
sample(2,:)=var.age.x1;
sample(3,:)=var.age.x2;
sample(4,:)=var.age.x3;
sample(5,:)=var.age.x4;
sample(6,:)=var.age.x5;
sample_ome(1,:)=var.age.x0_ome;
sample_ome(2,:)=var.age.x1_ome;
sample_ome(3,:)=var.age.x2_ome;
sample_ome(4,:)=var.... |
%%case 5, is a simple two-stage RO process, which the feed of second stage
%%is the brine of the first stage. Our objective in this case is to
%%investigate the ratio of SMC and SEC. And the optimal water recovery for
%%different salinity fo feed water.
%m and m_Norm in this file are different from the Zhu's paper, b... |
function [explLearning,explTest,explLearningLogistic,explTestLogistic,depLearning,depTest,...
depLearningQual,name_var_final,name_var_final_logistic_MARS] = DGP(N_sim,p)
N=5000; %Taille de l'échantillon
rng(123456789+N_sim); %seed
x=normrnd(0,1,[N,p]); %predictive variables
x2=sort(x);x3=x2(501:4500,:)... |
function[dVtot_opt,tof_tot_opt,tau_a,tau_d]=Interplanetary(date_dep_min,date_dep_max,date_arr_min,date_arr_max,body_dep,body_fb,body_arr,I,J,K)
%% Constant definition
misun=astroConstants(4);
midep=astroConstants(body_dep+10);
miarr=astroConstants(body_arr+10);
mifb=astroConstants(body_fb+10);
RPfbmin=70000;
%% Times... |
clc
clear all
close all
q=1.602*10^(-19);
k=1.38*10^(-23);
Vd=[0:0.1:0.6];
for t=[297.039 310.928 324.817]
v=((q*Vd)/(k*t));
Id=(2*10^(-6))*(exp(v)-1);
plot(Vd,Id)
xlabel('voltage');
ylabel('current');
title('diode characteristics');
hold on;
end;
legend('75','100','150')
|
function [J, grad] = CostFunction (theta, X, y, lamda)
m = size(X,1);
grad = zeros(size(theta));
J = (-y' * log(Sigmoid(X * theta)) - (1 - y)' * log(1 - Sigmoid(X * theta)))/ m + lamda * (theta(2:end)' * theta(2:end)) / 2 / m;
grad = (X' * (Sigmoid(X * theta) - y))/m + lamda * [0; theta(2:end)] / m;
endfun... |
function [correct, f, pi_star, E, M] = alg_3_4(E, func, hyps, ks_star, M, n, n_class, Pi, size_fold, xs_star, Y, ys_actual)
% a script performing Algorithm 3.4 of R&W
% by Mark Norrish, 2011
%disp('Predicting...');
correct = 0;
mu_star = zeros(n_class,1);
Sigma = zeros(n_class);
S = 3000;
for test_ix = 1:si... |
%% Code for using IPRH twice
function residual=IPRH(image)
I0=image;
hfs_y1=20;
L1=round(imresize(I0,1.25,'bilinear'));
L0=round(10*imresize(imresize(I0,0.8,'bilinear'),size(I0),'bilinear'))/10;
% high frequency part
H0=round(10*(I0-L0))/10;
% padding
largeL0=L0([ones(1,hfs_... |
% test case
% liquid-vapor phase equilibia calculation
% Define the components and load pure physsical properties
z=[.01210 .01940 .65990 .08690 .05910 .09670 .04745 .01515 .00330];
% Define the thermodynamic models
T= 300; % [K] temperature
p= 10e5; % [Pa] pressure
thermo = addThermo();
thermo.EOS = @PREOS;
mixture ... |
% 数据处理: 提取日志文件中的有用数据
V1000_to_mat_archi
if ~iscell(FileNames) % 当没有选择文件时,推出
if FileNames==0
fprintf('没有选择文件\n');
return;
end
end
% 进行组合导航验算
run_navi |
classdef iterator < handle
%ITERATOR Abstract Class for Iterator OOP Design Pattern
methods(Abstract) % Public Access
% Advance to the next element in sequence in the collection and
% return it.
% Input:
% obj = array of instances of concrete implementation of this
% ... |
function [ ] = serial( )
[ output] = outputToAd( );
if (output=='A')
fwrite(scr,'B');
pause(1);
end
if (output=='B')
fwrite(scr,'B');
pause(1);
end
end
|
function plotmemoryvariables(mv);
% Check number of input arguments
if nargin < 1
error('Not enough input arguments');
end
if nargin > 1
error('Too many input arguments');
end
figure;
% Schedule time
scheduletime = mv(1, 1);
title(sprintf('Schedule time: %d', scheduletime));
mv(1, :) = [];
% Sort
mv = sortrow... |
rob=[];
IOU=cell(96,1);
prob=cell(96,1);
dirName = 'C:\Users\shweta\Desktop\outData'; %# folder path
files = dir( fullfile(dirName,'PennPed-bbox-*.txt') ); %# list all *.xyz files
files = {files.name}'; %'# file names
data = cell(numel(files),1); %# store file content... |
clear;
t_sim = 500;
t_step = 0.1;
%% Initial conditions: start with random quaternion and angular rate
omega_B = rand([3, 1]);
gyro_mean_bias = rand([3, 1]); % Mean drift values for gyroscope;
q_init = rand([4, 1]);
% Normalize quaternion to one
q_init = q_init / norm(q_init);
%% Fill model noise parameters:
q_noise =... |
% -*- matlab -*-
%
% sum_x: array(D,K);
% sum_xx: cell(1,K);
% Nc: array(1,K); Nc(c) ~= 0 for all c
% Fc: array(1,K);
function Fc = bkm_Fc_stats(sum_x,sum_xx,Nc,p1,p2,p3,p4,p5);
K = length(Nc);
[D,tmp] = size(p1); % mu0
mu0 = p1*ones(1,K);
eta0 = p2*ones(1,K);
B0 = p3;
phi0 = p4*ones(1,K);
xi = p5;
Xbarc = sum_x./(... |
in_dir='F:\Bharti\Thesis\data';
o=load(fullfile(in_dir,'rgb_object_detection-15-person-offset-4794.imdb-again-offset-saved.mat'));
opts.target_file=fullfile(in_dir,'rgb_object_detection-15-person-offset-4794.imdb-again-offset-saved-bkg.mat');
imdb=o.imdb ;
uniq_val=0.5;
offsets=imdb.images.mask;
for j=1:size(offsets,4... |
function exerciseSLDSmeanrev
import brml.*
S=2;
H=1; V=1;
B=zeros(V,H,S);
A=zeros(H,H,S);
alpha=0.9; m=10;
A(:,:,1) = alpha;
A(:,:,2) =1;
meanH(:,1) = m-alpha*m;
meanH(:,2) = 0;
covH(:,:,1)=0.0001;
covH(:,:,2)=0.01;
B(:,:,1) = 1;
B(:,:,2) =1;
covV(:,:,1)=0.001;
covV(:,:,2)=0.001;
prior=[0.5 0.5]';
covP(:,:,1)=0.1*eye... |
function [Out1,Out2]=qsynth(Action,In1,In2)
% Dick Benson
% Design single terminated elliptic passive LC low pass filters.
% Copyright 2001-2013 The MathWorks, Inc.
% [L,C] = qsynth('getLC');
if nargin ==0
Action = 'init';
end;
if ~strcmp(Action,'init')
Hqsynth_ = get(gcf,'user... |
clear all
close all
clc;
% Load data
load('firingTimes')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% DESCRIPTIVE ANALYSIS %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 1. Raster Plot
% Q: How does the data look like in this trial?
[neurons, time] = find(allSpikes==1);
plot(time, neurons,'.... |
function ss = random_subset(s, m)
r = randi(length(s), m, 1);
ss = cell(1,m);
for i=1:m
ss(i) = s(r(i));
end
|
function [output] = NLM_filter(image,imsize, row, col,size, sig_r)
% clear all;
% tic;
% input_img = imread('image_01_Noise_03.bmp');
% imsize = size(input_img);
% size = 1;
% image = nearest_padding(input_img, imsize, size);
% row = 24;
% col = 58;
% sig_r = 11;
output = uint8(zeros(1,1,3));
image_window = image(row... |
function mark_gs = bitmark2gs(mark)
mark_gs = zeros(32,16);
for i=(1:32)
for j=(0:15)
mark_gs(i,j+1) = mark(i,j*2+1)*2 + mark(i,j*2+2);
end
end
mark_gs = uint8(mark_gs);
|
hold on
for V=1:5
ang=(0:1:360)*pi/180;
z=(3*cos(ang).^2-1)/V;
r=nthroot(z,3);
x=r.*cos(ang);
y=r.*sin(ang);
plot(x,y);
end
xlabel('x')
ylabel('y')
title('Cuadripolo eléctrico')
axis equal
%campo eléctrico en los puntos de esta malla
[X,Y]=meshgrid(-0.9:0.1:0.9,-0.9:0.1:0.9);
r=sqrt(X.^2+Y.^2... |
% ¾÷±ñ¥| ±i¤¸ºÍ E14013344
clear
clc
syms x1 x2 x3 v1
f=4*x1^2+3*x2^2-5*x1*x2-8*x1; % objective function
h=x1+x2-4; % constrain function
sol = l_solver(f,h,2,1); % l_sover
% Display result in sol
disp('Test P4.44 result:')
var = fieldnames(sol);
for i = 1:size(var)
tmp = getfield(sol,var{i});
fprintf('%s ... |
% clean up the matlab environment
clear; clc; close all;
% run initialization of some paths and variables
init_setup;
load('lab3.mat');
% contains A, B, C, LQR_Kss, target_hover_state, clipping_distance
% C = eye(size(x))
H = 2000;
% actual state, not observable, do not reference
x(:,1) = target_hover_state;
% init... |
function img = dwtsvd(original, mark)
%first part (image splitting)
[LL,LH,HL,HH] = dwt2(original,'haar');
[ULH,SLH,VLH] = svd(LH);
[UHL,SHL,VHL] = svd(HL);
%second part (watermark processing)
mark = bitmark2gs(mark);
mark = mark(:)';
%[WL,WH] = dwt(mark,'haar');
... |
% plot contrast results from agg_gp_CV.m
close all;
clear all;
%load('mat/agg_gp_CV_us=1_glm=9_theory.mat');
%load('mat/agg_gp_CV_us=1_sprite.mat');
load('mat/agg_gp_CV_us=1_sprite.mat');
zs_sprite = zs;
load('mat/agg_gp_CV_us=1_termination.mat');
zs_termination = zs;
load('mat/agg_gp_CV_us=1_interaction.mat');
zs... |
clear all;
%generowanie N_{2}(t) - jednorodnego pr. Poissona z \lambda=3
I=0;
t=0;
T=10;
lambda=3;
i=1;
S=[];
while t<=T
U=rand;
t=t-1/lambda*log(U);
I=I+1;
S(i)=t;
i=i+1;
end
%teraz mamy wektor momentow skokow S
%musimy z niego zrobic wektor wartosci N_{2} na przedziale [0,T]
... |
function e = uv(d,i)
%UV Unit vector.
% e = UV(D,I) is the d-dimensional ith unit vector, that is,
% e is a 1xd vector of zero entries, except e(i)=1.
%
% See also ZEROS, EYE.
% Author: Oren Livne
% 06/21/2004 Version 1: Created
e = zeros(1,d);
e(i) = 1;
|
function Gii = HW1_Gii
%HW1_GII
% GII = HW1_GII
% This function was generated by the Symbolic Math Toolbox version 8.3.
% 18-Sep-2019 21:07:47
Gii = [0.0;1.962000000001863e+2;8.388044015067862;-1.878723996749613e+1;-2.266169595241081e+1];
|
%add zero to the matries
%eigen vec and value calculated, so wrong
%find some P(row permutation) and Q(column operation)
%10 for each classes
%C matrix
C_data3=zeros(3,3,30);
C_data4=zeros(4,4,30);
for i = 1:30
tmp = randi(15,3);
C_data3(:,:,i)=tmp;
tmp = randi(15,4);
C_data4(:,:,i)=tmp;
end
%C_big ma... |
% Bloch Equation Simulation
% -----------------------------------------
%
M0 = [0;0;1];
a = pi/2;
M_p1 = xrot(a)*M0;
%
dT = 1; % 1ms time step.
T = 100; % 100ms total duration
N = ceil(T/dT)+1; % number of time steps.
df = 20; % Hz offset.
T1 = 200; % ms.
T2 = 30; % ms.
% ===== Get the Propagation Matrix =====... |
% John Heath
% ACM 116 Problem Set 4
% Problem 3B
clc; clear; close all;
% Generate 10 2-vectors from the normal distribution with 0 mean, sigma = 1
X = normrnd(0, 1, 10, 2);
G = [1 2; 3 4];
SigmaW = [.03.^2, 0; 0, .03.^2];
% Generate 10 2-vectors for noise
W = normrnd(0, .03, 10, 2);
% matrix for holding results to b... |
% This script will go from raw to 'depth-averaged' for Matt Hiatt's group
clear all
close all
% ADCP data begins 19 cm above ADCP and is taken every 5 cm (must be 10 cm for main pass?)
% CTDTu data is 22 cm above frame (i.e. the bed)
% Constants
adcp_height = 0.2015; % m - The height of the instrument
ctd_he... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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 generate_gif(d) % d为每幅画的间隔时间
global flage;
if isempty(flage)
flage = true;
end
frame=getframe(gcf);
im=frame2im(frame); %制作gif文件,图像必须是index索引图像
[I,map]=rgb2ind(im,32);
if flage
imwrite(I,map,'pic.gif','gif', 'Loopcount',inf,'DelayTime',d);%第一次必须创建!
flage = f... |
close all;
%clear all;
scale = .5;
sparsity = 1; %how much data to keep 1/sparsity*100%
lambda = 2;
snr = 5000;
type = 'RPMS'
% load some datas
%load ../data/stars512;
%x=stars512;
load ../data/sameer512
x=sameer512;
%load ../data/rachel379
%x=rachel;
%load ../data/oscar1078
%x=oscar;
%load ./l1magi... |
% Example for “web reading” a CSV file, but by breaking up the address
% into separate components so that you can make a loop that scans different
% stations, not just one.
%
% Normally, we would just do this once on a particular data set:
% % e.g. Read the water gauge data at BC station 07EC003:
% gauge_data = webread... |
function color_rgb = gray
color_rgb = {'color', [0.50196, 0.50196, 0.50196]};
end |
classdef showable
methods (Abstract)
[axeshandle primitivehandle] = ...
show(this,index,axeshandle,primitivehandle,varargin);
val = get(this,propName);
end
end % classdef |
function X = ShuffleMex(Arg1, Arg2, Arg3) %#ok<INUSD,STOUT>
% Random permutation of array elements
% SHUFFLE works in Inplace, Index and Derange mode:
%
% 1. INPLACE MODE: Y = ShuffleMex(X, Dim) - - - - - - - - - - - - - - - - - - - -
% The elements of the input array are randomly re-ordered along the specified
% di... |
annotation_file = 'D:/Academics/7100/Dataset/annotation.csv';
suspect_dir = 'D:/Academics/7100/Dataset/Copied/';
sample_dir = 'D:/Academics/7100/Dataset/Originals/';
annotation = csvread(annotation_file);
%figure; hold on;
dists = cell(1,80);
% costs = cell(1,80);
% locs = cell(1,80);
% slope_dev = cell(1,80);
tic
fo... |
function [ ArchDef ] = ladder_arch(n_caps)
%% DICKSON_ARCH Creates the incindence Arch for an N_STAGES (#capacitors)
% Dikson Ladder converter
%
% Retunr values Arch:
% ArchDef --> Architecture description file, with the fields:
% Acaps --> Capacitor incidence matrix
% Asw --> Switch incidence ma... |
sound = record_sound(2,20000,8,1);
[~,~,~,X_c] = dft(sound,20000);
X = X_c / norm(X_c);
load('one_av.mat');
load('two_av.mat');
load('three_av.mat');
one_inner = inner(one_av, X);
two_inner = inner(two_av, X);
three_inner = inner(three_av, X);
inners = [one_inner two_inner three_inner];
[~,index] = sort(inners, 'des... |
function tf = equaltolp(a, b, tol)
tol_a = abs(min(a,b).*tol);
tf = abs(a-b)<=tol_a;
end |
function [w,g,r,c,freq]=trainGlyph(P,X,C,s,epochs,showglyph)
%Syntax: [w,g,r,c,freq]=trainGlyph(P,X,C,s,epochs,showglyph)
%___________________________________________________________
%
% Spherical Self-Organized Feature Map training.
%
% w is the weights matrix.
% g is an estimate of weights' convergence.
% r i... |
function [f] = IDCT(F,U_L)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
blockSize = 4;
[M,N] = size(F)
f = zeros(blockSize,1,'single');
for u = 0 : blockSize-1
f = f + F(u+1) .* U_L(:,u+1);
end
end
|
classdef planner < handle
% sensor array processor
properties
N; %gridsize
worldview;% estimated dirt levels on N x N array
wetview; % estimated wet/dry condition (1 - wet, 0 - dry)
viewPrecision; % array of precision (1/variance) estimates for each location
vacuuml... |
function [zeta_minus_fp,zeta_minus_lb] = compute_zeta_limit(speed_ctrl,ival,G,XX)
%COMPUTE_FP_SPEED_BETA Summary of this function goes here
% Detailed explanation goes here
warning('OFF','ALL');
c = [1 1 0 0.5 0];
N = 8;
num_steps = 1;
M_bez=6;
te=0;
tF=[0 500];
tplot = 0;
for i=1:num_steps
clear thet... |
%% HomeWork #1_3_c
% discrete exp*cosine*unit
% Include labels and title for each plot.
clear all
n = -10:10;
u1 = heaviside(n);
u = exp(-0.15*n).*cos(0.2*pi*n).*u1;
stem(n, u) % y에 u(step function weighted sum)를 곱해줌으로써 -10:10이외의 값은 0처리.
% stem : sampling값만(discrete), plot : sampling값을 연결해서 그래프(continuous... |
clear;
clc;
Image=imread('Hubble-Massive-Panorama.png'); %Take the image as input.
gray= rgb2gray(Image); %Gray image.
binaryimage= imbinarize(gray); %Binarize gray image, each pixel is either 1 or 0.
dimension_length= size(binaryimage);
column_length= dimension_length(2); %number of columns
row_length= dimension_leng... |
function [ navData ] = KittiNavInfo( path )
%KITTINAVINFO Grabs the raw data from kittis nav sensor
%--------------------------------------------------------------------------
% Required Inputs:
%--------------------------------------------------------------------------
% path- path to where the kitti dataset is st... |
function ER = ErrorRate(LabelR, LabelH,Weight)
% ER 样本分类的错误率
% weight 样本权重
% LabelR 样本真实标签
% LabelH 样本预测标签
if(nargin <3)
Weight = ones(size(LabelR,1),1);
end
ER = sum((Weight.*abs(LabelH-LabelR))/sum(Weight))
end |
% Troitskaya 2018 a (JPO)
ccc
% neutral stability before eq 1
kappa = 0.4; % von karman
H10 = 10; % m
alpha = 0.0057;
g = 9.81;% m/s/s
z0 = @(u_star)alpha*u_star^2/g;
U10 = @(u_star) u_star/kappa*log(H10/z0(u_star))
u_star1 = 1.1; % where bag breakup becomes the dominant mechanism in experiments
U10(u_star1)
u_st... |
function [dop_buf] = rayleigh_dop(in_val)
% Function to generate Doppler-filtered Rayleigh fading simulator
% Doppler parameters
vo = (1.2*1000/3600); % vo = 1.2 km/h -> 0.333 m/s
lambda = 3e8 / 5.4e9; % lambda = c / fc;
fd = vo/lambda; % Doppler Spread (around 6 Hz)
% Generate Doppler Sf (25... |
clear;
close all;
warning off
addpath(genpath('PVLib'))
power_load = readtable('Konocti_Load.csv');
power_load = table2array(power_load(:,3));
SurfTilt=10;
SurfAz=180;
TMYData=pvl_readtmy3('725905TYA.CSV');
TimeMatlab = TMYData.DateNumber;
Time = pvl_maketimestruct(TimeMatlab, ones(size(TimeMatlab))*TMYData.SiteTimeZ... |
function v = myIntegral( arg, distribution, low_lim, high_lim, mu, d_var)
if strcmp('truncated_normal', distribution)
sd = sqrt(d_var); % standard deviation
con1 = 1 / (sqrt(2 * pi));
con2 = 0.5 * (1 + erf((high_lim - mu) / sd / sqrt(2)));
con3 = 0.5 * (1 + erf((low_lim - mu) / sd / sqrt(2)));
con4 ... |
% Clear Project Space
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; clc; close all; fclose all;
% Define Symbolic Space
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
syms x y z
ord = 1;
w = 1 - x - y;
% Set functional forms
%%%%%%%%%%%%%%%%%... |
function [FrontValue,DistanceValue,NoF] = SORNS (Population)
% Efficient non-dominated sort on sequential search strategy
% Copyright 2014 BCMA Group in Anhui University
% Written by Ye Tian
%
% Input:
% Population: a N-by-M matrix, which stands for the population on
% objective space, each r... |
% Same as Grow_ROI, except code-section at the bottom
if (~areTheseToolboxesInstalled({'Image Processing Toolbox'}) )
warndlg('Missing the required toolbox: Image Processing Toolbox');
return
end
ALGORITHM = 'FloodFill3D';
%ALGORITHM = 'regionGrowing';
% INITIALIZE
% Export to workspace
StoreVaria... |
function [ans] = distance_of_point_to_line_while_transforming(a, b, p)
n = b - a;
pa = a - p;
c = dot( n, pa );
% Closest point is a
if ( c > 0.0 )
m= dot(pa, pa);
ans = m;
return;
end
bp = p - b;
% Closest point is b
if ( dot( n, bp ) > 0.0 )
ans = dot( bp, bp );
return;
end
... |
close all
clear all
clc;
animal =1;
k = 0;
if animal ==1;
cfg.DispFlag = 1;
cfg.sponwin = [1 300];
cfg.tbin = 1;
cfg.hfshift = 0;
f32 = 'E:\DATA\Cortex\Tonotopy\JoeData\';
xcl = 'E:\DATA\Cortex\Tonotopy';
cd(xcl);
[NUMERIC,TXT,RAW] = xlsread('Joe-data.xlsx');
TXT = TXT(2:end,:);
sel = st... |
m = 8;
n = 7;
A = rand( m, n );
W = rand( n, n );
T = rand( n, n );
t = zeros( n, 1 );
[ QR, t ] = HQR_blk_var3( A, t, 3 );
Q = FormQ( QR, t );
R = triu( QR( 1:n, : ) );
A - Q * R
|
% Convert 2D binary image structure to microstructure parameters for FEA input.
% Assuming fillers are ellipses and domain window is square.
% Input:
% Imagefile: MAT file with matrix 'img_out' that contains binary image. Black (0) is matrix
% ActualLength: side length [pixel]
% dimension to pixel: ratio of physic... |
disp('Ingrese el número correspondiente al modelo que desea entrenar:');
disp('1. Ventana de Parzen');
disp('2. K-Vecinos');
disp('3. Redes Neuronales Artificiales');
disp('4. Random Forest');
disp('5. Máquinas de Soporte Vectorial');
punto = input('');
% Carga de las muestras de testeo
load('training.csv');
Xtraining... |
% ´æÈ¡¿î
load zcf
load CD
k = 1
n = 1;
PB = [];
for m = 2:4
zcfjz = [1,m,5];
t = regress(CD(:,2),zcf(1:3,zcfjz));
PB = [PB;[t',zcf(4,zcfjz) * t]];
n = n + 1;
end
for m = 3:4
zcfjz = [2,m,5];
t = regress(CD(:,2),zcf(1:3,zcfjz));
PB = [PB;[t',zcf(4,zcfjz) * t]];
n = n + 1;
end
zcfjz = [3... |
clc;clear;close all;
%load Features_MNIST_New;
load MNISTfull.mat
X = [F(1:1000,:);S(1:500,:);N(1:500,:)];
Y = [ones(1000,1);ones(1000,1)*2];
clear F S N
for loop = 1:5
N1=0.3; N2=0.3;
IND1=sort(randperm(sum(Y==1),round(N1*sum(Y==1))));
IND2=sort(randperm(sum(Y==2),round(N2*sum(Y==2))));
... |
% take the 'lof' operation to Z
%
% Z - can be either a binary or a real-valued matrix (compatible)
% (we adopt the lexigraphical order, also known as the dictionary order, in both cases)
%
% Written by Minjie Xu (chokkyvista06@gmail.com)
function Z = lof(Z)
Z = sortrows(Z', -1:-1:-size(Z,1))';
end
|
% MUSI 6202 HW1(iii) blocked Time domain convolution
% Created by Chih-Wei Wu at GTCMT 2015
% Last update: 2015.01.07
% objective: This part is to implement time domain convolution
% with signal partiioned into non-overlapping blocks
% y = myBlockedTimeConv(x, h)
% x: N*1 vector of input sequence
% h: M*1 ... |
%% Solution to 2D Brusselator Using ETD CN scheme
% E.O Asante-Asamani
% 05/08/2014
function [runtime,u_soln] = Brusselator2D_ETDCN(dt,steps)
clc;
% dt: time step
% steps: number of spatial points in each coordinate direction
%% Model Paramters and initial conditions
A = 1; B = 3.4;
% diffusion coefficient
epsln =... |
function output = get_unique_identifiers(imol_summary)
% this function identifies and calculates usefull parameters for sorting
% molecules
% sort_names = {'gp_num'
% 'movie_num'
% 'movie_ser'
% 'fps'
% 'dltg'
% 'mean_total_i'
% 'logPx'
% 'BIC'
% 'C1_mean_diff'
% 'C2_mean_diff... |
%sortGBP
%Week 4 of an introduction to programming.
%Will sort the data from GBplaces.csv by population in descending order.
%Author: Evan Tillotson
%Date: 21.10.2014
%Open the file
file_id = fopen('GBplaces.csv');
%Test to see if file has been opened
if (file_id == -1);
error('File cannot open');
e... |
clear all;
close all;
%[all_game_names, sprite_types_ordered] = get_game_names_ordered(12);
%subj_ids = 12:32;
[all_game_names, sprite_types_ordered] = get_game_names_ordered(11);
subj_ids = 1:11;
count_walls = true;
run_ids = 1:6;
all_levels = 1:9;
agents(1).name = 'Human';
agents(1).tag = '';
agents(2).name = 'R... |
% eval( MPI_Run('PruebaOctaveMPI',4,{}) );
% eval( MPI_Run('PruebaOctaveMPI',4,{'nodo10' 'nodo05'}) );
% eval( MPI_Run('PruebaOctaveMPI',4,{}) );
% Initialize MPI.
MPI_Init;
% Create communicator.
comm = MPI_COMM_WORLD;
% Get size and rank.
comm_size = MPI_Comm_size(comm);
my_rank = MPI_Comm_rank(comm);
% Since th... |
% mettre synchro OFF
for i=1:1000
tango_command_inout('ANS/SY/CENTRAL','FireSoftEvent');
pause(0.6)
end
|
function rgb = dark_blue
rgb = [0.0, 0.0, 0.54509];
end |
function userplot_plotTWCoeffs(cav_dir,num,beta)
%Load coeffs data and also convert to array
S_EcoeffsAll = structdata_load(cav_dir,num,'E','coeffs',1,0,beta);
%plot 2DfieldFFT from coeffs (lin and log)
plotting_plotData(S_EcoeffsAll,'TW','2Dcoeffs','',1,0);
end |
clear all;
close all;
%conn = mongo('holy7c22108.rc.fas.harvard.edu', 27017, 'heroku_7lzprs54', 'UserName', 'reader', 'Password', 'parolatamadafaqa')
conn = mongo('holy7c22109.rc.fas.harvard.edu', 27017, 'heroku_7lzprs54')
%conn = mongo('holy7c22108.rc.fas.harvard.edu', 27017, 'heroku_7lzprs54', 'UserName', 'root', 'P... |
% % J Schott
% CSI 700
% Computer Problem 3.1: Test Least squares data fitting for ndegree
% polynomials.
function [A,x,b] = testThis(n)
b = [1;2.7;5.8;6.6;7.5;9.9];
[m,tmp] = size(b);
A = zeros(m,n);
for t=0:1:m-1
for j=1:1:n+1
if ( j == 1 )
A(t+1,j)= 1;
else
... |
function [DataOut, Metric] = ReceiverHD(HDchips, G, Scrambler);
%
% ReceiverHD Hard Decision Receiver. This function performs transmitted packet data recovering,
% based on Viterbi Decoder.
%
% Block Diagram:
% HDchips -> [DeScrambler] -> [De-Interleaver] -> [Viterbi Decoder... |
function [x,t,w]=godunov(a,b,N,T,cfl,w0,um,rhom)
%
% [x,t,w]=godunov(a,b,N,T,cfl,w0,um,rhom)
%
% [a,b]: intervalo de definici�n.
% N: n�mero de pasos en espacio.
% T: tempo final.
% cfl: n�mero de Courant.
% w0: condici�n inicial (punteiro a unha funci�n .m).
% um: velocidade m�xima.
% rhom: densidade maxima... |
% Run deterministic delayed photons on repeat streams at each gamma
clearvars
clc
close all
% Assumptions and modifications
% - assume the distorted photons are already available
% - assume a folder structure for repeat photon sets
% - loop 1 is on gamma, 2 is on photons and 3 on beta
%% Setup the problem and folder ... |
function toggle_disp_survey_lines(main_figure)
axes_panel_comp=getappdata(main_figure,'Axes_panel');
curr_disp=get_esp3_prop('curr_disp');
main_axes=axes_panel_comp.main_axes;
u=findobj(main_axes,'tag','surv_id');
set(u,'visible',curr_disp.DispSurveyLines);
end |
function varargout = testgui(varargin)
% TESTGUI MATLAB code for testgui.fig
% TESTGUI, by itself, creates a new TESTGUI or raises the existing
% singleton*.
%
% H = TESTGUI returns the handle to a new TESTGUI or the handle to
% the existing singleton*.
%
% TESTGUI('CALLBACK',hObject,eventData,... |
function params = hw2_train_bnb(X,Y)
[rows, columns] = size(X);
params = struct([]);
prior = zeros(length(unique(Y)),columns , 'double');
minimum = min(Y);
maximum = max(Y);
len = maximum + abs(minimum);
mean = zeros(len, columns, 'double');
params(1).class = unique(Y);
params(1).length = len;
for i = 1: length(Y)
... |
function varargout = drawOutline(mask,varargin)
%DRAWOUTLINE Draw 2D outline.
%
% DRAWOUTLINE(MASK) draws 2D outlines of the connected components found in
% the specified mask on the current axes using the patch function.
%
% DRAWOUTLINE(MASK,'PARAM1',VAL1,'PARAM2',VAL2,...) can be used to specify
% additional ... |
%
% File: SIRscript.m (for use with Matlab)
% Author: Warren Weckesser
% Department of Mathematics
% Colgate University
%
% Copyright (c) 2005 Warren Weckesser
%
%
% Set the parameters
%
r = 0.12;
g = 0.07;
%
% Set the initial conditions and put into x0
%
S0 = 0.995;
I0 = 0.005;
R0 = 0.0;
x0 = [S0; I... |
clear
foldername = '3/';
try_num = 3;
ax = [0 1200];
filename = [foldername 'data' num2str(try_num) '.mat'];
load(filename);
P_cal_mat = P_cal*ones(1, 20);
plot(P_cal_mat(:), P_reruns(:), 'ko')
hold on
errorbar(P_cal, mean(P_reruns, 2), std(P_reruns, 1, 2), 'r.', 'markersize', 12, 'linewidth', 2)
plot(ax, ax, 'b:', 'li... |
function [ left, up, right, down ] = getBoundingBox( image )
imageSize = size(image);
left = imageSize(1)+1;
up = imageSize(2)+1;
right = 0;
down = 0;
for y = 1 : imageSize(1)
for x = 1 : imageSize(2)
if(image(y,x) == 1)
if(x < left)
l... |
% Generates a bi-partite graph, represented by its adjacency matrix according
% to a power law distribution for the first half of the graph.
% Input:
% n: number of nodes in each half of the graph
% beta: exponent for the power law
% Output: adjacency matrix
function [mat] = generate_power_law_graph(n, beta)
% I... |
function [freq,mphase] = msk_soft_decision(rxSig,w,l,t,freq_all,phase_all);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for m=1:w
txsig=signal_compensation(rxSig,freq_all(m),phase_all(m),l);
txsig=msk_soft_decode(txsig,l,t);
txsum(m)=(txsig*txsig')/(l-t+1);
end
t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.