text stringlengths 8 6.12M |
|---|
function [ feature,featurePoint] = LOIND_fgh( RgbImageFile,DepthImageFile,featurefile,index)
disp('***************************');
disp('calculating the LOIND...');
npies=8;%%%the spatial blocks
nbins=8;%%%the grayscale blocks
dnbins=2;%%%the normal blocks
RgbImage=imread(RgbImageFile);
DepthImage=imread(DepthImageFile)... |
function [Tumor] = TumorDetection(Mask, HighResolutionImage,Postprocessing,Postprocessingmiddle)
%tic
%[Mask, Stroma]=FCMSegm('MMR-5-MSH2_2015-05-08_21.12.05_x2.5_z0.tif');
%[LowResolutionImage, Stroma]=FCMSegmVV('MMR-3-MSH2_2015-05-08_19.25.43_x0.625_z0.tif');
%MMR-3-MSH2_2015-05-08_19.25.43_x10_z0.tif
%MMR-3-MSH... |
% Klasseneinteilung
class = 49:1:53
% Berechnung der Häufigkeiten
absFreq = hist(Klebermenge,class);
absSumFreq = cumsum(absFreq);
relFreq = absFreq./length(Klebermenge);
relSumFreq = cumsum(relFreq);
% Grafische Darstellung
f = figure(2);
% Relative Häufigkeit
subplot(1,2,1)
bar(class,relFreq,'b');
% Relative Summ... |
%% set hyper-parameters
dim = 400;
max_size = 120000;
voc_size = 200;
path='/gpfs/group/w/wang/jianbo/paintings/Westlake/';
signature_path=[path 'signature/'];
image_path=[path 'westlake_by_artists/'];
%% load set of images
names = struct([]);
list_dir = dir(fullfile(signature_path , '*' ));
for i=1:length(list_dir)... |
function chunk_recon(fidpath,max_blocks,ntraces,npoints,bitdepth,voldims,scannercode,runno,res,workpath,headfile)
%% warning about how this thing works
sprintf('\n');
display('Performing chunkwise recon of large dataset');
display('this will work MUCH faster if your dataset arrays have a large number of integer factor... |
%% This function compute the MCA subspace.
% [t] a dx(2n) matrix consist of 2n samples from n subjects (each subject has 2 samples from alternative modality). The
% training observations should be arranged as: [t11 t12 t21 t22 t31
% t32...tn1 tn2].
% [dh] is the dimension of latent variables.
% [rank_u] is the ran... |
% Cut the horizontal seams from the source image
%
% input
% -----
% img : 3-d array of the source image
% horizSeam : 1-d array of the horizontal seams
%
% output
% ------
% carved : 3-d array of the image with the seams removed
function carved = horizSeamInsert(img, horizSeamList)
[dimY, dimX, dimD] =... |
function fig = polarVAWT(vawt, val, titleName, hAxes)
%POLARVAWT Plot in polar coordinates any field that depends on azimuth
% angle.
%
% fig = obj.polarVAWT(val, titleName) plots the given field (val) against
% azimuth angle with the title titleName. It uses polar coordinates.
%
% fig = obj.polarVAWT(... |
function [eVec,eVal]=F_EigenSys(M);
%
% Syntax: [eVec,eVal]=F_EigenSys(M);
% - Eigen values and vectors of M, sorted by decreasing eigen values.
%
% Author: Lu Juwei - U of Toronto
% Created in 27 May 2001
% Modified in 6 August 2003
%
[eVec,eVal]=eig(M);
eVal=abs(diag(eVal)');
[eVal,Index]=sort(eVal);
eVal=fliplr(eV... |
%Just a function for connecting last and inital points in plots.
%Reference https://stackoverflow.com/questions/8545077/connecting-final-and-initial-point-in-simple-x-y-plot-plotting-closed-curve-po
function plotc(x,y,varargin)
x = [x(:) ; x(1)];
y = [y(:) ; y(1)];
plot(x,y,varargin{:})
end |
function str = integerize(A)
a=max(max(A));
b=min(min(A));
if(a>=intmin('int8') && a<=intmax('int8') && b>=intmin('int8') && b<=intmax('int8'))
str = 'int8';
elseif(a>=intmin('int16') && a<=intmax('int16') && b>=intmin('int16') && b<=intmax('int32'))
str = 'int16';
elseif(a>=intm... |
function Ls = computeTrigEdgeLengths(Trig)
N = size(Trig.Edges,2);
Ls = zeros(N,1);
for i = 1:N
i1 = Trig.Edges(1,i);
i2 = Trig.Edges(2,i);
c1 = Trig.Coords(i1,:);
c2 = Trig.Coords(i2,:);
Ls(i) = norm(c1-c2);
end |
classdef networkAnalyzer < qes.hwdriver.sync.instrument
% Network analyzer driver for S-parameters, basic.
% Currently support Agilent PNA E8300 series network analyzers only.
% Agilent PNA E8300/agilent_n5230c series network analyzers ROSCillator source is
% selected automatically:
% Applying a 10 ... |
%% test the function of stpMinGradientDescent
clc;
close all;
clear;
m = 5000;
n = 500;
% create random data
A = round(8 * rand(m, n));
x = round( 100 * randn(n, 1) );
x0 = round( 10 * rand(n, 1) );
% B = A * x
B = A * x;
fprintf('\ttest the function of stpMinGradientDescent\n');
% call steepest descent function
... |
function varargout = NucNorm_project(x, B,params,projTol,projData)
projData=[];
X = reshape(x,params.numc,params.nr);
d=params.order;
if norm(X(:))>B
X = X*B/norm(X(:));
end
params.factors{d}=X;
T=vec(cpdgen(params.factors));
scale_fac=max(abs(T(:)))/params.alpha;
% if scale_fac>1
% X=X/sca... |
%%
clear
% 機能一覧+テスト
% ToDo:
%% gTruth 読み込み
%load('gTruthCellMoving.mat')
load('gTruth.mat')
%%
A = GTruthConverter(gTruth);
% B = SeparateLabelDef(gTruth);
%%
A.changeFont()
%% 元画像の表示
frame = 1;
I = A.getOriginalImage(frame);
imshow(I)
A.titleFrame(frame);
%% 元画像 + 単一セグメント を取得
frame = 1;
segmentId = 1;
I = A.getSe... |
function d = extract_data(data)
% extract data
d.raw = data;
d.m = mean(data);
d.sd = std(data);
end
|
function [train_data,train_label,test_data,test_label] = create_train_test_data( data,kFold )
% split data to train and test
%
part_size = round(size(data,1)/kFold);
test_size = size(data,1) - (kFold - 1) * part_size;
train = [data(1:part_size,:);data(part_size + test_size + 1:end,:)];
test = data... |
function filtered = MAF(signal, filter_length)
N = length(signal);
L = filter_length;
filtered = zeros(1, N-L);
for i = 1:N-(L-1)
filtered(i) = mean(signal(i:i+(L-1)));
end
end |
% calculate rate of O + H2O2 -> OH+HO2
% Updated 7/13/06 AEP
% Based on JPL Data Evaluation #15
% rate = kOH2O2(T,M)
function j=kOH2O2(T,M)
j=1.4e-12.*exp(-2000../T); |
% COMPARE_SONGS takes in the PIs matrices creates by RUN_SONGS and
% computes the distance between the matrices and pairs them, then
% compares the pairings found with the truth data
thresh = '05';
shing = '6';
truth_name = strcat("thresh",thresh,"_shing",shing,"_truth");
% create the truth matrix to comp... |
eccs = [6 8 10];
blanks = NaN((vars/2), 1);
fctThresh = [FactorList(1:(vars/2), :), blanks];
for iic = 1:(vars/2)
grphF = FactorList(iic, :);
xo = table(table.Distance == grphF(2) &...
table.InducerSize == grphF(1)...
& table.IsRev == 1 & table.Reversals > 5 ...
... |
clear;
close all;
clc;
%loading data
data = load('XFOILdata.txt');
%extracting data
alf = data(1,:);
CLnaca = data(2,:);
CMnaca = data(3,:);
CLbicon = data(4,:);
CMbicon = data(5,:);
%plotting
figure;
hold on;
plot(alf,CLnaca);
plot(alf,CLbicon);
hold off;
grid on;
legend('NACA','Bicon');
figure;
hold on;
plot(alf,... |
function [ IM ] = IntensityMap( I )
% Subtask #1
% Returns Intensity map of HU saliency model
V = rgb2gray(I);
V = im2double(V);
V8 = imresize(V,.25);
% http://www.mathworks.com/help/images/ref/nlfilter.html
fun = @(x) std(x(:));
IM = nlfilter(V8, [2,2], fun);
IM = imresize(IM, 4);
end
|
%Section 4
close all;
clear all;
linearImg = imread('linear.tif');
corLinearImg = 255*(double(linearImg)/255).^(double(1/2.583));
figure(1);
image(uint8(corLinearImg)+1);
set(gca, 'Box', 'off');
axis('image');
graymap = [0:255;0:255;0:255]'/255;
colormap(graymap);
imwrite(uint8(corLinearImg), '../report/linear_gamma.p... |
function [ endpoints ] = getEndPoints( trial, left, breakPoints )
data = trial{left};
[n p] = size(data);
endpoints = [breakPoints'/n data(breakPoints,1:7) data(breakPoints,9)/max(data(:,9))];
end
|
function out=reduceBoozertoLCD_Nperiod(Geom)
%Divide all n in the Boozer data with the lowest common denominator.
if Geom.StelSym==0
error('not implemented yet')
end
out=Geom;
ns=[];
for rind=1:Geom.nsurf
ns=[ns,Geom.n{rind}];
end
ns=abs(ns(find(ns~=0)));
found=0;
Ntry=max(ns)+1;
while Ntry>1 && found==0
Nt... |
% This script is called by goDesignClassifier.m and goTest.m
% Plot 2D Gaussian PDF
figure
pointNum=100;
surfObj=qcSurface(DS2, pointNum, qcParam); % Compute the surface for each Gaussian PDF
classNum=length(surfObj.class);
% Plot the surface
for i=1:classNum
subplot(2,2,i);
mesh(surfObj.xx, surfObj.yy, surfObj.cla... |
% calculate PDC
function pdc = uGPDC_A(A2d, D, fftlen)
p = size(A2d, 1);
Abar = cat(3, eye(p), reshape(A2d, p, p, []));
Afrq = fft(Abar, fftlen, 3);
%H = zeors(size(Afrq));
%for k = 1 : fftlen
% H(:,:,k) = inv(Afrq(:,:,k));
%end
pdc = zeros(size(Afrq));
d = diag(D);
for j = 1 : p
for k = 1 : fftlen
pdc(:,j,k... |
function h=drawellipse(x,y,a,b,angle,gcah)
if nargin<6 gcah=gca; end
points=linspace(0,2.1*pi,20);
T=[sin(angle) cos(angle); -cos(angle) sin(angle)];
ell=(T*[cos(points)'/a sin(points)'/b]')';
ell(:,1)=ell(:,1)+x;
ell(:,2)=ell(:,2)+y;
h=plot(ell(:,1),ell(:,2),'LineWidth',3,'Parent',gcah);
|
function [rnd] = logrand(A_min,A_max,sz)
rnd = 10.^(log10(A_min) + (log10(A_max) - log10(A_min))*rand(sz));
end |
% DW2DHIST 離散2次元ウェーブレットのヒストグラム
% OUT1 = DW2DHIST(OPTION,IN2,IN3,IN4,IN5,IN6,IN7)
% Copyright 1995-2004 The MathWorks, Inc.
|
%*************** Advanced Communication Systems*****************%
% CE542, Fall 2018 %
% ECE, UTH, Greece %
% File: project_3a.m %
% Authors: Christos Georgakidis (1964) ... |
classdef nnspnorm < nntest
methods (Test)
function basic(test)
h = 13 ;
w = 17 ;
d = 4 ;
n = 5 ;
param = [3, 3, 0.1, 0.75] ;
x = test.randn(h,w,d,n) ;
y = vl_nnspnorm(x, param) ;
dzdy = test.rand(h, w, d, n) ;
dzdx = vl_nnspnorm(x, param, dzdy) ;
test.der... |
function show_diff_image(parameters, app, exp_num, im_num)
%SHOW_IMAGE Summary of this function goes here
% Detailed explanation goes here
cla(app.ImageAxes)
[h,w] = size(parameters.images{exp_num}{im_num});
image(app.ImageAxes,(flip_matrix(parameters.images{exp_num}{im_num})-multigauss_uncentred(parameters.sigm... |
%% Find XYZs for the solutions
% Specify the subject and the cv block
subNum = 1;
cvBlock = 1;
% Load the data
[X,metadata] = loadMRIData('jlp',subNum);
% load the results
load('JLP_ERR_TrueFaces.mat')
% Figure out the number of significant iteration
numSigIter = size(result(subNum).used,2);
% Get the XYZs
cod = me... |
function animateCovariances(covStack, covThreshold,workPath,covMode)
if ~isstruct(covStack)
if exist([workPath filesep covStack],'file')
load([workPath filesep covStack]);
elseif exist(covStack,'file')
load(covStack);
else
error('ANIMATE_COVARIANCES:Can_not_load_covariance_... |
function submit()
% Copyright (C) 2013 Georgia Tech Research Corporation
% see the LICENSE file included with this software
clear java;
clear classes;
if (isdeployed)
[path, folder, ~] = fileparts(ctfroot);
root_path = fullfile(path, folder);
else
root_path = fileparts... |
%% Image into Image hiding
clc;
clear;
close all;
%----------Embedding----------
%Get the cover image
in_image = imread('lena_gray.jpg');
cover = in_image;
[r c]=size(cover);
Secret_Image=imread('onion_gray.png');
[x y]=size(Secret_Image);
b=(dec2bin(Secret_Image))';
secret_img=reshape(b,1,[]);
message... |
function [good,replace,ur,vr] = validatePIV(u,v, medmax)
% function good = validatePIV(u,v, medmax)
filt = [-1 4 -6 4 -1; ...
4 -16 24 -16 4; ...
-6 24 100 24 -6; ...
4 -16 24 -16 4; ...
-1 4 -6 4 -1];
nbh = [5 5];
off = floor(nbh/2);
ctr = nbh(1)*(ceil(nbh(2... |
X_ = readtable('logistic_x.txt');
Y = csvread('logistic_y.txt');
% Y = table2array(Y_);
[m, n] = size(X_);
n = n + 1;
X = ones(m, n);
X(:,1:2) = table2array(X_);
theta = zeros(3,1);
grad = 1000.0;
eps = 1e-5;
jac = Jacob(theta, X, Y);
H = Hess(theta, X, Y);
its = 0;
while grad > eps
theta = theta - (jac/H)'... |
function signal = addSyn(filename, interType, fs, timeScale, freqScale)
% signal = addSyn(filename, interType, fs, timeScale, freqScale)
%
% ADDITIVE SYNTHESIS TOY
% Uses additive synthesis method to generate a complex waveform. It reads text based data
% set consiting of amplitude and frequency paramters. Th... |
function y = background_model(class,threshold,vaSet1,vaSet2,vaSet3,vaSet4,vaSet5,vaSet6,vaSet7,vaSet8,vaSet9,vaSet10,allomegas,allmeans,allcovs )
%BACKGROUND_MODEL Summary of this function goes here
% Detailed explanation goes here
%y = zeros(10,10) ;
v11=vaSet1(1:71,:);
v12=vaSet1(72:153,:);
v13=vaSet1(154:235,:)... |
function exercise1
%% SEE Line 47 and Line 64 for exercises.
rand('seed', 0);
%% Visualization (NO NEED TO MODIFY)
X = [randn(100,2); randn(100,2)+10];
for k = 2:5
figure(k);
y = kMeans(X, k);
visualize_result(k, X, y);
end
X = [randn(100,2); randn(100,2)];
... |
% Considering different symbol interval ts, plot frequency response of
% the channel. Is it an FIR/IIR?
% What is effect of increase/decrease of symbol interval related to delay
% spread?
% Find the output samples when a signal of symbol duration ts is
% passed through the channel.
% Use Toeplitz representa... |
% data_taking.public.xmon.tuneup.updatef01byPhase('qubit',[_c&o_],'delayTime',<_i_>,...
% 'gui',<_b_>,'save',<_b_>)
function varargout = updatef01byPhase(varargin)
% support multi-qubit parallel correction
%
% correct f01 at the current working point(defined by zdc_amp in registry)
% by phase tomo: f01 already s... |
%ABOUT Compact display of variable type
%
% ABOUT(X) displays a compact line that describes the class and dimensions of
% X.
%
% ABOUT X as above but this is the command rather than functional form
%
% See also WHOS.
function about(var)
if isstr(var)
% invoked without parentheses
w... |
function [sum] = perimeterSum(img, p_blackthreshold, windowwidth)
width = size(img,2);
height = size(img,1);
colordepth = size(img,3);
centerwidth = floor(width/2);
centerheight = floor(height/2);
maxdistance = ((width/2)^2+(height/2)^2)^.5;
newimg = zeros(width,height,colordepth);
newimg = img;
matrixofpixelaboveb... |
function circumferential_velocity = cartesian2cylindrical_velocity(cart_position, cart_velocity)
x = cart_position(1);
y = cart_position(2);
xdot = cart_velocity(1);
ydot = cart_velocity(2);
circumferential_velocity = simplify((x*ydot-xdot*y)/(x^2+y^2));
end
|
function configureMstate
%configures settings in the main window; this initializes the variables and
%will be overwritten by the master
%accepts:
% setup: string identifier of setup
global Mstate setupDefault
Mstate.anim = 'xxxx0';
Mstate.unit = '000';
Mstate.expt = '000';
Mstate.hemi = 'left';
Mstate.screenDist =... |
function var_save_test_so1(gNo, setNo)
cS = const_so1(gNo, setNo);
x = rand(4,3);
var_save_so1(x, cS.varNoS.vTest, cS);
x2 = var_load_so1(cS.varNoS.vTest, cS);
checkLH.approx_equal(x2, x, 1e-8, []);
end |
function [options] = getOptions(options,inputArgs,varargin)
% Gets default options for a function and replaces them with inputArgs inputs if they are present in Name-Value pair input (e.g. varargin).
% Biafra Ahanonu
% Started: 2013.11.04.
%
% inputs
% options - structure passed by parent function with each fiel... |
%% tail constants
h_cr = 3.732; % horizontal tail root chord [in]
v_cr = 5.067; % vertical root chord [in] |
function A = TMatrixFromValues(xi)
x = xi(1); y = xi(2); z = xi(3);
yaw = xi(4); pitch = xi(5); roll = xi(6);
cy = cos(degtorad(yaw));
sy = sin(degtorad(yaw));
cp = cos(degtorad(pitch));
sp = sin(degtorad(pitch));
cr = cos(degtorad(roll));
sr = sin(degtorad(roll));
A = [cy*c... |
function result = Inverse_matrix(mat)
if size(mat)(1) == size(mat)(2) && mat(1,1)!=0
if size(mat) != [1,1]
result = Inverse_matrix(mat(1:end-1,1:end-1));
if result == 0
return
endif
Y = Matrix_multiplier(mat(end,1:end-1),result);
if abs(mat(end,end)-Matrix_multiplier(Y, mat(... |
function GMM( K,vPath,pPath,imClass )
load(strcat(vPath,pPath,imClass,'_hog_.mat'));
%% PCA
[coeff,score,latent] = pca(V);
V = score;
%% GMM
tic;
GMModel = fitgmdist(V,K,'Regularize',0.1,'Start','plus');
idx = cluster(GMModel,V);
idx_model = strcat(vPath,pPath,imClass,'_idx.mat');
save(idx_model,'idx');
gmm_model = ... |
%例子:样条插值与拟合
clear;close;
x=linspace(0,2*pi,21);
y=sin(x)+(rand(1,21)-0.5)*0.1;
plot(x,y,'o');hold on;fnplt(csape(x,y));
fnplt(csaps(x,y,0.8),'r:');hold off;
|
#!octave -qf
index = input("Which file to open? (enter index): " , "s");
fid = fopen(["DataLin/" index ".txt"], "r");
in = fscanf(fid, "%d");
fclose(fid);
X = [1, in(1), in(2)];
Y = [in(3)-4];
for i = 2:19999;
X = [X; 1, in(3*i+1), in(3*i+2)];
Y = [Y; in(3*i+3)-4];
endfor;
w = inverse(transpose(X)*X)*transpose(X)... |
function N = SNR(origIm, estIm)
% Calculates the mean-square signal-to-noise ratio between original and
% estimated image
% Calculate numerator
numer = estIm.^2;
numer = sum(sum(numer));
% Calculate denominator
denom = (origIm-estIm).^2;
denom = sum(sum(denom));
N = numer/denom; |
t{1} = ['%Jouw tentamen cijfer: ' num2str(round(grade,1))];
t{2} = '% Kijk in elk m-file voor jouw score';
t{3} = '% Kijk eventueel in het UITWERKING bestand om te zien wat er';
t{4} = '% fout is gegaan.';
t{5} = '% Als dit het Tentamen cijfer is (niet het HERtentamen) dan moet';
t{6} = '% het bonuspunt er nog bij word... |
function [peaktimes1,peaktimes2,phaseshift]=peakphaseplot(o1,o2,trunc,filter_hours,delpeaks1,delpeaks2,list)
%PEAKPHASEPLOT Compare two groups' peaks and plot peaks and delays
%
% peakphaseplot(o1,o2,trunc,filter_hours,delpeaks1,delpeaks2)
% Uses a butterworth filter to smooth out two averaged activity datas
% loaded ... |
function my_string = per_gr_2mph_txt(tm)
% returns a string display for per_gr_2mph()
my_string = [' Percent of time with trace miss greater than 2 mph (absolute): ', num2str(per_gr_2mph(tm)*100), '%']; |
function result=ladderde(t,x,I,m,g,l);
% This function returns the angular velocity and angular acceleration for a
% ladder falling without friction
% Unpack the input values
theta=x(1);
thetadot=x(2);
numerator=m*g-(m*l/2)*thetadot^2*sin(theta);
denominator=-2*I/(l*cos(theta)) - (m*l/2)*cos(theta);
thetaddot=numer... |
%Program to perform 2D coordinate scaling transformation
%For actual object P
fprintf('Enter number of vertices of given shape: ');
n = input('');
%For coordinates of the given object P
for i=1:n
fprintf('Enter x coordinate of pt.%d: ', i);
x(i) = input('');
fprintf('Enter y coordinate of pt.%d: '... |
function m=LinRegress(x,y)
% Write a function which computes the least squares estimate given two matrices x and y.
% x is a regressor matrix with one row for each sample and y contains the output values one
% row for each sample
% m.theta=parameters
% m.variance= param uncertanties
% To be able to build a l... |
%
% Test of the arcmakemenu system, where I look at the creation of a
% SuperNEC menu system.
% Establish figure and handle storage.
CFh = figure;
set(CFh, 'MenuBar', 'none');
set(CFh, 'ToolBar', 'figure');
ud = get (CFh, 'UserData');
ud.handle.menu=[];
set (CFh, 'UserData',ud);
% Can either do this as an entire men... |
clearvars;
% X is our sampling points for x
X = linspace(-10,10,500)';
kernelType = 'linear';
% init hyper para
ko = 1;
k1 = 1;
L = 1;
X1 = X;
X2 = X;
% -- COMPUTE KERNEL MATRIX K(X,X) ---
% size of K(X1, X2) = #num of rows of X1 x #num of rows of X2S
if strcmp(kernelType,'RBF')
K = RBFKernel(X1, X2, ko, k1, L);
... |
clf;clear all;close all
% 2-1 : use two srrc pulse to get one rc channel
load('./filter/FIR_distortion')
% generate signal
[signal,bit] = bpskd([1 0],2)
srrc = srrc_pulse(10, 1/10, 4, 0); %SRRC pulse
delayed_signal = delay(signal,23)
% transmit signal
sout = filter(FIR_distortion,signal)
transmit_signal = conv(DAC(sou... |
function FollowOutcomeInstructions(taskParam, subject, cannon, whichPractice)
%FOLLOWOUTCOMEINSTRUCTIONS This function runs the instruction for the follow-outcome version of the Dresden experiment
%
% Input
% ~
%
% Output
% ~
screenIndex = 1;
while 1
switch(screenIndex)
case 1
... |
function yaw = magb2yaw(att,Magb)
%%根据磁力计的输出和水平姿态计算磁航向
Roll = att(1); %%横滚角
Pitch =att(2); %%俯仰角
Cb2 = [ cos(Pitch) sin(Pitch)*sin(Roll) sin(Pitch)*cos(Roll);
0 cos(Roll) -sin(Roll);
-sin(Pitch) cos(Pitch)*sin(Roll) cos(Pi... |
function [modlist,funlist,fun_info]=svd_make(typestrlist)
% fun_info is a 1x2 cell. fun_info{1}=>1 result is pointer, 0=>not
% fun_info{2}=>typestr ('r' or 'c' usually)
declare_globals
funname='svd';
modlist='';funlist='';
r=[char(10)];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function Moments = uq_gumbel_PtoM( Parameters )
% Moments = UQ_GUMBEL_PTOM(Parameters) returns the values of the
% first two moments (mean and standard deviation) of a Gumbel
% distribution based on the specified parameters [mu, beta]
%
% NOTE: This function refers to the *maximum* Gumbel distribution. For more
% info... |
%% Active learning Evaluation
%% Initiation - for seperate images
ImgDir = '/Users/apple/Dropbox/TBI/Validation';
ImgFiles = dir(ImgDir);
ImgFiles = ImgFiles(~strncmpi('.', {ImgFiles.name},1));
images = [];
ImgDir = '/Users/apple/Dropbox/TBI/Select_for_annotation';
for i = 1: length(ImgFiles)
fname = ImgFiles(i).n... |
function obj = addNodeCost(obj, func, deps, nodes, auxdata, load_path)
% Add a cost function that only depends on variables at a particular
% node. The input argument ''nodes'' will specify at which nodes the
% function is defined.
%
% @note This function provides a simple type of cost function whi... |
fc_tools.utils.cleaning()
N=40;verbose=2;
[bvp,info]=fc_vfemp1.examples.Poisson.setBVPPoisson3D_ex01(N,verbose);
[U,errors]=fc_vfemp1.examples.genSolveScalarBVP(bvp,info,verbose);
if fc_tools.utils.is_fcPackage('siplt')
fc_vfemp1.examples.genPlotScalarBVP(bvp,info,U,'Poisson2d[ex03]',verbose)
end
%
% Th=bvp.T... |
function testimageview()
if nargin==0,
[fname,pname]=uigetfile('*','Select the first file');
if isequal(fname,0)|isequal(pname,0)
disp('No file selected.');
return;
else
fullfilename=[pname fname];
end
end
%fpath=preparefolder(pname);
F=dir(pname); G=size(F);
I = [];
for i=1:G-2
... |
clc;
clear all;
close all;
%%
load DB
cl = {'open','close'};
dim = [30 60;
30 60
40 65];
delete(imaqfind)
vid=videoinput('winvideo',1);
triggerconfig(vid,'manual');
set(vid,'FramesPerTrigger',1 );
set(vid,'TriggerRepeat', Inf);
% start(vid);
% View the default color space used for the data — The valu... |
% Re-run the winning (combination) LTP model, but WITHOUT the thalamic
% cells.
% Rather than writing a new model function, I have added an option within
% the integration function that removes the states corresponding to the
% thalamic populations.
cd '/cubric/scratch/sapas10/tcm/LTP/NewSept2019';
mods = dir('FixNew... |
%% Create artificial random variable to mimic the underlying distribution
function [ artX , dto_id ] = create_artificial_distribution( obj , X_s )
% Create the variable for artificial random variable
Ns = size( X_s , 2 );
artX = NaN( obj.S , Ns );
dto_id = false( obj.S , Ns );
% Brute force version
ct = 1;
for s = ... |
function gradientDescent()
%Finds the x for which fn(x) is minimal by gradient descent
% fn: the (scalar) function to be minimized
% grad: a (vector) function, equal to the gradient of fn or an approximation
% startPoint: starting point for gradient descent
% step size: learning rate, so each step is stepSize * gradie... |
function [ V ] = BilinearInterp( X , Y, Img )
V=0;
p = size(Img,1);
q = size(Img,2);
f_x=floor(X);
f_y=floor(Y);
c_x=f_x + 1;
c_y=f_y + 1;
if (f_x >=1 && f_y>=1 && f_x <=p && f_y<=q)
V = V + Img(f_x,f_y)*(c_x-X)*(c_y-Y);
end
if (c_x >=1 && f_y>=1 && c_x <=p && f_y<=q)
V = V+ Img(c_x,f_y)*(X-f_... |
function x = adaptive_icurvelet(C, is_real, N1, N2,scale_locations, nbangles)
% Inputs
% C Cell array containing curvelet coefficients (see
% description in fdct_wrapping.m)
% is_real Type of the transform
% 0: complex-valued curvelets
% 1: real-valued... |
function h = GetDistance(a,b)
% difference in radian
h1 = sqrt(sum((a-b).^2));
h2 = abs(h1 + 2*pi);
h3 = abs(h1 - 2*pi);
h = min([h1 h2 h3]);
end
|
clc;
imgIn = imgRead('fishing_boat.bmp');imgOut = imgRecover(imgIn,8,50);
%imgIn = imgRead('lena.bmp');imgOut = imgRecover(imgIn,16,150);
imgShow(medfilt2(imgOut, [3 3]));
error = mean(mean((imgOut - imgIn) .^ 2));
medianError = mean(mean((medfilt2(imgOut, [3 3]) - imgIn) .^ 2)); |
function [best_machines,num_user_list] = find_free_hyena_machines(candidate_list_provider, user_limit, hyena_worker_per_node_limit, num_machines_ceiling, wait_for_free_nodes)
if(~exist('user_limit','var'));user_limit=1;end;
if(~exist('num_machines_ceiling','var'));num_machines_ceiling=1;end;
if(~exist('hyena_worker_pe... |
function varargout = Application(varargin)
% Application MATLAB code for Application.fig
% Application, by itself, creates a new Application or raises the existing
% singleton*.
%
% H = Application returns the handle to a new Application or the handle to
% the existing singleton*.
%
% Applica... |
function writeggp(varargin)
%WRITEGGP write time/data to ggp (eterna or preterna) format
% The output format follows the recommendation of IGETS Report:
% DOI: http://doi.org/10.2312/GFZ.b103-16087
%
% Inputs
% 'time' ... time vector in matlab datenum format
% 'data' ... data vector or matrix
% 'c... |
ts=[0 10]
x0=[0.1 0 0 0 0 0]';
[t,x]=ode45('robotadapt',ts,x0)
[qd,e]=robout(t,x)
plot(t,e)
plot(t,qd) |
function video2Slider(handles, curFrameInd)
if ~getappdata(handles.videoSlider, 'stopUpdateFrame')
set(handles.videoSlider, 'value', curFrameInd);
end
end |
function data = sensory_data_setup(embedded, external)
format long g;
% load sensory data
robot_data = load(embedded);
vision_data = load(external);
% some global consts of the system
imu_scaling_factor = 1000; % samples
magneto_scaling_factor = 1000; % samples
omnirob_buffer_size = 8; % samples
sampl... |
function [PI, PS] = ZSpec(obj, freq_offsets, w1, sat_time, pH, catalyst, pK_donor, concentration)
% w1 = [w1x, w1y] in rad/s
concentration_ = obj.HendersonHasselbach(pK_donor, pH, concentration);
% exchange rate
krate = obj.rateReactionPerCatalyst(pK_donor, catalyst, pH);
[PI, PS] = obj.NumericalSolution(freq_offset... |
% analyze_hint.m
% [SNR, stdev, list] = analyze_hint(subjname, subjnum, HAnum, NCstudynum)
%
% Purpose: Return SNR, stdev, and list # for a given subject file.
%
% Input: subjname (string), subjnum (string), HAnum (string), NCstudynum (1
% or 2)
%
% Output: SNR (double), stdev (double), list (string)
function ... |
function [newPorts, pixelpercmarray] = CT_ScaleAdjustments_v6 (C1xvals,C1yvals, C1ppcm, Ports)
%% File Description
%
% Takes (x,y) coordinates of "ports" for CO2 and Odor assays, and adjusts
% them to take into account scaling differences in the z-axis of the
% Chemotaxis Tracking Stations.
%
% Also, for CO2 a... |
function tauE=calctauE(Booz,Vpar,mndPhidpsi)
[kappa,varpi]=Vcomponents(Booz,Vpar)
integrand=...
(kappa-varpi*(Booz.u-Booz.G./Booz.FSAB2)).*...
(Booz.u-Booz.G./Booz.FSAB2).* ...
2*(Booz.G+Booz.iota.*Booz.I)./Booz.B.^3 .* ...
(Booz.G.*Booz.dBdtheta-Booz.I.*Booz.dBdzeta);
tauE = -mndPhidpsi*FSA(Booz,in... |
function fposition=Live_fn(x)
x=fix(100*rand(2,1));
p=0;q=0;
for k=1:5
p=p+k*cos((k+1)*x(1)+k);
q=q+k*cos((k+1)*x(2)+k);
end
fposition=p*q+(x(1)+1.42513)^2+(x(2)+.80032)^2
% [R,L]=size(x);tp=zeros(R,1);
% for i=1:R
% for j=1:L
% temp=x(i,j)^2;
% end
% tp(i)=tem... |
function [J grad] = nnCostFunction(nn_params, ...
input_layer_size, ...
hidden_layer_size, ...
num_labels, ...
X, y, lambda)
%NNCOSTFUNCTION Implements the neural network cost func... |
exactLineSearch = true;
%exactLineSearch = false;
%f = @(x) 0.5*(x(:,1).^2 - x(:,2)).^2 + 0.5*(x(:,1)-1).^2;
%f = @(x) aokiFn(x);
%[x1 x2] = meshgrid(0:0.1:2, -0.5:0.1:3);
f = @(x) rosen2d(x);
[x1,x2] = meshgrid(-2:.05:2);
Z = f([x1(:), x2(:)]);
Z = reshape(Z, size(x1));
figure;
contour(x1,x2,Z,50)
h... |
function res = fit(p,data,ctrl)
res = -dataprob(data,ctrl,[p ;0.01]);
end |
function [] = plot_mesh(X, Y, Z)
F = TriScatteredInterp(X, Y, Z);
rx = (max(X) - min(X)) / 30;
ry = (max(Y) - min(Y)) / 30;
[qx,qy] = meshgrid(min(X):rx:max(X), min(Y):ry:max(Y));
qz = F(qx,qy);
plot3(X(1:167),Y(1:167),Z(1:167),'o',...
'MarkerSize',6,'MarkerFaceColor','b');
... |
% List of Globals to be used by multiple codes
global URF Upinv T Titer dt dt_f s_vec N plotit plotiter tol; % Global Code params
global c_bliss rho rr gamma w1 w2 iter s1 s2 c_dl c_bl s_bar s_bl resreq; % Global Model Params
global mpregime clearcond; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.