text stringlengths 8 6.12M |
|---|
function run_netscan(N,rndinit)
%WRAPPER LAUNCH script for netfit package-wrapper NETFIT_main
%THIS IS NOT MULTIPROC SCRIPT, SEE run_netprobe FOR MULTIPROC
if(nargin<1) N=10; end%selection of N
if(nargin<2) rndinit=3711; end%random initialization
fprintf('In run_netprobe %i\n',N);
% cd /hmt/sardine/hpc/scratch/... |
n = randi([2 5]);
numvec = zeros(1,n);
for iv = 1:n
inputnum = input('Enter a number: ');
numvec(iv) = inputnum;
end
fprintf('The vector is: \n')
disp(numvec) |
clc;
clear all;
%% *** Matris birlestirme *****
A1=[ 1 2 3 4 5 1 2 3 4 5];
B1=[5 6 7 8 9 5 6 7 8 9];
A2=[ 1 2 3 4 5; 1 2 3 4 5];
B2=[5 6 7 8 9; 5 6 7 8 9];
% c1=[A1 B1]
% c2=[A1;B1]
% c3=[A2 B2]
% c4=[A2;B2]
%% ** D�zlem Denklemi eldesi ***
P1=[-2 1 1];
P2=[0 2 3 ];
P3=[1 0 -1 ];
Plane=GetPlane... |
function Tau_toe = Tau_toe(in1,in2)
%TAU_TOE
% TAU_TOE = TAU_TOE(IN1,IN2)
% This function was generated by the Symbolic Math Toolbox version 8.4.
% 25-Jul-2020 23:17:47
Fx = in2(:,1);
Fy = in2(:,2);
q_t1 = in1(:,1);
q_t2 = in1(:,2);
q_t3 = in1(:,3);
q_t4 = in1(:,4);
q_t5 = in1(:,5);
q_t6 = in1(:,6);
t2 = q_t... |
function index = interpindex(xgrid,xprime)
%returns the index within xgrid where x(i) <= xprime <= x(i+1)
%if xprime is larger than the last element in xgrid, interpindex() returns
%the last index in xgrid
%if xprime is smaller than the first element in xgrid,interpindex() returns
%the first index in xgrid
%define len... |
%ANALYZECELLULARCOVERAGE Cellular coverage simulator for blockage and path
%loss maps.
%
% This script is based on:
% 5_SimulationForExtendedTipp/simulateChannelForExtendedTipp.m
%
% Notes:
% - Please make sure to run the testing script debugPreprocessLidarDsm.m
% under 1_CoverageMapsForAcre/ before doing the s... |
function handles = plotMesh(handlesIN)
handles = handlesIN ;
global FileData
axes(handles.axesMesh) ;
cla
axis equal
xlabel '\bf X'
ylabel '\bf Y'
zlabel '\bf Z'
actPt = FileData.ActualPoint+1 ;
actOr = FileData.ActualOrientation ;
% POINTS
if strcmp(handl... |
function [P I] = slice_tri(V,T,plane,varargin)
% SLICE_TRI Slice through a triangular mesh (V,T) along a given plane (via its
% implicit equation).
%
% P = slice_tri(V,T,plane)
%
% Inputs:
% V #V by 3 list of tet mesh vertices
% T #T by 3 list of tet indices into V
% plane list of 4 coefficients in the plane e... |
Ca1(0.001,0.4,0.5,3,1,1,1);
%%
Da=load('Ca1Gamma-3Sp8Conn5Pop3NEnv1S1SC1.mat','ChiTTTAft');
%Da=load('Ca3Pop3NEnv1S1SC1.mat','PhiTTT');
Dat=struct2array(Da);
%%
[Radius,BumpStd]=UnitCorr(Dat);
%%
[PopRadius,PopStd]=PopuCorr(Dat);
[NumField,PeSizeAll,PeActAll]=FieldStat(Dat);
save('Ca1Sp08Act','NumField','PeSizeAll','... |
function [eventsCodesIndexes, artifactsIndexes]=read_markers_artifacts(varargin)
% Read a given markers file (*.vmrk) exported from Analyzer
%
% input: 1. The name of the exported markers file (as string), including the .vmrk extension
% 2. OPTIONAL - the row number in the marker file of the first marker (Mk1... |
%%
% Ripley dataset
close all
clear all
% load ripley.mat %2 dimension250
load breast.mat %30 dimemsion * 400
% load diabetes.mat % 8 dimension 300
Xtrain = trainset;
Ytrain = labels_train;
Xtest = testset;
Ytest = labels_test;
% Visualize the data. Inspect the data structure: what seems to be important
... |
if !(exist('./sv.oct','file')) system("mkoctfile sv.cc"); endif
n = 500; # number of obs
model = "sv_model"; # the DGP
# true parameters
phi = 0.95;
sig_b = 0.025;
sig_e = 0.26;
theta = [phi; sig_b; sig_e];
m_estimation = false;
S = 10000; # number of simulations
burnin = 100; # initial observations to discard from ... |
%Read in Cleaned File
load('raw.mat');
raw = Raw;
clear Raw
[r,c,~] = size(raw);
%Concatenate
followers = zeros(49,1);
countN = zeros(49,1);
count = 0;
for i = 2:r
if contains(raw{i,14},'AL') % Alabama
count = count + raw{i,16};
countN(1,1) = countN(1,1) + 1;
end
end
followers... |
function [Z,num_iter] = cod(X, Wd, S, alpha, thres)
%COD Summary of this function goes here
% [Z,num_iter,Zout] = cod(X, Wd, S, alpha, thres, out_iter)
% S is mutual inhibation matrix S=I-Wd'*Wd
B=Wd'*X;
Z=zeros(size(B));
Zd=Inf;
num_iter=0;
while any(abs(Zd(:))>thres)
num_iter=num_iter+1;
Z1=h_theta(... |
warning('off','all')
for index = 0:1:12
for tis = 1:1:1000
temp = [];
temp = [temp,main(index)];
val = mean(temp);
end
tk(index+1) = val;
end
re = [0:1:12;tk];
|
function [firstline,secondLine] = plotHist(Hist,clustering,nbins)
set(groot,'defaultAxesColorOrder',[ 0 1 0; 1 0 0]);
%figure;
%hist(Hist);
%h =line([Centers,Centers],ylim);
%legend(h,{'low error',' medium error' , 'high error'});
firstline = 0.5 *(max(Hist(clustering == 1)) + min(Hist(clustering ==2 )));
secon... |
clear all, close all
% First get parameters
params = gendata_params();
f = params.f;
deltaT = params.deltaT;
p0 = params.p0;
p_yc = params.p_yc;
p_yl = params.p_yl;
n_periods = params.n_periods;
k = params.k;
om = params.om;
dx = params.dx;
dy = params.dy;
flags.write_k_dependent = true;
flags.write_om_dependent = tr... |
function [ pilot ] = generate_pilot(length_pilot, type_of_pilot, pilot_pattern,modulation,nr_bits_symbols)
%generate_pilot generates pilot sequence
% Detailed explanation goes here
if strcmp(type_of_pilot, 'random')
pilot=3/sqrt(2)*((2*rand(length(pilot_pattern),length_pilot)-1)+(2*rand(length(pilot_pattern),... |
function showSpikes()
[f,p] = uigetfile('*');
data = tdfread(fullfile(p,f));
eventStartTime = data.Event_Start_Time_ms;
peakAmplitude = data.Peak_Amp_uV;
timeOfPeak = data.Time_of_Peak_ms;
timeOfAntipeak = data.Time_of_Antipeak_ms;
interspikeInterval = data.Interspike_Interval_ms;
... |
%% EXAMPLE 3 : USE FILES TO SHARE BIG DATA
clc
clear all
close all
% Parameters
port_Input = 9997 ;
port_Output = 1110 ;
packet_Length = 1e6 ;
timeout = 100 ;
while 1 % BREAK THE LOOP WITH CTRL + C
msg = [] ;
while isempty(msg) % While no msg Received
try
msg = judp('RECE... |
% =========================================================================
% Simple demo codes for face image super-resolution via TLcR-RL
%=========================================================================
clc;close all;clear all;
addpath('.\utilities');
nTraining = 360; % number of training sample... |
%% compare different methods
clc
clear all
% add the useful path
if isunix
addpath(genpath('./plotop'));
end
if ismac
addpath(genpath('./plotop'));
end
if ispc
addpath(genpath('.\plotop'));
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% some global parameters
%% global... |
% 2.19 整机配平 无冗余变量
clear all
clc
h = 100;
[~,~,~,rho] = atmosisa(h);
%% 建立对象
% 直升机
DoubleRotorHelicopter = Helicopter();
DoubleRotorHelicopter.GW = 5500;
DoubleRotorHelicopter.GWF = 5500*9.81;
% 下旋翼
LowerRotor = RotorFixed('anticlockwise'); % 下旋翼逆时针转, 为默认情况
LowerRotor.a_0 = 5.7; % 主旋翼升力线... |
%
% dividedDifference(points)
%
% By: Christopher Smith
%
% Usage: A = dividedDifference([0, 1; 2,3; 4,5])
%
% Description:
%
% Generates a matrix in which column vector 'i'
% contains the divided differences of order 'i'
% of the points matrix.
%
% The diagonals of this matrix contain entries
... |
error_map = zeros(50,50);
nonzero_map = zeros(50,50);
for lambda_1 = 1:50
for lambda_2 = 1:50
z = [lambda_1/10000, lambda_2/10000];
error_rate = zeros(1,10);
nonzero_count = zeros(1,10);
for i = 1:10
[train_set, train_R, test_set, test_R] = get_bootstrap_set(data1, chosen... |
%HVARITH - issue 3.0 (16/01/06) - HVLab HRV Toolbox
%--------------------------------------------------
% [outdata] = HVARITH(mode, indata1, indata2)
% Perform arithmetic operations on workspace data structure arrays
% outdata = new workspace data structure array containing the results of the arithmetic operation... |
% SOSDEMO3 --- Bound on Global Extremum
% Section 3.3 of SOSTOOLS User's Manual
%
clear; echo on;
syms x gam gam1;
% vartable = [x1, x2];
vartable = [x];
% =============================================
% First, initialize the sum of squares program
prog = sosprogram(vartable);
% =====================================... |
function predictedX = findMismatch(input, sensing_vector, output_coeff, gain)
idx = find(sensing_vector);
p = zeros(length(idx)+1, 1);
p(1) = 1;
p(end) = (output_coeff/(input*gain)-1);
predictedX = roots(p');
end
|
function [Wmext,psnrwmf,msewmf,images1] = extracting(images,WM)
p=0.2;
file = dir('D:\project\code_video_watermarking2\watermarkedframes\*.jpg');
NF = length(file);
images1 = cell(NF,1);
for i = 1:NF
images1{i} = imread(fullfile('D:\project\code_video_watermarking2\watermarkedframes\',file(i).name));
end
... |
%Nhom 1
%53
%Pham Ba Tung
%B15DCDT221
X = imread('c.jpg');
I = rgb2gray(X);
[m,n] = size(I);
ni(1:256) = 0;
for i=1:m
for j = 1:n
ni(I(i,j)+1) = ni(I(i,j)+1)+1;
end;
end;
s_ni(1:256) = 0;
s_ni(1) = ni(1);
for i=2:256
s_ni(i) = ni(i)+s_ni(i-1);
end;
S = m*n;
c = 255/S;
s_ni = round(... |
function [Iend,Ipoll] = PMDiffusion(u,dt,Tend,Tpoll,K)
% Perona Malik diffusion equation
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% Inputs:
% u: Initial image
% dt: time step
% Tend: end time
% Tpoll: times at which to poll
% K: edge strength threshold
%
% Output: Solution of the PM diffusion equation
... |
function IdealPath = ObtainComponentBasedIdealPath(Matches1, Matches2, LocationsArray)
NumComponents = size(Matches1,1);
Length = size(Matches1,2);
RefinedMatches1 = zeros(1,Length);
RefinedMatches2 = zeros(1,Length);
for c = 1:NumComponents
for k = 1:Length
if (Matches1(c,k) ~= 0)
CurComponen... |
classdef CustomFigureHandler < FigureHandler
properties (Constant)
figureType = 'Custom'
end
properties
updateCallback
end
methods
function obj = CustomFigureHandler(protocolPlugin, varargin)
ip = inputParser;
... |
addpath('../mimlib');
addpath('../messl');
addpath('../utils');
workDir = '/home/data/CHiME3/data/audio/16kHz/isolated/';
outDir = '/scratch/near/CHiME3/fixed_model/v3/replayMessl/maskhold11/';
combined_mask_dir = '/scratch/near/CHiME3/v3/maskhold11_lstm_initial_messl_output/data/';
%put combined mask to MESSL
enhance... |
function [sp,binform] = dijkstra(A)
% Moffett Stephen, Jacob Rios, Angel Sun and Blake Borgeson
% 9/28/01
% ELEC 422 Group D
%
% Solving the Shortest Path Problem using Dijkstra's Algorithm
% - This function takes in a square matrix as input. The matrix
% represents the weights of edges in a network of n ... |
function [s1,s2,s3] = divide_3parts(comp1)
rem = mod(numel(comp1),3);
add_val = [ zeros(1,3-rem),de2bi(3-rem,3,'left-msb')];
comp2 = [comp1;add_val'];
k = numel(comp2)/3;
s1 = comp2(1:k,1);
s2 = comp2(k+1:2*k,1);
s3 = comp2(2*k+1:3*k,1);
end |
classdef ConfigureNodes
properties
Noise;
NoisePower;
NoiseCategory;
IntialPosition;
RelativeVelocity;
RelativeNoise;
pathlosscoefficient;
WindowSize;
No_Of_Levels;
Active;
end
methods
function c = ConfigureNodes
c.Noise=0;
c... |
tresD1=imread('3D-1.jpg');
tresD2=imread('3D-2.jpg');
[x,y,z]=size(tresD1);
rojo=zeros(x,y,3);
verde=zeros(x,y,3);
azul=zeros(x,y,3);
final(1:x,1:y,1)=tresD1(1:x,1:y,1);
final(1:x,1:y,2)=tresD2(1:x,1:y,2);
final(1:x,1:y,3)=tresD2(1:x,1:y,3);
imshow(final)
%imwrite(final,'tD.jpg') |
function stopping()
pause(0.2); |
function ph = linear_phase(sz, shift)
% LINEAR_PHASE creates a linear phase (complex expontial of magnitude 1) that
% will shift your image the input number of pixels
%
% phase = LINEAR_PHASE(size_vector, shift_vector)
% size_vector is two element array of the same type as given by size()
% shift_vector is a two eleme... |
function pm25(pm)
if pm>=0 & pm<35
disp('空气质量为优')
end
if pm >=35 pm<75
disp('空气质量为良')
end
if pm >=75 & pm <115
disp('轻度污染')
end
if pm >=115 & pm <150
disp('中度污染')
end
if pm >=150 & pm<250
disp('重度污染')
end
if pm >= 250
disp('严重污染')
end |
classdef al_gparam
%AL_GPARAM This class definition file specifies the
% properties and methods of a gParam object
%
% A gParam object contains general task parameters such as
% number of trials and blocks, hazard rate, and concentration.
% Todo: finish comments and delete ... |
Het is mogelijk de matrix [2 3 2 ; 6 5 4]
met de matrix [6 2 2 ; 6 3 2] te vermenigvuldigen. |
function parsave_data(NameT,NameWSTiempoTotal,NameMISC,INPUT_TRAJ,OTHEROUT)
%Trajectory info
save(NameT,'INPUT_TRAJ');
% HF time
tiempo_TOTAL_HF = OTHEROUT.tiempo_TOTAL_HF;
save(NameWSTiempoTotal,'tiempo_TOTAL_HF');
% Miscelaneous data
INV_VAR_PLOT = OTHEROUT.INV_VAR_PLOT;
ITERATION_COUNTER = OTHEROUT.ITE... |
%{
A = [1,0,-4,8,3;4,-2,3,3,1];
b = zeros(1,5);
for index = 1:size(A,2)
if A(1,index) > A(2,index)
b(index) = A(1,index);
else
b(index) = A(2,index);
end
end
%question: what is b = to after execution
%answer is 1
%}
%{
function Q9()
x =1;
while x>1e-5
x = x/2;
end
disp(x)
end
%}
|
function [f, df, p0] = fitEchoLinear(phas, mag, TEs)
%FITECHOLINEAR Weighted linear fit for multi-echo data.
% Weights are equal to the reciprocal of the variance of the phase which is
% computed based on [1].
%
% [f, df, p0] = FITECHOLINEAR(phas, [mag], [TEs]);
%
% References
% ----------
% [1] Conturo... |
hold;
scatter(y1, results1, 'r');
scatter(y2, results2, 'b');
scatter(y3, results3, 'g');
scatter(y4, results4, 'k*');
scatter(y5, results5, 'b+');
scatter(y6, results6, 'r*');
scatter(y7, results7, 'p');
xlabel("y = X*w");
ylabel("Change from 0.9 V / V");
legend("[0.75, 0.25]","[1.00, 1.00]","[0.25, 0.25]","[0.25, 0.7... |
hh_data;
%% partial correlations
dm = log10([hh_2008_tab1_M/1E-3 hh_2008_tab1_A hh_2008_tab1_T/1E-4 hh_2008_tab1_N/1E5 hh_2008_tab1_D]/1E4)
[C,p] = fpc(dm)
[Vp,Dp] = eig(C) %PCA of partial correlations;1. M,N. 2: M(ish),-N,-D 3: A,-T 4: A,T,-N,D
%% PCA
[Vm,Dm] = eig(cov(dm)) %PCA of cova... |
RGB = imread('1_43_long6.png');
I = double(rgb2gray(RGB));
I = I./max(I(:));
figure, imshow(I)
%res = wlsFilter(I, 0.5);
%figure, imshow(res)
%res = wlsFilter(I, 2, 2);
%figure, imshow(res)
res = wlsFilter(I, 0.5, 0.1);
figure, imshow(res) |
%
% Batch Effect Removing
% mean-centering
%
% Input:
% idata -- The expression matrix, (samples are in columns)
% ilabel -- the batch labels, start from 1, continues.
%
function data = meanCentering(idata,ilabel)
size_label = size(ilabel);
size_data = size(idata);
if size_label ~= size_data(2);
return
end
... |
classdef TestGPCForest
%TestGPCForest
methods (Static)
function test_1
[img1, img2, flo] = readRubberWhale();
gpc = cv.GPCForest();
% NOTE: train can be slow
gpc.train({img1}, {img2}, {flo}, 'MaxTreeDepth',8, ...
'DescriptorType','WHT', 'P... |
function [ tanstruct_out ] = merge_ace_clim_data( climstruct1_in, climstruct2_in )
%A function to merge two ace climatology files so that the data is a
%combination of the data in both files.
% *INPUT*
% climstruct1_in: STRUCTURE - contains the gas specific ACE data.
% This structure can be created... |
function [ X ,Y ] =nivlines4 (F, dFx, dFy, Z, A, B, C, D, Steps, StepWidth)
% generiert Mengen von Wertpaaren (xij,yij) mit F(xij,yij)=Z(j) mit
% mit unterschiedlicher Schrittweite- und Anzahl.
%Die Startpunkte werden im Intervall [A(j),B(j)]x[C(j),D(j)] gesucht, wobei
%entweder Vektoren A aus R^(1 x k) oder Skal... |
%******************************************************************************************
% MAgnetometer Calibration
% Sérgio Patrão
% April 2015
%
% Tested with:
% MPU9150
% LSM9DS0
% AltIMU
%******************************************************************************************
clc;
clear all;
close all;
% Re... |
clc;
clear all;
% lights direction
light1=[0 0 40];
light2=[20 5 40];
light3=[-5 15 40];
light4=[-10 -10 40];
light5=[5 -10 40];
light6=[5 20 40];
%normalize lights direction
light1 = light1 / norm(light1);
light2 = light2 / norm(light2);
light3 = light3 / norm(light3);
light4 = light4 / norm(light... |
%% Stelling 9
%
% Met een semi-colon (;) maak je een nieuwe rij aan
% binnen een matrix.
%
Antwoord = 1;
|
function data = convertVEtoData(V, E, angle)
% function data = convertVEtoData(V, E, angle)
data = struct('type',{},'n',{}, 'x',{},'y',{},'R',{},'G',{},'B',{},'angle',{},'cut',{});
for i = 1:size(E,1)
if any(any(isnan(V(E(i,:),:))))
continue;
end
data(end+1).type = 'l';
data(end).n = 2;
da... |
function gaSVMcgForClassdraw(cg,bestacc,bestc,bestg)
cstep = 0.8;
gstep = 0.8;
gmax = 8;
gmin = -8;
cmax = 7;
cmin = -8;
accstep = 4.5;
[X,Y] = meshgrid(cmin:cstep:cmax,gmin:gstep:gmax);
%% to draw the acc with different c & g
figure;
[C,h] = contour(X,Y,cg,70:accstep:100);
clabel(C,h,'Color','r');
xlabel(... |
clear;
Size=40;
alfa=linspace(0.5,1.5,Size);
beta=linspace(0.5,1.5,Size);
syms y;
rou = 2;
for i=1:Size
for j=1:Size
int1=int((1-y^2)^(beta(j)/2),-1,1);
int2=int((1-y^2)^(beta(j)/2),-1,1);
int3=int((y^2)*(1-y^2)^(beta(j)/2),-1,1);
U1(i,j)=1/(2*alfa(i)*((2*rou)^beta(j))*int1)+1.2/(0... |
function parms = getMovParms (M)
%function [rotx roty rotz tx ty tz ] = getMovParms (M)
% cant' handle rotations greater than pi/2
%
% from http://bishopw.loni.ucla.edu/AIR5/rigidbody.html
rotx = asin(M(2,3));
roty = atan(M(1,3) / M(3,3));
rotz = -atan(M(2,1)/M(2,2));
tx = M(1,4);
ty = M(2,4);
tz = M(3,4);
parms = [... |
% File: Start.m @ FastObj
% Author: Johannes Reblimg
% Mail: johannesrebling@gmail.com
% Description: starts card but DOES NOT enable the trigger
% "Starts the card with all selected settings. This command automatically
% writes all settings to the card if any of the settings has been changed
% since the last on... |
%% Set training and test dataset
SetTrainTestN_FRF;
SetTrainTestP_FRF;
%% Prepare data for training and test
%Uso la funzione splitSignals per dividere in report di lunghezza uguale
[XTrainN_D_FRF,YTrainN_D_FRF] = splitSignals(XTrainN_FRF,YTrainN_FRF);
[XTestN_D_FRF,YTestN_D_FRF] = splitSignals(XTestN_FRF,YTestN_FRF);... |
function Load_EV_hour=V2G_double(n_EV,T_peak,mileage1,mileage2,T_arrive1,T_arrive2)
[Load_EV_dis_hour,~]=V2G_discharge(n_EV,T_peak,mileage1,T_arrive1);
[Load_EV_ch_hour]=V2G_charge(n_EV,T_peak,mileage2,T_arrive2);
% Load_EV_hour=(Load_EV_dis_hour+Load_EV_ch_hour).*10;
Load_EV_hour=(Load_EV_dis_hour+Load_EV_ch_hour... |
function [ filtered_data ] = filter_data( all_data, criteria )
% Given an array of data and an anonymous function, it applies the
% function to each element, if the result is false then the element is
% omitted.
filtered_data = [];
for d = all_data'
if (criteria(d))
filtere... |
function h = gauss1d( N )
sigma = (N-1)/6;
h = zeros(N,1);
N2 = ceil(N/2);
for i=1:N
h(i,1) = 1/(sqrt(2*pi)*sigma) * exp (-( (i-N2) * (i-N2) )/(2*sigma*sigma) );
end
end |
%A1ModJulian dv1.Element1 dv2.Element ElapsedDays Altitude RadPer RMAG
tmp =dlmread('E:\Lunar_Label.csv');
tmp = tmp(2:746167,:); % one year data
delta_V_1 = tmp(:,2); delta_V_2 = tmp(:,3);
ElapsedDay = tmp(:,4);
[m,n] = size(tmp);
% Compress_Data
Compressed_Scale = 5000;
Compressed_Tmp = zeros(floor(m/Compresse... |
function [s, u, i, offset, skew] = generate_true_profiles(Param, Grid, varargin)
% Given a set of parameters and a testcase, generate electric profiles and
% sync error parameters profiles used as underlying true profiles during estimation
%
% Args:
% Param: struct of parameters
% Grid: struct of testcase
%
% Retu... |
%Script to take all .lin files and store them a in single matrix
%Make sure all .lin files are on the same folder
%By Tassio Borges
global RootName
clear A B C D Bd G Gd Gd_teste Gbar Cbar Abar Bbar Kbar Lbar Dbar DescCntrlInpt Bseudoin;
twr = 1;
DrTr = 3;
fp1 = 4;
fp2 = 5;
fp3 = 6;
twr_speed = 7;
rot = 8;
DrTrdot = ... |
% [sentence leftover] = getNextCompleteSentence(filenumber, holdover)
%
% Get the next complete sentence from open text file FILENUMBER. A sentence
% is defined as everything before and including the next period.
% getNextCompleteSentence returns the complete sentence, as well as any
% text that is leftover on th... |
%%% for full ROI image anlysis : ROI setting: 'X (pix)':'1,427','Y (pix)': '1,684' (defalut)
%%% for single cell: choose specific x, y range; input 'X (pix)':'130,210','Y (pix)': '180,260'
%%% choose ch0, choose ch1;
clc; clear all;
close all
%% channel and threshold parameter setting
ch=2; % ch0=0; ch1=1, bot... |
classdef BoundaryTest < matlab.unittest.TestCase
% BOUNDARYTEST
%
% Description:
% Tests for IPL boundary marker classes
%
% History:
% 2Apr2018 - SSP
% ---------------------------------------------------------------------
properties
fh
ax
INL
end
... |
function [rayField, BR] = computeRayleighXZ(prs,nu,depth,width,X,Z,applyTop,applyLateral)
% Computes the static Rayleigh strength layers using cosine ramp
dLayerZ = prs.zH - depth;
dLayerR = prs.l2 - width;
dLayerL = prs.l1 + width;
% Get the indices for the lateral layers
%[xr1,xr2] = ind2... |
function list_id_bodyID =filter_skeleton(bodyinfo)
nof_cur_skeleton = size(bodyinfo.bodies,2);
list_id_bodyID = zeros(nof_cur_skeleton,1);
for i=1:nof_cur_skeleton
if((bodyinfo.bodies(i).leanX -bodyinfo.bodies(i).leanY)>0.8)
list_id_bodyID(i)=0;
else
list_id_bodyID(i... |
function velocity = restrictVelocity(velocity,maxVelocity)
swarmSize=size(velocity,1);
for iTemporary = 1:swarmSize
if norm(velocity(iTemporary,:))>maxVelocity
velocity(iTemporary,:)=velocity(iTemporary,:)*maxVelocity / norm(velocity(iTemporary,:));
end
end
end
|
function run_experiment(params, qnum)
% RUN_EXPERIMENT Run the project 1 experiments with the designated
% parameters.
% @params Struct containing the parameters of two 2D normal
% | distributions
% +--params.mu1 The mean of distribution 1
% +--params.sigma1 The covariance of distributi... |
%% Init Robust MPC Paths
addpath(genpath([pwd '/rmpc_mav']));
disp('### Some version of YALMIP and MPT is required!');
disp('### Robust MPC Tools initialized...');
|
function [ I ] = rasterize( V, F, M2V, V2P, imageSize )
% Tao Du
% taodu@stanford.edu
% Feb 23, 2015
%
% Given a 3D shape (V, F), transformation (M2V, V2P), and the image size
% imageSize, returns an indicator matrix I, where each pixel indicates it
% is covered by at least one triangle.
%
% Input: V, F: see readObj.
%... |
function c = ROI_medianFilter(c, varargin)
%
% NAME
%
% function c = ROI_medianFilter(c)
%
% ARGUMENTS
% INPUT
% c class basac_process class
%
% OPTIONAL
%
% OUTPUT
% c class basac_process class
%
%
% DESCRIPTION
%
% Performs a median filtering on each slice of the ROI volumes in
% <c>.
%
% PRE... |
function u = findViableController(x, chi_fin, A, B, H, m, n )
% the condition that the control input must satisfy for a given x is:
% F_fin(AX + B.u ) < g_fin
% H.u < 1
F_fin = chi_fin.A;
g_fin = chi_fin.b;
cols_H = m;
FAB = F_fin* [A, B];
size_FAB = size(FAB) ;
size_zeros_fillin... |
function [image, data] =kfft(mtx,sz,lim)
% [image data] =kfft(mtx)
% Takes fft of matrix
% Input: mtx = map to have fft taken
% Output: image = matrix with fft of mtx, chopping middle point.
% data = complex fft of mtx
mtx=mtx/mean2(mtx)-1;
if nargin==3, mtx(mtx<-lim)=0; mtx(mtx>lim)=0... |
%% This script does all the preprocessing steps from the 4D light reconstructed data set, to a dataset ready to be analysed using PCA and ICA
% The steps are:
% * Detrending the data with the signal boxed averaged over 10 s. This allows to center the data and to remove decrease in fluorescence from fluorophore bleach... |
%
% function reconstructed_image = BCS_SPL_DCT_Decoder(y, Phi, num_rows, num_cols)
%
% This function performs SPL reconstruction of y using a DCT
% sparsity basis. Phi gives the projection matrix. The reconstructed
% image, of size num_rows x num_cols, is returned as
% reconstructed_image.
%
% See:
% S.... |
function S = HANLMSinit(w0,mu,fb,ff,delay)
% HANLMSinit Initialize Parameter Structure of the NLMS Algorithm
% for Hearing Aids. Refer to Fig. 1.9
%
% Arguments:
% w0 Coefficients of FIR filter at start (@n=1)
% mu Step size for the NLMS algorithm
% ff Feedforw... |
clear all
addpath('Datasets');
%% 1. Load Datesets
load Fdataset_ms
Wrr1 = drug_ChemS;
Wrr2 = drug_AtcS;
Wrr3 = drug_SideS;
Wrr4 = drug_DDIS;
Wrr5 = drug_TargetS;
Wrr = [Wrr1, Wrr2, Wrr3, Wrr4, Wrr5];
Wdd1 = disease_PhS;
Wdd2 = disease_DoS;
Wdd = [Wdd1, Wdd2];
Wdr = didr;
Wrd = Wdr';
[dn, dr] = size(Wdr)... |
clear
asm = NET.addAssembly('C:\Users\raulr\Desktop\HexLibrary.dll');
% Control absolute time by changing absTime variable
hexControl = HexLibrary.Form1;
% Length of Time
Duration = 60; % in sec
% Rotation Reference in cm (?); Z is up and down
RefX = 0;
RefY = 0;
RefZ = 40;
% Movement axis
X = 0;
Y = 0;
Z = 89;
% A... |
i_path = '/data1/abide/Stanford/';
o_path = '/data1/abide/Out/Test2/';
m_path = '/data1/abide/Mask/';
% Make sure the paths are good paths
in_path = niak_full_path(i_path);
out_path = niak_full_path(o_path);
mask_path = niak_full_path(m_path);
% Make sure the base output directory exists
if ~psom_exist(out_path)
... |
% same as disp( sprintf(...) )
function mydisp(varargin)
disp(sprintf(varargin{:})); %#ok<*DSPS>
|
%add a new word to the dictionary
%Repeating recomended to increase frequency
titleBar = 'Add a new word';
userPrompt = 'Say you word immidiately after pressing ok';
%input the word
word = inputdlg(userPrompt, titleBar, 1);
%Generating File Name
%Word+random number +.exe
%Random number so that same word can be dupl... |
function [x, TRtime, GDtime1, GDtime2] = Alg43SR1(StepBound, eta, StopError, xstart, B0, Xdata, ydata)
E = Inf; Delta = StepBound/2;
x = xstart; B = B0; k=1;
while E > StopError
time1=0; time2=0; time3=0; time4=0;
t1=tic; [f, g] = N2GPLogLike(Xdata, ydata, x); time1 = toc(t1);
t2=tic; [lambda, pd] = Alg43SolTR1(B, g... |
function [qx, qy, SecondOrderTerm ] = matAssembleCharacteristicMatrix(obj, mesh, ele, edgeType)
%>@brief function used to calculate the term used when assemble the global stiff matrix
%>@detail In this version, the zero boundary condition for nonhydrostatic pressure is imposed at
%> the general clamped boundary, and t... |
function [] = PlotErrors(f,errors, T)
%PLOTERRORS Plots the error between real pose, estimated pose, and estim_d
%pose.
set(0,'CurrentFigure',f)
clf;
subplot(2,1,1);
title('Distance between real pose and estimated');
axis([1 T 0 inf]);
x = 1:size(errors,2);
plot(x, errors(1,:));
... |
%%
for ii = 1:15
figure; imagesc(storeStates(:,:,1,ii)); title(['t = ' int2str(ii)]);
end
%%
xValues = 100:400; % colony boundary;
yValue = floor(size(storeStates,1)/2);
xValues = yValue:xValues(end); % only the values of the right half of radius
%%
for tt = 1:30
outputFile = ['k1radius10_t' int2str(tt) '.mat... |
function [reg y]=regressor3(data,p)
N=size(data,1);
d=size(data,2);
reg=[];
for kp=p-1:-1:0
for j=1:d
aux=data(kp+1:N-(p-kp),j);
reg=[reg aux];
end
end
y=data([p+1:1:N],:);
|
%% Image Analysis Project
%
% Federico Badini & Stefano Bodini
% Politecnico di Milano
% 2014-2015
% Corso del Prof. V. Caglioti
%
% The following script aggregates images to reduce noise
% Preliminary steps
close all
clear
clc
% Constants
SRC_IMGS_PATH = '../Pics/';
DEST_IMGS_PATH = '../Output_pics/';
IMGS_TO_MERGE ... |
function T= build_all_features(Align_table,Hist,Hist1,Hist2,start, stop,varargin)
% BUILD_ALL_FEATURES builds all the statistics based on a given set
% of alignments, k-mer histograms, 1-mer histograms, and 2-mer histograms
% Align_table(:,[2 3]) provides the sequence numbers for each statistic
pack;
... |
function [ ] = PlotTimeStamps( Track, Name )
%PLOTTIMESTAMPS Summary of this function goes here
% Detailed explanation goes here
n_zero_stamp = 0;
for i = 1:Track.number_of_elements
stamp(i) = Track.get_time_stamp(i);
if (Track.get_time_stamp(i) < 0)
n_zero_stamp = n_zero_stamp+1;
zero_stamp(n... |
function p = viterbi (hmm, sample)
%将模型中的数据取对数,以保留精度
pi = log (hmm.pi); %初始概率
A = log (hmm.A); %转移矩阵
B = hmm.B; %高斯混合模型
T = size (sample, 1); %观察序列/样本长度
N = hmm.N; %状态数
%初始化
f = (ones (T, N)) * (-inf);
for i = (1 : N)
f(1, i) = pi(i) + log (calcGmm (B(i), sample (1, :)));
end
%计算转移方程
for i = (2 : T)
for j = ... |
a=imread('coconut.bmp');
%Conversion of RGB to YIQ format
b=rgb2ntsc(a);
%Histogram equalization of Y component alone
b(:,:,1)=histeq(b(:,:,1));
%Conversion of YIQ to RGB format
c=ntsc2rgb(b);
imshow(a),title('original image')
figure,imshow(c),title('Histogram equalized image')
|
+function [ sampleVoltsList ] = SampleToVoltsU12( sampleValueList , inputRange_volts )
%SAMPLETOVOLTSU12 此处显示有关此函数的摘要
% 此处显示详细说明
sampleValueList = bitshift(sampleValueList,-4);
sampleValueList = double(sampleValueList);
sampleVoltsList = (sampleValueList-2047.5)/2047.5 * inputRange_volts;
end
|
function createhelpfiles(mfile)
% function createhelpfiles(mfile)
if nargin==0, help createhelpfiles, return, end
fn_cd brick
if strcmp(mfile,'all')
d = cellstr(fn_ls('*.m'));
else
d = {[mfile '.m']};
end
opt = struct('outputDir',fn_cd('brick','html'));
for kfile=1:length(d)
% file names
mfile =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.