text stringlengths 8 6.12M |
|---|
function solution_summary = display_results_interp(solution,conf)
% Initials
algs = fields(solution);
nalgs = length(algs);
Xtest = solution.(algs{1})(end).Xtest;
fm = 1/conf.data.T;
f = linspace(-fm/2,fm/2,length(Xtest))';
Ytf = abs(fftshift(fft(solution.(algs{1})(end).Ytest)));
options = {'FontSize',20,'Interpreter',... |
link_number=5;
path=pwd;
result=[]
flow_number=0
for i=1:link_number
fprintf(strcat('link',num2str(i),'\n'))
path=strcat(path,'/',num2str(i),'/');
path_find=strcat(path,'bw*.txt');
file_list=dir(path_find);
file_number=length(file_list);
for j=1:file_number
file_list(j).name;
file_name_vector=(file_list(j)... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RC bootstrap with cost and demand calculations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
% Primary Config parameters
RC = true % Set RC to choose between RC and NL
ces = true % Set ces to... |
function hybrid_decoding(hmm_dir, vars)
hmm_defs_path = fullfile(hmm_dir, vars.hmm_defs);
floor_path = fullfile(hmm_dir, vars.hmm_vfloors);
ds = vars.te;
% log_path = fullfile(hmm_dir, 'hybrid_vite.log');
cmd = strjoin({'hvite_dnn_test.exe' vars.global_opt ...
'-C' vars.htk_cfg_file...
... |
if ~isoctave(), clearvars -except exampleName; end
N = 1;
M = 2;
E = 2;
envModel = Env('MyEnv');
envName = {'Stage1', 'Stage2'};
envType = {Semantics.UP, Semantics.DOWN};
rate = zeros(M,E); rate(M,1:E)=(1:E); rate(1,1:E)=(E:-1:1);
envSubModel = {example_randomEnvironment_genqn(rate(:,1),N), example_randomEn... |
%% Preamble and defining variables
% This is the code for the basic Karplus-Strong Algorithm.
% 2)
% Firstly, I assign values to some necessary variables: the sample rate,
% the frequency of the desired pitch, the length of the input vector, the
% damping and the decay.
Fs = 44100; f0 = 110;
N = round(Fs/f0 - 0.... |
function OutIma = data_type_cvip( InIma, Type )
% DATA_TYPE_CVIP - Convert the dta type according to the selected Type.
%
% Syntax :
% ------
% OutIma = data_type_cvip( InIma, Type );
%
% Input Parameters include :
% ------------------------
%
% 'InIma' Input image can be gray image or rgb image o... |
% Comsol server required
%% figure 2d
delta=0.25; %element size
ratio=0.5; %ratio of material
a=1;%beam half width
b=1;%beam height
filename='temp.txt';
n_train=[100,200,300,400,500,600,2000,6000,9000];
%% figure 2e
e0=1/func_outputs(reshape(ones(5,5)*0.5,1,5,5),1,1,0.25,'temp.txt');
for i=1:9
figure;
load(['.... |
function [Setup, Results] = StationairyScenario(SetupSrc, varargin)
%StationairyScenario Stationary scenario to demonstrate observer behavior
if nargin == 1
% Rerun setup file
Setup = SetupSrc;
else
Setup.DefenderConfig = defaultDefenderConfig;
Setup.InvaderConfig = defaultInvaderConfig;
Set... |
%% Runs interactions between changes in beta_str and beta_sma
clear; clc;
% Results are stored in a structure dependent_vars
% with a field for every dependent variable
% Instances are recorded in a AxBxC matrix
% where A is the variation in parameterCTX (beta_sma and beta_pfc)
% B is the variation in parameterSTR
... |
clc
clear all
close all
%% Time condition
T = 1;
dt = 0.01;
SumT =14 ;
t = [0:dt:T-dt];
tt = [0:dt:SumT-dt];
L = length(t);
%% standard
c1 = 202;
c2 = 372;
c3 = 202;
x0_1 = 574;
x1_3 = 700;
x5_6 = 700;
y0_1 = 0;
y1_3 = 2;
y5_6 = 0;
%% x-z 3_mortor_control
syms x y
for i = 1:1:3
if i==1
xi = x0_1;
... |
clear all
clc
Binfile = 'Tofet Files/15%_2min_Bin.mat';
load(Binfile);
size = 400;
MS = MS(1:size,1:size,:);
pw = 2000/2160; ph = pw;
lsx = 0.37; lsy = 0.37; lsa = 0.38;
[XYZ, Edge] = Populate_Lattice(MS,pw,ph,lsx,lsy,lsa);
% figure
% spy(MS(:,:,1))
% figure
% plot(MonList(:,1),MonList(:,2),'.b')
|
% Copyright (c) 2015
% Yukun Chen <cykustc@gmail.com>
%
% Compute likelihood of given data sequence on given HMM model using Forward Backward Algorithm
%
% likelihood = hmm_likelihood_jia(data, d, nseq, onelen, numst, verbose, a00, a, gmm.mu, gmm.covariance, gmm.inv_covariance)
%
% Input:
% - d: dimension
% ... |
clc, clear all
H = rand(8,1,16,1);
% H(:,1,1,1) = 0.1;
C = createCellOffsets('square',[4 4],[1 1]);
L = createCellOffsets('square',[3 3],[1 1]);
Hnorm = blockNormalization(H,C,L,'box',[2 2]);
reshape(sum(Hnorm,1),[4 4 1])
sum(Hnorm(:))
|
function [pot,sh]=Potential(clv)
% POTENTIAL computes the potential and the Shapley value of a TU-game v.
%
% Usage: [pot,sh]=Potential(clv)
%
% Define variables:
% output:
% pot -- The potential of the game v.
% sh -- The Shapley value of a TU-game v.
%
% input:
% clv -- TuGame class object.
%
% ... |
function bin=binaryimg(gim)
level=graythresh(gim);
bin=im2bw(gim,level);
bin=imcomplement(bin);
end |
function setTrigger(object,value)
% manage input
assert(isstruct(value),'ERROR: invalid trigger setting');
% apply settings
communicate(object);
if ischar(value.Source)
value.Source=upper(value.Source);
end
switch value.Source
case {'CHANNEL1' 'CH1' '1' 1}
value.Source='CHANNEL1';
case {'CHANNEL2... |
%%
% subplot(2,1,1)
% figure(1)
i = 3;
scatter(x_SEM,slope)
title('SEM weights vs unweighted initial')
xlabel('slope using SEM weights')
ylabel('slope using unweighted initial')
% subplot(2,1,2)
print('SEM weights vs unweighted initial intercepts through zero', '-dpng')
% figure(2)
x = [0 max(MSDss(i).MSD(:,1))/4];
% y... |
figure()
clear
[model,biomass] = setupModel('iJO','EX_glc(e)','anaerobic');
targets = {'lyc_rxn';
'cap_rxn';
'EX_phb(e)';
'EX_ibut(e)'};
% targets = {'EX_cys-L(e)';
% 'EX_hom-L(e)';
% 'EX_thr-L(e)';
% 'EX_15dap(e)';
% 'EX_lys-L(e)';
% ... |
function [cost, a, x, niter] = siquan_LPDVFS(m, l, s, AP, IP, N, nj, tau, n, na, xd, tol)
%%
% m: number of processors
% l: number of speed levels
% s: vector of speed levels
% AP: vector of active power datas
% IP: idle power data
% N: number of discretization steps
% nj: a vector containing number of deadlines at eac... |
% spamTrain.mat contains 4000 training examples of spam and non-spam email
% spamTest.mat contains 1000 test examples.
% training accuracy ~99.8% and a test accuracy ~98.5%
% Load the Spam Email dataset
% You will have X, y (training set) in your environment
load('spamTrain.mat');
C = 0.1;
model = svmTrain(X, ... |
function RegionReduction( tController )
%Getting the solution of the Explicit Problem
%
try %
%
%
% Obtaining TpolyObject
%
tPolyUnion = mpt_mpsol2pu(tController.tSolution);
tHVrepresentation = tPolyUnion.Domain.triangulate();
%
% Partition of the simple optimizer must be a PolyUnion object
%
... |
function [ somaLocation ] = ReadSwc( filename )
% read swc files
somaLocation=load(filename);
somaLocation=somaLocation(:,3:5);
tmp=somaLocation(:,2);
somaLocation(:,2)=somaLocation(:,1);
somaLocation(:,1)=tmp;
end
|
function [K, invK, rbfK] = mk_computePriorKernel(X, theta)
% 这个是GPDM的新模型,用来计算对K_X的核函数
rbfK = kernel(X, X, theta(2:3));
K = lin_kernel(X, X, theta(1)) + rbfK + eye(size(X, 1))*1/theta(end);
invK = pdinv(K);
|
function C=change_parameter(configfileNb,parameterName,parameterValue)
filename=sprintf('config/configuration%d.in', configfileNb);
if exist(filename,'file')~=2
error(['Le fichier ' filename ' n''existe pas']);
else
fileID=fopen(filename);
C = textscan(fileID,'%s %s','Delimiter',{' ... |
function radar = h_doppler_radar(x)
%RADAR Summary of this function goes here
% Detailed explanation goes here
radar_pos = [0, 0];
dx = x(1,:) - radar_pos(1);
dy = x(3,:) - radar_pos(2);
slant_range = sqrt(dx.^2 + dy.^2);
elevation_angle = atan2(dy, dx);
radar = [slant_range; elevation... |
function CreateOverlayImage(protonimage,PFOB,PFCE,params)
% 16 11 2017 J SCHOORMANS
normalize = @(x) x./(median(abs(x(:)))+eps);
if isempty(PFOB)&&isempty(PFCE);
error('please input at least one overlay image')
else
if isempty(PFOB);
PFOB=zeros(size(PFCE));
end
if isempty(PFCE);
PF... |
function plotroute(city, route, current_distance, temperature)
% PLOTROUTE
% PLOTROUTE(city, route, current_distance, temperature) plots the route and
% display current temperautre and distance.
global h;
cycle = route([1:end, 1]);
% update route
x=city(:,1);
y=city(:,2);
set(h,'Xdata',x(cycle),'Ydata',y(cycle));
% d... |
close all
load([cd '\antr0_7v2.mat')
tempo=(Sinal.Dado(:,8)-Sinal.Dado(1,8))/1000;
ax(1)=subplot(2,1,1);
h=plot(tempo,Sinal.Dado(:,1:3),'.-');grid on
legend(h,{'GoniD' 'GoniE' 'SinRef'})
ax(2)=subplot(2,1,2);
h=plot(tempo,Sinal.Dado(:,6:7),'.-');grid on
legend(h,['CH1' 'CH2'])
linkaxes(ax,'x');
figure
hist(Sinal.Da... |
function analyse_CheckSNR2_aston_batch
%Written by Xing 6/7/20. Runs batch file on SNR data, using corrected SNR
%code (calculate SD of baseline using MUA, not using mean MUA).
for sessionInd=13:15
switch sessionInd
case 1
date='280818_B1_aston'
whichDir=2;
case 2
... |
classdef Thermal_Storage < Device
%THERMAL_STORAGE Klasse aller Verbraucher mit thermischen "Speicher"
% THERMAL_STORAGE repräsentiert Verbraucher, deren Verhalten mit Hilfe eines
% Thermischen Modells modelliert wird (z.B. Kühlschränke, Gefriergeräte,
% Heizungen, Boiler, ...)
%
% Argumentenüberga... |
function slider_Callback_ZT(hObject, eventdata, handles)
% hObject handle to slider (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and ... |
% Gaussian-type orbitals
% r,r0 are row vectors
function phi=GTO(r,r0,A)
phi = (2*A/pi)^0.75*exp(-A*(r-r0)*(r-r0)');
end
|
function [succeeding_neigh_node_2_degree] = nieghbors_degree_2(G,current_node,preceding_node)
% this function reads a graph and an origin node. The neighboring nodes and
% their degrees are calculated. Only the nodes with a degree of 2 are
% returned
neigh_nodes = [neighbors(G,current_node) degree(G,neighbors(G,cu... |
function score = windowedDTW(x, y, windowWidth)
lenX = length(x);
lenY = length(y);
DTW = zeros(lenX, lenY);
for i=1:lenX
DTW(i,1) = 1e20;
end
for i=1:lenY
DTW(1,i) = 1e20;
end
DTW(1,1) = 0;
for i=2:lenX %%%% 2's BECOME 1's FOR C CODE
left = i - wind... |
%FDEP to show a function's dependencies
%
% FDEP dissects a MATLAB (ML) file and iteratively looks for
% all user defined functions (modules), which are used
% during runtime
%
% FDEP retrieves for each module its
% - subfunctions
% - nested functions
% - anonymous functions
% - number of calls to f/eval ... |
%% Calculate angles with new window tensors. Use with new_time_windows function.
function output=angle_new_windows(word,probe)
%% Part 1 -> Use to create 9x8 figure, each part is a subplot of probe_win x word_win angles
%% Find probe norms
probe_norm=cell(1,size(probe,3));
for i=1:size(probe,3)
te... |
Q = @(a) pi^2 /(4*a^2); %y(a) = 0 => 0.3cos(sqrt(q)a) = 0 => sqrt(q)a=pi/2 => q=pi^2/(4a^2)
y = @(q, x) 0.3*cos(sqrt(q)*x);
%Startvärden
format short e
[x_0, x_1] = guess();
x_2 = 0;
% sekantmetod
while true
q = Q(x_0);
%Om båglängd är tillfredsställande nära 0.5 sÃ¥ bryter vi
if abs(arcLength(q, x_0) - 0.5)... |
function graphs = opents_nbin(files, numsubs, fileval)
% a function to open a timeseries into a usable format
% Inputs:
% files: a struct containing filenames in the file(i).name category
% numsubs: the number of subjects
% fileval: the batch of subjects in the file being considered
% this parameter enabl... |
function [descriptorCentroids,features_dsiftConcat] = DSIFTClustering(DirPath ,numOfClusters,clustersPath,sampleSize)
run([pwd ,'\..\Libs\VLFEAT\toolbox\vl_setup' ]);
fileList = getAllFiles(clustersPath);
if(sampleSize>size(fileList,1))
sampleSize=size(fileList,1);
end
% parameters for extracting features
binSi... |
vid = VideoReader('timelapsevideo.avi');
numImgs = get(vid, 'NumberOfFrames');
frames = read(vid);
obj=VideoWriter('BW.avi');
open(obj);
for i=1:numImgs
movie(i).cdata=rgb2gray(frames(:,:,:,i));
movie(i).colormap=gray;
end
writeVideo(obj,movie);
close(obj);
for k=1:numImgs
movie(k).cdata=... |
function [sqrew, vrew] = getQuadraticCostIndividual(m, c);
%
% Calcualtes the expected square cost with its covariance matrix for an n dimensional input.
%
% Input:
% m: the mean [n, d]
% c: the covariance [d, d, n] or [d, n]. if [d, n] --> diagonal [d, d, n]
% Q: quadratic weighting matrix such that cost(t) = x'*Q*x, ... |
function [ Srr, Ssh, Sm ] = shuma( A )
%funksion per shumen sipas rreshtave,shtyllave dhe gjith matrices
%Srr-vektor, Ssh-vektor ,Sm-numer
permasa=size(A); %size() kthen 2 permasat e matrices
Srr=zeros(permasa(1),1); %sipas rreshtave, percaktuar me zero nje vektor shtylle
Ssh=zeros(1,permasa(2)); %sipas shtylla... |
function [] = main
clear;
% Step 3
[S, Id] = get_scores_from_file;
% Step 4
[G, I] = Genuine_Impostor(S, Id);
% FMR, FNMR, DET, ROC, EER
FMR_FNMR(G, I);
end
function [S, Id] = get_scores_from_file
% Loads score matrix and plots info.
S = load('Data/scorematrix.txt',... |
%% EXAMPLE: Differential Drive Path Following
% In this example, a differential drive robot navigates a set of waypoints
% using the Pure Pursuit algorithm while avoiding obstacles using the
% Vector Field Histogram algorithm.
%
% Copyright 2019 The MathWorks, Inc.
%% Simulation setup
% Define Vehicle
R = 0... |
%%in barnamei baraye tolide ADAPTIVE MEDIAN FILTER ast,BARAYE
%EJRAYE BARNAME HAME BARNAME RA ENTEKHAB KARDE(Ctrl+A & Ctrl+C)VA DAR Command
%Window MATLAB PASTE KONID.
clc
clear all
close all;
%tasvire vorudi
Img_in=imread('2.tif');
Img_in=imnoise(Img_in,'salt & pepper',0.25);
Img_in=double(Img_in);
figure(1);
imshow(... |
function pca_rpt(p,t,s,ttle)
%PCA_RPT - Produces the final figure and results for the Papadopulos Cooper model
%
% Syntax: pca_rpt(p,t,s,ttle )
%
% p(1) = a = slope of the late time straight line
% p(2) = t0 = intersept of late time straight line
% t = measured time
% s = measured drawdown
% ... |
%Skrypt sprawdza jak bardzo modele są do siebie podobne
%DANE:
dirPath = 'dat\cutOutParamsPre\'; %katalog danych
%{
testPaths = {'cara1_frontal1', 'cara2_frontal2', 'cara3_arriba', ...
'cara4_abajo', 'cara5_gesto', 'cara6_risa', ...
'cara7_frontal1', 'cara8_abajo', 'cara9_frontal2', ...
'cara1... |
% cemVE13.m
% 27 Aapril 2016
% Ian Cooper
% School of Physics, University of Sydney
% https://d-arora.github.io/Doing-Physics-With-Matlab/
% Potential and Electric Field in [2D] region
% METHOD OF IMAGES: charge and GROUNDED PLATE
clear all
close all
clc
tic
% =======================================================... |
function flag = boxplot3(center,rotate,color,size,start)
%% 绘制一个立方体
% center 中心
% theta 转角
% color 颜色
% size 尺寸
% start 起始点
% 调用实例:
% boxplot3([0 0 0],[0 0 0], 'y',[1 1 1],[0 0 0])
global params;
theta = rotation(rotate);
x=[0 1 1 0 0 0;1 1 0 0 1 1;1 1 0 0 1 1;0 1 1 0 0 0] * size(1) ... |
function nrm = lp_nrm( tp, name, Bf, Kf, G, Z )
%
% Computes efficiently either of the following norms provided that
% Z has much more rows than columns:
%
% for tp = 'B':
%
% nrm = || F*Z*Z' + Z*Z'*F' + G*G' ||_F,
%
% for tp = 'C':
%
% nrm = || F'*Z*Z' + Z*Z'*F + G'*G ||_F.
%
% Here, F = A-Bf... |
function varargout = cart2sph2(varargin)
%CART2SPH2 Convert cartesian coordinates to spherical coordinates.
%
% [THETA PHI RHO] = cart2sph2([X Y Z])
% [THETA PHI RHO] = cart2sph2(X, Y, Z)
%
% The following convention is used:
% THETA is the colatitude, in radians, 0 for north pole, +pi for south
% pol... |
close all;
clear variables; clc;
%
addpath('.\..')
addpath('C:\DATA\MATLAB\ExportFigPackage');
Number_equations = 15136;
MAXSO = '30';
frequency_pade = 200:1:1000;
frequency_direct = 200:10:1000;
Model_name = 'Sphere eye - 8653 nodes';
Nnod = 5; % NUMBER OF FIELD POINT NODES
%
RETOL = 10^(-3);
%
filename_pade = 'Stra... |
function [X dX] = parse_grid_script(output_dir, dir_name, output_fname, Nruns)
% function [X dX] = parse_MC_script(output_dir, dir_name, output_fname, Nruns)
% output_dir = '~/output/MC/20000trials/';
% output_fname = 'job_MC_grid_task_%05i.mat';
% Nruns = 4000;
X = zeros(Nruns, 11);
dX = zeros(Nruns, 10);
for i = 1:... |
function [F, V] = hub_mesh(Xstor, Rstor, Ystor, HubD, HubT, ShaftD, alpha0, alphaT, Nu, Nd, Nb, Nf, Nh)
F = zeros(0,3);
V = zeros(0,3);
% up from root
[~, ixmn] = min(Xstor(1,:));
eg_from = [Xstor(1,1:ixmn); Rstor(1,1:ixmn); Ystor(1,1:ixmn)];
eg_to = [Xstor(1,1:ixmn); Rstor(1,1:ixmn); Yst... |
function Recognition003_Digits()
fprintf('\n Load training data ');
imgTrainAll = loadMNISTImages('train-images.idx3-ubyte');
lblTrainAll = loadMNISTLabels('train-labels.idx1-ubyte');
fprintf('\n Done loading \n');
nTrainImages = size(imgTrainAll,2);
figure;
imgFirst = imgTrainAl... |
function [pass,maxerr] = test(opt)
% Check indifference of correctphase() towards input dimensionality
S = rand(1,100) + 1i*rand(1,100);
[Vr1,Vi1] = correctphase(S);
[Vr2,Vi2] = correctphase(S.');
% Pass 1: all real part signals are equal
pass(1) = isequal(Vr1,Vr2);
% Pass 2: all imaginary part signals are... |
%Remove key with minimum cost from the queue
%function flag=priority_isMember(pq,key)
%Inputs
% pq Priority queue struct array
% key Key to find
%Outputs
% pq Updated priority queue struct array
% key Key of element with minimum cost
% cost Minimum cost
function [pq,key,cost]=priorityMinPop(pq)
if isempty... |
load meas.mat;
load test.mat;
%r = input('Enter the value of r ');
V = randn(5,2);
W = randn(3,3);
check = [1 2 3];
check = repmat(check,10,1);
check = check(:);
logic = zeros(10000,1);
B = randperm(120);
Yk = zeros(10000,3);
r = input('Enter the value of r ');
for m = 1:10000
for n = B
%random = randi... |
function GU_ExMGetMitoLysoVolRP3(data)
i = 1
% l(i) = load([data(i).source 'parameters_rp3_lyso_mito_all.mat']);
lysoMask = readtiff([data(i).source 'Analysis' filesep 'LysoMask_new.tif']);
mitoMask = readtiff([data(i).source 'Analysis' filesep 'MitoMask_new.tif']);
[lholes, N] = bwlabeln(mitoMa... |
%%Model Estimates MasterFile%%
% Edit to path of folder
cd 'C:\Users\diamondr\GitHub\FoodDeserts\Code/Analysis/ModelEstimates'
addpath('D:\Dropbox (Diamond)\FoodDeserts\Externals\Calculations\Model')
addpath('C:\Users\diamondr\GitHub\FoodDeserts\Code/Analysis/ModelEstimates')
addpath('C:\Users\diamondr\GitHub\FoodDe... |
%% This will take all the rates and prepare user-item rate dataset.
function [ dataset ] = PrepareDataSet( u )
[user, ~] = size(u);
OriginalDataset = zeros(1,1);
for i = 1 : user
OriginalDataset(u(i,1),u(i,2)) = u(i,3);
end
OriginalDataset(~OriginalDataset) = -1;
dataset = OriginalDataset;
end |
% Testbench for the coderFilter function.
clear;
close all
%% Check dependencies
dependencies.toolboxDependencyAnalysis({'coderFilter'})
%% Sim settings
fs = 96e3;
dur = 1;
Ns = fs*dur;
f = (0:Ns-1).*(fs/Ns);
t = (0:Ns-1)./fs;
%% Signal setup
% Impulse response
x = [1 zeros(1,Ns-1)];
%% Cascade filters
% Composit... |
function [ I_d ] = outer_3( s, n, L )
%outer_3 この関数の概要をここに記述
% 詳細説明をここに記述
I_d = zeros(n, 1);
for i = 1:n
I_d(i) = (s(i) >= L/2);
end
end
|
% tsqL = -36.7;
% rsqLsq = -65 - tsqL;
tsqL = -31.23;
rsqLsq = -51.12 - tsqL;
opt=[];
opt = gaoptimset('PopulationSize',50);
fit = ga(@(x)abs(x(1)*x(2) - 10^(tsqL/20)) +abs(x(3)*x(2)^2 - 10.^((rsqLsq)/20)),3,[],[],[1 0 1],1,[0,1e-6,0],[1,1,1],[],[],opt)
vg = 4000;
fm = 4e9;
L = 600e-6;
alpha = -log(fi... |
%% layering: do layering process to generate roughing path.
%%
%% arguments @intersection_points cell arrays of
%% |cc points|slicing line|triangle|normal|,
%% @points_cloud points cloud
%% returns ccpoints in sorted order, along with advanced ccpoints under CBV
function outputs = layerin... |
function display_lines(main_figure)
layer=get_current_layer();
lines_tab_comp=getappdata(main_figure,'Lines_tab');
axes_panel_comp=getappdata(main_figure,'Axes_panel');
curr_disp=get_esp3_prop('curr_disp');
[trans_obj,idx_freq]=layer.get_trans(curr_disp);
curr_time=trans_obj.Time;
curr_pings=trans_obj.get_transceiver... |
% Note: q = ||q_vec||
function pPRIME_acc = compute_force_pPRIME_screenedCoulombInteraction(pPRIME_acc, num_dimensions, num_particles,...
q_pos, simulation_step,...
lambda, Z, e, gamma_packet_width)
for particle_itr = 1:num_particles
% compute the norm now to cut down on the size of the equation
... |
function y = my_normcdf(x, mu, sigma)
if any(size(x)==1)
% y = 0.5 * (1 + erf((k-mu) ./ (sigma*sqrt(2))));
y = 0.5 * erfc((mu-x) ./ (sigma*sqrt(2))); % erfc produces more accurate near-zero results for large negative x than erf. same speed
else
y = bsxfun_normcdf(x, mu, sigma);
end |
% INPUT:
% --------
% RGBint: a Nx3 matrix with one RGB value per row, in [0..255]
%
% OUTPUT:
% --------
% XYZ : a Nx3 matrix, X = [0 .. 95.05 ], Y = [ 0 .. 100 ], Z = [ 0 .. 108.90 ]
%
% note: r,g,b denote values in [0..1] but still in companded lightness (CRT domain)
% i.e. r=R/255 etc
%
% Co... |
% File: SA8_3.m for SA8-3
clear;
clf
% Seledt values for Pt, f, R, B, do, Fdb, n, and XdB.
Pt = 0.0005;
f = 2.4e9;
R = 2e6;
B = 4e6;
do = 50;
d = 200;
GatdB = 2.15;
GardB = 2.15;
FdB = 8;
Tso = 0;
n = 3;
XdB = 7;
%Evaluate quanties for Link Budget
PtdBw = 10*log10(Pt);
PeirpdBw = PtdBw + GatdB;
lambda =3.0e8/f;
F = ... |
% A)
load humanactivity.mat;
% B)
nObs = table('Size', [1,5],'VariableTypes',{'int32','int32','int32','int32','int32'},'VariableNames',actnames);
nObs{1,1} = size((actid(actid == 1)),1);
nObs{1,2} = size((actid(actid == 2)),1);
nObs{1,3} = size((actid(actid == 3)),1);
nObs{1,4} = size((actid(actid == 4)),1);
nObs{... |
function [pressure,temperature,Comp] = get_flash_input(state,param)
%now assumes the system pressure is gas pressure
pressure = state.pg;
nc = length(pressure);
temperature = param.rTemp*ones(nc,1);
mi = state.mi;
num_comp = length(mi);
Comp = zeros(nc,num_comp);
for i = 1:num_comp
Comp(:,i) = mi{i};
end
to... |
function [tsc,alpha,V] = total_signed_curvature(P,E)
% TOTAL_SIGNED_CURVATURE Total discrete signed curvature of a given closed
% planar curve P (see http://ddg.cs.columbia.edu/SIGGRAPH05/Didactic.pdf)
%
% [tsc,alpha] = total_signed_curvature(P)
% [tsc,alpha] = total_signed_curvature(P,E)
%
% Inputs:
%... |
% EEGLAB history file generated on the 25-Apr-2019
% ------------------------------------------------
%% General parameters
signif_time_step_size = 10; % ms
disk_prefix = 'K';
ERPLAB_scripts_folder = [disk_prefix, ':\eeglab14_1_2b\ERPLAB_Scripts_for_eSports\'];
combined_results_output_folder = [disk_prefix, ':\EEG_Exp... |
function [LrwList, Lrw, wM, eVals] = Spect(imBase,segCoords,segSize,condList)
%Makes a weight matrix of type depending on input and runs eigs on Lrw.
%{
condList directory:
1 - Sigma for intensity
2 - Is NN
3 - Number of neighbors
4 - Includes random edges
5 - Number of random edges
6 - Is distance
7 - Ra... |
function reconverted = dsp__ref_subtract_per_channel(obj)
assert( isa(obj, 'SignalObject'), 'Initial input must be a SignalObject' );
converted = Container.create_from( obj );
ref = converted.only('ref');
assert( ~ref.isempty(), 'Reference signals are not in the object' );
others = converted.remove( 'ref' );
other_reg... |
%Read images
% imL= imread('stereo_pairs/tsukuba/imL.png');
% imR= imread('stereo_pairs/tsukuba/imR.png');
imL= imread('aL.jpg');
imR= imread('aR.jpg');
%
imLgray = im2double(rgb2gray(imL));
imRgray = im2double(rgb2gray(imR));
%
imshowpair(imLgray, imRgray,'montage');
title('imL (left); imR (right)');
%color composite ... |
function out = zeroList(in)
%jayrav
%eschbach
out = [];
count = 0;
[r c] = size(in);
for x = 1:r
for y = 1:c
if(in(x,y) == 0)
count = count + 1;
out(count, 1) = x;
out(count, 2) = y;
end
end
end
%toc |
clc,clear;%%%清除工作空间中的变量
a0=load('lwy.txt');% 导入数据
a=a0';
b0=a(:,[1:29]);dd0=a(:,[30:end]);%提取已分类和待分类数据
%[b,ps]=mapstd(b0);%已分类数据的标准化,b保存标准化后的数据,ps保存的均值和标准差
%dd=mapstd('apply',dd0,ps); %待分类数据的标准化
b=b0;
dd=dd0;
group = [ones(3,1);2*ones(26,1)];%已知样本点的类别标识,前20个数据是第一类,21-27是底二类
s=svmtrain(b',group)%训练支持向量机分类器
%sv_index=s.s... |
function [numswings,numupswings,numdownswings,dtrace,uptrace,downtrace]=swings(trace,thresh)
%[numswings,numupswings,numdownswings,swings,upswings,downswings]=SWINGS(trace,thresh)
%
% count number of swings in a signal trace that cross a middle band
% centered around the midpoint level of the signal
%
% a swing must en... |
% This is a very simple template of experiment with triangular stimulus
% TRST Unstructured -- Triangle Rotated Stimulus Test following the unstructured
% programming paradigm
clear all
close all
Screen('Preference', 'SkipSyncTests', 1);
Screen('Preference', 'Verbosity', 0);
addpath('supportFiles')
%%%%%%%%%%... |
function tick64 = parseNeoHeader(fid,hdrlen)
%Michael Hirsch Sept 2012
%the header is actually not 16-bit--will be parsed next
hdr = fread(fid,hdrlen, 'uint16=>uint16',0,'l');
% all other header entries "should" be zero
%parse header
%ticklength = typecast(hdr(end-1 :end-0),'uint32'); %4 bytes example: 12
%tickC... |
clc;
clear all;
close all;
%Taking input for gesture recognition system through a dialog box
TrainDatabasePath = uigetdir('C:\Hand Gesture Recognition-AshutoshShrivardhanPoonam\Hand Gesture Recognition 3D\train', 'Select the train database path' );
TestDatabasePath = uigetdir('C:\Hand Gesture Recognition-AshutoshShri... |
%% How does limest work?
% How might one best compute the limit of a function at a specific point
% using numerical techniques? Since we need to compute a limit, the
% function will generally be singular in some fashion at that point.
% Either a discontinuity exists, or if we tried to evaluate the function,
% we might ... |
function [E,u,delta] = file_read(file)
E = double.empty;
u = double.empty;
delta = double.empty;
max_R = zeros(1,length(file));
for f = 1:length(file)
file_title = char(file(f));
fid = fopen(file_title,'r');
S0 = fscanf(fid,'%g');
max_R(f) = length(S0)/3;
S = zeros(max_R(f),3);
for r = 1:max_R(... |
%% Apply transformation matrix
% Also align image frames to a reference bregma after warping to help
% align across animals
% This code uses function WarpImage and AlignWithBregma
clear all
close all
clc
Initial = 'CR';
Animals = {'4383182-O','4383182-L','4383183-O'};
for curr_animal = 1:length(Animals) ... |
% GaussPhaseAmpPlot.m
% plot distributation of Orientation and Amp based on Gauss fitting
clear all;
%%
cd /Users/tancy/fMRIData_RIKEN/AnalyData/Wan_140319_01/modFit/ % Chisato_131025_01 Wan_140319_01 Kenji_131209_02
Filename = 'Wan_volMdData007_1_4s_Left.mat'; % Chisato_volMdData01_1_4s Wan_volMdData007_1_4s Ken... |
function MCgetStimulationFeatures(experiment,save_data,repeatCalc)
Path = get_path;
parameters=get_parameters;
clearvars -except experiment parameters Path save_data repeatCalc n_animal
if ~isempty(experiment.animal_ID)
for CSC=1:32
for stimulusType = parameters.stimulationTypes
if ~isnan(experi... |
function [A,t]=gauss_with_pivoting(A)
tic;
s=size(A);
a=min(s);
for ii=1:a
[t,r]=max(abs(A(ii:end,ii)));
t=A(r+ii-1,:);
A(r+ii-1,:)=A(ii,:);
A(ii,:)=t;
A(ii,[1:ii-1 ii+1:end])= A(ii,[1:ii-1 ii+1:end])/A(ii,ii);
A(ii,ii)=1;
ss=A(ii,[ii+1:end]);
for jj=[1:ii-1 ii+1:a]
A(jj,[ii+1:end])=... |
function [ MOV ] = ModDiff( Pro_Ref, Pro_Test)
%[ MOV ] = ModDiff( Pro_Ref, Pro_Test)
% As described by ITU-R BS.1387-1 Section 4.2
ModDiff1B.negWt = 1;
ModDiff1B.offset = 1;
ModDiff1B.levWt = 100;
ModDiff2B.negWt = 0.1;
ModDiff2B.offset = 0.01;
ModDiff2B.levWt = 100;
ModDiffA.negWt = 1;
ModDiffA.offset = 1;
ModDiff... |
function w = ej3(x)
y = fun3(x);
for j = 1 : 150
z(j) = 24/25 + j/25;
end
w = inewton(x, y, z);
plot(z , fun3(z));
hold on;
plot(z, w, '*');
endfunction
|
function [J grad] = nnCostFunction(nn_params, ...
input_layer_size, ...
hidden_layer_size, ...
num_labels, ...
X, y, lambda)
%NNCOSTFUNCTION Implements the neural network cost ... |
function modelA8
% see also mixture: http://doingbayesiandataanalysis.blogspot.nl/2012/06/mixture-of-normal-distributions.html
close all
clear all
clc
% plotFlag = 'scat';
plotFlag = 'hist';
fnames = {'RG-GB-2013-09-24-0001';'RG-GB-2013-09-26-0001';'RG-GB-2013-09-30-0001';'RG-GB-2013-10-01-0001';...
'RG-GB... |
%% Parte 1 - Custos Proporcionais
function[f1,tc,r]= flowvecnE(A,s,c,p)
[~,edges]=size(A);
[~,inst]=size(s);
cvx_begin
variable f1(edges,inst)
variable r(edges)
tc=dot(p,r);
minimize(tc)
subject to
for i = 1:inst
A*f1(:,i)+s(:,i) <= 10^(-10);
0 <= f1(:,i) <=... |
function chart(ipi,pi,ci,ipp,pp,cp,ipi1,pi1,ci1,ipp1,pp1,cp1)
%User
filename = 'mainUser.png';
idea = ipi+pi+ci;
problem = ipp+pp+cp;
pie([idea , problem]);
legend({'IDEA','PROBLEM'},'Location','best');
saveas(gcf,filename);
filename = 'ideaUser.png';
idea = [ipi pi ci];
pie(idea... |
function [K_H,K_B,K_V,K_R] = ...
calcPonceShettyIndices(...
P,Q_f,W,Q_b,V,ID,lambda_P,lambda_W,W_p,V_p)
%CALCPONCESHETTYINDICES Calculate different indices as shown in Sivapalan
% et al., 2011
%
% INPUT
% P: annual precip [mm]
% Q_f: annual fast flow [mm]
% W: annual wetting [mm]
% Q_b: annual slow fl... |
function [result,wpsnr] = detection(original, watermarked, attacked)
orgn = imread(original);
wtrm = imread(watermarked);
atck = imread(attacked);
%w = load('whataremarks.mat');
%w = w.w;
wpsnr = WPSNR(wtrm, atck);
d_orgn = dct2(double(orgn));
d_wtrm = dct2(double(wtrm));
d_atc... |
function poly = LaguerreF(x, n, alpha)
%
% LaguerreF.m - Compute the Laguerre polynomial L^n(x;alpha)
%
% Syntax: poly = LaguerreF(x, n, degree);
%
% Input : x = x-coordinate in matrix form
% n = order of polynomial
% alpha > -1 (not mandatory) is the parameter.
%
% Output: poly = polynomial v... |
% This program does the dynamic balancing of a rotor shaft.
% Made By
%VARAD VAIDYA
%BT2018MEC060
%VISVESVARAYA NATIONAL INSTITUTE OF TECHNOLOGY
%NAGPUR
%-----------------------------------------------
%-----------------------------------------------
% Insert the matrix of the masses in the format of
% mass ra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.