text stringlengths 8 6.12M |
|---|
function indicesNonFacesToTake= test(indicesNonFaces, numberToTake)
indicesNonFacesToTake= zeros(1,numberToTake) ;
for i=1:numberToTake
index = randi([1 length(indicesNonFaces)],1,1) ;
indicesNonFacesToTake(i) = indicesNonFaces(index) ;
indicesNonFaces(index) = [] ;
end
end |
function add_ts_curves_from_st_cback(~,~,main_figure)
curr_disp=get_esp3_prop('curr_disp');
layer=get_current_layer();
[trans_obj,~]=layer.get_trans(curr_disp);
if~isempty(layer.Curves)
layer.Curves(contains({layer.Curves(:).Name},'Single Target'))=[];
end
ST = trans_obj.ST;
if isempty(ST.idx_r)
return;
e... |
try
clear all;
% open window
Screen('Preference', 'SkipSyncTests', 1);
[window_ptr, screen_dimensions] = Screen(0,'OpenWindow',[0,0,0]);
% define keys
KbName('UnifyKeyNames');
esc_key = KbName('Escape');
EXIT = 0;
%up/down control eccentricity by increments o... |
classdef nodeTest < matlab.unittest.TestCase
properties
rng_seed
end
methods(TestMethodSetup)
function random_save(testCase)
% save current rng state
testCase.rng_seed = rng();
% set state to 1
rng('default');
rng(1)... |
function [ output_args ] = subsetData( extent, verbose )
% This function takes a spatial subset of LAS, WSL class TIF, and CIR TIF
% imagery based on the input extent (xMin, xMax, yMin, yMax).
% Input las files covering the extent must be in the current directory
%
% Input:
%
% extent - spatial extent of subset in ... |
% Assignment 1, coded by Yang Wang, B00711141
cIterations = 30;
x = rand(1, 10);
y = 0.5 * x + 1 + 0.1 * randn(size(x));
% according to the code, the regression target should be y = 0.5 * x + 1.
mList = 1: 1: cIterations + 1;
bList = 1: 1: cIterations + 1;
RSEs = 1: 1: cIterations + 1;
m = 0; b = 0;
for i = 1: cIter... |
%%%%%%%%%%%%%
for obj=[2 4 6 8 10]
objective=obj
Result=cell(7,1);
best_HV=cell(7,1);
for p=2
run = 30;
%-----------------------------------------------------------------------------------------
C = [ ];
for i = 1:30
eval(['load D:\ARCHIVE-BASED\org-K-G-B-NSGA-III\DTLZfiles\GrEA_D\GrEA_D','_',num2st... |
%%%%%%%%%%%%%%%% PLOT SHAPE PLOTS %%%%%%%%%%%%%%%%
% Plots plots for individual shapes.
% Inputs:
% plotPlots - sets the type of plots to make
% options: 'pathSpeed' - plots the shape's path and speed
% 'plotSpaceTime' - plot the local and global shape and moti... |
function [xa,Pa,Qest,Rest,innov,FPF] = AUKF_STEP(xa,Pa,obs,f,h,Q,R,Q_param,prev_innov,prev_FPF)
%%%Propagate from one observation time step to the next%%%
% xa an Nx1 vector containing the state at itime
% Pa an NxN matrix containing the covariance matrix at itime
% obs an Mx1 vector which con... |
function [X,Y] = Spiral_2class(n,d)
%Generates 2 noisy spirals for binary classification
fpath = mfilename('fullpath');
findex = strfind(fpath,'/');
rootDir=fpath(1:findex(end-1));
p = genpath(rootDir);
gits=strfind(p,'.git');
colons=strfind(p,':');
for i=0:length(gits)-1
endGit=find(co... |
i=1;
x1=Fparam(i,1);
x2=Fparam(i,2);
y1=Fparam(i,3);
y2=Fparam(i,4);
src=D(:,:,i)
k=28;
[L,C,U,LUT,H]=FastFCMeans(uint16(src*(2^16-1)),k);
Umap=FM2map(uint16(src*(2^16-1)),U,H);
for l=1:k
Dfuzzy(:,:,l)=im2bw(Umap(:,:,l),0.001);
end
l=28;
src=Dfuzzy(:,:,l)
centerX = round((x1+x2)/2);
centerY = round((y1+y2)... |
function R = RieszAnalysis(A,config)
% RIESZANALYSIS perform the 3D Riesz transform
%
% R = RieszAnalysis(A,config)
% perform the 3D Riesz transform for the 3D image A. The transform is
% characterized by the RieszConfig object config.
% Returns a 4D matrix of coefficients, which first dimension indicates the
% Riesz t... |
function [E] = plotgNap(M)
%FITGKS Fit the kinetics of gKs to the Bostock and Baker model
% [E] = fitgKs(X,V)
%
%X = [q10 asC asB]
%
%Defualt [3.0 23.6 21.6]
E = -100:1:40;
I = find(E == -60);
for n = 1:length(E)
am(n) = type1(E(n),M.A(1,1),M.A(1,2),M.A(1,3)); %23.6
bm(n) = type2(E(n),M.B(1,1),M.B(1,2),M.B(1,3));... |
function [motorPositionVector, angleVector, zernikeVector] = motorStepResponse(bench, axis, step, nStep)
if nargin<3; step = 0.2e-3; end
if nargin<4; nStep = 10; end
switch axis
case 'rX'
switch bench.config.rXOrder
case 'tip'
zernike = 2;
... |
function H=polhank(a,n)
% Programmed 1994 by Niels K. Poulsen
% Department of Mathematical Modelling,
% Technical University of Denmark
a=a(:)'; na=length(a)-1;
H=hankel(a); H=H(1:end-1,2:end);
if nargin > 1,
H=[H; zeros(n-na,na)];
end
|
function varargout = act_ive_gui(varargin)
% ACT_IVE_GUI M-file for act_ive_gui.fig
% ACT_IVE_GUI, by itself, creates a new ACT_IVE_GUI or raises the existing
% singleton*.
%
% H = ACT_IVE_GUI returns the handle to a new ACT_IVE_GUI or the handle to
% the existing singleton*.
%
% AC... |
function [XY] = getPathOfRBBs(cx,cy,w,h,angle)
x1=cx-w/2;
x2=cx+w/2;
y1=cy-h/2;
y2=cy+h/2;
xv=[x1 x2 x2 x1 x1];yv=[y1 y1 y2 y2 y1];
% R(1,:)=xv;R(2,:)=yv;
% XY=R;
XY=[cos(angle) -sin(angle);sin(angle) cos(angle)]*[xv-cx;yv-cy]+repmat([cx;cy],[1,5]);
end |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
%
% Problem 9- system described by difference equation
%Transfer function
num=[.01 0.03 0.15];
den=[1 -1.6 0.8];
printsys(num,den,'z')
% a)Impulse Response
num=[.01 0.03 0.15];
den=[1 -1.6 0.8... |
clc;clear;
f=@(x,y,z) x^2+y-2*z; %匿名函数
f(1,2,3)
% syms x y z;
% f=x^2+y-2*z; %符号表达式
% x=1;y=2;z=3;
% eval(f) |
% predictors for MeanRSA on facedistid data. Uses facedist_rsaglmpredictors
% internally to generate the correct FIR-like model RDMs.
%
% rdmgroups = facedist_rsapredictors_mean_tuning(rdms)
function outg = facedist_rsapredictors_mean_tuning(rdms)
switch size(rdms(1).RDM,1)
case 24
fullrdm = true;
case... |
function [fX,phiX] = getX(formula, args, k)
global Mw Z zLoop ZLoop bigM epsilon;
if length(args)~=1
disp('X(next) takes a single argument');
assert(length(args)==1);
end
if k < length(Mw)
% phi2
[fX,phiX] = getLTL(args{1},k+1);
else
%constraints
fX = [];
% And(zLoop_i, ... |
function X = randSmoothWaveform( cohsteps, totalsteps )
X = rand_bac( cohsteps, totalsteps );
X = startatzero( X );
end
|
function [Smoothed, SmoothedCov, Smoothed0, SmoothedCov0, ConvMinus ] = ...
FixedIntervalSmoother(Filtered, FilteredCov, Predicted, PredictedCov, TranMX, State0, StateCov0)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
% get dimensions
[~, d, T] = size(TranMX);
... |
primes = [2,3,5,7,11,13,17,19,23,29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71];
resultGF = [];
for k = primes
m = 10;
n = 10;
d = 4;
corrected = 0;
samples = 100000;
command = sprintf('./bipartiteFull %d %d %d %d %d %d', m, n, d, k, corrected, samples);
system(command);
fi... |
% Generarea retelei de noduri pe domeniului considerat
[X,Y]=meshgrid(-3.75:0.05:3.5);
% Evaluarea functiei de doua variabile de reprezentat
Z=peaks(X,Y);
% Incarcarea nivelelor negative de reprezentat
v_neg=-3:0.5:-1;
% Incarcarea nivelelor pozitive de reprezentat
v_poz=1:0.5:7;
% Desenarea liniilor ... |
%{
#
-> animal.Animal
-> animal.Animal
(sire_id) -> animal.Animal
(sire_id) -> animal.Animal
%}
classdef Sire < dj.Manual
end |
function logdist = LogDist(Mat1, Mat2)
[r1,c1] = size(Mat1);
[r2,c2] = size(Mat2);
logdist = zeros(c1,c2);
for i = 1:c1
for j = 1:c2
logdist(i,j) = sum(abs(log(Mat1(:,i)) - log(Mat2(:,j))));
end
end
end |
%根据房间数量和相邻房间之间距离建立任意两房间之间距离表
function disGraph = makeDisGraph(roomNum, roomDis)
for i = 1:roomNum
disGraph(i,i) = 0;
for j = i+1:roomNum
disGraph(i,j) = disGraph(i,j-1) + roomDis(j);
disGraph(j,i) = 0;
end
end
end |
function seg = chanvese_exp(I,mask,num_iter,mu, nodeBelMF, hybrid_b, prior_phis, kernel_sigma, Epsilon,beta,lambda)
% Only works for emb3!
imboundary = findboundary(prior_phis(:,:,1));
no_ex = size(prior_phis,3);
method = 'chan';
[m,n] = size(I);
%% Preprocessing
% Resize
s = 200./min(size(I,1),size(I,2)); % res... |
% [INPUT]
% data = A numeric array of n elements representing the original (non post-processed) sample on which the Number Duplication Analysis must be performed.
% ddec = An integer [0,10] representing the number of decimal places to consider (optional, default=2).
% No rounding is performed, the exceeding d... |
function [J grad] = nnCostFunction(nn_params, ...
input_layer_size, ...
hidden_layer_size, ...
num_labels, ...
X, y, lambda)
%NNCOSTFUNCTION Implements the neural network cost func... |
function pc=DataExtract(CellArray,framerange,argnum)
%
% function DataExtract(CellArray,framerange,argnum)
%
% Will take a data cell array CellArray derived from a single aoi data
% and extract only those frames specified by the framerange
% parameter. The function will return a [frame data] Nx2 matrix where the
% '... |
% Generate subclusters by decomposing a spacific cluster n from scale K into a higher scale K' ( K < K')
cluster = 1;
from_scale = 17;
at_scale = 151;
path_folder = '/home/yassinebha/Dropbox/twins_study_basc/basc_fir/stability_fir_all_sad_blocs_EXP2_test1/FIR_EXP2_test1_n... |
function blo = prepa_num_cifrar_firma (tamanyosbloquesfirma, bloque)
%PREPA_NUM_CIFRAR_FIRMA
%Función que transforma un mensaje de
%Parametros:
%tama=Tamanyo de los bloques
%bloque=Cadena numerica a transformar
if(~ischar(bloque))
%Si no es una cadena
disp("No es una cadena");
blo=0;
return;
end
i=1;
b... |
clc;clear
word = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ';
index = linspace(1,52,52); % 定义编码
text = 'SECURITY'; %需要加密的字符
encoding = 'RXJFKZYH'; % 加密后的字符
len = length(text);
text_ind = zeros(1,len);
code_ind = zeros(1,len);
% 对每个字符编码,A?>0,...,Z->25
for i = 1:len
for j = 1:26
if text(i)... |
clear all
close all
save_data=1;
repeatCalc=0;
experiments = get_experiment_list;
experiments=experiments(523:535);
experiments=experiments([2016 2013]);
%% subfunction 1 - getStimProperties
getStimulationProperties(experiments,save_data,repeatCalc)
correctStimulationProperties(experiments,save_data,repeatCalc)
%% ... |
function [sx, sy] = swathblockseg(seg, b, d)
% SWATHSEG Produces a polygon bounding a series of segmentseg.
% [SX, SY] = SWATHBLOCKSEG(SEG, BOC, D) produces a polygon bounding the segments
% in structure SEG, located +/- D km from the segmentseg. At each segment
% endpoint, a line is projected D km at +/- 90 de... |
function PlotDecision_Fronts_Table()
% Plot previous concentrations of glucose and galactose assayed in the past
load('../data/20140702_decision_front/output/data')
load('../data/20140702_decision_front/output/fit_17May')
color_table=[
0.8203 0.4102 0.1172;
0 0.5000 0;
0.5000 0.5000 0.5000... |
function [Pcrac f phi_s Qload] = crac_model_v1(Q, Ts, Tr, Tcoil, P, phi, Pmax, fmax, e_coil, e_fan, mode)
%%
%% crac_model_v2.m
%%
%% CRAC model
%% Input:
%% * Q: amount of heat to be removed in watts
%% * Ts: supply air temperature in Celsius
%% * Tr: return air temperature in Celsius
%% * Tcoil: cooling coil ... |
function [f,band,xgrid1,xgrid2]=autobiv(x,y,h1a,h1b,p,order,msespan,M1,J1, ...
J2,nterms,gridsize1,gridsize2, ...
varyfactor,ridgecoef,type,varest,coef,bandspan,weights) ;
%
%
%
%
% Last edited: 1/11/95
%
% Automatic bandwidth for bivariate local linear re... |
function N=grandcoalition(n)
%GRANDCOALITION returns a coalition of max cardinality
% N=grandcoalition(n) N is a coalition of cardinality n, if n single;
% otherwise n is considered a game and N will hold its grand coalition
% Copyright 2005 Universiteit Maastricht, dept. of Mathematics
% $Revision: 1.01$ $... |
% Popul Control : VR Navigation Mode
txt = uicontrol('Parent',f,...
'Style','text',...
'Position',[5 710 100 40],...
'String','NavMode');
data.popup = uicontrol('Parent',f,...
'Style','popup',...
'Position',[5 700 100 25],...
'String',{'Walk';'Exami... |
%@(#) ldfresh7.m 1.1 00/11/23 10:09:03
%
function ldfresh7(refufile,asytyp,num)
if exist(refufile,'file')
refu=load(refufile);
bocfile=refu.bocfile;
khot=readdist7(bocfile,'khot');
[bocburn,mminj]=readdist7(bocfile,'asyid');
sym=refu.symmetry;
if sym==3
num=num/2;
... |
% Tomado de la figura 3.46 del libro de Gonzalez 3rd Edition.
% D.Mery, PUC-DCC, Sep-2008
% http://dmery.ing.puc.cl
I = imread('../images/skeleton.tif');
close all
% a)
Ia = double(I);
figure
imshow(Ia,[])
title('(a) Image of whole body bone scan');
pause
% b)
L = [0 -1 0; -1 4 -1; 0 -1 0];
Ib = abs(conv2(Ia,L,'same... |
function dispResults(method, payout, fees, probRuin, time)
% A Helper function to conveniently display the result of various methods.
% Call it with the syntax "dispResults('header') to get just the column
% headers.
if strcmp(method, 'header')
str = sprintf('% 20s % 10s % 10s % 10s % 10s', 'Method:', 'Payou... |
function options = defaults
% Copyright 2013-2015 The MathWorks, Inc.
options.precision = 'double';
options.direction = 'default';
options.reduction = 1;
options.useGPU = 'no';
options.useParallel = 'no';
options.showResources = 'no';
options.direction = 'default';
options.CheckpointFile = '';
options.CheckpointDelay... |
%
function C = findClusters (D)
D = single(D);
%T = clusterdata(D,'maxclust',4,'distance','emd','linkage','average'); % All white except floor
%T = clusterdata(D,'maxclust',4,'distance','jaccard','linkage','weighted'); % All white except floor
%T = clusterdata(D,'maxclust',4,'distance','hamming','linkage','weighted')... |
function [model analysis state] = DM_NLDynamicNRwFixIter(MODEL, ANALYSIS, STATE)
% Nonlinear dynamic analysis using displacement method with fixed number of iterations
%
% Written by T.Y. Yang and Andreas Schellenberg and Hong Kim 09/14/2009
% Model Variables
A = MODEL.A;
B = MODEL.B;
C = MODEL.C;
K = MODEL.K... |
function [array_config]=optimiza(Potencia_sensores,freq_config,Numero_de_sensores,posicion_X,posicion_Y,posicion_Z,range_config,array_config,generaciones,poblacion,clusters_fijados)
%% Parametros de configuraci?n
global mejor_x;
global estacion_si;
global estacion_no_deseada_si;
global estacion;
global mejor_e... |
# read magnetometer and parse data
function [magTime,magX,magY,magZ] = gyrGetData(inFile)
# read mag data
inData = csvread(inFile);
# parse mag data
magTime = inData(:,1)';
magX = inData(:,2)';
magY = inData(:,3)';
magZ = inData(:,4)';
endfunction
|
% EE569 HW #1
% Author: Xiang Gao
% USCID: 9216348910
% Email: xianggao@usc.edu
% Submission Date: Sep 19, 2013
% Require: drawhistfromfile.m
%% Problem 3: Noise Removal
% (a)
datafilename = 'peppers_mix_histdata_0.dat';
drawhistfromfile(datafilename);
datafilename = 'peppers_mix_histdata_1.dat';
drawhistfromfile(d... |
classdef (Hidden, Sealed) WriterMat < graph.writer.Writer
%WRITERMAT Writes a graph problem into a MATLAB MAT file.
% This interface writes a GRAPH adjacency matrix and metadata to a
% MAT file.
%
% See also: WRITER, GRAPH.
%======================== IMPL: Writer ===============... |
function seg_viewer(segFile)
%SEG_VIEWER View segmentation files
% SEG_VIEWER(segFile) will view the segmentation file, segFile.
%% Execute segmentation viewer
exeName = 'segment_viewer';
[status, cmdout] = system([exeName ' --input="' segFile...
'" --window_name=seg_viewer']);
if(status ~= 0)
error(cmdout);... |
function [relay_structure]=generate_relay_structure();
%为relay创建结构体
rx_structure=generate_rx_structure;
relay_structure=struct(...
'mode',{},... %'AAF','DAF'
'magic_genie',{},... %'Magic Genie'
'amplification',{},... %AAF模式下使用
'symbol_sequence',{},... %DAF模式下使用
'signal2send',{},... ... |
function [Imask,Ibck] = NeckMask(I,alpha,corner,percent);
% NeckMask: get a mask for the background
%
% [Imask,Ibck] = NeckMask(I,alpha,corner,percent);
% alpha: threshold for masking 0.1 <=> 10 % upper histogramme is one
% 0, uses 10% of the corner
% [amin amax] : compute ... |
function tri_vis1(Time,Y,Tri)
%outputs gif file
filename = 'pictures\expfit\creeploop\realcreep';
h =figure;
for i = 1:length(Time);
% subplot(2,1,1);
clf
current_points = Y(i,:);
[R,P] = matricize(current_points);%real and reference points
TR = triangulation(Tri,R);
hold on;
triplot(TR);
... |
function [ images, pred, gtx, gty, lmx, lmy ] = result_view_reg_init()
images = evalin('base','eval_img');
pred = evalin('base','pred_new');
%Red
lmx = evalin('base','xl');
lmy = evalin('base','yl');
% gtx = evalin('base','gtx');
% gty = evalin('base','gty');
%Green
gtx = zeros(size(lmx));
gty = zeros(size(lmy));
% ... |
function [u,v] = f_vecUV(mag,dir,geo)
% - returns U,V components of a vector given its magnitude & direction
%
% Usage: [u,v] = f_vecUV(mag,dir,geo);
%
% mag = column vector specifying magnitude of vectors (in arbitrary units)
% dir = column vector indicating angle of rotation (in degrees from 0-360)
% geo = use geogra... |
function exportTable(directory,matrix,titlesArray,numberOfIterations,delta,time)
% dlmwrite(directory,matrix,'delimiter','\t','precision','%15.5f');
fid = fopen(directory,'w');
for i = 1: size(titlesArray,2)
fprintf(fid,'%s\t\t',string(titlesArray(i)));
end
fprintf(fid,'\n');
fprintf(fid,[repmat('%f\t', 1, size(mat... |
function build_tools (compiler)
if ispc
exe_ext = '.exe';
else
exe_ext = '';
end
if ~exist(fullfile('.', 'tools', ['MATLAB2C++' exe_ext]), 'file')
if nargin < 1
disp('the argument ''compiler'' of build_tools is empty');
disp('finding available compiler...');
compiler = ... |
function [B,x,Icor,B0] = BiasCorrLEMSS2D(I,Imask,V_mean,V_std,options,B0);
% BiasCorrLEMSS2D: Correct for Inhomo by local entropy minimization with splines support
%
% [B,x,B0] = BiasCorrLEMSS2D(I,Imask,V_mean,V_std,options,B0);
% B: Final bias filed
% x: corrected iamge (x=I/B)
% B0: Initial bias field i... |
function hh = dtmfdesign(fb, L, fs)
%DTMFDESIGN
% hh = dtmfdesign(fb, L, fs)
% returns a matrix (L by length(fb)) where each column contains
% the impulse response of a BPF, one for each frequency in fb
% fb = vector of center frequencies
% L = length of FIR bandpass filters
% fs = sampling freq
%
... |
function wind_turbine_parameters = get_wind_turbine_parameters(idx_typ)
%GET_WIND_TURBINE_PARAMETERS Auslesen der Parameter der Windturbinen
% GET_WIND_TURBINE_PARAMETERS ist die Definitionsdatei für verschiedene
% Windturbinen und kann deren Parameter zurückgeben:
%
% WIND_TURBINE_PARAMETERS = GET_WIND_TUR... |
function [Controller] = ControllerA(i,Ts)
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
if (i == 1)
s = tf([1 0],[1]);
Plant = 12.688/(s + 5.113);
control = 4.53 + 296/s;
%step(Plant*control/(1 + Plant*control))
Ts = 1/100; D11 = c2d(control,Ts,'zoh');
Controller = [D11 0; 0 D11]; % ... |
clear
clc
x = [2329 1593 1479 1857 1335 1140 2136 1844 144 472 1230 2146 1641 1350 2120 1480 1495 3112 2615 2206];
y = [1350 1621 1263 1293 1666 1593 932 1121 1398 1615 2113 1457 1519 1936 1427 1735 1803 1280 1191 1283];
syms z
a = sum((x - mean(x)).*(y-mean(y)))/sum((x-mean(x)).^2);
b = mean(y) - mean(x)*a;
r = (... |
%% Step 9
% Graph of Friction Torque vs. Average Disc Radius R
Rad=[0.065 0.089 0.116];
%%Notice that we're going by runs and not discs
% Run 1
figure(2);
t1=[1.553 2.330 3.107];
h1=plot(Rad,t1,'ob','MarkerFaceColor','b')
p=polyfit(Rad,t1,1);
xx=linspace(-p(2)/p(1), max(Rad));
f=polyval(p,xx);
hold on... |
function readGyro(fileName)
% [sensorMatrix char raw] = xlsread(fileName);
accCalibreX=0;
accCalibreY=0;
accCalibreZ=0;
close all;
fid = fopen(fileName,'r');
C = textscan(fid, repmat('%s',1,6), 'delimiter',',', 'CollectOutput',true);
C = C{1};
xValues=smooth((str2double(C(:,2))-accCa... |
function imageStack = openPupilCamVid(pupilCamFileID, imageHeight, imageWidth)
pixelsPerFrame = imageWidth*imageHeight;
skippedPixels = pixelsPerFrame*2; % Multiply by two because there are 16 bits (2 bytes) per pixel
fid = fopen(pupilCamFileID);
fseek(fid, 0, 'eof');
fileSize = ftell(fid);
fseek(fid, 0, 'bof')... |
%%% change rgb to hsc
ix = imread('rice.png');
i = imresize(ix, [500,500]);
%%ok
figure, imshow(i);
i1 = imopen(i, strel('disk', 9));
i3 = i - i1;
figure, imshow(i3);
i4 = imadjust(i3);
figure, imshow(i4);
bw = imbinarize(i4);
figure, imshow(bw);
i6 = bwareaopen(bw, 200);
figure, imshow(i6);
figure, imshowpair(i,i... |
clear all
close all
clc
donneefix=[1000 3000 7000 10000 30000 60000];
neurfix=[200 500];
couchesfix=[2 4];
for t=1:size(donneefix,2)
for s=1:size(neurfix,2)
for v=1:size(couchesfix,2)
nb_iter_grad=100;
taillebatch=100;
epsilon=0.1;
steps=1;
nb_classes=10;
iterations=100;
StepRatio=0.1;
BatchSize=100;
taille_cut=donn... |
function [PLT_N_0,PLT_N_1,PLT_N_2,PLT_N_3,PLT_N_4,PLT_N_5,PLT_N_6]=PLT_N(n_e,T_e);
global n_e_data_PLT_N;
global T_e_data_PLT_N;
global Table_PLT_N_0;
global Table_PLT_N_1;
global Table_PLT_N_2;
global Table_PLT_N_3;
global Table_PLT_N_4;
global Table_PLT_N_5;
global Table_PLT_N_6;
... |
function [] = ExtractBlobs(file,todebug,thresh,mask)
% [] = ExtractBlobs(file,todebug,thresh,mask)
% extract active cell "blobs" from movie in file
% todebug 0 or 1 depending if you want to go through frame-by-frame
% thresh is initial threshold (try BlobStats for thresh determination)
% mask is the binary mask of... |
function y = f(x)
% Usage: f(x) = 0
%
% Simple external function.
%
% Aaron Krauss
% Math3315/CSE3365
% Spring 2010
%
y = (.08*pi*(5.67*10^(-8))*(x^4)) + (2*pi*x) - 2085.938; |
function [intercoord, inter2edge, edge2inter] = qt_img_intersection(I, coord, meshEdge)
%calculate intersections based on image I
I = [I,I(:,end)]; %increase one more colum
I = [I;I(end,:)]; %increase one more row
edge1 = coord(meshEdge(:,1),1:2)';
edge2 = coord(meshEdge(:,2),1:2)';
compass = edge1~... |
%% Plot Auditory Salience Metrics for OB and TT stimuli
if exist('/home/knight/','dir');root_dir='/home/knight/';app_dir=[root_dir 'PRJ_Error_eeg/Apps/'];
elseif exist('/Users/sheilasteiner/','dir'); root_dir='/Users/sheilasteiner/Desktop/Knight_Lab/';app_dir='/Users/sheilasteiner/Downloads/fieldtrip-master/';
else roo... |
% sif2mat - loads each sif file in a folder, and writes out as a matfile of the
% same name, but with the .mat extension. The resulting .mat file is smaller by a factor
% of 2 (thus easier to copy from server, etc), and loads ~5x faster than the sif file
% It only does the conversion if the matfile does not already e... |
gpuDevice(1);
ratio = 1.0;
Tomo = gpuArray( imread('img/Italy_Tomo.png'));
Height = gpuArray(im2double(imread('img/Italy_Height.png')));
Area = gpuArray(im2double(imread('img/Italy_Area.png')));
% Get the size from the image
[nY, nX] = size(Height);
if ratio < 1
nY = double(int32(nY * ratio));
nX... |
% =============================================
% = GIC Line Preparation =
% = Rui Sun, Dominion Technical Solutions =
% =============================================
% To save calculation time, it is wise to condense latitude and ground
% effect (other than the field) on lines into co-e... |
%% Clear
clear; close all;
display = displayCreate('CRT12BitDisplay');
%% Sample images from the sparse prior
prior = load('sparsePrior.mat');
imSize = [100, 100, 3];
image = sparseSampler(prior, imSize);
figure();
imshow(gammaCorrection(image, display), ...
'InitialMagnification', 1000);
%% Sample images fr... |
DefineBeamline
bl.SetTrackingMethod('CParticleTracking');
[beta, tune, closedorbit] = ComputeMatchedTwiss(bl,beam);
emittance = [0.34 0.03 32.0] * PhysicalUnits.micrometre;
nparticles = 1000; % number of particles
beam.particles = MakeMatchedBunch(closedorbit(:,end),beta(:,:,:,end),emittance,nparticles);
beam.pa... |
%Lab One Simulation Frequency Response
figure(1)
semilogx(f_sim,v_db_sim)
axis([10^1 10^5 80 110])
grid on
xlabel('Frequency (Hz)')
ylabel('Gain (dB)')
%title('Transimpedance Amplifier Frequency Response')
set(figure(1), 'Position', [400 300 960 480]);
ax = gca
ax.XTick = [10 100 1000 10000 100000];
ax.XTickLabel = {'1... |
x=0:0.1:10;
y=sin(x);
h_f =figure('Position',[200 300 300 300],'menubar','none');
h_a1=axes('position',[0.1,0.1,0.8,0.8]);
h_t =title(h_a1,'ÕýÏÒÇúÏß');
h_I=line(x,y);
set(gca,'xtick',[0 pi/2 pi 3*pi/2 2*pi 5*pi/2 3*pi]);
set(gca,'xticklabel',['0', 'pi/2' , 'pi' , '3*pi/2' , '2*pi' , '5*pi/2' , '3*pi']);
set(gc... |
function plotfamilystartup(handles)
% plotfamilystartup(handles)
% TLSMenu=uimenu(handles.('figure1'), 'Label', 'Access Mode');
%
% SubMenu = uimenu(TLSMenu, 'Label','Old Control System');
% set(SubMenu,'Callback', 'mode(1)');
% set(SubMenu, 'Separator','On');
%
% SubMenu = uimenu(TLSMenu, 'Label','EPICS Control Syst... |
function[TT,y]=DE_track_age(Tin,y0,t0,treat)
global mu_PWID mu_former exit_IDU r_relapse delta alpha p_complete omega infect total_PWID PWID0 dt...
r_AF0 r_F0F1 r_F1F2 r_F2F3 r_F3F4 r_F0F1_PWID r_F1F2_PWID r_F2F3_PWID r_F3F4_PWID r_F4DC r_DCHCC r_F4HCC r_DCLT r_DCdeath r_HCCLT r_HCCdeath r_LTdeath1 r_LTdeath2 r_S... |
function varargout = Intercept_Plane_with_Surface(varargin);
%
% Syntax :
% [intCurve, edgeLabels] = Intercept_Plane_with_Surface(planEq, Surf);
%
% This function cuts a surface (defined by vertices and faces as represented
% by MATLAB patches) by a plane, leading to a curve in 3D space. The
% resulting curve is r... |
function labels = pylonInference1Class(nBaseRegions, Tree, U, V, additionalUnaries)
% finds the optimal configuration in the 1-class case
% see the paper for more details.
% V. Lempitsky, 2011
% INPUT:
% nBaseRegions -- number of leaves in the segmentation tree
% Tree -- segmentation tree, that is (... |
function [] = write_dmp_parameters_to_ascii(directory,thetas)
if (~exist(directory,'dir'))
mkdir(directory);
end
current_update = read_current_update(directory);
if (ndims(thetas)==2)
thetas = shiftdim(thetas,-1);
end
n_samples = size(thetas,2);
output_directory = sprintf('%s/%03d_update/rollouts',directory,cur... |
function [ W, funcVal, W0] = reg_MTL( X, Y, lambda1, lambda2 )
%% get individually learned models
% gives a better starting point
T = length(X);
for i = 1:T
gamma = 0.5;
w(i,:) = regularized_linear_regression(X{i},Y{i},gamma);
end
%% problem 2.2
% p1 = (1/T)*((lambda1*lambda2)/(lambda1+lambda2));
% p2 = (1/T)*... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2010 - 2015 Moon Express, Inc.
% All Rights Reserved.
%
% PROPRIETARY DATA NOTICE:
% The data herein include Proprietary Data and are restricted under the
% Data Rights provisions of Lunar CATALYST Space Act Agreement
% No. SAAM ID#... |
function [RT,code,cor]=singleTrial(w,rect,Actions,imaget,acor,timing)
prestime =timing(1);
AFB = timing(2);% action-FB delay
% FB presentation time
FBprestime = timing(3);
% interstimulus interval
ISI= timing(4);
% > help snd
% Snd('Play',sin(0:10000)); % play 22 KHz/(2*pi)=3.5 kHz tone
% Snd('Play',[sin(1:200... |
tic
pre_test
post_test_even
post_test_odd
toc
h = figure(1);
% saveas(h,'FigA.fig');
% print('Spectral Analysis.png','-dpng','-r600') |
%book: Signals and Systems Laboratory with MATLAB
%by Alex Palamides & Anastasia Veloni
% exp(-t^2),-2<t<2 as FS in the cosine with phase form
%x(t)
T=4;
t0=-2;
w=2*pi/T;
syms t n
x=exp(-t^2);
ezplot(x,[t0 t0+T]);
legend('x(t)')
%trigonometric coefficients and approximation
figure
a0=(1/T)*int... |
function net = make_srn(ninput, nhid, noutput, params)
switch nargin
case 3
% Use the default setting
params.wrange = 0.5;
params.lrate = 0.1;
params.momentum = 0;
params.wdecay = 0;
params.efunc = 'CE'; % CE or SSE
params.ofunc = 'sigmoid'; % sofmax vs. s... |
function initStim5v
global visual scr params design
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Screen & Stimulus Parameters %%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%--------------------
% Screen information
%--------------------
visual.black... |
function set_all_visible(hia,hiaw,his)
for c=1:length(hia)
set(hia(c),'visible','on');
end
for c=1:length(hiaw)
set(hiaw(c),'visible','on');
end
for c=1:length(his)
set(his(c),'visible','on');
end |
%% Monopole acoustic source in free space
% complex pressure at point in space
% j*omega*rho*q*(e^(-jkr))/(4*pi*r)
f = 100; % Single frequency
omega = 2*pi*f; % Angular frequency
c = 344; % Speed of sound
lambda = c/f; % Wavelength
rho = 1.225; % Density of air
k = 2*pi/lam... |
function [ ] = funct_print3ph( Sig_beg, Sig_end, SL )
xl = 'индекс, точки';
yl = 'амплитуда, о. е.';
line_width = 1.5;
figure;
subplot(2,1,1);
plot(Sig_beg.sig, 'LineWidth', line_width);
grid minor;
xlabel(xl);
ylabel(yl);
title(SL.title_beg);
legend(SL.leg... |
function notebook_function3 = pendulum_equation3(t,x1)
%PENDULUM_EQUATION3
% NOTEBOOK_FUNCTION3 = PENDULUM_EQUATION3(T,X1)
% This function was generated by the Symbolic Math Toolbox version 5.11.
% 08-Nov-2013 10:38:37
notebook_function3 = -x1+3.1416;
|
%% for arbitrary sensor-finger(magnet) combinations...
function bS = varAngToBm_A_sym(theta, n_sensors, n_magnets)
% allocate memory for symbolic formula
syms x % temporary symbolic value
b = formula(symfun(ones(n_sensors*3,1),x)); % for the resulting b-field
s_cnt = 1; % indicates the actual sensorpos... |
classdef sirVisualClassDef < handle
properties
N; %number of people
L; %size of simulation box
t; %current number of time steps completed
dt; %time step size
otime; %number of time steps between outputs
rc=1.5; %cutoff dist... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.