text stringlengths 8 6.12M |
|---|
function [F, c1, c2, con, H] = smoothhist2D_SVDcorrected(Z, smth_win, M, bins1, bins2,Fcircular1,Fcircular2)
if isempty(Z)
F = nan*ones(M);
c1 = bins;
c2 = bins;
con = F;
H = F;
return;
end
X = Z(:,1);
Y = Z(:,2);
[F, c1, c2, ~] = smoothhist2D_AS(Z, smth_win, M, bins1, bins2, Fcircular1, Fcircu... |
% percent signs comment out sections of code and is not used
% settings
filetype='*.xls' %specify file type
data_sheet=''
start_row=2 %row which the data starts
time_column_number=1 %colum number of the time
blank_column_number=2
bootstrap_samples=20
figures_of_fits='no'
lower_bound=.3 %discards data with an optical d... |
function [hmm, Gamma, Xi, vpath, GammaInit, residuals, fehist, feterms, rho] = ...
hmmmar (data,T,options)
% Main function to train the HMM-MAR model, compute the Viterbi path and,
% if requested, obtain the cross-validated sum of prediction quadratic errors.
%
% INPUT
% data observations, either a struct ... |
function [searchArray] = stateSearchUi(channels,stateList)
%This interface allows users to specify a sequence of states they would
%like to search for within the data
%
dropDownOpt = cell([1 channels]);
dropDowns = cell([1 channels]);
stateCell = {};
searchArray = [];
searchText = {'Se... |
function [x] = BFGS( x0, funder, maxiter, tol )
%
% metodo de Newton global (busqueda lineal con condiciones fuertes
% de Wolfe) para optimizacion de funciones sin restricciones
% j-l morales 19 de febrero, 2015, ITAM
%
%--------------------------------------------------------------------------
%
% ... tolerancias y va... |
function [ output ] = neural_groupmatch(teams,input,label,mtime)
[m,n]=size(teams);
for i=1:m
for j=1:m
if (teams(i,n-1)==teams(j,n-1))&&(i~=j)
teams(i,:)=neural_match(teams(i,:),teams(j,:),input,label,mtime);
end
end
end
output=teams;
end |
clc;clear;
% load data;
% data_array=data;
load data2_bridges_all;
% load wdbc;
% data_array=wdbc;
tic
% data_array=data_array_flat;
% data_array=data_array_sub;
[m,n]=size(data_array);
[feature_slct,sig_s,sig_a]=FS_GKFS(data_array,'GD_S',0.03,1);
% tic
% [feature_slct,sig_s,sig_a]=FS_GKFS(data_array,'GD_theta',0.03,1)... |
CAM=[Ciaverage_nirsAMo Ciaverage_nirsAMd Ciaverage_nirsAMf Ciaverage_eegAM Ciaverage_combAMo Ciaverage_combAMd Ciaverage_combAMf];
CAM(end+1,:)=mean(CAM);
C=round(CAM*100)/100;
d=num2cell(C);
for i=1:numel(d);d{i}=num2str(d{i});end;
e={'C4' ,'C6' ,'C7' ,'C8', 'C9' ,'C10' ,'C11','C12','mean'}
f=[e' d];
s=sym(f,'d');
lCA... |
clear;
load tomo.mat
load seiscmap
moho = load('data/moho_pick.mat');
[xi yi] = ndgrid(xnode,ynode);
lalim = [min(xnode) max(xnode)];
lolim = [min(ynode) max(ynode)];
r = 0.1;
figure(65)
clf
set(gcf,'color',[1 1 1])
Ncol = 4; Nrow = floor(length(tomo)/Ncol)+1;
%Ncol = 4; Nrow = floor(length(tomo)/Ncol/2)+1;
for ip = ... |
function [M_left,M_right,error,F]= drawCorr_inliner(Cones_left,Cones_right)
% Finding points and features in left
grayImage = rgb2gray(Cones_left);
[y,x]= harris(grayImage,1000);
points_left = cornerPoints([x y]);
[features_left, points_left] = extractFeatures(grayImage, points_left);
% Finding points and features in... |
function load_one_instrument_capabilities(instr)
global params
r = global_jess_engine();
instrument_list = params.instrument_list;
% i = find(strcmp(instrument_list,instr),1);
meas = java.util.ArrayList;
subobj = java.util.ArrayList;
obj = java.util.ArrayList;
pan = java.util.ArrayList;
fprintf('Instrument %s...\n',i... |
yd=double(y); %convert from int16
yd=yd/max(abs(yd)); %need to normalize
wavwrite(yd,11025,16,'somename.wav') %write as 16-bits
z=wavread('somename.wav','native'); %avoid normalization
|
%% 00 Hello
%Caroline Myers
%This script pulls out relevant trial info
%for DPFv2 data collected by Kate and Rishi
%No attention here folks- sorry to disappoint
%Assumes folder 'data' in same directory- contains data.
%Saves output to structure- change path, probably.
%% 01 Init
clearvars -except SubjectsStruct
... |
%% plotlcss_anim
%
% Pretty plots the dynamic programmming solution as an animation, saving each frame to a PNG file.
%
% Requieres to use a 'debug' version of the lcss to show the internal
% variables.
%
% Input:
% stream: data stream
% template: template
% dbscore: score selected at each el... |
% Inputs: a is matrix to be quantized
% k is number of centroids required
%
% Output: c is the result codebook
%%%%%%%%%%%%%%%%
function c = testvq(a,k)
c = mean(a, 2); %compute the mean of each row(centroid of the whole data)
DP = 1000;
ep = 0.0001;
for i = 1:log2(k)
c = [c*(1+ep), c*(1-ep)]; %s... |
function [ category ] = categorize( data )
%CATEGORIZE 数据列分档
% inputs:
% data 原数据列
% outputs:
% category 结构体变量,已分好的类
% version 1.0 , luhuaibao;
% version 1.1, luhuaibao, 加入第10行至13行,去nan
ntag = size(data,2) ;
for i = 3:ntag
data( isnan(data(:,i)),:) = [];
end ;
var0 = ... |
function [W] = sensor_update(L, zt, sigma_zt, xt, W_tmp) %added sigma_zt
% L = lake, zt = [depth dtb], xt = [x1 y1 z1]
%SENSOR_UPDATE Return probability of sensor reading zt at position xt,
% Detailed explanation goes here
if ~IsInBounds(L, xt)
% error('move out of bound')
W = 0;
disp('out of bou... |
clear all
XC=0;YC=0;ZC=0;XR=1;YR=1;ZR=2;N=50;
[xx,yy,zz] = ellipsoid(XC,YC,ZC,XR,YR,ZR,N);
Fxx = 2*xx;
Fyy = 2*yy;
Fzz = 0.5*zz;
figure(12);
quiver3(xx(1:5:end,1:5:end),yy(1:5:end,1:5:end),
zz(1:5:end,1:5:end),Fxx(1:5:end,1:5:end),
Fyy(1:5:end,1:5:end),Fzz(1:5:end,1:5:end));
axis([-2 2 -2 2 -2 2]);... |
function analyze_report( obj )
%ANALYZE_REPORT generates graphes for a single simulation run
% Generates four Graphes and saves them as .eps and .fig
% Included Graphes:
% -Hive Statistics
% -daily change in stored food and bees
% -daily max/min of scouts and foragers
% - count of active food patches and thei... |
Y = Y(unsaturatedPix,:);
A = [A,b];
Cin = [Cin;fin];
nA = sum(A.^2); % 1 x comp
YrA = Y'*A - Cin'*(A'*A);
YrA(:,ii) = YrA(:,ii) + nA(ii)*Cin(ii,:)'; % fr x comp
SAMPLES = cont_ca_sampler(YrA(:,ii)/nA(ii),params);
C(ii,:) = make_mean_sample(SAMPLES,YrA(:,ii)/nA(ii));
S(ii,:) = mean(samples_cell2mat(SAMPL... |
clear;
BRWMDI_LOOCV();
overallauc=positiontooverallauc();
save overallauc overallauc
a=mean(overallauc)
b=std(overallauc) |
T = 1/50000;
Eb = T/2;
No = 2e-6*2;
PB_QPSK = qfunc(sqrt(2*Eb/No));
T = 1/50000;
No = 2e-7;
k = 6000/10000 / ((10000+4000)/10000);
PB_MSK = 0.5*exp(-k*(T/4)/(2*No)); |
% Note: This code is the main GUI that is first run in order to do image
% processing. This is based primarily off of image_processing_common_matter.
% This is roughly the GUI version of that code.
function varargout = ImgTestGui(varargin)
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_St... |
function varargout = uq_mc_display( module, idx, varargin )
% UQ_MC_DISPLAY visualizes analysis and results of the Monte Carlo
% simulation
%
% See also: UQ_DISPLAY_UQ_RELIABILITY
Results = module.Results;
%for each response quantity
for oo = idx
%only plot when more than one iteration has been done in MCS
... |
function out1 = hess_grf_ceq_heel1818(in1,toe_th,dmax,cmax,k,us,ud)
%HESS_GRF_CEQ_HEEL1818
% OUT1 = HESS_GRF_CEQ_HEEL1818(IN1,TOE_TH,DMAX,CMAX,K,US,UD)
% This function was generated by the Symbolic Math Toolbox version 8.4.
% 23-Jun-2020 09:33:54
out1 = 0.0;
|
%% CZ
if ~exist('CZTomoData','var')
CZTomoData = P;
end
chi = sqc.qfcns.processTomoData2Chi(CZTomoData);
phi = toolbox.data_tool.fitting.fitCZPhase(CZTomoData)
PIdeal = sqc.qfcns.CZChiP(phi);
chiIdeal = sqc.qfcns.processTomoData2Chi(PIdeal);
trace(chi*chiIdeal)
trace(chi*chiIdeal)/trace(chi)/trace(chiIdeal)
ax = q... |
function tileimg2pdf(niiDatIn,varargin)
% EXAMPLE
% strFileNii = 'run_01.nii';
% tileimg2pdf(strFileNii,'o','outfile','f',10);
% Author - Krisanne Litinas
% $Id: tileimg2pdf.m 1279 2014-03-24 20:06:25Z klitinas $
% $HeadURL: svn+ssh://klitinas@anger.engin.umich.edu/svn/matlab/img/trunk/tileimg2pdf.m $
% Read image d... |
# control points given as
# [x1,y1; x2,y2;...] or [x1,y1,z1; x2,y2,z2;...]
# s ... parameter (float)
# k ... natural number
function P = beziersub(control_points, s, k)
if(k==0)
P = control_points;
return;
endif
C = decasteljau(control_points, s);
temp = C(1,:,:);
S1 = zeros(size(temp)(2), s... |
function dxdo = mth_dcart_doblsph(a, b, eta, lambda)
% MTH_DCART_DOBLSPH computes the partials of 3D Cartesian coordinates
% w.r.t. 2D oblate spheroidal coordinates composed of elevation and
% azimuth parameters. The oblate spheroidal coordinate system is 2D
% because the semimajor axis is considered fixed, resulting ... |
function DrawRect(a,b,L,W,c)
% Helper function for Q8.m
% Adds a rectangle to the current window. Assumes hold is on.
% The rectangle has vertices (a,b), (a+L,b), (a+L,b+W), and (a,b+W)
% and color c where c is one of 'r', 'g', 'y', etc.
x = [a, a+L, a+L, a, a];
y = [b, b, b+W, b+W, b];
fill(x,y,c); |
function [ img ] = preprocessing( img )
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
i=imresize(img,[640 640]);
applybw = @(i) im2bw(i.data,mean(double(i.data(:)))/1.05/255);
img=~blockproc(i,[40 40],applybw);
figure(1),imshow(img);
%img=bwareaopen(img,25);
[ilabel conn]=bwlabel(img... |
function [x,varargout]=minL1lin(C,d,varargin)
% The submission minL1lin finds the minimum L1-norm solution of the linear equations C*x=d,
% optionally under linear constraints. It is similar to the Optimization Toolbox's lsqlin except that it minimizes with
% respect to the L1 norm by reformulating the problem as... |
function [mean std] = sub_chains(N,iter)
mean = 0;
std = 0;
for i = 1:iter
p = randperm(N);
Mat = bsxfun(@minus,repmat(p(1:end-2),N-2,1),p(2:end-1)');
Mat = tril(abs(Mat) == 1);
M = sum(sum(Mat,2) == 0);
mean = mean + M;
std = std + M*M;
end
mean = mean/iter;
std = sqrt(std/iter - mean^2);
|
function out = method2str(method)
% example: method = struct('name', 'mmm', 'gamma', 1, 'omega', 1)
% method2str(method) returns: 'mmm_1-1'
out = [method.name '_']; %#ok<*AGROW>
method = rmfield(method, 'name');
fld = fieldnames(method);
for i = 1:length(fld)
val = method.(fld{i});
if isnumeric(val) || islogic... |
%Filenames and location of measured spectra and output results
measdir = 'data\measured\exampledata\'; % Directory of measurements
outdirname = 'data\retrieved\test\'; % directory to store the output
wlfilename = 'wl.txt'; % file with the wavelengths
reflfilename = 'reflectan... |
function [x,histout,costdata, jachist, xhist,rout, sc] = newlsq_v2(x0,f,tol,maxit,mode,nu0,high,low,data)
%
% C. T. Kelley, May 9, 2007
%
% This code comes with no guarantee or warranty of any kind.
%
% THERE ARE NO OPTIONAL ARGUMENTS!!
%
% function [x,histout,costdata] = newlsq(x0,f,tol,maxit,mode,nu0,high,low)
%
% Ge... |
% Read sample data(wav files)
% Plot the files.
% Scale the files by a facor of a (multiply amplitude)
% Delay by N (i.e y[n-N]
% Reverse y y[-n]
% upsample by a factor
% downsample by a factor
[y, Fs] = audioread('audio/bye.wav');
t = size(y);
plot(1,y);
% Amplitude scaling
y1 = 2*y;
sound(y,Fs,16);
... |
function [u,R] = solveSystem(dim,KG,Fext,ur,vr,vl)
%Definition of KLL, KLR, KRL, KRR, FLext, FRext and system solving
%KLL
Kll = zeros(length(vl),length(vl));
for ii = 1:length(vl)
Kll(ii, ii) = KG(vl(ii), vl(ii));
for jj = 1:length(vl)
Kll(ii, jj) = KG(vl(ii), vl(jj));
Kll(jj, ii) =... |
function plot_group_level_results(correlationMats, Settings, netType, correctionType, ROInames, ROIorder, firstLevelConsToPlot, groupLevelConsToPlot)
%PLOT_GROUP_LEVEL_RESULTS
%
% PLOT_GROUP_LEVEL_RESULTS(CORRELATIONMATS, SETTINGS, NETTYPE, CORRECTIONTYPE,
% ROINAMES, ROIORDER, FIRSTLEVELC... |
function eta = get_efficiency(N, input_body)
eta_tot = 0.95^2;
switch input_body
case 'sun'
R = 1/N;
% Z_tot = 1-N;
eta = R + (1-R)*eta_tot;
case 'arm'
R = 1/N;
Z_tot = 1-R;
if R>0
eta = (Z_tot - 1)/(Z_tot*eta_tot - 1);
else
eta ... |
function [y] = decision_functionParzen(x,samples,class_length)
y = 0;
for i = 1: size(samples,2)
y = y + class_length * exp( -(x-samples(:,i))'*(x-samples(:,i)) / 2 );
end
end |
selected_image=24;
sigma_raw=squeeze(collect_width(1,selected_image,:));
sigma_m=sigma_raw*resolution*1e-6;
y_loc_select=squeeze(y_loc(1,selected_image,:))
ene=linear_energy_scale(y_loc_select(isfinite(y_loc_select)));
QS=-14;
z_im=2016.04;
p0=[1e-4 0.1 0.3]
[p,s_fit]=emitFit(ene,sigma_m',QS,z_im,p0)
p*1e6
figu... |
function h=sigm(in,pian_zhi)
h=1./(1+exp(-in-pian_zhi));
end |
global MPI_COMM_WORLD;
load 'MatMPI/MPI_COMM_WORLD.mat';
MPI_COMM_WORLD.rank = 56;
Alluxio_Row_mv_version3;
|
function psi=ITP_trap(c)
%% Parameterization
global z h len Num
V=1/2*z.^2;
dt=-1i/100; % time step
%% Exact
exact_psi=exp(-(z).^2/2)/pi^(1/4);
%plot(x,exact_psi.^2)
%% Initialization
% Gaussian function
psi=exp(-2*(z).^2/2)/pi^(1/4);
psi=psi/sqrt(h*sum(abs(psi).^2));
mu=conj(psi)*computeH(len,V,c,psi,h,z)*psi.'... |
% Script that adds joints to TDSEM bodies
% import opensim libraries
import org.opensim.modeling.*
% Load scapulothoracic joint library
Model.LoadOpenSimLibrary('C:\OpenSim 4.1\plugins\ScapulothoracicJointPlugin40_WinX64.dll');
%% Moving Base
Base = FreeJoint('MovingBase',TDSEM.get_ground(),Vec3(0),Vec3(0),Th... |
function [area,Ax,roc]=ensemble(n,betaT,net,inx,Bx,outfile)
%WBL 23 Sep 2002 Ensemble together boosted nets and then calculate its performance
% $Revision: 1.5 $ $Date: 2002/10/31 11:23:47 $
%WBL 23 Sep 2002 Based on testnet.m r1.4
Ax = zeros(2,size(Bx,2));
for i=1:n
Ax = Ax -log(betaT(i))*sim(net{i},inx);
end
... |
% Measure Human Dynamic Range with a flash-probe test
%
% Begun 15 Mar 2006 gregng
% QuestDemo.m
%
% By commenting and uncommenting five lines below, you can use
% this file to implement three QUEST-related procedures for measuring
% threshold.
%
% QuestMode: In the original algorithm of Watson & Pelli (1983)
% each tr... |
load('Pharama_Intervention/baseline.mat')
load('Pharama_Intervention/nicotine.mat')
load('Pharama_Intervention/nicotine_alcohol.mat')
threshold = 0.0038;
[voltage_bl, time_bl] = get_voltage(data_baseline, fs_baseline, 20, 40);
[data_baseline, peakIndex_base] = findpeaks(voltage_bl,'MinPeakHeight'...
,threshold);
b... |
function varargout = detmasas(varargin)
% DETMASAS MATLAB code for detmasas.fig
% DETMASAS, by itself, creates a new DETMASAS or raises the existing
% singleton*.
%
% H = DETMASAS returns the handle to a new DETMASAS or the handle to
% the existing singleton*.
%
% DETMASAS('CALLBACK',hObject,ev... |
% speckle structured illumination fluorescent microscopy
% Coded by Li-Hao Yeh 2015.08.07
% Last updated 2018.08.02
% clear all;
set(0,'DefaultFigureWindowStyle','docked');
F = @(x) fftshift(fft2(ifftshift(x)));
iF = @(x) fftshift(ifft2(ifftshift(x)));
% load res_speckle_shift.mat;
%% Coordinate assignm... |
function [ fitness ] = computeFitness( image1, originalImage )
[rows, columns, rgb] = size(image1);
fitness = 0;
for rgb=1:3
for row=1:rows
for column=1:columns
fitness = fitness + abs(double(image1(row,column,rgb)) - double(originalImage(row,column,rgb)));
en... |
function [labels, error_table] = get_error(lowpatches, highpatches, PPs)
%% Basic
pps_num = numel(PPs);
patch_num = size(lowpatches, 2);
error_table = zeros(patch_num, pps_num);
%% Update error table
for i=1:pps_num
patch_recon = PPs{i}*lowpatches;
error_table(:,i) = (mean( (highpatches -... |
function run(measure_type, varargin)
% RUN -- Calculate coherence, normalized power, or raw power
% trial-by-trial, day-by-day according to the current config options.
%
% If unspecified, the config file dsp2/+config/config.mat will be
% loaded.
%
% run( measure_type ) runs the analysis for the given... |
function xy = axonCheck(neuron, dims)
% AXONCHECK Quickly visualize neuron plot
%
% 13Aug2017 - SSP - created
% 3Jan2017 - SSP - updated neuron methods
% ---------------------------------------------------------------------
if nargin < 2
dims = 2;
end
xyz = neuron.getCellXYZ();
... |
function [features] = matrixFeatures_fc61(files, model_name)
total = size(files, 1);
features = zeros(total, 2048);
for i=1:total
if mod(i, 1000) == 0
fprintf('iteration: %d/%d\n', i, total);
end
elm = files{i};
elm = strcat(elm, '_', model_name, '.fc6');
%disp(elm)
[dim6,... |
%Fatma Manual trial
close all
clear all
% patientList = dir('C:\Users\fatmausta-admin\Documents\MATLAB\LV');
% addpath('C:\Users\fatmausta-admin\Dropbox\3DSegmentationCode\metaImage');
addpath('/Users/fatmausta/Documents/RESEARCH/3D/LV/');
% addpath('/Users/fatmausta/Dropbox/3DSegmentationCode\metaImage');
addpath('/Us... |
%这里将.mexw64文件的train和predict前方加了lib,以防与内置函数重名。
% 得到需要的所有数据
addpath(genpath('./.'));
% getModel('fs',10000);
% close all;
%-------------------------对下面2行的注释----------------------------------
% trainLabels: 训练labels,为 (remain*12)*1的矩阵。存储的是1,...remainNum,
% 1...remainNum,...共12组。对应的效果与目录排序对应效果相同(注意删除的效果不进行排序)
% trainHi... |
function show_Labels( opt )
if ( opt == 1)
ind(1) = title( 'Miss Distance Vs. Bounded Target Manuever');
ind(2) = zlabel('Miss Distance [m]');
view([-27 25]);
else
ind(1) = title( '$G_M(s)$ Step Response');
ind(2) = zlabel('Amplitude');
view([-27 22]);
end
ind(3) = xlabel('$t_{go}$... |
clear
clc
t = [10 15 20 25 30];
% X = 0.025
load('WaterTemp10X0.025.mat')
y(1, 1) = sum(exGas.dmCond.all);
load('WaterTemp15X0.025.mat')
y(1, 2) = sum(exGas.dmCond.all);
load('WaterTemp20X0.025.mat')
y(1, 3) = sum(exGas.dmCond.all);
load('WaterTemp25X0.025.mat')
y(1, 4) = sum(exGas.dmCond.all);
load('WaterTemp30X0.02... |
recDuration = 5;
recPause = 0;
recObj = audiorecorder
count = 1;
while count <= 10
recordblocking(recObj, recDuration);
y = getaudiodata(recObj);
wavwrite(y, ['wav/recording' num2str(count)]);
pause(recPause);
%plot(y)
count = count + 1;
if count == 10
cou... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 本函数用于下载指定证券代码(多个请用‘,’隔开)相应指定起始和截止日期之间的日
% 行情数据,保存到backtest Cache中,文件名为证券代码。
% 这里的日行情数据格式如下:
% 732686 4.460868254 4.48874868 4.419047614 4.453898147 11022101 6.39 215.9386515
% 732687 4.426017721 4.432987827 4.286615588 4.377226974 21426743 6.... |
clear
addpath(genpath('Data'));
addpath(genpath('Utils'));
clear all; clc;
set(0,'defaultAxesFontSize',14,'defaultTextInterpreter','latex');
rng(260196,'twister');
Order = [1, 2, 3];
FFR1d = 1;
PrepdataFull
diffFFR = [NaN; ydata(2:end,3) - ydata(1:end-1,3)];
%% Util script fetching 2 of our 3 series
url = 'https://fre... |
%
% irpExtrinsic calculates the extrinsic parameters of a calibration plane
% depending on the selection of 4 points on the plane.
%
% Usage: CTW = irpExtrinsic(I,calib_dist,fc,cc,kc)
%
% The origin of the corresponding world coordinate system lies in the first
% selected point, the y-axis points towards the second sel... |
load('F:\WORK\25ms\-1-1 left hand exclude\EEG__32_10_mwv_mfc_convVSnoch_25ms_10.mat')
load('F:\WORK\25ms\-1-1\EEG__32_10_mwv_mfc_convVSnoch_25ms_10.mat')
cfg = [];
cfg.parameter = 'powspctrm';
cfg.operation = '(x1-x2)./x2';
TFR_diff = ft_math(cfg, GA_tf_CONV, GA_tf_NOCH);
%% PreSpeech
cfg = [];
cfg.marker = 'on... |
function [sim_basis,pose_pc,pose_ev] = OrthonormalizeBasis(obj)
%OrthonormalizeBasis Summary of this function goes here
% Detailed explanation goes here
[Q,~] = qr([obj.sim_basis,obj.pose_pc],0);
sim_basis = Q(:,1:obj.n_sim_basis);
limit = min(obj.n_sim_basis+obj.n_pose_pc,size(Q,1));
pose_pc = Q(:,obj.n_sim... |
function [nParticles, outcomeDeviation] = al_getParticleN(nMaxParticles, outcome, distMean, concentration, sign)
% AL_GETPARTICLEN This function determines the number of confetti particles
% in the asymRewardVersion of the confetti-cannon task.
%
% The number of particles depends on the maximum number of particles,
%... |
function plotHurricane(avgWS,days)
% plotHurricane
% Inputs: a vector of average wind speeds for each month and a matrix of
% (average) days per month storms of each category were recorded
% Outputs: none returned, but a customized plot is created
% Create a cell array of text labels for the hurricane categor... |
close all
clear all
clc
%% System parameters
m = 0.79; % mass [kg]
k = 400; % stiffness [N/m]
c = 4; % damping coefficient [Ns/m]
% Initial conditions
x0 = 0; % initial displacement
v0 = 0; % initial velocity
% Controller parameters
Kp = 3; % proportional gain
Ki = 8; % integral ... |
function gum(t, f, X, depth)
% GUM global unstable manifold.
%
% GUM(t, f, X, steps) performs the continuation algorithm for computing
% (part of) some global unstable manifold of the map f, cf. [1].
%
% t tree containing the box covering (and initially a covering
% of the object for which the ... |
function [summa,index] = max_sum(v,n)
summa = -inf;
index = 0;
if n > length(v)
summa = 0;
index = -1;
else
for i = 1:(length(v) - n + 1)
temp = 0;
for j = i:(i + n - 1)
temp = temp + v(j);
end
if temp > summa
summa = temp;
index = i;
... |
close all
clear
clc
source "./bawm.m"
# synthesis of the virtual world
num_points=10;
num_lines=10;
num_planes=10;
num_landmarks=num_points+num_lines+num_planes;
num_poses=10;
world_size=10;
constraints=[1; #point-point
0; #line-point
1; #line-line
0; #plane-point
... |
function img_path = cloudWatch( cloud_img)
%% make cloud into one map of one cloud/not cloud
fprintf('Translating clouds to outline...\n');
cloud_outline = cloud_to_outline(cloud_img);
%% read dataset, find closest matches
fprintf('Comparing cloud to dataset...\n');
img_path = match_outlines(cloud_outline);
... |
%This class abstracts an instance of the N-Port Charging Problem, that is,
%the N-Port Power Problem which aims to minimize the time required for all
%devices to exceed a given threshold.
classdef NPortChargingProblem < NPortPowerProblems
properties
end
methods
function obj = NPortChargingProblem(ti... |
function [] = psradialblur(a, m, q)
%PSRADIALBLUR Run the Radial Blur filter.
% PSRADIALBLUR runs the filter with the default parameters.
%
% PSRADIALBLUR(A,M,Q) A for amount in the range of 1 -> 100, default is
% 10. M for method of bluring either 'spin' or 'zoom', default is 'spin'.
% Q for quality of blur... |
function varargout = make_it_last(varargin)
% MAKE_IT_LAST MATLAB code for make_it_last.fig
% MAKE_IT_LAST, by itself, creates a new MAKE_IT_LAST or raises the existing
% singleton*.
%
% H = MAKE_IT_LAST returns the handle to a new MAKE_IT_LAST or the handle to
% the existing singleton*.
%
% MA... |
function [p_tilde]=calcul_champ_pulsating_string(f,param,r);
w=2.*pi.*f;
k=w./param.c_0;
p_tilde=i.*param.rho_0.*w.*param.V_0./besselh(1,2,k.*param.a).*besselh(0,2,k.*r);
%p_tilde=besselh(0,2,k.*r); |
function [wordcounts,words] = import_data(dataset)
rep_data = '../data/'; % folder of the data
switch dataset
case 'ANC'
namedataset = 'American National Corpus';
matfilename = [rep_data 'ANC/ANC.mat'];
if exist(matfilename, 'file') == 2
load(matfilename);
els... |
function dynEqn = newtonEuler(mod)
%function tou = newtonEuler(rMat,p,pc,m,Ic,var,var_dot,var_dot2,total_var)
for i=1:length(mod.total_var)
syms(char(mod.total_var(i)));
assume(mod.total_var(i),'real');
end
w=sym(zeros(3,length(mod.var_dot)+1));
w_dot=sym(zeros(3,length(mod.var_dot)+1));
w_dot2=sym(ze... |
%chebfun.pdf pag. 21
function ex4_lab2
format long e;
d = [-1, 1];
fprintf('\n \t COSTANTI DI LEBESGUE, NODI EQUISPAZIATI');
max_deg = 50;
lebesgue_constants = []; %stores lebesgue constants
est = [];
%em=0.57721566490153286060651209008240243104215933593992; %EULERO-MASCH.
for deg = 1:max_deg
l_bound = 2^(deg-2)... |
function [mz,x,img,opt,allAnno,imz] = desiH5LoadFunction(file)
%desiH5Load - load an existing h5 file into the desi toolbox
% Define the name from the 'file' input
fn = [file.dir file.nam];
% Create a waitbar
%wb = waitbar(0,'Loading an H5 file');
% Please try to read the imzML filename from which the raw data was
%... |
a = imread('museum.jpg');
b = imread('DSCN1078.jpg');
newA = zeros(length(a(:,1,1)),length(a(1,:,1)), length(a(1,1,:)));
for i = 1:3
[newA(:,:,i), newAhist, oldAhist] = hist( a(:,:,i) );
end
newB = zeros(length(b(:,1,1)),length(b(1,:,1)), length(b(1,1,:)));
for i = 1:3
[newB(:,:,i), newBhist, ... |
% Andrew Dhawan
% 9th April 2017, Describes growth of cells given radiotherapy
function dy=dCells(t,y,params)
dose = params(1);
t_fraction = params(2);
t_dose_given = params(3);
t_end_rad = params(4);
alpha = params(5);
beta = params (6);
rho = params(7);
percent_in_morning = params(8);
dose= percent_in_morning * dos... |
function [data, time] = getOmni(date)
arguments
date (1,1) datetime {mustBeAfter(date, 1995)}
end
[year, month] = ymd(date);
fileName = sprintf("%4i-%02i.cdf", year, month);
archive = fullfile("data", "omni.7z");
file = tempdir + fileName;
try
get7zip(archive, fileName, t... |
%y(t) = a1u1(t) + a2*sqrt(u2(t))
% dy(t)/dt=a1u1(t) + a2*sqrt(u2(t)), y(0−)
a_1= 2;
a_2= 1;
c = 2;
Y_Euler = [out.y];
dY_Euler = [out.dy];
%Y_Heun = [out.y];
%dY_Heun = [out.dy];
|
function Options = get_default_inference_options
% Set up Inference Options struct
Options.num_PK_param_vecs_to_sample = 1e5;
Options.num_T10s_to_sample = 1e3;
Options.T10_approach = 'marginalise';
Options.posterior_stats = {'joint_posterior_mode', 'joint_posterior_mean', 'joint_posterior_stddev', ...
... |
%% D. Sersic, M. Vucic, October 2015
%% Update: I. Ralasic, May 2016
% Compressive sensing (CS) - 2D example
%
% Assumption of sparsity
% There is a linear base Psi in which observed phenomenon is sparse:
% only K non-zero spectrum samples out of total N are non-zero, K << N
%
% Examples: Psi == DWT (discrete wavelet t... |
clear all;
% definiujemy pierwszą część przedziału
a = 0.5;
b = 1.5;
h = 1; % dokładność przybliżenia ilorazu różnicowego
%%%%%%%%%% METODA NEWTONA
xk = a;
fk = exp(xk) - 3*xk^2;
fpk = ((exp(xk+h) - 3*(xk+h)^2)-(exp(xk) - 3*xk^2))/h;
iteracje = 0;
while abs(fk) > 10^-6;
xk = xk - (fk/fpk);
fk = exp... |
classdef ic_OPTtools_data_controller < handle
% Copyright (C) 2013 Imperial College London.
% All rights reserved.
%
% 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... |
% The function shows dataMtr (size 2 matrix) as image
% The values in matrix are form 0 to 1
function [] = showImage(dataMtr, name)
if nargin < 2
name = "";
end
imagesc(dataMtr);
limits = [];
limits(1) = double(min(dataMtr(:)));
limits(2) = double(max(dataMtr(:)));
handle ... |
function ans = pizza(z,a)
pi * z.^2 * a;
end |
% created: Zoya Bylinskii, Aug 2014
% This finds the KL-divergence between two different saliency maps when
% viewed as distributions: it is a non-symmetric measure of the information
% lost when saliencyMap is used to estimate fixationMap.
function [score,map] = KLdiv(saliencyMap, fixationMap)
% saliencyMap is the... |
function [signals,varName] = msloadutl(filedataname)
%MSLOADUTL Multisignal load utilities.
% [signals,varName] = MSLOADUTL(filedataname)
% M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 19-May-2006.
% Last Revision: 14-Nov-2006.
varNAM_Cell = {'signals','X','Y'};
InVAL = load(filedataname);
varInFile = fieldna... |
function wasClicked = checkClick(x,y, rect)
%CHECKCLICK checks if the user clicked in the specified rectangle
if x >= rect(1) && x <= rect(3) && y >= rect(2) && y<=rect(4)
wasClicked = true;
else
wasClicked = false;
end
end |
function [ label, data ] = stpReadSvmData( fileName)
%% 读取 svm训练数据
% 打开文件
fin = fopen(fileName, 'r');
info = textscan(fin, '%d 1:%f 2:%f');
label = info{1, 1};
data = [info{1, 2}, info{1, 3}];
end
|
function dy = compute_diff_fd(y, degree)
%DIFF_FD Summary of this function goes here
% Detailed explanation goes here
global D
dy = D{degree}*y;
end
|
function [ ] = check_size_fid( ex , data_for_acqp)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
fid_size=prod(size(data_for_acqp));
% acqp_size=prod(ex.acqp.ACQ_size)/2*ex.method.PVM_EncNReceivers;
%
% if (fid_size~=acqp_size)
%
% fprintf('%d %d \n', fid_size, acqp_size);... |
clear all;
close all;
clc;
% add folders containing helper scripts to search path --------------------
addpath( [pwd '\helpers']);
resultsFolder = [pwd '\data\results\problemtrials\'];
% read data ---------------------------------------------------------------
[data dataIndices] = readHulkamaniaData(resultsFolder);... |
function joint_perb_dist_combination
fls = dir('joint_perb_dist/*.mat');
%[operation L/R S O]: operation = 1 for remove, 2 for add; L/R = 1 for neighbor of source vertice and L/R = 2 for sink vertice, L/R=3 for source vertice, 4 for sink vertice; S = 1->6 for status of neighbor. S = 1 to 3 means up,horizontal,and dow... |
n1 = numel(D); %Get number of log data
Fs = n1 / 31015 %data frequency
Data = D(5000*Fs:25000*Fs);
n = numel(Data); %Get number of log data
%t = n / Fs;
MV = mean(Data); %Mean Value Calculation
SD = std(Data); %Standard Deviation Calculation
%Fast Fourier Transform o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.