text stringlengths 8 6.12M |
|---|
%% Monte Carlo for Comparing the three approaches
%% GLUP - NFINDR - SDSOMP
clear all ; close all ; clc
N_total = 100; % Nbr of repetitions for MonteCarlo
%% Create synthetic data
R = 8; % nbr of endmembers
N = 192; % nbr of mixed pixels
Nt = N+R; % total nbr of pixels
SNR = 20;
load endmembers.mat;
E = M(:,1:R);... |
%-----------------------------------------------------------------------
% Job saved on 21-May-2014 17:24:28 by cfg_util (rev $Rev: 5797 $)
% spm SPM - SPM12b (5918)
% cfg_basicio BasicIO - Unknown
%-----------------------------------------------------------------------
matlabbatch{1}.cfg_basicio.file_dir.file_ops.cfg_... |
function v = cv_mole(a)
% CV_MOLE - Molar heat capacity at constant volume [J/kmol-K].
v = thermo_get(a.tp_id,7);
|
function [x1] = H4_PotentialNavigation(Goal,P_Robot,radius_robot,P_Obs_all,radius_Obs_all,u_Obs_all,gama,ro)
time = [0 1];
[t x] = ode23(@vehicle,time,P_Robot);
x1 = x(end,:);
function dx = vehicle(t,x)
v = 1; % Robot constant longitudinal velocity
L = 2; % The wheel base
rG... |
% KPCAOIL Demonstrate kernel parameter selection with the sub-set of the oil data.
load ..\3Class
latentDim = 2;
% Select data
numData = 100;
indices = randperm(1000);
indices = indices(1:numData);
Y = DataTrn(indices, :);
lbls = DataTrnLbls(indices, :);
meanData = mean(Y);
Y = Y - repmat(meanData, numData, 1);
be... |
N=1000; n = 2; K=10;
mu = zeros(n,1);
Sigma = eye(n);
Theta = [-pi,pi];
R = [2,3];
% class priors for labels -1 and 1 respectively
p = [0.35,0.65];
% Generate samples
label = rand(1,N) >= p(1); l = 2*(label-0.5);
% number of samples from each class
Nc = [length(find(label==0)),length(find(label==1))];
% re... |
% Zellulaerer Automat zur Simulation der Pheromone
% Field_up = zeros(n+2,n+2);
% Field_up(1:n,2:n+1) = max(0,floor(Phero_Field_Food/2));
% Field_right = zeros(n+2,n+2);
% Field_right(2:n+1,3:n+2) = max(0,floor(Phero_Field_Food/2));
% Field_down = zeros(n+2,n+2);
% Field_down(3:n+2,2:n+1) = max(0,floor(Phero_Field_Foo... |
function vel = biped_hipVel(x,p,model)
addpath([model,'/robotGen/grad']);
vel = zeros(1,size(x,2)-1);
for i=1:size(x,2)-1
x1 = x(:,i);
x2 = x(:,i+1);
cur_x = (x1+x2)/2;
dx = (x2-x1)/p.sampT;
vel(1,i) = hip_vel_x(cur_x.',dx.',p.sampT);
end
rmpath([model,'/robotGen/grad']);
end |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Z-function
% 1-a
% H(z)= -------
% 1-az^-1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all; clear all; clc;
%///////////////pole calc.///////////////%
%////////////////////////////////////////%
fs=8.2e3; % samplling frequency
fc1=5; % low pass cutoff frequen... |
for si=1:10
figure,
subplot(1,2,1),plot(A1csERD{si}(2).out.dv.pos),title(num2str(ADR1o(si,2)))
subplot(1,2,2),plot(A1csERD{si}(2).out.dv.neg),title(num2str(ADR1o(si,2)))
% figure,plot(A1csERD{si}(2).out.dv.neg)
end |
function varargout = barcon(varargin)
% barcon Contribution bar graph for tseries objects.
%
% Syntax
% =======
%
% [H,Range] = barcon(X,...)
% [H,Range] = barcon(Range,X,...)
% [H,Range] = barcon(Ax,Range,X,...)
%
% Input arguments
% ================
%
% * `Ax` [ handle | numeric ] - Handle to axes in whi... |
function neighbors = kNearestNeighbor(S,T,K)
if nargin < 3, K = 3;end
neighbors = zeros(size(S,1),3,K);
for k=1:size(S,1)
dk = sqrt(sum((bsxfun(@minus,S(k,:),T)).^2,2));
[~,locs] = sort(dk);
neighbors(k,:,:) = T(locs(1:K),:)';
end
end |
clear all
clc
populationSize = 4000;
mutationProbability = 0.025;
tournamentSelectionParameter = 0.75;
variableRange = [0 20 0 20];
numberOfGenerations = 4000;
cityLocation = LoadCityLocations();
nCities = size(cityLocation,1);
tspFigure = InitializeTspPlot(cityLocation,variableRange);
connection = Initi... |
function HF=high_fusion(Y1,Y2)
map=(abs(Y1)>abs(Y2));
map=majority_consist_new(map,19);
HF=map.*Y1+~map.*Y2; |
function NP_init_directory_structure_pp
% Function that creates the NP folder structure for preprocessing.
main_dir = pwd;
get_dir_for = {
'Anatomy'
'Functional'
};
get_subdir_for = {
'Functional/raw'
'Functional/preprocessed'
};
for n = 1:length(get_dir_for)
make_dir = fullfil... |
function custom_colorbar(labels_vec)
%function custom_colorbar(labels_vec)
ncbar_labels=5;
Ncolors = 64;
c1 = colorbar('West');
%set(c1,'YTick',[linspace(1,Ncolors,ncbar_labels) ],...
set(c1,'YTick',labels_vec,...
'YLim', [1 Ncolors], ...
'YTickLabel',labels_vec, ...
'FontSize',12 ...
);
|
function Proj1A
% Conor Luppnow
% This program:
% - Determines the paramater A in the two-suffix Margules equation.
% - Evaluates gamma_1 and gaamma_2 for each x1, and plots this data.
% - Evalulates and plots ln(gamma_1/gamma_2) vs. x1 for use in the
% thermodynamic consistency test, as well as the Wis... |
function x = twos2dec(t) %2s complement function for signed data
%error(nargchk(1,1,nargin));
if iscellstr(t)
t = char(t);
end
x = bin2dec(t);
nbits = sum(t == '0' | t == '1', 2);
xneg = log2(x) >= nbits - 1;
if any(xneg)
x(xneg) = -( bitcmp(x(xneg), 'uint8') + 1 );
end
e... |
clear;
N = 1000;
M = 10;
h = (1/M) * ones(1, M);
fs = 1;
figure(7); clf;
freqz(h, 1, N, fs);
|
function [y,x,r] = getFootPoint(qFoot,qTest)
% [y,x] = getFootPoint(qFoot,qTest)
%
% This function computes a point on the foot (x,y) given the absolute angle
% of the foot (qFoot) and an absolute angle of the query point in the world
% frame (qTest). The point is given with respect to the ankle joint.
%
r = footModel... |
function R2=fCoefDeterminacaoPn(n,a,m,x,y)
%valor médio
ym=0; for k=1:m ym=ym+y(k); end
ym=ym/m;
SQE=0; for k=1:m SQE=SQE+(fPnH(n,a,x(k))-y(k))^2; end %soma do quadrado dos residuos
SQT=0; for k=1:m SQT=SQT+(ym -y(k))^2; end %soma dos quadrados totais
R2=1-SQE/SQT; %coeficiente d... |
function code=encode_magnitude(magnitude)
if magnitude>=0
code=encode_positive_magnitude(magnitude);
else
code=~encode_positive_magnitude(abs(magnitude));
end
function code = encode_positive_magnitude(magnitude)
code=zeros(1,0);
icode=zeros(1,0);%code逆序,但是不包括code最高位的0
current_index=1;
%code(1)=0;符号位不存在的
while magnit... |
function [trainingData] = dataprocessing()
%Read the data from the provided file "corners.csv" with the positions of
%the frame
data=readtable('corners.csv');
data{:,1} = erase(data{:, 1}, 'img_');
data{:,1} = erase(data{:, 1}, '.png');
%Initialize some variables needed for the computations
target=[];
input=[];
aux=[]... |
function [R,RA,RB,RC,RBI,RCI,RCJ] = ROT(phi, theta, psi,flag1)
% this function computes the rotation matrix for EULER angles
% !!! PAY ATTENTION => IN ORDER TO COMPUTE THE ROTATION MATRIX
% IT IS NECESSARY YOU PUT THE PROIECTION OF THE TRANSFORMED
% VECTORS IN COLUMNS !!!... |
% This scpript plots the growth of ZF in a shear flow growth phase
clear; close all;
global phi vx vy
%%
load('parameters.mat');
addpath(code_path);
%---input---
start_diag = 1226; %1035;
end_diag = 1246; %1045;
r_start = 0.4; % cm
r_end = 7.6; % cm
font_size = 15;
legend_font_size = 13;
fig_position = [50, 50, ... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% masterScript.m
%
% Written by Jari Korhonen, Shenzhen University
%
% This script runs scripts to process LIVE Challenge database,
% train CNN feature extractor, make SPAQ-768 dataset, extract
% CNN features from KonIQ-10k and SPAQ... |
function [Q b Y2] = postopek1(X, Y)
format free
dim = size(X, 1); #dimenzija
count = size(X, 2); #st tock
%dobimo tezisca telesa X in Y
avgX = sum(X, 2)/count;
avgY = sum(Y, 2)/count;
%premaknemo telesi v srediscno lego
X1 = X-avgX;
Y1 = Y-avgY;
%korak 1
%dobimo matriko C = Y ... |
clear all; clc;
%% 1.1
fs = 8000;
t =1;
f = 100;
T = fs/f;
y = exciteV(t*fs,T);
<<<<<<< Updated upstream
Y = fft(y);
Ymod = abs(Y);
Ydb = 20*log10( 0.000000001 + Ymod(1:fs/2)); %%se incrementan los valores en una cantidad despreciable para evitar el log10(0)
figure
plot([0:fs/2-1], Ydb(1:fs/2))
soundsc(y,fs)
=... |
function [liq_hist, gas_hist] = phas_histogram(liq, gas, gaussFilter, PLOT, thresh)
close all
hold on
if length(liq) > thresh
[Y, X] = histcounts(liq, 50, 'Normalization', 'probability');
X = (X(1:end-1) + X(2:end))/2;
peak = 0.05 * max(Y);
Y(Y < peak) = 0;
h_filt = conv(Y, gaussFilter, 'same');
... |
% $Header: svn://.../trunk/AMIGO2R2016/Kernel/IVP_solvers/sens_analysis_1.1/sensy0.m 770 2013-08-06 09:41:45Z attila $
function sens0=sensy0(y,u)
sens0=eye(size(y,1));
end |
function [test_targets, a, updates] = LMS_cc(train_patterns,train_targets, test_patterns, Max_iter, theta, eta)
% Classify using the least means square algorithm
% Inputs:
% train_patterns - Train patterns
% train_targets - Train targets
% test_patterns - Test patterns
% Max_iter - Maximum iteration
% theta - Co... |
%% Compute the magnitude of spherical harmonics coefficients at each band
%%
%% Example:
%% [coeff_magnitude] = compute_magnitude(coeff, degree, dl)
%%
function [coeff_magnitude] = compute_magnitude(coeff, degree, dl)
%%=============================================================
%% Project: Spherical Ha... |
function camDraw( current_p,types,c,z,yaw,pitch,roll,b,theta,theta2,axes_handle,add_in)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
global mapSize mapCenter p;
myColor=hsv2rgb([(current_p-1)/(size(p,2)+add_in),1,1]);
if current_p>size(p,2)
myAlpha=0.6;
else
... |
% What to run
%win_om_path = 'C:\OpenModelica1.9.1Beta2\bin\'
%system([win_om_path,'omc.exe +d=failtrace +s simulate-ICSolar.mos.'])
%omimport(modelname, saveName)
cd 'C:\Users\Justin\Documents\GitHub\RPI_CASE_ICS_Modelica\Archive\Modelica Scirpting'
clear
%SOUTH
%South, Vertical
display('South, vertical')
win_om_pa... |
function total_area = get_area(bin_img,r_sqr)
%INPUT:
% A binary image whose total area is needed
%OUPUT:
% Total area of white patch when projected onto a sphere
%DESCRIPTION:
% Finds area of white pathes when projected onto a sphere of
% radius 1.
num_rows = size(bin_img,1);
num_col... |
clc
close all
clearvars;
selpath = uigetdir;
addpath(selpath)
addpath(genpath([selpath,'\Third_party_scripts\']))
addpath([selpath,'\Scenario1_SteadyStateIC\results\'])
ksmm=0.018;
kb=0.00028; %h-1
Y=0.31;
km=25;
rho= 1.65; %g/cm3 soil bulk density
rho_wood=1.1;%g/cm3 max carboff density in form of wood
nx=100;ny=... |
clear all
clc
[T, X] = ode23('OriginSystem', [0 20], [3 2 1 0 1]);
figure(1)
plot(T, X(:,1), '-r', 'LineWidth',1.5);
hold on
plot(T, X(:,3), '-b', 'LineWidth',1.5);
hold on
plot(T, X(:,4), '-g', 'LineWidth',1.5);
title('Input-Output Linearization');
legend('x1','x2','ref');
xlabel('Time(sec.)');
grid ... |
% CIRCLE( c, r );
% Creates a 2D circles as a segmented line of N components
% with center C and radius R
function X = circle( C, R, N )
if ~exist('N','var')
N = 100;
end;
theta = linspace(0, 2*pi, N);
x = C(1) + R.*cos( theta );
y = C(2) + R.*sin( theta );
X = [x,y]
% plot(x, y) |
%Matlab code to validate in vitro correlation (IVIVC).
% Created by Senkai Hsia for the Saltzman Biomedical Engineering Lab at
% Yale University, 2018
% project on biodegrable contraceptives
% Version: 2
% Load Files from FourierPredict: NewTime, New Vitro, SingleVivo, VitroPer,
% VitroTime
% Curve Fits: 27%, Vitro ... |
function [i, p] = fn_meshclosestpoint(P,p)
% function [i p] = fn_meshclosestpoint(vert,p)
% function [i p] = fn_meshclosestpoint(mesh)
%---
% Input:
% - vert (3xN) array of points
% (can be alternatively a {vertices,faces} array, then first cell
% array element is used)
% - p 3D point (vec... |
function VirtualObject(block)
setup(block);
function setup(block)
block.NumInputPorts = 2; % Force, Torque in global coordinate system
block.NumOutputPorts = 2; % Pose, Pose_dot in global coordinate system
block.InputPort(1).DatatypeID = 0; % double
block.InputPort(1).Complexity = 'Real'... |
dataset_path = ['./dataset_d7'];
for Ti = 1000:100:4000
filename = [dataset_path '/logs/log' num2str(Ti) '.log'];
csv_data_all = csvread(filename);
Tss_t = csv_data_all(:,2);
pi.Tss = Tss_t(Tss_t ~= 0);
ISE_t = csv_data_all(:,3);
pi.ISE = ISE_t(ISE_t ~= 0);
IAE_t = csv_data_all(:,4);
pi.IAE = IAE_t(IAE_t ~... |
clear;
faceOnly = load('JLP_HF_onlyFace_TrueFaces.mat');
voxelUsedEveryCV = NaN(9,10);
totalVoxels = NaN(9,1);
for subNum = 1 : 9
totalVoxels(subNum) = size(faceOnly.result(subNum).used{1},2);
totalIters = size(faceOnly.result(subNum).used,2);
voxelUsedEveryCV(subNum,:) = sum(faceOnly.result(subNum).use... |
%Author: Martin Silberberg
%Applies averaging to the inputted image, img, with mask size x:y.
function result = avgfilter(image, x, y)
[row,col] = size(image);
%Split x and y in half for use in generating masks later
if mod(x,2) == 0
x1 = uint16(x/2)-1;
x2 = uint16(x/2);
else
x... |
function [error] = svm_for_mnist(trainX, trainY, testX, testY)
%SVM_FOR_MNIST Summary of this function goes here
% Detailed explanation goes here
%% Iniital Training and comparison
%
% linear kernel
model_lin = svmtrain(trainY, trainX, [ '-s 0 -t 0 -b 1 -q']);
% polynomial kernel
model_pol =... |
%% OMD重复性实验数据处理
% ## 数据处理主要步骤
% * 通过ImageJ获得液位变化的轨迹
% * Excel文件“OMD渗透通量重复性试验.xlsx”计算跨膜通量
% * MATLAB文件“DataProc.m”提取数据降低数据处理时的偶然误差
%% 从原始数据中采用类似系统抽样方法提取数据
% 需要函数DataExtract.m和原始数据ExpData.mat
%% 脚本DataProc.m
%
clear;
% 从工作空间数据变量ExpDataSet中提取最新的数据子集构造数据矩阵
load('ExpDataSet.mat');
i = length(ExpDataSet);
col1 = [Ex... |
## Copyright (C) 1999 Paul Kienzle
##
## 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 2 of the License, or
## (at your option) any later version.
##
## This program is distribu... |
function [ xx, tt ] = syn_sin( fk, Xk, fs, dur, tstart )
%=========================================================================%
%SYN_SIN Function to synthesize a sum of cosine waves
% usage:
% [xx,tt] = syn_sin(fk, Xk, fs, dur, tstart)
% fk = vector of frequencies
% (these could be negative or positive)
% Xk = vec... |
folder_name = '/home/alex/Desktop/Data/Zoidberg_data/area01/suite2p/plane0/';
save_folder = '/home/alex/Desktop/Data/Zoidberg_data/img_mask/';
save_name = 'Zoidberg_area01';
ROIMask = get_roi_mask(folder_name);
reg_img = get_reg_img(folder_name);
filename = [save_folder,save_name,'.tif'];
final_image = uint8(255*mat2... |
t_ac = settings.temperature(1:100:10001);
%TDO: scale temps properly
temps = [450 460 480 490 500] * 0.001;
for k = 1:length(temps)
for i = 1:length(t_ac)
delta = abs(t_ac-temps(k));
[~, inds(i)] = min(delta);
end;
ind(k) = round( mean(inds) );
end; |
function distanceVec = getMixedDistance( X0, data, nCatFea)
%get the distance from X0 to all samples in the data from idstance mat
[R, C] = size( data); %get number of samples
distanceVec = zeros( R, 1); %allocate tthe distanc result
for i=1: R
distanceVec(i) = getMixedDistance... |
addpath(genpath('wavelet\'));
addpath(genpath('GPSR_5.0\'));
addpath(genpath('images\'));
addpath(genpath('mex\'));
addpath(genpath('utilities\'));
addpath(genpath('solvers\'));
|
close all
clc
clear all
load('data/mat_real_exp/optimized/experiment_47.mat');
addpath('../../utils');
addpath('../../EnergyModel');
E = info_energy(:,1);
N = info_normal(:,1);
[energy_cost, energy_index] = min(E(E > 0));
[normal_cost, normal_index] = min(N(N > 0));
%%%%%%%%%%%%%%%%%%% MINIMUM ENERGY %%... |
%SHAPEDER2 Second derivative of the shape functions.
% SHAPEDER2(x,L,n) computes the second derivative of the shape function
% at point x within a bending element of length L and 4 degrees of
% freedom.. The degrees of freedom are
% n=1: displacement at first node;
% n=2: rotation at first node;
% ... |
function c12icbm( c1, urc, t1, icbm, ydeform, outpath )
%UNTITLED2 Summary of this function goes here
% c12icbm('${c1}','${uimage}','${t1image}','${template}','${ydeform}','${outpath}')
matlabbatch{1}.spm.util.defs.comp{1}.inv.comp{1}.dartel.flowfield = {urc};
matlabbatch{1}.spm.util.defs.comp{1}.inv.comp{1}.darte... |
function bin = joinBin(bin1,bin2)
% Combine two data sets. Note bin1.x must continue on to bin2.x, and the
% two y arrays must be equal.
dLon=round(bin1.x(2)-bin1.x(1),8);
if (bin2.x(1)~=bin1.x(end)+dLon || any(bin1.y ~=bin2.y) || ...
bin1.dt ~= bin2.dt)
error('Binned data sets incompatible.');
end
bin.da... |
%TEST_getTraj.m
%
% This script tests the trajectory optimization code
clear; clc;
%%%% Parameters for Dynamics %%%%
config.dyn.g = 9.81; % acceleration due to gravity
config.dyn.l = 0.96; % leg length (hip joint to foot joint)
config.dyn.d = 0.14; % distance between foot joint and virtual center of foot
config.dyn.r ... |
% Name: Zheng Wen
% USC ID: 7112807212
% USC Email: zwen1423@usc.edu
% Submission Date 2/11/2020
addpath('basicOperations')
img = readraw('E:\Chrome Download\EE569\Week2\HW2\Problem1\Gallery.raw');
[R, G, B] = raw23D(img, 481, 321);
R = matTranspose(R);
G = matTranspose(G);
B = matTranspose(B);
gray = RGB... |
function param = buildModPoissonParam( s1, s2 )
if( nargin == 1 )
s = s1;
else
s = [s1 s2];
end
K=zeros(s(1)*2,s(2)*2);
K(1,1)=4;
K(1,2)=-1;
K(2,1)=-1;
K(s(1)*2,1)=-1;
K(1,s(2)*2)=-1;
param = fft2(K);
param = real(param(1:s(1),1:s(2))); |
function chop_audio(old_name,new_name)
info_y=audioinfo(old_name);
[y,Fs]=audioread(old_name);
t=0:1/Fs:info_y.Duration;
t = t(1:end-1);
a=figure;
plot(t,y)
x=ginput(2);
x=sort(x);
x(1)=max(0,x(1));
x(2)=min(t(end),x(2));
y=y(x(1)*Fs:x(2)*Fs);
audiowrite(new_name,y,... |
classdef Quad_Footstep
% A data structure for a single footstep position.
% The pose of the footstep is assumed to be expressed as the [x,y,z,r,p,y] pose
% of the center sole of the foot, which is the location expressed by the Drake
% frame given by frame_id
properties
pos
id
frame_id
is_in_contact
... |
function [ Uc, Ur, T, E ] = vbbrpca( Y, T_in, E_in, Uc_in, Ur_in, r, MAXITER)
%VBBRPCA VBBRPCA with Uc and Ur column independent
addpath Bayes_tools/
% MAXITER = 1;
% Constants about the data
[n, m] = size(Y(:,:,1));
Nobs = size(Y, 3);
% M = mean(T_in, 3);
M = zeros(r);
% Initialization of gamma, alpha, beta
a = 1e... |
function [ tanstruct_out ] = reduce_tanstruct_data_by_index( tanstruct_in, indices, delete_rows )
%A function to reduce the ace data according to the provided
%indicies. Data that do not correspond to the indices are changed to NaNs.
%If a whole row (occultation) of data is converted to NaNs, then that
%occultation is... |
% EJERCICIOS RESUELTOS DE VISIÓN POR COMPUTADOR
% Autores: Gonzalo Pajares y Jesús Manuel de la Cruz
% Copyright RA-MA, 2007
% Ejercicio 14.2: Fusión de imágenes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 14.4.2 Desomposición en pirámide FSD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
classdef SVMClassifier < handle
properties
%MAX_TRAINING_SAMPLES_PER_CLASS = 12500;
end
properties
classmap;
classnames;
sequences;
cfg;
train_ind;
test_ind;
svm_classifier;
train_success;
trai... |
% This script draws the fields using all dat****.mat files in its directory
% Copy this script to the folder of the data and then run it
clear; close all;
global den Te phi
%%
load('parameters.mat');
addpath(code_path);
last_file = get_last_file('data');
last_diag = str2num(last_file(end-7: end-4));
%---input---
st... |
close all;
clear;
clc;
[num, txt, raw]=xlsread('person.xlsx','A2:B1277');
for i=1227:1276;
temp=imread(raw{i,1});
if raw{i,2}==1
imwrite(temp,strcat('data/person/',raw{i,1}));
else
imwrite(temp,strcat('data/none/',raw{i,1}));
end
end |
%
%%% SPY1 %%%
SeisSound('NL.SPY1.00.HHZ.D.2016.158.133657.SAC',...
'../Sboom','6 June 2016 2 x F-16',...
0,600,... % t0, tmax
0.1,15.0,15.0,... % freqmin, freqmax, freqlimit
' ',' ',... % units label, datatype label
100,... % speed factor
0,-30,... % colorbar upper+lower lim... |
% function [z,sigma]=ProjectionWL1(xx,L,alpha)
%
% Computes the projection of xx on a weighted l1 ball
% sigma is the threshold parameter.
% The ball is defined by {x, ||L.*x||_1 \leq \alpha}
%
function [z,sigma]=ProjectionWL1(xx,L,alpha)
x=xx(:);
L=L(:);
n=numel(x);
%Check if solution is non trivial
M=sum(abs(L(:).*... |
clear
path = '../../CommonExperiment';
addpath(genpath(path));
fs = 48828;
tlen = 1;
t = 0:1/fs:tlen-1/fs;
ERB_halfwidth = 0.5;
ERBspacing = 1.5;
target_f = 4000;
noise_bands = CMRbands(target_f, ERB_halfwidth, ERBspacing);
SNRdb = -6;
mod_band = [2 10];
target_modf = 0;
coh = 1;
bp_mod_fo = 1/2 * 5 *fs; %filter orde... |
function [ existente ] = verificar_ope( Operadores,idx )
for idx_line=1:length(Operadores)
if(Operadores(idx_line)==idx)
existente=true;
return
end
end
existente=false;
end
|
% Prompts user to select a song from the songs folder
prompt = msgbox('Reading Song');
% Reads in an audio file
[filename, pathname] = uigetfile('songs/*.wav');
filename = sprintf('songs/%s',filename);
[clip, fs] = audioread(filename);
% generates a random 10 second sample of the selected song to identify
star... |
function test_pred = predclass_test(mu_1,sigma_1, ...
mu_2,sigma_2, ...
test_set)
M_1 = (-1/2)*pinv(sigma_1);
M_2 = (-1/2)*pinv(sigma_2);
a_1 = pinv(sigma_1)*mu_1';
a_2 = pinv(sigma_2)*mu_2';
b_1=(-1/2)*mu_1*pinv(sigma_1)*mu_1' +... |
bmark_path = 'E:\Benchmarks\wiki';
bmark_path_ = 'E:\Crossmedia(deep)\Benchmarks\wiki';
path_prefix = '/home/ruoyu/Benchmarks/wiki/images';
path_prefix_ = '/home/ruoyu/Crossmedia(deep)/Benchmarks/wiki';
img_files_tr = dir(fullfile(bmark_path,'images','train','*.jpg'));
img_files_tr = {img_files_tr.name};
img_files_te ... |
function myezaxis2
theAxis = 'y';
theFcn = 'r2atoms';
theInvFcn = 'atoms2r';
bkgdOrig = gca;
orig = copyobj(bkgdOrig,gcf);
thePosition = get(orig, 'Position');
theLim = get(orig, [theAxis 'Lim']);
origYLim = theLim;
origXLim = get(orig,'XLim');
origTick = get(orig,[theAxis 'Tick']);
origTickLabel = get(orig,[theAx... |
% [data] = readDacData( rootPath, dacNumber )
% rootPath - sysgen root path
% adcNumber - DAC number 0...3
%
% [data] = readDacData( rootPath, dacNumber, dataLength )
% rootPath - sysgen root path
% adcNumber - DAC number 0...3
% dataLength - length of acquisition
function [dat... |
function [simData,confidenceRawData]=confidenceModel(data,fitresult,varargin)
% simulates confidence values for some percepts and a given generative model
% with specified parameters
% inputs
% data- table with following columns
% 'evidence' and 'mapping' for simulation of confidence
% 'confidence' (optiona... |
%% Set up energy discreminating detector properties
% structDet:
% Input:
% fEnergyLow: lower bound of energy detected
% fEnergyHigh: upper bound of energy detected
% fEnerghWidth: width of energy bins
% Output:
% pfEnergyLow lower bound of energy detected for all bins
% ... |
% This script takes the DesignInputs.json file and adds additional values
% to it
% Load the current version of the json file
DesignInputs = loadjson('Lookup Tables/DesignInputs.json');
%% Low Pressure Compressor Inputs
DesignInputs.LPC.TipSpeed = 450;
DesignInputs.LPC.HT_Ratio = 0.45;
DesignInputs.LPC.AnnulusShape =... |
%This is a demo of Encoder Based Lifelong Learning showing how to learn a
%set of tasks in a sequence
%Task sequence: Imagenet -> Scenes -> Birds
%This code is based on matconvnet-b23.
%
%For more details, see A. Rannen Triki, R. Aljundi, M. B. Blaschko, and T. Tuytelaars, Encoder Based Lifelong
%Learning. ICCV 2017
... |
classdef Drone < handle
%% MEMBERS
properties
g
t
dt
tf
m
l
I
x %(X, Y, Z, dX, dY, dZ, phi, theta, psi, p, q, r)
r ... |
% image_hex.m
% Draw the hexagonal grid represented by the matrix A
% NOTE: this implementation computes the vertices and faces of each hexagon and makes a single call to patch - FASTER
% zde
function [] = image_hex(A)
tic
clf;clc
verts = zeros(length(A)^2 * 6,2); % store x,y-coords of each hexagons' vertices
fa... |
function x = newmet(fx,dfx)
x0 = 0;
epsi = 1e-3;
x = x0;
delta = feval(fx,x)/feval(dfx,x);
while(abs(delta) > epsi)
delta = feval(fx,x)/feval(dfx,x);
x = x-delta;
end |
function Ball = generateIdealBall(resolution)
l = 1:resolution;
[X, Y, Z] = meshgrid(l,l,l);
X = X - length(l)/2;
Y = Y - length(l)/2;
Z = Z - length(l)/2;
Ball = (sqrt(X.^2 + Y.^2 + Z.^2) < length(l)/2);
end |
function [ a,b ] = sindeg( de )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
m= pi.*(de/180);
a=sin(m);
[k,d] = size(a);
b = sum(sum(a))/(k*d);
% k multiply d is total number of elements
end
|
function x = project_consensus(varargin)
% PROJECT_CONSENSUS Bring a set of points into consensus.
%
% project_consensus(v1,v2,...,vn) returns the elementwise
% average of v1, ..., vn, i.e., the projection of the vi
% onto the consensus set.
N = length(varargin);
x = zeros(size(varargin{1}));
for ... |
function bwmask = sbxPupilCoreSearchAlternates(mouse, date)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
bwmask = [];
runs = sbxRuns(mouse, date);
for run = runs
if isempty(bwmask)
path = sbxPath(mouse, date, run, 'pmask');
if ~isempty(path... |
clear all; % clear all variables from the workspace
load fisheriris;
X1=[meas(51:90,1);meas(101:140,1)]; % construct X1 which represents sepal length for training (80 samples)
X2=[meas(51:90,2);meas(101:140,2)]; % construct X2 which represents sepal width for training (80 samples)
X3=[meas(51:90,3);meas(101:140,3)]; % ... |
function T=calc_T(z,Ts,Ti,G,del,thid);
% T=calc_T(z,Ts,Ti,G,del,thid);
% Compute temperature from geothermal parameters
% thid: 1 for linear; 2 for erf; 3 for exponential;
% G: surface geotherm
% del: coefficient for erf
% Ts: surface temperature
% Ti: Temperature at infinity (for erf)
switch ... |
% map the point Y on a manifold onto the tangent space of X
function [Y] = S2_log(X, Y)
dYX = Y - X;
P = S2_proj(dYX);
Y = P .* norm (dYX)./norm (P);
end
|
function x = Har_mo(x)
x_r = x(:);
x_r = x_r';
% x_r = x_r.^-1;
n = numel(x);
sum_val = 0;
for i = 1:1:n
if(x_r(i)~=0)
sum_val = sum_val+(1/x_r(i));
end
end
x = (1/sum_val)*n;
end |
figure
p1=subplot(6,1,1)
area(DatumUhrzeit,BLHA0)
legend("Hand=1 Automatik=0",'Location','northwest')
axis tight
grid on
pos = get( p1(1), 'Position' );
pos(4) =pos(4)/ 10; % Increase height.
pos(2) =0.95
set( p1(1), 'Position', pos ) ;
offset=0.9
abstand=1/5.9
hoehe=1/6
p2=subplot(6,1,2)
plot... |
classdef TestRect
%TestRect
methods (Static)
function test_1
pt1 = [2 3];
pt2 = [6 8];
rect = cv.Rect.from2points(pt1, pt2);
validateattributes(rect, {'numeric'}, {'vector', 'numel',4});
assert(isequal(rect, [pt1 pt2-pt1]));
pt = ... |
function [ c ] = ConditionNumber( A, eps )
% Szymon Samuel Zborowski
% Funkcja oblicza wskaźnik uwarunkowania podanej macierzy diagonalnie
% silnie dominującej A=A'>0. Oblicza wartość własną maksymalną z metody
% potęgowej i wartość własną minimalną z odwrotnej metody potęgowej. Układy
% równań rozwiązuje korzyst... |
% Biyi Fang
% 2015.8.28
% It is a postprocess function for getting amplitude and phase of any arbitrary "csi.dat" file
% Example: [length, amplitude, phase]= CSIparse('d/test5g2.dat', 1, 2, 1, 0, 0)
function [tracelength, amplitude, phase, num_trace] = CSIparse(filename, NUM_Tx, NUM_Rx, rate, START, END)
% Input:
% fi... |
clear;clc;clf
% 1. Download RLR monthly data
% 2. Load the data set to Matlab and comprehend its contents.
data = readRlrMonthly('.\rlr_monthly');
data2 = struct2table(data); %資料
data2.name = categorical(data2.name);
plon_sub2 = data2.longitude;
plon_sub2(plon_sub2 < 0) = plon_sub2(plon_sub2 < 0) + 360;
% for i = 1:le... |
clear
clc
filename = '.\153_Sol.txt';
[x,y] = textread(filename,'%n%n') ;
Ncircles = x(1) ;
R = 0.5*y(1) ;
Circle = zeros(Ncircles,2) ;
contact = zeros(Ncircles,1);
for i=1:Ncircles
Circle(i,1) = x(i+1);
Circle(i,2) = y(i+1);
end
figure;
hold on;
line([-1.0*R,R],[R,R], 'linewidth',1.3, 'linest... |
clear all
load plantas
P = sys_red(:,1:2,:);
D = sys_red(:,3,:);
P_som = inv(P);
nplants = size(P,3);
w = [0.01 0.1 1 3 5 10 30 100];
phs = 0:-0.1:-360;
% Especificaciones
s = tf('s');
% b11 = -3600*(s/2.5+1)/(s/1+1)/(s/1+1);
% b21 = 4000*(s^2/539.4126^2+2*s*1/539.4126+1)/(s/1.0007+1)/(s/1.0007+1);
b11 = -3000*(s/2... |
function amat = inverseAmat(nrows, ncols, r, nsamples, theta_lim, delta, debug)
if nargin < 7
debug = 0;
end
if nargin < 6
delta = 0;
end
% the transfer matrix we infer through interpolation
% we assume the corner is at (1/2, 1/2)
% we use points in the middle of the pixel, (x+1/2, y+1/2)
if nargin < 5
thet... |
clc; clear;
% x = [1 1 1;1 -7 1;1 1 1]; % "强边缘锐化"卷积核
x = [-1 -1 0;-1 0 1;0 1 1]; % "浮雕"卷积核
% x = [-1 -1 -1 -1 0;-1 -1 -1 0 1;-1 -1 0 1 1;-1 0 1 1 1;0 1 1 1 1]; % "夸张浮雕"卷积核
% x = [-1 -1 -1;-1 8 -1;-1 -1 -1]; % 全方向边缘提取
% x = [0 0 -1 0 0;0 0 -1 0 0;0 0 4 0 0;0 0 -1 0 0;0 0 -1 0 0]; % "垂向边缘检测"卷积核
% x = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.