text stringlengths 8 6.12M |
|---|
function [s_i] = solve_si(i,X)
eps = 0.05;
x_i=X(:,i);
f = ones(1,size(X,2));
f = [f,f];
A = [X;-X];
A = [A,-A];
b = [x_i+eps,eps-x_i];
Aeq = [ones(1,size(X,2))];
s_ii = zeros(1,size(X,2));
s_ii(i) = 1;
Aeq = [Aeq;s_ii];
Aeq = [Aeq,-Aeq];
beq = [1,0];
[y,z]=linpr... |
function contact = left_toe_contact(robot)
% The left toe contact point
contact.frame = ToContactFrame(robot.ContactPoints.LeftToeBottom,...
'LineContactWithFriction');
contact.fric_coef.mu = 0.6;
contact.fric_coef.gamma = 100;
contact.geometry.la = 0.05;
contact.geometry.lb = 0.0... |
%demonstrate t-distribution
% from Parameter Estimation and Inverse Problems, 3rd edition, 2018
% by R. Aster, B. Borchers, C. Thurber
clear
x=-4:.01:4;
figure(1)
clf
bookfonts
for nu=[3 20]
plot(x,tpdf(x,nu),'k')
hold on
end
plot(x,normpdf(x,0,1),'k--');
hold off
ylabel('f_t(x)')
xlabel('x')
text(-2.8,0.01,'\... |
function [ dx ] = f_rkmk( x )
%F_RKMK
global A m r N DC DN E g;
u = x(1:3);
v = x(4:6);
alpha = x(7:8);
An = A(N(alpha(1),alpha(2)));
T_a = m*r^2*(2/5*eye(3)-An^2);
w = T_a\v;
du = (eye(3)-1/12*A(u)*(6*eye(3)+A(u)))*w;
dalpha = r*(E(alpha(1),alpha(2))\(DC(alpha(1),alpha(2))'*A(w)*N(alpha(1),alpha(2))'));
dv... |
function [u,v,V]=Get_Velocity(w)
rho=w{1};
rhou=w{2};
rhov=w{3};
u=rhou./rho;
v=rhov./rho;
V=sqrt(u.^2+v.^2);
end |
%% ROS Initialization
% Initialize
setenv('ROS_MASTER_URI','http://192.168.91.135:11311')
setenv('ROS_HOSTNAME','192.168.91.1')
setenv('ROS_IP','192.168.91.1')
rosinit |
%%
% 2018.05.02
% 1.重新筛选心肌梗死的数据,仅从diag描述中筛选
% 2.随机选择相同比例的训练数据和测试数据
%%
clc
clear
path = 'E:\DataBase\180413ecg\data\Classify_f';
outpth = 'E:\DataBase\MI0502_MedianWave';
type = {'前壁心肌梗死','侧壁心肌梗死','前侧壁心肌梗死','前间隔心肌梗死','间壁心肌梗死','下壁心肌梗死','下后壁心肌梗死','急性心肌梗死','正常心电图'};
% for jj = 1:length(type)
% MI_path = [path '\' typ... |
% Program to add one layer of water to r and/or c side of a Modl that has an odd number of
% elements (which causes Fourier transform to shift wave as it is propagated).
% If the Modl is already odd in one or more r, c directions, no additional layer added.
% May 13, 2019 Copyright D. Christensen
[file... |
%File of points we would like to create
file_points = fopen('point.in','w');
%Print the number of points on the first line
fprintf(file_points,'%i\n', size(P,1));
%Print the coordinates of the points row for row.
for i = 1:size(P,1)
fprintf(file_points,'%f ', P(i,1:end-1));
fprintf(file_points,'%f\n', P(i,en... |
function [wavelet]=haarWavelets(frames,n)
wavelet=[];
for i=1:size(frames,1)
tmp=frames(i,1:n);
%wavelet(i,:)=HaarDecomposition(tmp,'max');
wavelet(i,:)=wavedec(tmp,6,'haar');
end
for j=1:n
% wavelet(:,j)=HaarDecomposition((wavelet(:,j))','max');
wavelet(:,j)=wavedec(wavelet(:,j),5,'haar');
end
... |
% load('Feature_Train.mat')
% final_feature1 = transpose(F_Train);
% % n = size(F_Train,1); % no of training images to consider
count =0;
Digit_Prior;
for k =1:1000
k
test_id = k;
submatrix = F_Test(test_id,:);
likelihood_matrix =[];
likelihood =1;
for digit = 0:9
l... |
clc;
clear;
close all;
warning off;
addpath 'func\'
%cloud computing parameters
cloudcal_parameter;
D = M*N; %search space
woa_idx = zeros(1,D);
woa_get = inf;
%initialize individuals
for i=1:Num
for j=1:D
xwoa(i,j)=randn;
end
end
for t=1:Iters
t
for i=1:Num
%... |
function [out1,out2,out3] = checkFileTimes_Best2(recentTimes,pastTimes)
% Method to make sure each of the most recent files in the matrix is not a
% duplicate
% Variable to keep track of the number of times this function has been
% called...it will automatically resent back to 0 when reaching 100
persistent fu... |
function [ WindowSize ] = Ask_WindowSize( Data_Length )
flag = true;
while flag
fprintf ('\n\n[Length of the given Input data is %d]', Data_Length)
str = sprintf('\nPlease Enter the Moving Window Size [ >= 3 and <= %d]:', Data_Length);
WindowS... |
%% INFORMATION
% Dec 2018; Last revision: 7-Dec-2018
% Dependencies: nctoolbox.github.io/nctoolbox/
% Remember to run the command "setup_nctoolbox".
% The user inputs are on lines 13 (choose variable), 19 (choose month), and 21 (choose depth level).
%% 1. Load the Data
bathydir =... |
function [s] = similarity_image(HLGPP_CRe,HLGPP_Re,HLGPP_CIm,HLGPP_Im,HGGPP_CRe,HGGPP_Re,HGGPP_CIm,HGGPP_Im);
s1=0;
s2=0;
s3=0;
s4=0;
s = 0;
for v=1:5
for i =0:63
s1 = s1 + sum(min(HGGPP_CRe(v,i*16+[1:16],:),HGGPP_Re(v,i*16+[1:16],:)));
s2 = s2 + sum(min(HGGPP_CIm(v,i*16+[1:16],:),HGGPP_Im(v,i*16+... |
% ContinueCompare.m
%
% Example Category:
% Counter
% Matlab(2010 or 2010 above)
%
% Description:
% This example demonstrates how to use Continue Compare Counter function.
%
% Instructions for Running:
% 1. Set the 'deviceDescription' for opening the device.
% 2. Set the 'channel' as the channel... |
function center = get_mask_center(mask)
[y, x] = find(mask);
center(1) = (min(x)+max(x))/2;
center(2) = (min(y)+max(y))/2; |
function result = f_mleCook(M,B,grp,txt,verb,pdf,bs)
% - maximum likelihood estimation via Cook's constrained corrected classification
%
% USAGE: result = f_mleCook(M,B,grp,txt,verb,pdf,bs)
%
% M = mixture data (= UNKNOWN SET) (rows = obs, cols = variables)
% B = baseline data (= TRAINING SET)
% grp ... |
clear, close all
n = linspace(0, 0.5, 1024);
x = 4 * sin(2*pi*100*n) + randn(size(n));
X = fft(x);
X = abs(X);
M = zeros(1, 1024);
M(44:55) = 1;
M(970:980) = 1;
Y = X.*M;
y = real(ifft(Y));
subplot(4,1,1);
plot(n, y, 'r+')
ylabel('y')
xlabel('t (\times \pi)')
title('a graph of the original ampli... |
function [gamma] = temporaldamping(f, kperp, kpar, w, m, wch, qh, mh, ...
qs, Ns, ms, nus, B0, TOL, INTEGMETHOD)
% Compute the temporal damping rate gamma in a hot plasma for the
% resonances given in the vector m (m=0 is Landau damping, +-1 is the
% cyclotron resonance.
%
% f = cell ... |
%L1 Cubature weights
configs = jsondecode(fileread('configs.json'));
%'%05.f'
input_dir = '/home/lawson/Workspace/AutoDef/models/x-final/training_data/training/';
E = readDMAT([input_dir, 'energy_', num2str(1),'.dmat']);
for ii=2:500
E_n = readDMAT([input_dir, 'energy_', num2str(ii),'.dmat']);
E = [E E_n];
end
... |
function [ dx ] = Plaque_plane_6DDL ( t,x )
variables_plaque;
%rotquaternion test ode solution for rotating quaternion
% Detailed explanation goes here
% x(1,2,3) contains P, Q, R
% rotation velocity in radian P, Q, R
% x(4,5,6,7) contains q1, q2, q3, q4
% x(1) => P= d(phi)/dt
% x(2) => Q= d(theta)/dt
% ... |
function [image, btable, vs, mat]= read_src(file_name)
%
% This function returns image (= nifti.data), btable(bvals, bvecs), and vs.
%
% EXAMPLE
%
% file_file = 'SE_diffusion_weighted.src.gz';
% [image, btable, vs, mat]= read_src(file_name);
%
% SO @Vista lab 2014
if ~exist('file_name')
file_name = ... |
function [ plate ] = PlateIsolation( images, mask )
%If this function receives two arguments, image and mask it tries to
%isolate the ROI in the image based on that mask. If it only receive the
%image it assumes that the license plate represents the majority of the image and
%tries to isolate the ROI based on the numbe... |
function [ time ] = outputTime( timestamp )
%This function ouputs just the time portion of the timestamp
hours=str2num(datestr(timestamp/86400+datenum(1970,1,1), 'HH'));
minutes=str2num(datestr(timestamp/86400+datenum(1970,1,1), 'MM'));
seconds=str2num(datestr(timestamp/86400+datenum(1970,1,1), 'ss'));
time=minute... |
function [y c r] = wanted_char(str,char_list)
% [y c r] = wanted_char(str,char_list)
% Check the first character, which is not white-space or control character, in the given char_list.
% If it is, y = the index of character apperred in the char_list, otherwise y = 0.
% Return y, the character (c) and the remainder stri... |
function permute_vocalizations(count, data_path)
% permute
disp('permuting...');
temp_png_file = strcat(data_path, 'temp.png');
temp_png_raw_file = strcat(data_path, 'tempr.png');
temp_csv_file = strcat(data_path, 'temp.csv');
temp_mat_file = strcat(data_path, 'tem... |
function obj = parkingSpaceXML(obj,parkingSpace)
%parkingSpaceXML Parsing the XML to the corresponding classes and properties
%
%----------------------------------------------------------------------
% BSD 3-Clause License
%
% Copyright (c) 2020, Jonas Wurst, Alberto Flores Fernández
... |
%scale = 1e0
model_opt = 'logistic_regression';
if strcmp(model_opt,'logistic_regression')
sum_time_seq_OGD = [100 200 300 400 500 700 800 900];
sum_f_seq_OGD = [ 0.0312 0.034 0.036 0.038 0.0388 0.04 0.042 0.0426];
sum_time_seq_OMGD = [100 200 300 400 500 700 800 900];
sum_f_seq_OMGD = [0.0062 0... |
function kts = mph2kts(mph)
%MPH2KTS Convert speed from miles per hour to knots
%
% kts = MPH2KTS(mph) convert speeds from miles per hour to knots.
%
% See also MPH2KMPH, MPH2FTPS, MPH2MPS, KTS2MPH.
% Jonathan Sullivan
% Original: May 2011
% jonathan.sullivan@ll.mit.edu
kts = mph*0.868976; |
function compute_normals_from_file(filename)
profile off;profile on
W=2; % filter radius
R=imread(filename);
R=double(R);
% f = 400.0; % focal length of asus kinect
f = 525.0; % focal length of asus kinect
invf = 1.0/f; % inverse focal length of asus kinect
[U,V]=meshgrid((1:size(R,2))-size(R,2)/2,(1:size(R,1))-size(R... |
function ders = Der1BasisFun(i,u,p,U)
%--------------------------------------------------------------
%function ders = Der1BasisFun(i,u,p,U)
% NURBS-Book modified (algorithm A2.3)
% evalute nonzero basis functions and first derivative
%INPUT:
% i : current knotspan
% u : evaluation point
% p ... |
function X = FK(q,robot)
T = Tz(robot.links(1,1))*Rz(q(1))*Tx(robot.links(2,1))*Ry(q(2))*Tx(robot.links(3,1))*Ry(q(3))*...
Tx(robot.links(4,1))*Rx(q(4))*Tx(robot.links(5,1))*Ry(q(5))*Tx(robot.links(6,1))*Rx(q(6))*Tx(robot.links(7,1));
b = asin(T(1,3));
if abs(b-pi/2) < 1E-3
c = 0;
a = acos... |
function [J, grad] = costFunctionReg(theta, X, y, lambda)
m = length(y); % number of training examples
J = 0;
grad = zeros(size(theta));
h = sigmoid(X*theta);
J = -(1/m) * ((y'*log(h))+(1-y)'*log(1-h))+(lambda/(2*m))*(theta(2:length(theta)))'*theta(2:length(theta));
theta0 = theta;
theta0(1)=0;
grad = ((1 / m)... |
function arranged_pos = arranged_position(base_pos,N,gap,z)
% arranged_position(base_pos,N,gap,z)
% base_pos を基準にgap 間隔でx-yに整列した初期値を生成
% 高さはzで一定
kpos=ceil(sqrt(N));
cpos=floor(N/kpos);
rempos=mod(N,kpos);
[xpos,ypos]=meshgrid(1-floor(kpos/2):ceil(kpos/2),1-floor(cpos/2):ceil(cpos/2));... |
img = imread('moon.tif');
lap = fspecial('laplacian');
img_lap = imfilter(img, lap);
figure('Name', 'Original');
imshow(img);
figure('Name', 'Laplacian Blur');
imshow(img_lap, []);
figure('Name', 'Sharp');
imshow(img - img_lap); |
% comparison of the constanst used in AUTO and chebfun
%% Parameters used in AUTO
% beam base structure material constants
lp = 100.0e-3;
Ys = 10.0e10;
rhos = 7.165e3;
hs = 0.25e-3;
b = 20.0e-3;
% piezo layer material constants
c11E = 66.0e9;
rhop = 7.80e3;
hp = 0.2e-3;
ep33S= 15.93e-9;
e31 = -12.54;
... |
function K = GetCovariance(X,sigma)
[num,~] = size(X);
K = zeros(num,num);
for i = 1:num
for j = i:num
K(i,j) = RBF(X(i),X(j),sigma);
K(j,i) = K(i,j);
end
end
end |
clear
clc
%*********初始化
M=20; %种群规模
x1=rand(M,1); % 初始化粒子位置
x2=rand(M,1);
%x3=rand(M,1);
%X=[x1,x2,x3]
X=[x1,x2];
c1=2; % c1和c2是学习因子
c2=2;
wmax=0.9; % 最大最小惯性权重
wmin=0.4; % 线性减小惯性权重
Tmax=50; % 迭代次数
%v=zeros(M,3);
v=zeros(M,2); % 初始化速度
% v1m=0.1; % 速度1约束
% v2m=1;% 速度2约束
%******* 全局最优粒子位置初始化
fmin=1000;
for i=1:M
f... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Creating Feedback control using ekf.
%
% - Prabhjeet Singh Arora
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear
% Time
dt = 0.1;
tf = 60;
t = 0:dt:tf;
m = length(t);
% System m = 1, c = 2
% x_dot = [x_2;2x_1 -3x_2]+ BKx + w_k
A = [0 1;-2 2];
B = [0;1];... |
function [ label_data,unlabel_data,labels,test_data,tast_labels ] = lilun( trace )
%LILUN 理论数据的生成
%%
% trace2=trace;
% trace=trace1;
sizeM = 2000;
label_sample_num = 100;
index_label_data_1 = randperm(sizeM,label_sample_num);
label_data_1=trace(:,index_label_data_1);
index_label_data_2 = 2000+randperm(3000,lab... |
%nb = input(' Nombre de types de documents différents ');
D =[dir(fullfile('.','*.gif'));dir(fullfile('.','*.png'));dir(fullfile('.','*.jpeg'));dir(fullfile('.','*.jpg'));dir(fullfile('.','*.pdf'))];
chemin = strcat(D(1).folder,'\');
nbImg = size(D,1);
arg = ['le dossier contient ',num2str(nbImg),' images'];
c... |
function writeexp(expfile,datdir,theta,phi,id,int,ledon,sndon)
% Save known trial-configurations in exp-file
%
%WRITEEXP WRITEEXP(FNAME,DATDIR,THETA,PHI,ID,INT,LEDON,SNDON)
%
% WRITEEXP(FNAME,THETA,PHI,ID,INT,LEDON,SNDON)
%
% Write exp-file with file-name FNAME.
%
%
% See also GENEXPERIMENT
%
% Author: Marc... |
%Direkte Kinematik
clc
clear
close all
%Denavit-Hartenberg Parameter
DH = [
[0 128 0 90 ]; %1
[0 0 -612 0 ]; %2
[0 0 -572.3 0 ]; %3
[0 163.941 0 90 ]; %4
[0 115.7 0 -90]; %5
[0 92.2 0 0 ]; %6
];
DH(:,[1 4]) = deg2rad(DH(:,[1 4])); %Umr... |
format compact
clc
% matrix in matlab we use ;
m = [1 2 3; 4 5 6; 5 6 7; 8 9 10]; % matrix 4x3
disp('4x3 matrix: ');
disp(m);
% max(between size of row and collunm - this function returns the size of the longest dimension of X)
fprintf('Length of m: %d\n', length(m));
disp('Array using: ');
mm = [1:3; 4:6; 7:9]; % ... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2014 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:/... |
clc;
clear all;
load homoIndep.mat
load homoCa.mat
c=1.6;
g=0.08;
cmd = ['-c ',num2str(c),' -g ',num2str(g),' -b ',num2str(1)];
model1=svmtrain(Ca(:,1),Ca(:,101),cmd);
[predictions_fIndepSVM,accuracy1,dec_values1]=svmpredict(Indep(:,1),Indep(:,2:101),model1,'-b 1');
[ACC,SN,SP,PPV,NPV,F1,MCC] = roc1(prediction... |
% this function take the task of reSeq:
%
%start,stop = 1xn double
%gradStart, gradStop = 1xn double
function [Start, Stop]= reSeq2(start,stop,trace, varargin)
%default
recalc = 0;
if nargin == 5
recalc = varargin{1};
end
if length(start) <=2 || length(stop) <=2
Start = start;
Stop = sto... |
% INPUT:
% --------
% RGBint: a Nx3 matrix with one RGB value per row, in [0..255]
%
% OUTPUT:
% --------
% xy : a Nx3 matrix,
%
function [xy] = rgb_2_xy_testV(RGBint)
% [srgb] = RGBint_2_sRGB(RGBint);
%scale to [0..1]
rgb = RGBint/255;
%% convert rgb to XYZ
% Input RGB is companded, needs first to go to linear RGB ... |
clear;
load('G:\无源感知研究\数据采集\2019_07_18\实验室(3t3r).mat');
sample_num = size(csi_train,1);
for i=1:sample_num
amplitude = csi_train{i};
sequenceLengths(i) = size(amplitude,1);
end
for i=1:sample_num
amplitude = csi_train{i,1};%读取序列
amplitude = hampel(amplitude');%hampel滤波
amplitude = wifi_butterworth... |
function [Tp] = bilinear(x,y,T,Px,Py)
%bilinear: Bilinear of interpolation of T(x,y) to get Tp(Px,Py)
%Input: x, y, T, Px, Py -one dimensional xgrid, ygrid and
% two dimensional T and target point Px, Py
%
%Output: Tp- Temperature at Px, Py
if (nargin ~= 5)
Tp = 'Error wron... |
function [B,L,var,fac,E] = FA(X,s)
% FA Factor analysis (principal factoring technique)
%
% The reason to favour this method opposite to maximum likelihood
% (Statistics toolbox) is no distributional assumptions. In comparison to
% SPSS program, this provides the same results. We expect identical
% numerical sol... |
function [LP, EP, TP, testIm1, margin] = MultiLeafAlignment(testIm, testMask, template, templateMask, templateTip, Parameters)
% INPUT:
% - testIm: a binary matrix of the edge map
% - testMask: a foreground mask
% - template, templateMask, templateTip: are cells containing all template
% information, their sizes... |
%% ========================================================================
% y2 function (example2)
% written by Dongjin Lee (dongjin-lee@uiowa.edu)
%% ========================================================================
function [output]=responY2(X,mu)
%Multivariate Gaussian score function
global cntY2;
cntY... |
function setloads(filename)
allData = importdata(filename);
names = allData.textdata;
loads = allData.data;
for i=1:size(names)
set_param(names{i}, 'ActivePower', num2str(loads(i,1)));
set_param(names{i}, 'InductivePower', num2str(loads(i,2)));
set_param(names{i}, 'CapacitivePower', num2str(loads(i,3)));
... |
% Andrew Brown Lab 3 Problem 4
clc
clear
%Write a script that keeps getting a number from the user. If that number
%is positive, print positive; negative, print negative. If it is zero,
%print zero and then stop. Demonstrate with any sequence that mixes
%positives and negatives before giving it zero.
x=input('Num... |
function [dev,inputs]=A_build(source)
% function dev=A_build(source)
%
% Define the semiconductor device to be simulated and simulate at
% thermal equilibrium @ temperature=REF.T
%
% source = diktat file name
%
global CONST A_FID VERBOSE
if nargin == 0
error('A_build.m: no diktat file specified');
end
a_init;
i... |
function currentStatus = isReady(arduino, oldStatus)
%Checks on the current status of the Arudino. 1 = Ready. 0 = Busy.
%Empty out the current buffer and all new text
read = 'noByte';
while arduino.BytesAvailable > 0
read = fscanf(arduino, '%s');
end
%Do not change the status if no bites were available
if s... |
clc;
addpath('./Shared/');
addpath('./Questions/');
addpath('./dlmtbx/');
|
% This model is the Connors-Stevens model, similar to Hodgkin-Huxley, but
% more like neurons in the cortex, being type-I.
% See Dayan and Abbott pp 166-172 then pp.196-198 and p.224.
clear
dt = 0.000005;
tmax=1;
iclamp_flag = 1; % if this is 1, run under current clamp conditions
vclamp_flag = 0; % otherwise this sho... |
function [c_labels, centroids] = myKMeansClustering(data, K)
%% Implements a k-means clustering algorithm
%
% Input:
% data: num_features x num_data_points matrix, containing the data features
% K: int, parameter for the kNN classifier
% Output:
% c_labels: 1 x num_data_points vecto... |
function CheckSystem(A)
% CHECKSYSTEM checks whether system is composed correctly.
%
format_message = ['\nSystem of inequalities A*x<=b must be defined ',...
'as a structure S, with S.A = A, S.b = b and S.var - a list of variables indexes.\n',...
'For more details please see the package documentation.'];
if iss... |
function [value,isterminal,direction] = intersect_event(t,y)
%creates event if any cells self intersect. Usually stops code if this is
%the case if used as an event in the code
global C
[V,V_ref] = matricize(y);
value = is_self_intersecting(C,V) || is_self_intersecting(C,V_ref);
value = double(value);
direction = 0;
i... |
%% Melakukan testing menggunakan model probabilistik
clear;
clc;
close all;
% Membaca data Train dan data Test
dataTrain = csvread('data_train_PNN.csv');
dataTest = csvread('data_test_PNN.csv');
train = dataTrain(1:150,:);
valid = dataTest(1:30,:);
train_sort = sortrows(train, 4);
% Memisahkan data train sesuai deng... |
load('B')
figure
subplot(2,1,1)
plot(0:.2:400,ENeuron,'k')
ylim([-80 40])
set(gca,'YTick',[-80:40:40])
ylabel('Voltage (mV)')
title('Excitatory Neuron')
box off
subplot(2,1,2)
plot(0:.2:400,INeuron,'color',[.5 .5 .5])
ylim([-80 40])
set(gca,'YTick',[-80:40:40])
ylabel('Voltage (mV)')
box off
title('Inhib... |
classdef ClosedLoopMPC < Controller.AbstractMPC
%
properties
%
%
%
end;%
%
%
% ---------------------------------------------------------------------
methods
%
function tController = ClosedLoopMPC( tParameters )
%
tController = tController@Controller.AbstractMPC( tParameters );
%
%
... |
try
close 2;
close 3;
close 4;
close 5;
close 6;
catch
end
resolution=ceil(length(all.T_dif)/1000);
figure(2)
set(gcf,'name','Annually DHW','units','centimeters','position',[0.5 2 16 7], 'color','white','PaperUnits','centimeters','PaperType','A4','PaperOrientation','landscape','PaperPosition... |
function [] = make_fmri_parallel_jobs(datafilename, numofparalleljobs, datafolder, savefolder)
if(nargin<1)
% datafilename = '88_100316CR_1-pol_20140129T132253';
datafilename = 'fmriGP_whole_20140130T111128';
end
if(nargin<2)
numofparalleljobs = 50;
end
filename = 'fmriGP_script_wholebrain_p';... |
function error=rmse(x,t),
%
% RMSE error function
%
% error=rmse(x,t)
%
% x = salida obtenida
% t = salida deseada
%
error = sumsqr(t-x)/sumsqr(t-mean(t));
|
%This function checks to see if a rectangle is bounded by tracks
function [OutBool , NumFilledOut]=CheckOutBoundGround(LocIminT,LocImaxT,LocJminT,LocJmaxT,SubPixRes,IpixelsFillA,FillNoFillVal,ImSize,NumFilled)
LocImin=max(LocIminT-1,1);
LocImax=min(LocImaxT,ImSize(1));
LocJmin=max(LocJminT-1,1);
LocJmax=min(LocJmaxT... |
function claxis
% claxis -- Clear plot axis
% Usage
% claxis
axis([0 1 0 1]); axis;
%
% Part of WaveLab Version 802
% Built Sunday, October 3, 1999 8:52:27 AM
% This is Copyrighted Material
% For Copying permissions see COPYING.m
% Comments? e-mail wavelab@stat.stanford.edu
%
|
function newobjectivesolution = golocalsearch(inputquantityshipped, quantityshipped,objectivesolution);
nosp = 5; %reads the number of sales points considered
global nopd salespointresiduals
noft = 4; %reads the number of factories
%nopd = 6; %number of planning period
trkcap = 70; %Ca... |
function dfdpval = SEIR_var_dfdp(t,y,p,more)
beta = more.beta_fun(t,p,more);
beta = beta(:);
dbetadp = more.beta_dfdp(t,p,more);
n = size(y,2);
r = zeros(length(t),n,n,length(p));
r(:,1,1,more.beta_ind) = diag(y(:,1)*(p(2)+y(:,3))) * dbetadp;
r(:,2,2,more.beta_ind) = diag(y(:,1)*(p(2)+y(:,3))) * dbetadp;
r(:,1,2,mor... |
% Tanvir Ferdousi
% Kansas State University
% Last Modified: Oct 2018
% Copyright (c) 2019, Tanvir Ferdousi. All rights reserved.
% Redistribution and use in source and binary forms, with or without
% modification, are permitted
% Runs simulations for a range of different parameters (one at a time)
clear; clc
%% Ini... |
% sequentiallly determined integer control on two genotype modelsfor
% sub-intervals of length t_int
clear all
close all
% set parameters
global beta mu_M D_M psi1 u
beta=1.5;
mu_M= 1/(5*365);
D_M=1/20;
u=0;
psi1=0.9;
%mu_M=1.6;
% set up ode model from functions
dx_m=@(t,x)geno_2_mean_dyn(t,x);
dx_v=@(... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
%
% step response
a=[1 -1];
b=[.2 .1];
n=0:100;
u=ones(size(n));
s=filter(b,a,u);
stem(0:100,s);
title('Step response of the system')
|
%% Load display setup
projectName = 'ISETImagePipeline';
dataBaseDir = getpref(projectName, 'dataDir');
displayFile = 'CRT12BitDisplay.mat';
display = load(fullfile(dataBaseDir, displayFile));
%% Create the cone mosaic, test run
retina = ConeResponse('eccBasedConeDensity', true, 'eccBasedConeQuantal', true, ...
'... |
%clear variables
clc; clear; close all;
% change this path if you install the VOC code elsewhere
addpath([cd '/VOCcode']);
% initialize VOC options
VOCinit;
VOCopts.testset='test';
% VOCopts.testset='val';
results_auc = pascal_classifier( VOCopts );
latex_table( VOCopts.classes, results_auc, 1 ); |
classdef ExplicitMPC < Controller.Controller
%
properties
%
% -----------------------------------------------------------------
% cost function
afLinearCostMatrix;
aafQuadraticCostMatrix;
%
% -----------------------------------------------------------------
% optimization inputs
tConstraints;
t... |
%% Mean field inference
fprintf('Running Mean Field Inference...\n');
[nodeBelMF,edgeBelMF,logZMF] = UGM_Infer_MeanField(nodePot,edgePot,edgeStruct);
figure;
imagesc(reshape(nodeBelMF(:,2),nRows,nCols));
colormap gray
title('Mean Field Estimates of Marginals');
fprintf('(paused)\n');
pause
% fprintf('Running mean fi... |
nSkip = 0;
load('all_cases.mat');
fmdl_recon = create_thorax_fem_simon(32, nSkip, 0.05, 0, 0, 0);
hp = logspace(-7,-5,10);
beta = 0.5;
BR = zeros(length(beta),length(hp));
for i = 1:length(beta)
for j = 1:length(hp)
imdl = mk_hpselection_imdl(cases{i}.fmdl,fmdl_recon, 1,0,'bestres',1,0,2);
... |
% Controller Parameters
% Number of Operation Mode & Motor
num_mode = 2; % number of operation mode
num_motor = 3; % number of motor
% Task Sample Rates
ts1 = 50; % ts1 sample time [msec]
ts2 = 100; % ts2 sample time [msec]
ts3 = 200; % ts3 sample time [msec]
% Times
tim... |
function varargout = conf(varargin)
% CONF MATLAB code for conf.fig
% CONF, by itself, creates a new CONF or raises the existing
% singleton*.
%
% H = CONF returns the handle to a new CONF or the handle to
% the existing singleton*.
%
% CONF('CALLBACK',hObject,eventData,handles,...) calls the l... |
function [fval] = DummyCustAssign(storeLoc,commX,commY,commSize,congest,timeScale,k)
%UNTITLED6 Summary of this function goes here
% Detailed explanation goes here
storeX = storeLoc(1:k)';
storeY = storeLoc(k+1:2*k)';
[~,fval] = CustomerAssignment(storeX,storeY,commX,commY,commSize,congest,timeScale);
end... |
clear all;
player_move = 0;
previous_move = 0;
previous_outcome = 0;
AI_agent = 'random';
round_counter = 0;
wins = [0,0,0]; %wins vector, player, AI, draws
win_matrix = [];
%WIN_MATRIX
%row 1 = random_agent
%row 2 = wslfds_agent
%row 3 = wslbds_agent
%row 4 = wslsds_agent
%row 5 = wslfdf_agent
%r... |
function [oil_conductance, water_conductance, A_oil, A_water] =...
conduct_drain(Pc_threshold,rec_angle,half_angles,geometry,...
G_factor,total_A,sig_ow,rInscribed)
% Patzek's approach to find corner fluid area and conduactance.
% This model is based on paper:
% "Patzek ;Verification of a Complete Pore Net... |
%% Verify Marginal Likelihood Equation with Interventional Data
% "Causal Discovery from a Mixture of Experimental and
% Observational Data" Cooper & Yoo, UAI 99, sec 2.2
%#testPMTK
G = zeros(2,2); G(1,2) = 1;
CPD{1} = TabularCPD([0.5 0.5], 'prior', 'BDeu');
CPD{2} = TabularCPD(mkStochastic(ones(2,2)), 'prior', '... |
%% Midterm Question 4 (Take 2)
% Paul "Nick" Laurenzano
%% Setup
clear;
close all;
%% Overview
% For the shown RPP robot...
%% A
% Calculate the inverse kinematic equations for the three joint variables
% theta1, d2 and d3, given X, Y and Z. Type them into the window as your
% answer. Save them for the question belo... |
[Y, X] =svmlread2('arxiv.train');
[Z, W] =svmlread2('arxiv.test');
PredictedClass=zeros(32487,1);
Ypositive=Y(X==1,:);
Ynegative=Y(X==-1,:);
TotalPositiveWordOccurence= sum(Ypositive);
TotalNegativeWordOccurence=sum(Ynegative);
%[x,y,v]=find(Ypositive(:,:))
%TotalPositiveWords=length(unique(y))
vocab=99758;
TotalPo... |
% DEC.m - DEC class
%
% Copyright (C) 2013 Integrated System Laboratory ETHZ (SharperEDGE Team)
%
% This program is free software: you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by the
% Free Software Foundation, either version 3 of the License, or (at your
% o... |
function update(epb)
lastupdate = epb.LastUpdate;
starttime = epb.StartTime;
val = epb.Value;
% Enforce a minimum time interval between updates
if isempty(epb.TimeString) || etime(clock,lastupdate) < 0.01
return
end
if val >= 1
timeleftstr = 'done.';
else
runtime = etime(clock,starttime);
... |
function tab=Step_5(n)
tab = 1*[ ...
0,0.7,1; % light blue
0,0,1; %%blue
1,1,0; %%yellow
1,0.7,0; %%orange
1,0,0]; %%red
|
method_vec = {'adaptive','adaptive_control','costben','ensemble','ethics','ibm','optim','sdm','SDP','voi'};
method_vec = {'ethics','optim','costben','voi','adaptive','ibm','adaptive_control','ensemble','sdm','SDP'};
method_vec = {'ethics','optim','costben','voi','adaptive','ibm','sdm','ensemble'};
% method = 'ethics'... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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#... |
chen=5;
aaaa=6;
|
function getBaselineMUASpikePhase(baselineStructure,experiment,CSC,save_data)
%% calc oscTimes,Ampl,Duration, and occurence
Path = get_path;
parameters=get_parameters;
Filters = parameters.spikeanalysis.phaseFilters;
load(strcat(Path.output,filesep,'results',filesep,'BaselineMUAspikeTimes',filesep,experiment.name,files... |
function [actdcf, mindcf, prbep, eer, numTargets, numNontargets] = plotOneScr_TargetsNontargets(scrMatrix, duration, key)
%
% Inputs:
% 'scrMatrix' is a Bosaris' Scores structure
% 'duration' is a string among '1sec', '2sec' or '3sec'
% '~' a Bosaris' Key file
%
% Example:
... |
function [M4] = algo2versio4(histim,historig,bins)
%blue pensado por mi
suma = 0;
for i=1:bins
suma = suma + abs(histim(i)^0.5-historig(i)^0.5);
end
M4 = suma;
end
|
close all
a = {'005','006'};
dataMatrix = {};
for n = 1:size(a,2)
% h(n) = figure('Color','White');
load(['sgvd04_211011_' a{n} 'a_pArt1_MScanData.mat']);
t1 = (1:length(MScanData.data.vesselDiameter))*(1/MScanData.notes.frameRate);
procData1 = MScanData.data.vesselDiameter;
procData1 = medf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.