text stringlengths 8 6.12M |
|---|
function varargout = lkDpxGratingExpAddResponse(varargin)
% varargout = lkDpxGratingExpAddResponse(varargin)
%
% Gui to select a lkDpxGratingExp stimulus and the 'ses' output of
% Jorrit Montijn's two-photon processing suite (mountainpro) and merge
% them. The output file should contain all inf... |
function fuerza
pos=get(gca,'UserData')
if isempty(pos.fuzzy)
errordlg('No hay ningun modelo fuzzy cargado','error')
return
end
if ~isempty(pos.objeto)
objeto=pos.objeto
fnec=objeto.peso./objeto.rugosidad;
fefector=evalfis([objeto.peso; objeto.rugosidad; objeto.fmax],pos.fuzzy)
if fefector>=... |
function [X lnHyperpara_Kx lnHyperpara_Ky] = mk_paramsDecompose(params,N,Q,kern)
% 这里先把params中的X,所有的超参数都提出来
X = reshape(params(1:N*Q), N, Q); % 把初始化的隐变量从params中抽取出来
% 把Kx的超参数提取出来,由于在这个过程中Ky是一直不变的,所以不用考虑Ky的超参数
num_kern = length(kern.comp);
num_hyperpara_Kx = 1; % 噪声项开始算
for i = 1:num_kern
num_hyperpara_Kx = n... |
initBp;
for i=1:8
runBp;
end
|
% GUI Update
% Updates GUI after xPos and yPos change
global nMaps
handles.current.XData = xPos;
handles.current.YData = yPos;
foil = handles.d.express(handles.map.genes(xPos,yPos,:));
handles.foil.XData = foil(1,:);
handles.foil.YData = foil(2,:);
if nMaps==2
foil2 = handles.d2.express(handles.map2.genes(xPos,y... |
%Per provar el codi de realengine.
F=25000; %N
PI.f=1.4;
PI.c=25;
T.t4=1700;
alpha=1;
T0=245;
P0=60000;
M0=0.8;
rho0=1.225;
Rgas=287;
a0=sqrt(rho0*Rgas*T0);
gam.cold=1.4;
gam.hot=1.4;
TAU.r=1.128;
TAU.gam=T.t4/T0;
PI.r=pi2tau(TAU.r,gam.cold);
T.t0=276.36;
P.t0=912000;
CP.hot=1005;
CP.cold=1005;
h=43e6;
%Parámetres del... |
clc
clear
% load time.txt
%Displacement=load('Displacement_GP-3.txt');
T=load('stresstri.txt'); % Effective or Von Mises Stress
AccuStrain=load('AccuStrain.txt'); % Accumulated Equivalent Plastic Strain, LABEL is EPEQ in abaqus
%T=load('T_GP-3.txt');
[m,n]=size(T);
VGImono=zeros(m,n);% VGI_mono
for i=2:1:m
dep=Acc... |
function [OutputParamStats, IncorrectTest] = ...
organizeData(myFiles, myDir, subjectNames,stats, incorrectPerc, masterAngles)
for k = 1:length(myFiles)
clear angles;
baseFileName = myFiles(k).name;
fullFileName = fullfile(myDir, baseFileName);
data = table2array(readtable(fullFileName));
... |
function z=iscycleIntersect(line,A,r)
if (line(3)-line(1))~=0
k=(line(4)-line(2))/(line(3)-line(1));
b=line(2)-k*line(1);
d=abs(k*A(1)-A(2)+b)/sqrt(k^2+1);
[x y]=solve(['x*(' num2str(k) ')-y+(' num2str(b) ')=0'],...
['(y-(' num2str(A(2)) '))*(' num2str(k) ')=(' num2str(A(1)) ')-x']);
else
... |
function [salt,temp,model] = plot_read_data_gula_tracer_multitime_2()
% Read the velocity of the day (day or night) of the simulation of Gula,
% Molemaker, McWilliams
%
model.type_data = 'Gula';
model.filtering.smoothing= true;
init_model
vectname_data = {'u','v','salt','temp'};
one_day = 24 * 3600;
one_week = 7 * on... |
clear
clc
close all
% USER-DEFINED PARAMETERS
filename = 'data.2d';
filedir = '/Users/tyler/Google Drive/Data/Epoxy/Intact/5/';
filelabel = 'Pinhole7';
nMeas = 7;
startNum = 1;
tStart = 0;
zBlocks = 8;
G = 23.87; %T/m
% G = 6.59; %T/m
zf = 1; %levels of zero-filling
alpha = 5e9;
T2lims = [1e-5 1e1];
omitEchoes = ... |
function [P] = prolongation(CV,CF,V,varargin)
% PROLONGATION Build a linear prolongation operator taking solutions on a
% coarse mesh (CV,CF) and prolongating (upsampling) them onto vertices of a
% fine mesh (V). Useful for multigrid and embedded mesh deformations.
%
% P = prolongation(CV,CF,V)
%
% Inputs... |
clc
clear all;
close all;
cd ../../bnt/
addpath(genpathKPM(pwd))
cd ../PGM_PROJ/project_part2/
global suited;
global unsuited;
suited=[];
for i=1:13
for j=i+1:13
suited = [ suited ; i*13+j];
end
end
unsuited=[];
for i=1:13
for j=1:13
if i ~= j
... |
clear;
addpath(genpath('DeepLearnToolbox'));
load('KLH.acc.mat');
data_path='../test/KLHdata/';
boxsize=272;
start_mic_num=57;
end_mic_num=57;
dim_x=2048;
dim_y=2048;
scan_step=20;
range1=70;
range2=40;
min_std=22;
max_std=34;
name_length=2;%for the other dataset length=5
name_prefix='';%for the othe dataset 'imag... |
%MLDIVIDE Dataset overload
% $Id: mldivide.m,v 1.2 2006/03/08 22:06:58 duin Exp $
function c = mldivide(a,b)
prtrace(mfilename,2);
if (isa(a,'dataset')) & (~isa(b,'dataset'))
c = a.data \ b;
elseif (~isa(a,'dataset') & isa(b,'dataset'))
c = a \ b.data;
else
c = a.data \ b.data;
end
return
|
clear
clc
close all
%% Initialize data.
D = 0:6; % Demand x.
p = [0.04,0.08,0.28,0.4,0.16,0.02,0.02]'; % Probability p(x).
nStock = 0; % Initialize stock.
cost = 0; % Initialize cost.
nWeek = 52; ... |
clear all;
m=1.2*10^3;%kg
k=58*10^3;%N/m
Dc=4*10^3;%kg/s
displacement(1)=-0.1;
velocity(1)=0;
dt=0.001;
%Euler's method
for t=1:1:5000
velocity(t+1)=velocity(t)+((-Dc./m).*velocity(t)-k./m.*displacement(t)).*dt;
displacement(t+1)=displacement(t)+velocity(t+1).*dt;
end
%tt is used to r... |
% Marcus Hall
% ME 352 Hmwk 4
% 3/13/19
figure
tran_A = tf([1],[1,6,8,0])
bode(tran_A)
title('A')
figure
tran_B = tf([1,5],[1,6,5])
bode(tran_B)
title('B')
figure
tran_C = tf([1,8,15],[1,6,8,0])
bode(tran_C)
title('C')
figure
tran_4 = tf([1],[2,0.25,15])
bode(tran_4)
title('Q4')
%% Question 5 %%
L = [2,0.25,15];... |
function [centroids, idx] = runkMeans(X, initial_centroids, ...
max_iters, plot_progress)
if ~exist('plot_progress', 'var') || isempty(plot_progress)
plot_progress = false;
end
% Plot the data if we are plotting progress
if plot_progress
figure;
hold on;
end
grid on;
... |
%@(#) getcrbui.m 1.3 05/12/08 10:31:35
%
%function buidvec=getcrbui(distfile)
function buidvec=getcrbui(distfile)
[buid,mminj,konrod]=readdist7(distfile,'asyid');
[ikan,ikancr]=filtcr(konrod,mminj,0,99);
s=size(buid,2);
for i=1:size(ikan,1);
buidvec(4*i-3,1:s)=buid(ikan(i,1),1:s);
buidvec(4*i-2,1:s)=buid(ika... |
function [ out_population ] = mutate( population, probability )
population_size = size(population, 2);
for i = 1 : population_size
if rand() < probability
locus = randi([1,7]);
char = population(i).genotype(locus);
if char == '0'
char = '1';
else
char = '0'... |
%% Generate data from Cooper ()
% WCST with young adults
dbstop if error
partecipant = {'01' '02' '03' '04' '05' '06' '07' '08' '09' '10' '11' '12' '13' '14' '15' '16' '17' '18' '19' '20' '21' '22' '23' '24' '25' '26' '27' '28' '29' '30' '31' '32' '33' '34' '35' '36' '37' '38' '39' '40' '41' '42' '43' '44' '45' '46' ... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author : Roger (Aohan) Mei
% Date : 04/20/2020
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the similarity function
function score = similarity(v1,v2)
score = 1 - 1/2*norm(abs(v1/norm(v1)-v2/norm(v2)));
end |
function [x, iter] = conjGradFR(gradF, x0, epsilon, maxIter)
% Fletcher and Reeves Conjugate Gradient Method
%
% Inputs:
% gradF - gradient of f(x) (column vector)
% x0 - initial point (column vector)
% epsilon - termination scalar or error tolerance
% maxIter - maximum number of iterations allowed
%
% Outputs... |
function temp = writecsv( data,featurename,N )
%%A script for writing the data into a csv file
% Detailed explanation goes here
% N = 23;
if N == 0
N = 23;
l = ones(N,2);
name = 'feature';
label = 'label';
% temp = [];
for i = 1:N
temp = [];
s1 = ['l(i,:) = size(data.f.f',n... |
% Charlie Nitschelm
clear all
close all
clc
%% This Script Pulls from the MatrixMaker and MatrixSolver Functions and displays a steady 2D temperature figure
% Input Parameters
ResX = 80;
ResY = 30;
T_0 = 100+273.15; % C
T_1 = 200+273.15; % C
L1 = 1; % Meters
L2 = .70; % Meters
D = .50; % Meters
k1 = 200; % W/mK
k2 = ... |
function [tst_out,tst_trg,tst_hd,model] = regress_inter_loocv(img,scores,subj_labels,subj,kernel)
% REGRESS_INTER_LOOCV conducts cross-validation using svm via the specified kernel
%
% [...] = REGRESS_INTER_LOOCV(img,scores,subj_labels,subj,kernel)
%
% ARGUMENTS
%
% OUPUTS
%% Allocate storage
tst_out = [];
tst... |
%% Loading conditions
temp = 295; %K
sApp = 15; %[MPa] applied stress at temperature = temp
matSel = 'resin';
expLength = 24; % experiment length in hours
deg = NaN;
%% Define rectangular test specimens
oal = 165; %mm
width = 12.7; %mm
thickness = 8; %mm
%--------------------------------------------------... |
clear
load('Covariance')
Output=[];
for j=0:9
filename=strcat('Result0_',num2str(j));
load(filename);
result=[];
for i=101:150
%if isempty(Result{i})==0
path=strcat('c:\WT10G\',num2str(i),'.txt');
data=load(path);
scores=data(:,1);
... |
%% Make the plots for the mouse tsne coronal view (PCA sweep)
clear variables
close all
% Load additional color data
ids = {'9861','10021','12876','14380','15496','15697'};
id = ids{2};
markersize = 30;
%% Figure a
% t-SNE mapping colored by region with 10 components
% Load data
load(['results_human_average_cell_sele... |
clear all;
span = [1,1.5];
f1 = @(X,y) 2*X*y;
MetodoEulerModificado(f1);
[x1,y1] = ode45(f1,span,1);
f2 = @(X,y) 2*X - 3*y + 1;
MetodoEulerModificado(f2);
[x2,y2] = ode45(f2,span,1);
f3 = @(X,y) X*y.^2 - y/X;
MetodoEulerModificado(f3);
[x3,y3] = ode45(f3,span,1);
figure(2)
title('Gráficas con ODE4... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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 [U0,U1,U2] = TopDown(alpha,chi)
%TOPDOWN implements top down algorithm to find u and U0 U1 U2
format long;
a0 = 1/2*chi;
b0 = 1;
delta_0 = 1;
tol = 1e-6;
sum_0 = a0/b0;
u0 = a0/b0;
a = zeros(1,200);
b = zeros(1,200);
delta = zeros(1,200);
uArray = zeros(1,200);
sum = zeros(1,200);
a(1) = a0;
b(1... |
function [ p, ind ] = max_product( v, n )
v = v(:)';
[row, col] = size(v);
if col < n
p = 0;
ind = -1;
return;
end
p = -inf;
for i = 1 : col - n + 1
pp = prod(v(i : i + n - 1));
if pp > p
p = pp;
ind = i;
end
end
end
|
function [orbital_parameters, delta_v] = half_hyp(v_i_inc_or_out, v_f_out_or_inc, V_body, mi_body, orbital_parameters_park, option)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% half_hyp.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ... |
clear
clc
global xmean xsd xcov corrMatrix xr
global codeFolder reviseFolder
xmean = [8000 38 1-0.2863 4641 2.00E-05*1.03e-6];
xsd = [4000 6 0.065 8808 1.55E-05*1.03e-6];
xcov = xsd./xmean;
corrMatrix=[1,0,0,0,0
0,1,0,0,0
0,0,1,0,0
0,0,0,1,0
0,0,0,0,1];
xr = corrMatrix;
codeFolder = 'F:... |
function testspeakertmp2
close all
% clear all
cd('/Users/marcw/DATA/tmp/testspeaker');
Fs = 48828.125;
% x = acoustic
% -0001 = speaker
% -0002 = TDT
for ii = 1:2
close all
if ii ==1
[~,~,l] = pa_readcsv('testspeaker-2014-11-21');
sel = l(:,5)==2;
l = l(sel,:);
hrtf = pa_readhrtf('tes... |
% function Raw2Nii(FN,DIM,Format, [HdrFile])
% Or function Raw2Nii(Data,FNOUT,Format, [HdrFile])
% ---
% the data is saved as "RAW" data. the original DWI are 16 bits integer.
% the processed data (like FA etc.) are 32 bits float.
function Raw2Nii(FN,DIM,Format, HdrFile)
% FN='D:\Projects\Development\temp\J-0-1.5_AIR... |
function break_loop_function(source, userdata, callbackdata)
loops = 'no'
save('output\looping.mat','loops')
|
function x=GaussNaive(A,b)
[m,n]=size(A);
if m~=n, erros('Matrix A must be square'); end
nb=n+1;
Aug=[A b];
for k=1:n-1
for i=k+1:n
factor=Aug(i,k)/Aug(k,k);
Aug(i,k:nb)=Aug(i,k:nb)-factor*Aug(k,k:nb);
end
end
x=zeros(n,1);
x(n)=Aug(n,nb)/Aug(n,n);
for i=n-1:-1:1
x(i)=(Aug(i,nb)-Aug(i,i+1:n)... |
function [H, LambdaMap] = BLOM_EvalHessian(P, K, x, Lambda)
% This function evaluates the Hessian of the PolyBlock function represented
% by the exponent matrix P and coefficient matrix K, at the column vector x
% with Lagrange multipliers Lambda. The Hessian is a square symmetric
% matrix with dimension equal to t... |
function y = encoder_miller(x,osf)
po = ones(1,osf);
po(osf/2+1:osf) = -1;
no = fliplr(po);
pz = ones(1,osf);
nz = -pz;
y = [];
for i=1:length(x)
if isempty(y)
if x(i) == 1
y = [y, po];
else
y = [y, pz];
end
continue
end
i... |
function plot_subjs_on_average_grouping(subj_labels, grouping_idx, avgsubj, cfg)
% PLOT_ELEC_ON_AVERAGE_GROUPING Plots electrodes on average brain.
% Electrodes with the same grouping_idx will have the same color.
%
% subj_labels : cell array in subj-label format, e.g. {'D14-RPIP10', 'D14-RPIP9',...}
% groupin... |
%% CtrlSim_VFOV_fit_func
function fError = CtrlSim_VFOV_fit_func_vectorized_serial(x)
% global MEMS
% Fitness function for calculating the RMS error of individual in
% population compared to reference signal (x over time)
% vectorized version of function
% For non vectorized, use: CtrlSim_... |
% pConsensusPairSubstitution(a,b,f,File,F,L,Search) looks at the letter pairs corresponding to nucleotides a and b of the query motif in Search, uses interactions in F as the consensus,
% The argument Noncanonical being set to 1 means that this pair should set low probabilities for CG, GC, AU, and UA base combination... |
function NEWLATTICE = restoreparamgroup(LATTICE,PARAMGROUP)
%RESTOREPARAMGROUP restores the values of multiple physical
% parameters of the lattice.
% NEWLATTICE = RESTOREPARAMGROUP(LATTICE,PARAMGROUP)
%
% See also: ATPARAMGROUP RESTORPARAMGROUP SAVEPARAMGROUP
NEWLATTICE=LATTICE;
for i=1:length(PARAMGROUP)
NEWLA... |
setup;
currentPath = pwd;
dataFolder = [dataPath 'medical/'];
load([dataFolder 'data.mat']);
xmlLocation = 'medicalNew.xml';
disp('Dataset Statistics');
disp(['Num Instances: ' num2str(numInstances)]);
disp(['Num Labels: ' num2str(numLabels)]);
disp(['Num Features: ' num2str(numFeatures)]);
labels = data(:,numFeature... |
function px_sw_mss(rpath, npath, rname, nname,vector)
% px_sw_mss(rpath, npath, rname, nname,vector)
%
% this function is used to merge the data for each single subject to one file.
% for each single subject, the data name must like 'name_001.mat' and there
% should have sw_auc, sw_eff_aucand node_para in each .mat fil... |
initial = imread('pokemon_00.jpg');
to_fill = imread('pokemon_05.jpg');
to_fill_gray = rgb2gray(to_fill);
meanIntensity = mean(to_fill(:));
meanIntensity_initial = mean(initial(:));
ims = {to_fill, initial};
% Pick correspondence points
e = [];
u1 = []; u2 = [];
[u,e] = edit_points( ims, { u1, u2 }, e );
u1 = u{1}... |
clear all;
clc;
totalsteps = input('Enter the total number of steps you would like for the day: ');
loop = true;
m = mobiledev;
m.AccelerationSensorEnabled = 1;
m.Logging = 1;
display('start');
a = arduino();
configurePin(a,'D7','pullup');
while(loop)
if(readDigitalPin(a,'D7') == 0)
display... |
%% Create busses
% Input
clear dummy
dummy.xTarget = 0;
dummy.yTarget = 0;
dummy.zTarget = 0;
dummy.yawTarget = 0;
dummy.manual = [0 0 0 0 0];
Simulink.Bus.createObject(dummy);
inputsBus = slBus1; clearvars slBus1;
% Sensor
clear dummy
dummy.acc = [0,0,0];
dummy.vel = [0,0,0];
dummy.pos = [0,0,0];
dummy.omega = [0,0,0... |
function [data,headermap,header]=readdat(filename)
dataraw=importdata(filename,'\t',1);
data=dataraw.data;
header=dataraw.colheaders;
headermap=containers.Map(header,1:size(header,2));
end |
function [smoothx,smoothy] = smoothCoord(query,origin,WHATSBAD,timecourse)
%this function takes in the query coordinates and a reference origin
%coordinates as structs, and a threshold of bad jump, apply gaussian
%interpolation and return smoothed coordinates
% query, and origin are supposed to be structs
% try usi... |
%%%%Program Variables:
%%%%input: given image of size row,col,bands and parameter k for number of
%%%%smooth curves to cover a cluster
%%%%b(i,k): boolean variables for each curve : dim: row*col*k,
%%%const: b(i,k)^2-b(i,k)=0
%%%%____________
%%%________________
%%%%
%%%%
%%%%eps: curve fit error: in obj: minimize eps... |
function varargout = Compound_Surf_Objects(Surfa,varargin)
%
% Syntax :
% Surfout = Compound_Surf_Objects(Surfa);
%
% This function employs mesh_boolean (GPToolbox) to create compound objects by peforming boolean operations.
%
% Input Parameters:
% Surfa : Surfaces files.
% : An atlas surface file... |
addpath(genpath('DD2423_Lab_Files'))
load canoe256;
nallo = nallo256;
hund1 = double(imread('dog.jpg'));
hund2 = double(imread('dog.tiff'));
phone = phonecalc256;
vad = whatisthis256;
%% 1
% image(nallo)
% colormap(gray(256))
% colormap(cool)
% colormap(hot)
% colorbar;
%showgrey(vad,64,0,70)
%colorma... |
function [a1,a2] = Subproblems2(p,q,r,w1,w2)
%欧阳俊源@2020/04/14
%思路:先找出c点,再化为2个子问题1
%p:原来的位置3x1
%q:目标位置3x1
%r:两轴交点3x1
%w1,w2:两轴3x1
%顺序:先绕w2,再绕w1。
u=p-r;v=q-r;
w1=w1/norm(w1);w2=w2/norm(w2);
t=w1'*w2;
alpha=(t*w2'*u-w1'*v)/(t^2-1);
beta=(t*w1'*v-w2'*u)/(t^2-1);
gamma=sqrt((u'*u-(alpha^2)-(beta^2)-2*alpha*beta*w1'*w2)/(nor... |
%1)
%Import 'GlobalCarbonBudget.xlsx' & 'GlobalTempYear.txt' as tables
GlobCarbBud = array2table(xlsread('GlobalCarbonBudget2018.xlsx','Historical Budget'));
GlobCarbBud.Properties.VariableNames = {'Year' 'ffai' 'luce' 'ag' 'os' 'ls' 'bi'};
GlobTempByYear = array2table(textread('GlobalTempbyYear.txt'));
GlobTempByYear.... |
clear all
close all
clc
format long
diary('logOutput.txt')
diary on
tic
year_begin = 4;
year_end = 7;
numOfDays = 365 * (year_end - year_begin);
max_iter = 420;
threshold_value = 1e-8;
threshold_relative = 1e-12;
variations_in_calculation = ["Only_omega0_is_alter... |
function [u_dy] = img_estimation(blurry_dy, u_dy, h, lambda)
% 在梯度域恢复模糊图像
% lambda: l0范数正则化参数
%% pad image
H = size(blurry_dy,1); W = size(blurry_dy,2);
blurry_dy_pad = wrap_boundary_liu(blurry_dy, opt_fft_size([H W]+size(h)-1));
% H = size(u_dy,1); W = size(u_dy,2);
u_dy_pad = wrap_boundary_liu(u_dy, opt_fft_s... |
% read cmap data
C = zeros(3, 718, 930);
C(1,:,:) = csvread('data/cmap/HL60.csv');
C(2,:,:) = csvread('data/cmap/MCF7.csv');
C(3,:,:) = csvread('data/cmap/PC3.csv');
dim1C = {'HL60','MCF7','PC3'};
dim2C = textread('data/cmap/drug_names_cmap_expression_list.csv', '%s', ...
'delimiter', '\n');
dim3C = textread('dat... |
% all variables in matlab are arrays (pg 339)
a=2
b=[3 1 5]
c=[6 2; 8 3; 14 42]
|
function [cv,robustcv]=mycv(x)
cv=nanstd(x,0,2)./nanmean(x,2);
if nargout>1
robustcv=iqr(x,2)./nanmedian(x,2);
end
|
mc = MarkovChain([0.75 0.25], [0.99 0.01; 0 1]);
g1 = GaussD('Mean',0,'StDev',1);
g2 = GaussD('Mean',3,'StDev',2);
h = HMM(mc,[g1,g2])
x = rand(h,100);
|
clear all;
a=load('oridata_z1z11.txt');
row=find(abs(a(:,1))+abs(a(:,2))+abs(a(:,3))>0);
a=a(row,:);
b(:,1)=a(:,1);
b(:,2)=a(:,2);
b(:,3)=-a(:,3);
b(:,4)=a(:,2);
fname=strcat('oridata_1','.txt');
fid=fopen(fname,'wt+');
b=floor(b);
fprintf(fid,'%f %f %f %f\n',b'); |
% this file provides a quick test for verifying that the dcm matlab
% implementation gives the same result as the one implemented in c
% that can be found in [1].
% if you want to reproduce the same test, you will need to have the
% hardware setup described in [1] connected to the computer via a serial
% usb connexion... |
clear,clc;
F = dir('E:\Tez\Thesis\userStudy\originalFrames\nguyen\*.mat');
for ii = 1:length(F)
% video = VideoReader(['E:\Tez\Thesis\userStudy\originalAvi\' F(ii).name]);
% frames = read(video);
% frames = permute(frames.retargetedFrames,[4 2 3 1]);
frames2 = [];
load(['E:\Tez\Thesis\userS... |
% Projet de session
%% Fonction phi
clc ; clear all ; close all ;
%
phi_num = [9590];
phi_denum = [1 31.3 -1780 -5.57e4];
FCT_phi = tf(phi_num,phi_denum);
% graphique
% spécifications du client
MP = 5;
Ts = 0.03;
Tp = 0.025;
Tm_10_90 = 0.02;
Err_echelon = 0;
% Traduction en terme d'ingénierie
p... |
clear all ; close all ;
subs = {'alex','dina','genevieve','jeremie','russell','sukhman','tegan','valerie'};
scans = {'mc_retino_allstims_01','mc_retino_allstims_02','mc_retino_gamma_01','mc_retino_gamma_02','mc_retino_movie','mc_retino_rest'};
eegscans = {'retino*allstim*01*set','retino*allstim*02*set','retino*... |
function result = myStopTest(history, data)
% This function must return a structure, and that structure must have a
% single length variable called 'stop' as a result of the test.
% In this example, return structure is 'result', and its 'stop' field is
% set to false or true.
% You can add additional information u... |
% External excitation to the SMA schemas
% are due to the environmental trigger
% Basic excitation for all the motor schemas
o_EXT_SMA(:,tt) = weights.w_STIM_BASE + unifrnd(-extNoise,extNoise);
% Excitation for the sensorimotor schema from the environment
o_EXT_SMA(stimuli(counter.trial_num),tt) = weights.w_STIM_PRES... |
names1 = {'Chrona_NapEnt001sess1.edf','Chrona_NapEnt002sess1.edf','Chrona_NapEnt003sess1.edf','Chrona_NapEnt004sess1.edf','Chrona_NapEnt005sess1.edf','Chrona_NapEnt006sess1.edf','Chrona_NapEnt007sess1.edf','Chrona_NapEnt008sess1.edf','Chrona_NapEnt009sess1.edf','Chrona_NapEnt010sess1.edf','Chrona_NapEnt011sess1.edf'};
... |
function exportEphemeris(filetype,X,filename)
% Input
% X [7x:] [X Y Z Xdot Ydot Zdot timeStamp]
fileID = fopen([filename '.txt'],'w');
[~,m] = size(X);
if strcmp(filetype,'stk')
% Write ephemeris to inertial frame in STK format
stkVersion = 'stk.v.11.0';
InterpolationMethod = 'Lagrange';
centralBody = ... |
clc
clear all
close all
% Check Resolution of Camera
% imaqtool
% To check detailed information of Camera in MATLAB
% imaqhwinfo(videoinput('winvideo', 1));
% Start Camera & set image to Colored Image
video = videoinput('winvideo', 1, 'YUY2_640x480');
set(video, 'ReturnedColorSpace', 'RGB');
% Take Snapshot... |
%flat surfaces - exact solution
figure(1)
disp('point source through a tilted rectangular prism')
example_001
figure(2)
disp('column through a tilted rectangular prism')
example_002
figure(3)
disp('chromatic ray through a dispersive prism')
example_003
figure(4)
diosp('chromatic ray reflects from diffraction grating... |
function [recover_bitplane1,recover_bitplane2,recover_bitplane3,recover_bitplane4,recover_bitplane5,recover_bitplane6,recover_bitplane7,recover_bitplane8] = Recover_image1(Decrypt_I,compress_type_len,tag_preprocess,recover_start_ub,block_size,typeI1,typeI2,typeI3,typeI4,typeI5,typeI6,typeI7,typeI8,tag_NUB1,tag_NUB2,tag... |
function shape = shuffle_shape(expe)
sub_shape = shuffle_subshape;
shape_order = findmirror(expe);
% 2 last training shapes: not in the first two test blocks
pres = shuffle_subshape;
s = sub_shape(shape_order(5:end),:);
while sum(sum(ismember(pres(3:4,:),s(1:2,:))))~=0
pres = shuffle_subshape;
end
% allocate sha... |
close all
clear all
clc
addpath ../../../Matlab/Functions
% Décrit dans équilibre.m
% Position à l'équilibre de la sphère (pour tests statiques)
% xSeq = 0.000; % Position x de la sphère à l'équilibre en metres
% ySeq = 0.000; % Position y de la sphère à l'équilibre en metres
%
% %Point d'opération choisi p... |
function opa=decimate_optimums(z,op,opv)
% z zeros
% op optimums from d/dt=0
% opv optimums values
Lz=length(z);
Lop=length(op);
zop=[z; op];
zopv=[zeros(size(z)); opv]; % values
[zops ind]=sort(zop);
zopsv=zopv(ind);
isz=(ind<=Lz); % if zero in zops list
iszind=find(isz);
L1=length(iszind);
opa=[];
opva... |
function [A,S,E] = rcurve(M,TS,Idc)
%ACURVE Accommodation curve
% [A,S,E] = rcurve(M,TS,R,Idc) this function simulate the accommodation curve [A]
% for the durations [TS] of ramp. [A] has the same
% length as [TS]. The rheobase [R] is used for calculating the accommodation
% curve [A] and the accommodation slo... |
%一般计算区域二重积分计算模板
%quadl(@(x)arrayfun(@(xx)quadl(@(y) 被积函数f(xx,y),y的积分下限,y的积分上限),x),x的积分下限,x的积分上限)
y=quadl(@(x)arrayfun(@(xx)quadl(@(y) exp(sin(xx)) * log(y),5*xx,xx.^2),x),1,2)
%最外层quadl(@(x)f(x),1,2)
%f(x)支持向量输入,arrayfun(@(xx)g(xx),x)
%g(xx) quadl(@(y) exp(sin(xx)*log(y),5*xx,xx.^2)
|
function ruQ=ReasSetEqsUpsQ(v)
% REASSETEQSUPS checks if the reasonable set and the upper set are equal.
%
% Usage: ruQ=ReasSetEqsUpsQ(v)
%
%
% Define variables:
% output:
% ilQ -- Returns true (1) if the upper set and the reasonable set coincide,
% otherwise false (0).
% input:
% v -- A ... |
%{
MIT License
Copyright (c) 2017 Joris Gillis, KU Leuven
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... |
cd c:/shared/pcasl ;
pcat = load_untouch_nii('mc_paslcat.nii.gz') ;
pimg = pcat.img ;
p1 = pimg(:,:,:,1:2:200) - pimg(:,:,:,2:2:200) ;
p2 = pimg(:,:,:,201:2:400) - pimg(:,:,:,202:2:400) ;
p3 = pimg(:,:,:,401:2:600) - pimg(:,:,:,402:2:600) ;
allp(:,:,:,1:100) = p1 ; allp(:,:,:,101:200) = p2 ; allp(:,:,:,20... |
load('basePV1_basePV2_sensitivity_analyses_DATA.mat')
figure (1) %figure 5a-b in paper
subplot(1,2,1)
pcolor(a3_vec/1e3,a2_vec/1e3,behaviorcoord_storage)
colormap jet
shading flat
pbaspect([1 1 1])
xlabel('Baseline PV_2 ($10^5)')
ylabel('Baseline PV_1 ($10^5)')
set(gca,'FontSize',20)
title('Coordination')
... |
classdef BloodGlucoseAndHct
%% BLOODGLUCOSEANDHCT
% $Revision$
% was created 08-Apr-2017 23:39:13 by jjlee,
% last modified $LastChangedDate$ and placed into repository /Users/jjlee/Local/src/mlcvl/mlraichle/src/+mlraichle.
%% It was developed on Matlab 9.2.0.538062 (R2017a) for MACI64. Copyright 2017 J... |
function test_suite = test_assertFilesEqual
%test_assertFilesEqual Unit test for assertFilesEqual
% Steven L. Eddins
% Copyright 2009 The MathWorks, Inc.
initTestSuite;
function test_equal
assertFilesEqual('black.tif', 'black.tif');
function test_differentSize
assertExceptionThrown(@() assertFilesEq... |
function [x,y,z,Energy,TotalEnergy1MCS,ColorMatrix] = InitializeMatrices_3D_QPOTTS(NoLatticePoints,Q,MonteCarloSteps)
x=zeros(NoLatticePoints,NoLatticePoints,NoLatticePoints);y=x;z=x;
Energy=x;
TotalEnergy1MCS=zeros(1,MonteCarloSteps);
ColorMatrix=rand(Q,3); |
tic
for i = 1:1000
A = rand(5,5);
if rank(A) == 5
A_inv = A^(-1);
end
end
toc
tic
for i = 1:1000
A = rand(5,5);
if rank(A) == 5
% A_inv = YToolkits.QR_inverse(A);
% % A_inv = inv(A);
A_inv = A\eye(5);
end
end
toc
|
% Modified KTS from Kording, Tenenbaum, Shadmehr
close all
clear all
%% Joint parameters
states = 30; %how many hidden states to use
taus = exp(-linspace(log(0.000003),log(0.5),states)); %calculate the timescales
A = diag(1-1./taus); % the transition matrix
C = ones(1,states); % the observation matrix
Q = di... |
%% Initialise
clc;
clear;
close all;
addpath('..\functions and GUI')
run('..\vlfeat-0.9.21-bin\vlfeat-0.9.21\toolbox\vl_setup.m')
warning off % suppress warnings
%% Function parameters and Ordering
num_of_imgs = 9; % min = 2, max = number of images to stitch
uniq = 1.25; % u... |
%%Example of plotting ROC curve for fish classfication (1:seabass, 0:
%%salmon)
FishSkinTone=[-2 -1 0 1 3.9 1 1.5 2 2.5 3.9]; %Given skin tone values for 10 different fish
GroundTruth=[1 1 1 1 1 0 0 0 0 0]; %given ground truth (true fish labels)
Likehd1=normpdf(FishSkinTone,mean(FishSkinTone(1:5)),std(FishSkin... |
function waittext_test(benchmark)
%WAITTEXT_TEST Suite of unit tests and benchmarks for WAITTEXT.
% WAITTEXT_TEST is used for development of the WAITTEXT function and runs a
% series of unit tests to confirm proper operation.
%
% WAITTEXT_TEST(BENCHMARK) when BENCHMARK is true runs a series of benchmarks
% th... |
% Tests fitEigvec routine for stability
% Initialize Data
n = 100; % Size of Matrix
k = 10; % Size of Subset
A = rand(n);
[V, D] = eig(A);
d = diag(D);
win = 1:k;
% ~~~~~ FIRST WORK ON UNSTABLE METHOD ~~~~~~~ %
method = 'both';
% Fit without noise
V_in = V(1:10, win);
V_in = normalizematrix(V_in);
d_in = d(win);
[fR... |
function Yv = y_vetorization(Y, s)
Yv = zeros(size(Y,1),s);
for i=1:size(Y,1)
Yv(i,Y(i)) = 1;
end
end
|
clear
data=importdata('/home/ywh/work2/git/emc2/build_x86/tests/qmode3');
sizedata=size(data);
lenth=sizedata(1,1);
xmax=data(lenth,1)+1;
ymax=data(lenth,4)+1;
b=data(:,2:3);
figure (1);
% axis([0,xmax,-20,20]);
hold on;
plot(data(:,1),data(:,2),'-k','LineWidth',2);
legend('a');
grid on;
hold on;
figure(2)
% axis([0,x... |
function y = evaluateLine(x,point1,point2)
slope_intercept = [point1(1) 1; point2(1) 1]\[point1(2); point2(2)];
y = slope_intercept(1) * x + slope_intercept(2);
end
|
% Gavin Sabine 1001020462 Numerical Project Method Comparison
clc
clear variables
%----------parameters-----------------
func = @(x) ((1-cos(x))./x);
a = 0;
b = 2*pi;
n = 50; %maximum number of points used
xPlot=linspace(1,2*n-1,n);
y=zeros(1,n); %the ans to the interegration
%--------------main function-------------
... |
% Variables Used:
%
% maze : maze representation in a matrix
% direction : The direction selected by an user ('n','e','w','s')
% playerPosition: The current player's position is provided
% updatedMaze : The maze after shooting a paint ball.
% complete: This should contain a boolean value representing the game.
% ... |
function taskNum_CoflowNum = parseMasterLog(masterLogFilename)
fID = fopen(masterLogFilename, 'r');
if ( fID == -1 )
error('could not open file %s', masterLogFilename);
end
taskNum_CoflowNum = [];
while ~feof(fID)
taskNum = fscanf(fID, '%d', 1);
coflowID = fscanf(fID, '%d', 1);
taskNum_Cofl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.