text stringlengths 8 6.12M |
|---|
function statesTransformed = FlylabGetTransformedStates(varargin)
%function [posTransformed,angleTransformed] = FlylabGetTransformedStates(varargin)
% Given the .csv data and two frames of reference, return the transformed
% state of the child frame in the parent frame.
%
% iFrameParent: The object number in the ... |
function log_pdf_clutter=Calculate_log_clutter_pdf_nb(Nc,r_nb,p_nb,Area_tot)
%Evaluates the multi-target clutter density for negative binomial clutter
% Author: Angel F. Garcia-Fernandez
%Log Probability mass function of the cardinality (see nbinpdf.m and
%https://uk.mathworks.com/help/stats/negative-binomial-distrib... |
function output_image = Problem2b_SED()
%% ------------------------------------------------------------------------%
% EE 569 Homework #3
% Date: Nov. 1, 2015
% Name: Faiyadh Shahid
% ID: 4054-4699-70
% Email: fshahid@usc.edu
%------------------------------------------------------------------------%
%% Reading the file... |
%Copyright Barshan, Ghodsi 2009
%Paper: Supervised principal component analysis: Visualization, classification and
%regression on subspaces and submanifolds.
clear
clc
close all
load sonar;
load param_dim_sonar;
[p,n] = size(X);
% isnormal = input('Is normalizetion required?(1/0)');
isnormal = 1;
if isno... |
function [X, Y, u, Tf] = RK4_nl5(N, m, Tf)
% This function solves
% u_t = (u^5)_xx + (u^5)_yy, 0 < t < 1, 0 < x,y < 1,
% with initial and boundary condition prescribed by the exact solution
% u(x,y,t) = ((4/5)*(2*t+x+y))^(1/4),
% with centred differences in space and RK4 in time.
% The PDE is stiff. Its eigenvalue... |
function [sim_vars,bot,target] = init_vars()
% Define the simulation "constraints"
sim_vars = struct('t_end',30, 't_step',0.01, 'x_bounds', [0,1], 'y_bounds', [-0.25,0.25]);
% Define the Target Variables
target.speed = 0.2;
target.traj_option = 2;
% Define the Bot Variables
bot.speed =... |
%% form label set on each pixel
% B, lower bound map
% mask_r, mask radius
% Label_set, label set structure
function Label_set = Lee_Get_LabelSet_perNode( B, mask_r )
[m,n,~] = size(B);
if nargin <= 1
mask_r = ceil(0.05*min(m,n));
end
pixel_num = m*n;
Label_set = cell(pixel_num,1);... |
% 测试行情输出的默认方法,看结果。
hist_test = HistoricOptQuoteStore;
hist_test.optCode = '11111111';
hist_test.optName = '测试期权';
t_q = QuoteOpt;
t_q.code = '11111111';
t_q.optName = '测试期权';
t_q.impvol = 0.3;
hist_test.push(t_q);
t_q2 = QuoteOpt;
t_q2.code = '11111111';
t_q2.optName = '测试期权';
t_q2.impvol = 0.4;
hist_test.push(t_q2)... |
[x1,x2] = meshgrid ( -2:0.05:2, -2:0.05:2);
Ras =20+x1.^2+x2.^2- 10*(cos(2*pi*x1)+cos(2*pi*x2));
% subplot(1,2,2)
contour(x1,x2,Ras,1:4:40);
title('Contour Plot of Rastrigin Function')
% hold on
% for i = 1:81
% plot(best_points(i,:),'+r');
% end
subplot(1,2,1)
surf (x1,x2,Ras, 'EdgeColor', 'none');
shading interp;... |
addpath('Functions')
%% Set initial info and function
initSeed = 1;
% Time and area
L = 10; XInt = [-L,L];
T = 1; TInt = [0,T];
% Numerical precision, number of points
N = 2^9; % Time
M = 2^7; % Space
sigma = 1;
u0Fun = @(x) exp(-2*x.^2);
per = false;
modelInfo = initModelInfo(N,TInt,M,XInt,sigma,per);
u0FunVal = u... |
% VERTEXLABEL label ternary phase diagram at vertices
% VERTEXLABEL('ALABEL', 'BLABEL', 'CLABEL') puts labels at vertices of ternary phase diagrams created using TERNPLOT
%
% VERTEXLABEL('ALABEL','BLABEL','CLABEL',OFFSET) sets the labels OFFSET units away from the vertices.
% H = VERTEXLABEL('ALABEL', 'BLABEL'... |
function generatePrintPlan(structure, centers, radius, xLimit, yLimit)
maxLayerNum = 0;
for i = 1:size(radius, 1)
maxLayerNum = max(maxLayerNum, size(radius{i, 1}, 2));
end
plottingCells = cell(maxLayerNum, size(centers, 1));
for i = 1:size(centers, 1)
currentCenter = centers(i... |
function [j_star,meas_mat] = get_VWJSdata(meas)
% for finding the correct data for final VWJS reconstruction
[size_meas,num_meas] = size(meas);
l2_comp = zeros(num_meas,num_meas);
for ii = 1:num_meas
for jj = 1:num_meas
l2_comp(ii,jj) = norm(meas(:,ii)-meas(:,jj),2);
end
end
tmp = ones(num_meas,1)*m... |
function y = fn_timevector(x,t,outputtype)
% function times|count = fn_timevector(times|count,dt|tidx[,outputtype])
%---
% switch representation of a point process between the times of the events
% and the number of events per time bin
%
% Input:
% - count vector of spike count at each time bin (or array or cell
... |
rep = input('How many times were the simulations run? > ');
if (~exist('Host_Peer_Count'))
Host_Peer_Count = Host_NormalPeer_Count + Host_StealthPeer_Count;
end
figure
hold on
grid on
plot(averagegroup(Host_Peer_Count,rep),averagegroup(DHT_E2ELatency_Max,rep),'r--')
plot(averagegroup(Host_Peer_Count,rep),averageg... |
function t = TranslateIm(convIm, Translation,FillValue);
%function t = TranslateIm(convIm, Translation,FillValue=0);
%
% third value can be modified to include any constant fill value
% output is the same size as the input.
if(nargin < 3), FillValue = 0;, end
Translation = round(Translation);
t = zeros(size(convIm));
f... |
% plot speed and tarvel time for Bridge segments during time 19:00 to 21:00
close all;
dataBridge;
% B145speed B145time B149speed B149time B150speed B150time B223speed B223time B443speed B443time;
time=1:size(B145time);
figure;
subplot(2,1,1);hold on;grid on;
plot(B145speed, 'r', 'LineWidth',2)
plot(B149sp... |
function handl = LetterLabels(n,FontSize)
% This function puts letter label text in a figure for labels
% different subplots.
if (exist('FontSize')==0)
FontSize = 20;
end
txt = {'(a)','(b)','(c)','(d)','(e)','(f)',...
'(g)','(h)','(i)','(j)','(k)','(l)',...
'(m)','(n)','(o)','(p)','(q)','(r)',...
... |
% Build all of the required libraries
addpath(fullfile(pwd,'Source'),...
fullfile(pwd,'Source/anigaussm'),...
fullfile(pwd,'Source/graph_code'),...
fullfile(pwd,'Source/graph_code/maxflow_mex'),...
fullfile(pwd,'Source/randomforest_base'));
% Graph cut
run('Source/graph_code/maxflow_me... |
%%%%%%%%%%%%%%%%%%
%各ケースでの推定誤差平均値と平均不均質度をまとめてプロット.
%相関を求める.
%%%%%%%%%%%%%%%%%%
%% 初期設定
load("H:/data/kwave/config/t_pos_2board.mat");
load("H:/data/kwave/result/2018_11_11_case26_variousIMCL/case26_IMCL1.0_pure/kgrid.mat")
load("H:/data/kwave/result/2018_11_11_case26_variousIMCL/case26_IMCL1.0_pure/rfdata.mat")
casena... |
%Lagguerre method
x = linspace(-10, 10, 21);
nb = 0;
result = 0;
p = 0;
for i=1:size(x',1)
[y, iter(i)] = LG_final(x(i),10e-15);
for j=1:size(result' ,1)
if abs(result(j) - y) > 10e-15
nb = nb + 1;
end
end
if nb == size(result', 1)
p = p + 1;
result(p) = y... |
% =========================================================================
% Function: SpringCalculation
%
% Parameters: springRate (N/m), maximumBumpForce (N)
%
% Outputs: meanCoilDiameter (mm), wireDiameter (mm), fullSolidDeflection
% (mm), innerDiameterSpring (mm)
%
% Description: Calculates the differ... |
function [w, ix_eff, W, AX] = slr_learning_var2(label, X, varargin)
% Learning parameters of ARD-sparse logistic regression model (SLR-var).
%
% The estimation algorthm is derived from lower bound method.
% The likelihood function is approximated by Gaussian distribution using variational parameters. (SLR-var)
%
% ... |
function [] = plot_CE(CE_array,CE_array_avg,CE_array_valid)
[numbatches,epochs] = size(CE_array);
CE_values = reshape(CE_array,[1 epochs*numbatches]);
[num_valid,epochs] = size(CE_array_valid);
CE_valid_values = reshape(CE_array_valid,[1 num_valid*epochs]);
% figure(1)
% plot(CE_values)
%% Validation C... |
function [ R ] = RotationMat( aci )
%ROTATİONMAT Summary of this function goes here
% Detailed explanation goes here
Rx=[ 1 0 0
0 cos(aci(1)) -sin(aci(1))
0 sin(aci(1)) cos(aci(1)) ];
Ry=[ cos(aci(2)) 0 sin(aci(2))
... |
function target = Read_GULP(flag, ID)
%This routine is used to read flags from gulp output
%-1: if GULP is complete (For NEB)
%-0: if 1st SCF is done (for USPEX)
% 1: energy/enthalpy
% 2: pressue tensor
% 3: dielectric constant
% 6: elastic constant matrix (array data)
% 7: atomic forces
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
G=APLO2;
members=sort(properties(G));
for k=1:3%numel(members)
S=G.(members{k}).copy;
S.default.train_classifier('trials','all','classes',{{22};{16}},'channels',1:64,'time',1:64,'blocks_in',1:4,'vis','on','trainav','yes');
S.default.train_classifier('trials','all','classes',{{22};{16}},'channels',1:6... |
addpath('../lib/')
addpath('../')
% load trajectory
load('../trajectories/eight.mat')
NN = N;
T = sol(9*NN+1); VR = sol(9*NN+2);
[~,t] = fourierdiff(NN);
t = T*t/(2*pi);
% interpolate to 100 point grid
N = 100;
X = zeros(9*N,1);
[~,tt] = fourierdiff(N);
tt = T*tt/(2*pi);
for i = 1:9
j = (i-1)*NN; jj = (i-1)*N;
... |
function [ Q, grouping ] = Split( adjacencyMatrix )
B = CalculateB(adjacencyMatrix);
[eigenVectors, eigenValues] = eig(B);
largestEigenVector = eigenVectors(:, size(eigenVectors, 2));
grouping = sign(largestEigenVector);
Q = CalculateQ(adjacencyMatrix, eigenVectors, eigenValues, grouping);
end
|
function Fmn=removecos(Fmn)
Fmn.c(find(not(isnan(Fmn.c))))=0; |
function al_showCue(taskParam, latentState)
%AL_SHOWCUE This function presents the cue that indicates which enemy is
%currently shooting in the "chinese", i.e., planets task
%
% Input
% taskParam: structure containing task paramters
% latentState: current enemy that will be indicated
%
% Output
% ... |
% Neurite Apposition
%
% Requires:
% Matlab Image Processing Toolbox
% Matlab Statistics Toolbox
%
% Tiffread by Francois Nedelec
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function NeuritesApp()
% Load config file - TODO
% close all
format compact
%Launch UI
... |
function confusion = calcConfusion(index, listOfFeatures, listOfModels, modelNames, p)
%% Returns a column for the confusion matrix for one category
% listOfFeatures is n*m matrix with n = number of images, m = number of
% features
display(modelNames{index});
length = size(listOfFeatures{in... |
function [t1,t2,a1,a2] = FastLearnWeakClassifierBis(zc,ys,ws,mu,var1,var2,fs)
% function [theta,p,err] = FastLearnWeakClassifierBis(zc,ys,ws,mu,var1,var2,fs)
a = var2-var1;
b = mu(1)*var1-mu(2)*var2;
c = (1/2)*(-(1/2)*log(var2/var1)+log(zc(1)/zc(2))+(mu(2)^2)*var2-(mu(1)^2)*var1);
d = b^2-2*a*c;
if d<0
theta = (... |
clc
close all
clear all
test_131_pos = [55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 130 125 120 115 110 105 100 95 90 85 80 75 70 65 60]
test_131_frame = [146 163 172 179 185 190.5 196 201.5 207 213 219 224.5 231 239 248 268 274 290.5 299.5 306 312 317.5 323.5 329 334.5 340 346 352 359 368.5 390]
motor_vol_... |
addpath('/Users/jonathangornet/Documents/GitHub/SOSpikingModel/RunCodes')
addpath('/Users/jonathangornet/Documents/GitHub/SOSpikingModel/FunctionRoutines')
addpath('/Users/jonathangornet/Documents/GitHub/SOSpikingModel/MiscUtilities')
close all
%% Example Neuron Properties
%Input
PopParams.sigma = 0; %niose ... |
clear;clc;clf;close all
data = importdata('data_ex2_task3_2017.txt');
runs = 20;
k=4; % k=4 for 3a , k=10 for 3b , comment out for 3c
% class_10 = zeros(10,1); % delete '%' when run 3c
% for k=1:10 % delete '%' when run 3c
class_error_runs = zeros(runs,1);
weights_unsup_runs = zeros(2*runs,k);
weights_sup_runs = zer... |
function [x0,y0,x1,y1]=convert_shape_deg(sx,sy,vd,xpx,ypx,xpos,ypos,xdeg,ydeg)
disp(nargchk(0, 9, nargin))
% SCREEN characteristics
% sx: screen x in pixels
% sy: screen y in pixels
% vd: viewing distance in cm
% xpx: screen size x in cm
% ypx: screen size y in cm
% SHAPE characteristics
% xposs: postion of cent... |
function Answer = ZpPolyMult(px,qx,p)
% Answer = ZpPolyMult(px,qx,p)
%Program for adding two polynomials
%mod n (i.e., in Z_n[x])
%px, and qx (input polynomials) are stored
%as vectors in the following format:
%X^4 +3X^2 + 1 ---> [1 3 0 1]
n=length(px)-1; m=length(qx)-1;
%We initialize two vectors of zeros Vec, and sum... |
clear;
clc;
%% 全局变量
H = 1024;
W = 1024;
%分块大小
height=H;
width=W;
%重叠比例
x=0.0;
%% 图片
%% 打开文件夹
[filename,filepath] = uigetfile('*.*','Select the image');
if isequal(filename,0)||isequal(filepath,0)
return;
end
fileFolder=fullfile(filepath); %打开刚刚打开图片所在的文件夹
dirOutput=dir(fullfile(fileFolder,'*.tif'));%获取所有.jpg
fil... |
function [ X ,Y ] =nivlines1 (F, dFx, dFy, X0, Y0, steps, stepWidth)
% generiert Mengen von Wertpaaren (xij,yij) mit F(xij,yij)=F(X0j,Y0j) mit
% gegeben Stellen, durch die die Niveau-Linien gehen sollen
% X und Y sind Matrizen aus R^(k x steps) wobei deren Zeilenvektoren
% X(j,:) bzw Y(j,:) genau die zu plotenden... |
function [y] = mlr_regressor2(beta,X)
%MLR_REGRESSOREvaluate The Output of a Multiple Linear Regressor Model
% Given Beta (1xNCoefs) 's and aInput Vector X (NxVars)
% y (NxVars)
[N,Vars] = size(X);
Xt = X;
y = Xt*beta;
end
|
classdef X4p < sqc.op.logical.gate.RX
% X/4 gate, pi/4 rotation around X axis
%
% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences
% mail4ywu@gmail.com/mail4ywu@icloud.com
methods
function obj = X4p()
obj = obj@sqc.op.logical.gate.RX(pi/4);
end
en... |
% WPREC 1次元ウェーブレットパケットの再構成
%
% X = WPREC(T) は、ウェーブレットパケットツリー T に対応する再構成された
% ベクトルを出力します。
%
% 参考 WPDEC, WPDEC2, WPJOIN, WPREC2, WPSPLT.
% M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Mar-96.
% Last Revision: 14-May-2003.
% Copyright 1995-2004 The MathWorks, Inc.
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File: features.m
% Author: Peter Welby
%
% This script extracts features from the training set and saves the design
% matrix to the file "data.mat"
%
% Additionally, the target classification vector is constructed, with
% target classif... |
function AMIGO_update_LCurve_plot(hfig,Q_cost,Q_penalty,alpha,titlestr,formatpts)
% AMIGO_update_LCurve_plot(Q_cost,Q_penalty,alpha,titlestr) creates or
% updates the LCurve by adding the new points and text
if nargin < 5 || isempty(titlestr)
titlestr = 'L-curve';
end
if nargin < 6 || isempty(formatpts)
forma... |
function test_path
% Test code to verify that the Matlab path includes the QTFM folder.
% Copyright © 2009 Stephen J. Sangwine and Nicolas Le Bihan.
% See the file : Copyright.m for further details.
% This test code is not bombproof: it is simply a cursory check to trap the
% most obvious case where the user has not ... |
function k = knn_validacao(base_treino, base_teste)
% Testa a base com o modelo knn
% input:
% base_treino: base que sera utilizada para treinamento
% base_teste: base que sera utilizada para teste
% output:
% k: melhor k para a base de treino e teste
validacao = [1; 3; 5; 7];
[m n] = size(valid... |
function [weightedMean,weightedStdOfMean,weightedStdOfSample] = weightedStats(data, weightsOrSigma,sw)
%wStats calculates weighted statistics (mean, stdev of mean) for a list of inputs with corresponding weights or {std}
%
%SYNOPSIS [weightedMean,weightedStd] = weightedStats(data, weightsOrSigma,sw)
%
%INPUT data: vect... |
% Qualitative assessment of probabilistic archetypal analysis and standard
% archetypal analysis by Cutler and Breiman on different observation models
%
% Additional info: Figures 4, 5 and 6 in article Probabilistic Archetypal
% Analysis by Seth and Eugster in Machine Learning Journal
%
% Copyright Sohan Seth sohan.set... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TF of 2nd-Type 2nd-Order ChargePump PLL %
% 2nd-Order prop-Integrator filter %
% CP-------------VCO ---Icp/2pi--F(s)--Kv-- %
% | | ... |
function plotExampleBurstPLV(R,BB)
if ~isfield(R,'condcmap')
R.condcmap = jet(2);
end
BB.T = linspace(0,length([BB.AEnv{1:2}])/BB.fsamp,length([BB.AEnv{1:2}])); % Data time
BB.TSw = linspace(0,length([BB.PLV{1:2}])/BB.fsamp_sw,length([BB.PLV{1:2}])); % sliding window time
set(gcf,'defaultAxesColorOrder',[[0 0 0]; [0... |
function [radius, particleNumber, fractalDimension,timeElapsed] = DLAOffLattice(numberOfParticles);
% This is off-lattice DLA simulation. We aim to utilise methods similar to
% Kuijpers, Martin and Ommen in their 2013 paper. We also utilise the
% method of bringing back to the launching radius in one step seen in
% Sa... |
function[res] = clean_table(table,gender,ethnic,maxage)
com = [1 3 5; 2 4 6];
res.lx = table(1:maxage,com(gender+1,ethnic+1)+6); %Number of people alive
res.dx = table(1:maxage,com(gender+1,ethnic+1)); %Numbe of people who died in this period
res.qx = table(1:maxage,com(g... |
%% Description
% The script is one of the final scripts CEE 199.
% A numerical method is used to calculate the volume of the beach and the
% results are compared with that of Surface Volume Tool in Arcgis.
% Linear Regression relationship is used to check the relationships between
% these two method.
clear all; clo... |
%% Title Block
% J.Cohen
% Lab 3 Homework Part 1
% 2019-10-01 - script started, focused on reaching a point where the game
% could be played by two players
% 2019-10-03 - script updated, enable randomization of player that goes
% first. Add welcome message and rules. added logic to detec... |
clear ; close all; clc
pkg load io;
% Dodavanje puteva di se nalaze funkcije
cd ('C:\Users\Korisnik\Desktop\Faks 3. semestar\Praktikum\6');
addpath ('C:\Users\Korisnik\Desktop\Faks 3. semestar\Praktikum\FunkcijePogreske');
addpath ('C:\Users\Korisnik\Desktop\Faks 3. semestar\Praktikum\Grafovi');
% Ucitavanje ... |
function plot_slice2_noisestudy(tiledata,sliceangle,plottitle,nsides,xlabelstr,counts,pol,col,cax) % pol is 'ew' or 'ns'
npix = length(tiledata);
angmax = cell2mat(pix2ang(nsides,1));
Theta=-angmax(1);
Phi=pi-angmax(2);
R=[cos(Theta)+cos(Phi)^2*(1-cos(Theta)), cos(Phi)*sin(Phi)*(1-cos(Theta)),... |
function [pclperson, indices2pcl] = mask2pcl(person, pcl)
%{
Creates point clouds based on a mask and save the indices to be able to
come back to the image.
Inputs:
- person: mask of the person. Cell of size 4.
- pcl: original point clouds from the kinects. Cell of size 4.
Returns:
%}
% Calc... |
function plotBehavior(vidDir)
% akm 2/7/18
dbstop if error
trialStr=vidDir(strfind(vidDir,'vidout'):end);
dataDir=strrep(vidDir,['\' trialStr],''); % location of the corresponding daqout file
savePath=vidDir;
cd(vidDir);
%% Load data
% Load daq file
cd(dataDir)
daqFileName=strrep([trialStr '.mat'],'vidout','daqout... |
%%
% 整体性的测试准确率
clc
clear
net1 = dagnn.DagNN.loadobj(load('D:\myself\matlab\matlab_documents\dynamic_image\exp\ntu\net-deployed.mat')) ;
net1.mode = 'test' ;
imdb = load('D:\myself\matlab\matlab_documents\dynamic_image\exp\ntu\imdb.mat') ;
% imdb = imdb.imdb;
b = 1;
opts.dataDir = fullfile('data','ntu') ;
opts.expDir ... |
function toTapFile(self, toolPaths, Shifting)
fileName = "testTapFile.tap";
fid = fopen( fileName, 'wt' );
boundingBox = [];
scalingFactor = 1;
figure(1)
hold on
axis equal
view([1 1 1])
xlabel x
ylabel y
zlabel z
xmax = 0;
xmin = 10000;
ymax = 0;
ymin = ... |
%Ejercicio 4
file = 'irisbin.csv';
%Uso distintos k para probar
k_1=1;
k_2=5;
k_3=20;
%Nombre de los archivos donde se va a guardar cada particion
trn_file_1= 'trn_file_1';
tst_file_1= 'tst_file_1';
0.958,
trn_file_2= 'trn_file_2';
tst_file_2= 'tst_file_2';
trn_file_3= 'trn_file_3';
tst_file_3= 'tst_file_3';
c... |
%% Ronen & Gilad, extracting tublets from boxTables, and passing them through vgg16 to get vectors.
clear; clc;
%% Add folders' path and getting the train table according to version 2.0
addpath(pwd) % the folder of the script
% Getting the table from the csv file. in this case we will choose the
% train table of ... |
%% 概要
%EMCL率が16 %, IMCL率が2 %, EMCLクラスタが3つのモデルに対して
%平均音速値をbent-rayに基づいて算出するためのプログラム 2018/07/25
%% 初期化
close all;
clear;
clc;
%% データ呼び出し
cd('H:\result\2018_04_27_analyzeLipidModel')
myfilename = sprintf('2018_04_27_TOFdata_Group1ERate16IRate02Num3-2');
load(myfilename)
%% センサ設置
param = makeParam( 0.125,0.125,400,400,0 );... |
clear;clc; close all hidden;
% directory containing saved taskonomy rdms
rdm_dir = '/home/ruchit/garage/Algonauts_Exp/RSA-CVPR19-release/taskonomy/taskbank/tools/RDMs';
% directory of downloaded rsatoolbox
rsa_dir = './rsatoolbox';
% directory to save the results
save_dir = './Fig5';
C_Fig5(rdm_dir,save_dir,rsa_dir) |
function [cc] = CovarianceHsiBands(bandA, bandB, HSI_Cube)
myCube = double(HSI_Cube);
[cols, lines, ~] = size(HSI_Cube);
totalpixels = cols * lines;
corSlice = zeros(cols, lines, 1);
sumA = 0;
sumB = 0;
sum_line_A = zeros(1, lines);
for i = 1:cols
sum_line_A(1,i) = sum(myCube(i, :, bandA)) / 51... |
function constrainedFoopsi = simpleDeconvolve(dF, stimParams)
dF = removeStimArtefact(dF, stimParams.scopeStimArtefact);
constrainedFoopsi = deconvolve(dF);
calcium = constrainedFoopsi.c;
spikes = constrainedFoopsi.deconvInSpikes;
|
function [ bestValue, bestMove ] = MiniMax( b, depth, isMaxPlayer )
if depth == 0
bestValue = b.Evaluate();
return
end
moves = ValidMoves(b);
if isMaxPlayer
bestValue = -Inf;
for i = 1:size(moves, 1)
m = moves(i,:);
if m(5) ~= 1, continue, ... |
function [id] = cris_freq_to_id(freq, nguard);
% function [id] = cris_freq_to_id(freq, nguard);
%
% Convert CrIS channel frequencies to channel IDs.
% Note: this version for 8/4/2 mm OPD CrIS
%
% Input:
% freq : [n x 1] channel freq (wn)
% nguard : OPTIONAL [1 x 1] number of guard channels at each edge
% ... |
%% Plot results
function Plot_Target_Estimated_Position_With_Labels (truth, est, uav, model)
font_size = 20;
ntarget = size(truth.X,1);
R_max = model.R_max;
% k = max([est.foundIndex{:}]);
k = min(size(uav(uav(3,:)>0),2)+1,model.T);
% c = get(gca,'ColorOrder');
c = color_vector(ntarget+... |
%Simple code for Topographic ICA of images
%Aapo Hyvärinen, for the book Natural Image Statistics
function W=tica(Z,topoxdim,topoydim,neighbourhoodsize)
global convergencecriterion
%------------------------------------------------------------
% input parameters settings
%---------------------------------------------... |
function strBest = bestMusic(cellVar)
for i = 1:1e6
disp('EAST IS FOR YEAST');
end
end |
% Limpar
clear all
close all
clc
%Inicio
mdl_planar2 %Load do modelo planar 2
% Cordenadas da base (Espaço cartesiano)
p2.base=transl(0,-1.5,0);
% Pontos desejados no espaço cartesiano (metros)
hold on
xlim([-2,2]); %tamanho do eixo dos x
ylim([-2,2]); %tamanho do eixo dos y
zlim([-1,1]); ... |
Elk element van een vector heeft een index. Deze index kan
worden gebruikt om de waarde van het element op te vragen. |
%two componets
path=pwd;
path=split(path,"/");
pathSize=size(path,1);
path(pathSize,1)={'Chart'};
path(pathSize+1,1)={'Setup4_components'};
pathComp2=path;
pathSize=size(pathComp2,1);
pathComp2(pathSize+1,1)={'Components2'};
pathComp2(pathSize+2,1)={'Data.xlsm'};
pathComp2=string(join(pathComp2,"/"));
pathComp1=path... |
function [ P_out ] = get_markov_sequence( P, n )
%На вход программы подается матрица переходов P и число шагов процесса.
% На выходе последовательность случайных состояний Марковского процесса.
[s1 , s2] = size(P);
q = 1/s1;
for i = 1 : s1
Q (1,i) =q;
... |
function [E01,E02] = TriJFlxQbtdE(Jc,Cc,S,L,alpha,kappa,sigma,FluxBias,nk,nl,nm)
[Ej, Ec, beta] = EjEcBetaCalc(Jc,Cc,S,L,alpha);
EL = TriJFlxQbtEL(Ej,Ec,alpha,beta,kappa,sigma,FluxBias,nk,nl,nm,6);
E01 = (EL(3) + EL(4) - EL(1) - EL(2))/2;
E02 = (EL(5) + EL(6) - EL(1) - EL(2))/2;
end
function [Ej, Ec, b... |
clc
clear all
close all
%declararea variabilelor
P=40;
N=50;
D=13;
n=D/P;
%baza de timp se intinde pe 10 perioade
%esantionare
pas=1/(2*P);
PMax=10*P;
t=0:pas:PMax-pas;
%Am apelat functia de creare a semnalului dreptunghiular
%stocarea semnalului original
S_in=(1+square(2*pi*t/P,n*100))/2;
%Am calcul... |
%% MyMainScript
tic;
%% Your code here
clc
clear all
close all
% k = 0 for the plot generation and k = n; n != 0 for accuracy at k = n
mySVD('../../../att_faces/s', 112, 92, 32, 6, 4, 0);
myEIG('../../../att_faces/s', 112, 92, 32, 6, 4, 0);
% e = 0 for including the top 3 eigen vectors
% e = 1 for excluding the top... |
function [x,y] = image2ball_pos(image)
% [x,y] = image2ball_pos(image)
% funkcja do odczytu pozycji piłeczki na podstawie obrazu
image_filtered = medfilt2(image, [3 3]);
% postac binarna z progiem 0.18
image_bin = im2bw(image_filtered,0.18);
% % domkniecie obiekty mniejsze niz 10pix - używać jeśli obraz jest niestabil... |
function AMIGO_cellstr2htmltable(cs,fid)
% AMIGO_cellstr2htmltable converts the cell string into a html table and writes to the file
[nrow ncolumn] = size(cs);
for irow = 1:nrow
fprintf(fid,'\t<tr>\n');
for icolumn=1:ncolumn
fprintf(fid,'<td>%s',cs{irow,icolumn});
... |
function pitch = myFrame2pitch(frame, plotOpt, PP)
if nargin<1, selfdemo; return; end
% 求 frame 的平均值
average=mean(frame);
frame=frame-average;
maxShift=length(frame);
%method=1;
%plotOpt=1;
%acf=frame2acf(frame,maxShift,method);
%acf=myFrame2acf(frame);
%[pitch, index1, index2] = myAcf2pitch(acf, fs);
nsdf=my... |
function multiSessionRemappingControlled(paths)
clc
fprintf('\n')
%%% Reliability constaint
warning off all
if isempty(gcp)
parpool('local',7);
end
pctRunOnAll warning off all
%% Split by animal
piece = [];
ag = [];
spiece = [];
for i = 1:length(pa... |
function confusionnew = confusion_matrix(class,confusionold, o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,teSet)
confusionnew = confusionold ;
lhood = zeros(1,10) ;
lhood(1) = loglikelihood(o1,m1,c1,teSet) ;
lhood(2) = loglikelihood(o2,m2,c2,teSet) ;
lhood(3) = log... |
%%
%Problem 1
clear all
clc
fprintf('\n Bisection Approach: \n')
incremental(@(x) -12 - 21*x - 18*x^2 - 2.75 * x^3, -10, 10, 15)
fprintf('\n Bisection Approach: \n')
bisection(@(x) -12 - 21*x - 18*x^2 - 2.75 * x^3, -5.7143, -4.2857, 15, 0.001);
fprintf('\n False Position Approach: \n')
false_position(@(x) -12 - 21*... |
function [H, r, c] = harris_corner_detector(image_file_name, threshold, should_visualize)
% Returns:
% H - matrix of cornerness scores per pixel
% r - x coordinates of detected corners
% c - y coordinates of detected corners
visualize = true;
if nargin == 3
visualize = should_visual... |
% EECS 545 - Computer Vision
% Final Project
% Rajat Mittal & Sean Messenger
function isFace = checkIsFacePresent( subimage, classifiers, thres )
%CHECKISFACEPRESENT Based on features, determines if a face is present in a window.
% This classifier returns true (nonzero) if the subimage matches the
% given classif... |
function [optimal_v] = ov_calc(a,b,hm,s)
optimal_v = a*(tanh((s-hm)/b)+tanh(hm/b));
end
|
function [errors, errorTags] = checkGroupTildes(original)
errors = '';
errorTags = {};
checkTildeTags(original);
function checkTildeTags(originalTags)
% Checks if the tags in the group have no more than 2 tildes
numTags = size(originalTags, 2);
for a = 1:numTags
if ~ischar(origi... |
function [A,d] = my_poisson_matrix(h,bd,u_0y,u_1y,u_x0,u_x1)
%
% function [A,d] = my_possion_matrix(h,bx,by,u_0y,u_1y,u_x0,u_x1)
%
% Generating five-point difference scheme of Poisson equation
% A * u + d = b
%
% Input -
% h: step unit, h = 1/(N+1), default be N=8
% bd: boundary of variable x, y
% u_0y,u_1y,u_x0,x_y... |
function [CellMeasurements, ModuleData] = textureModule(CellMeasurements,parameters, labels, AuxImages, ModuleData)
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% textureMODULE measures texture and contrast of specified AuxImages channels
%
% CellMeasurements structure ... |
% Noisefree goldballs simulations with Bernoulli masks
n = 256; % signal is n x n (possibly complex valued)
n_illumin = 8; % number of structured illumination patterns
% Set signal and illumination patterns
load goldballs_256
Pattern = round(rand(n,n,n_illumin));
Pattern(:,:,1) = 1;
% Generate ... |
function varargout = build1(varargin)
% BUILD1 MATLAB code for build1.fig
% BUILD1, by itself, creates a new BUILD1 or raises the existing
% singleton*.
%
% H = BUILD1 returns the handle to a new BUILD1 or the handle to
% the existing singleton*.
%
% BUILD1('CALLBACK',hObject,eventData,handles,... |
%% 写文件
%% 将压缩后的数据进行存储
fid=fopen(filename,'w');%写入文件路径
[m,n]=size(newdata);
for i=1:m
for j=1:n
if j==n
fprintf(fid,'%g\r\n',newdata(i,j));
else
fprintf(fid,'%g\t',newdata(i,j));
end
end
end
fclose(fid); |
function [accdiff1,accdiff2,accdiff1v2,accdiff2v2,accall,accSall,accallL,accSallL,p1,lapaccL,lapaccA] = decode_choice_by_thetaphase(thisdir,numshuff,indinds,indinds2,toplot,savefolder)
load(thisdir,'times_armon_thetaof_headingarm_lap_thetahalf_all','PFCthetaspikes_binned');
Th = times_armon_thetaof_headingarm_lap_the... |
function Sm = generateSm(idxM, U)
N = size(U, 1);
S = zeros(N, 1);
n = 0;
for i = 1:size(idxM, 1)
p = idxM(i);
t = [p p];
while (size(t, 2) > 1 && ~ismember(t(2), S))
n = n + 1;
S(n) = t(2);
p = t(2);
t = find(U(p, :), 2);
end
end
Sm = S(1:n);
end |
classdef LoginScreen < WBTask
properties
title = 'Multitask';
pIDBox
end
methods
function obj = LoginScreen(nm)
obj@WBTask(nm);
end
function start(this)
[xC, yC] = this.canvas.getCenter();
this.pIDBox = ... |
%% 3-D Point Cloud Registration and Stitching
%% Register Two Point Clouds
|
%testing
a=1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.