text stringlengths 8 6.12M |
|---|
function [figureArray] = plot_results(table,optns)
% close all;
% clear;
% load('plotData.mat');
%% options
%plotGens = [1:6];
N = size(table.Vm,2)-3;
n_legend_columns = 6;
% default values
if ~isfield(optns.plot,'plots')
plots = struct();
[plots.Pg,plots.Qg,plots.Vm,plots.Curtail, ...
plots.CurtailT... |
function evpdf = evpdfdbw(y,mu,sigma)
evpdf=1./sigma.*exp((y-mu)./sigma).*exp(-exp((y-mu)./sigma));
end
|
function [all_theta]=onevsall(X,label,y)
lambda=.3
n=size(X,2);
theta_t=zeros(n,1);
all_theta=zeros(label,n);
options=optimset('GradObj','on','MaxIter',50);
for i=1:label
[all_theta(i,:)]=fminunc(@(t)IrisCost(t,X,(y==i),lambda),theta_t,options);
end
|
clear all; close all; clc
matriz = importdata('dados_grupo1.txt');
vazao = matriz.data;
temp = datetime(matriz.rowheaders);
%--------Média Semanal---------%
%Considerando o ciclo contendo 7 dias;
%Desconsiderano o resto da divisão por 7, por exemplo, se temos 37
%dias, consideramos 5 semanas e desconsideram... |
function [FE, Fit, Obs, Date] = ExpandingWindowFAVAR(X_st, Y, plag, K, det, slowcode,Dates, StartOoS, type)
% Refits the FAVAR and forecasts one-period ahead in an expanding window style
% For iterative study use the function in a for-loop
%-------------------------------Inputs-------------------------------------
% ... |
addpath('../../common')
Fadc = 614e6; % MHz
axi_clk = 156.25e6;
taps_per_chan = 7;
number_channels = 128;
number_subband = number_channels/2; % really will generate 2 overlapping PFB
filt_len = taps_per_chan*number_subband;
pass_band = 1;
stop_band = 20;
pass_band_freq = (0.6)/(number_subba... |
function [C,timingfile,userdefined_trialholder] = UnityVR_userloop(MLConfig,TrialRecord)
% A userloop file is a MATLAB function that provides information of the
% next trial (stimuli, name of the timing file, condition number, block
% number, etc.) on behalf of the conditions file, the condition selection
% file, the ... |
function result = nelderMead(objFnc, numVars, lowerLimits, upperLimits, options)
%NELDERMEAD Constrained Nelder-Mead algorithm
%
%Input values:
% objFnc - The objective's function handle
% numVars - Number of variables of the problem
% lowerLimits - The variables' lower bound
% upperLimits... |
function obj = assembleEdgeConnect( obj, mesh )
%myFun - Description
%
% Syntax: output = myFun(input)
%
% Long description
edge2d = mesh.mesh2d.BoundaryEdge;
Nz = mesh.Nz; % num of vertical layers
Ne = edge2d.Ne * Nz; % num of edge
obj.Ne = Ne;
% connect element
obj.FToE = [];
for n = 1 : Nz
ind1 = ( edge2d... |
%% DefineSL.m
%
% SEE: phantom
%
% Matthieu Guerquin-Kern, Biomedical Imaging Group / EPF Lausanne,
% 30-10-2009 (dd-mm-yyyy)
SL.FOV = 1*[1,1]; % the FOV actually changes the shape of the phantom
% This head phantom is the same as the Shepp-Logan except
% the intensities are changed to yield higher contrast in
% ... |
% totalerror
%
% Plot contour map of the total error in y = m1 + m2*x. x is LSAT and y GPA
% for the 15 law schools in the data of Diaconis and Efron (1983).
% clear all variables
clearvars;
% read the data
D=csvread('GPAvsLSAT.csv');
x=D(:,1);
y=D(:,2);
% plot the data
figure(1);
plot(x,y,'ko','MarkerFaceColor','m'... |
% batch job to test different estimation strategies, forcing Vart and f to be correlated.
% call_2_s kinetix.m , which call_2_s kinetix_lsq.m
global rpenalty
NITER=1;
noise = 0;
reglevels = [0:100:1000];
all_f = [];
all_sig = [];
all_est = [];
bias = zeros(NITER,length(reglevels));
variance = zeros(NITER,length(reg... |
%softmax generalization logistic loss for multiclass classification
function [loss,gradient] = MCL(preds,labels)
% indices of targets
iy = sub2ind(size(preds),1:size(preds,1),labels')';
% loss
expreds = exp(preds); % n x k
sumexp = sum(expreds,2); % n x 1
loss = sum(1-expreds(iy)./sumexp);
% gradient
gradient = -ex... |
classdef CloudQueueClient < azure.object
% CLOUDQUEUECLIENT Class to provide access to the CloudQueue client
% A client object is used to perform many basic operations when working with
% queues.
%
% Example:
% % Create the Client
% az = azure.storage.CloudStorageAccount;
% az.loadConfigurationSettings();
% ... |
function [ indThreeWhite ] = isThreeWhite(obj, bars )
%%
% 《日本蜡烛图技术》,1998年5月第一版,P151
%% Parameters
upShadowLimit = 0.001*obj.zoomFactor;
%%
ind1 = (bars.yinYang(1:end-2)==1)&bars.lineLenUp(1:end-2)./bars.barCeil(1:end-2)<upShadowLimit;
ind2 = (bars.yinYang(2:end-1)==1)&bars.lineLenUp(2:end-1)./bars.barCeil(2:end-1)<up... |
function log = cora_filtered_oscillator_8(saveFig,savePath,filename, diff, show, timeStep, tTerms, zOrder, pOrder,strategy)
HA = filtered_oscillator_8_ha();
options.enclosureEnables = [3 5];
options.guardIntersect = 'polytope';
Zdelta = [0.05;0.1;0;0;0;0;0;0;0;0];
% options
Zcenter = [0.25;0;0;0;0;0;0;0;0;0];
options... |
img=imread('cameraman.tif');
[Gx,Gy]=imgradientxy(img,'sobel');
[Gmag, Gdir] = imgradient(Gx, Gy);
%Uncomment the code below to visualize Gx and Gy
imshowpair(Gx,Gy,'montage')
%Uncomment the code below to visualize Gmag and Gdir
imshowpair(Gmag,Gdir,'montage')
|
function [ Q ] = gauss ( Q, Ld, Lc )
%GAUSS Gaussian function (cutoff allowed)
%
% Usage: [ Q ] = gauss ( Q, Ld, Lc )
%
% Inputs: Q - a grid over which to compute function
% Ld - decorrelation length of gaussian function
% [Ld}- optional cutoff value of correlations
%
... |
function[avgdata]=movingaverage(data,ptstoaverage)
% computes a moving average of the data
% Useage: movingaverage(data,#pts_to_average)
filterindex=fix(ptstoaverage./2);
filter=filterindex+1-abs(-filterindex:filterindex);
filter=filter./sum(filter);
% I think I should be able to do it using filter, e.g.,..
... |
function [fitresult, gof] = fit_stiffness(elongation, force, loc_cut, displ_MTJ, displ_OTJ)
global subject_id plot_check plot_achilles
% 0 = use fit through zero
% 1 = use fit with free beginning
choice_of_fit = 1; %VAR
%% Fit: 'Stiffness fit'.
[xData, yData] = prepareCurveData( elongation(1:loc_cut), force... |
newtonSystem([1;1],1e-8); |
function [A,Na_new]=Unimolecular_Decay(A,Na,Pf)
r1=rand(Na,1);
dtemp=(r1<Pf);
A(dtemp,:)=[];
Na_new=size(A,1);
|
% data = dlmread("hacked.csv");
test = dlmread('.csv');
x=test(:,1);
y=test(:,2);
z=test(:,3);
surf(x,y,z);
|
function [ z ] = normalized1d( dat,rangedata )
x = double(reshape(dat,1,[]));
%x = double(reshape(instanceData.depth,1,[]));
%normalized = double(x);
normalized = ((x-min(x))/(max(x)-min(x))) * rangedata; % INTI NYA DISINI
z = uint8(reshape(normalized,size(dat)));
end
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Compute the test statistics of the functional connectivity matrix
%
% To be tested.
%
% Inputs:
%
%--corrTRegion (correlation matrix re-organized into a matrix with row the
%number of time series points, and column the number of pair-wise regions
%
%--code (index code ... |
function OutputMatrix = my_sort_descending(Matrix,n,m,c)
%
% OutputMatrix = my_sort_descending(Matrix,n,m,column)
%
% This function sorts in descending order a n*m matrix by a given column
%
% Inputs & output of this function are:
%
% Matrix: the matrix to be sorted
% n: number of rows of matrix
% m: number ... |
function [ dim_x, dim_y ] = gerb_preproc(line_count)
% Preprocesses the file data in preparation for rasterizing the image. This
% includes finding the bounds of the figure, grounding it back to the
% origin if it is too far away, and mirroring the image across the x axis
% to unify coordinate systems.
% Input Par... |
% laserRamp.m
% Odorized box alternates every minute
% Six 1 minute test segments
% Four 1 minute training segments with an iv second pre-laser
% Six 1 minute post-test segments
% Constants
global ts;
center = 0;
% Format: {time, visStim}
% [Mode, K0, K1, K2]
visStimN = [1, 0, -1, center];
LaserOn = '000... |
function depl_corpsus( mat_in, mat_out )
S = load(mat_in);
options = optimset('MaxIter', 100, 'Display', 'off' );
lb = zeros( size(S.P,2), 1 );
ub = ones( size(S.P,2), 1 )+0.02;
r_ns_ln = lsqlin( S.P, S.cdice, [],[],[],[],lb, ub,[], options);
r_ns_pr = opt_prod( S.P, S.cdice );
save( mat_out... |
% Starter code prepared by James Hays
% This function creates a webpage (html and images) visualizing the
% classiffication results. This webpage will contain
% (1) A confusion matrix plot
% (2) A table with one row per category, with 3 columns - training
% examples, true positives, false positives, and false ne... |
clc;
sh_dens = 739.2068;
sp_heat = 2692.4;
sh_vis = 0.4252;
%t_cond = x(4);
t_cond = 0.1015;
do = 0.019;
% nb = 10;
% lbi = 0.68;
% lbo = 0.76;
% lbb = 0.012;
% ltp = 0.023;
% as = 0.034;
us = 2.327;
rtw = 1.174e-6;
c_depo = 277.8;
c_supp = 1.417e-13;
e_activ = 48;
reys = sh_dens * us * ... |
function [ extractor ] = getMusicExtractor(framelength, overlap)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
function[comb_enf, time] = musicExtractor(y,fs)
nominalFrequency = which_nominal_frequency(y,fs);
[comb_enf, time] = MUSIC_ENF(y, fs, framelength, overlap... |
%--------------------------------------------------------------------------
%% Deep Learning Basics : Utilities
%--------------------------------------------------------------------------
%
% This script implements a class called "utilities" that provides all the
% required utilities to perform transformations on the i... |
function gammatonegram_x=plotgammatonegram(x,fs)
fMin=125;
fMax=7e3;
nFilters=128;
windowTime=0.016;
hopTime=0.008;
gammatonegram_x=gammatonegram(x,fs,windowTime,hopTime,nFilters,fMin,fMax);
cf=flipud(ERBSpace(fMin,fMax,nFilters));
plotTimeFreq(20*log10(gammatonegram_x).',cf);
caxis([-90 -30]);
|
function [llikhood,C_d] = nHDP_test(Xid_test,Xcnt_test,Tree,beta0)
% Written by John Paisley, jpaisley@berkeley.edu
Voc = length(Tree(1).beta_cnt);
tot_tops = length(Tree);
D = length(Xid_test);
% collects statistics for updating the tree
B_up = zeros(tot_tops,Voc);
weight_up = zeros(tot_tops,1);
gamma1 = 5; % top-l... |
function dx=smd(t,x,theta,u)
omega = theta(1);
zeta = theta(2);
dx = [x(2);
u(t)-2*omega*zeta*x(2)-omega^2*x(1)];
|
function spc_calc_timeCourseFromStack (slices)
global spc gui
if ~nargin
slices = 1:spc.stack.nStack;
end
%%%%%%%%%%%%%%
[PATHSTR,fileNAME,EXT] = fileparts(spc.filename);
cd(PATHSTR);
fname = [fileNAME, '_ROI2'];
evalc(['global ', fname]);
if ~spc.switches.noSPC
nChannels = spc.datainfo.scan_rx;
else
... |
clear
clc
close all
A = tf([1.3],[1,1.3])
G = tf([1],[.00303,0,0])
H = tf([1000],[1,1000])
GOL = A*G*H;
bode(GOL)
margin(GOL)
figure()
rlocus(GOL)
C1 = tf([1,1],[1,650])
C2 = tf([1,5],[1,300])
C = C1*C2;
CGOL = C*GOL
bode(CGOL)
margin(CGOL)
figure()
rlocus(CGOL)
K = 5;
GCL = K*CGOL/(... |
%{
/////////////
PROGRAM NOTES
/////////////
To Determine AntennaData
------------------------
1)Name of file
2)Name of spreadsheet
3)Data Range
To Determine RotAngle
----------------
1)Rotate the Polar plot so the main lobe is centered at 0 degrees
*This will require verification using the polar plot
2)RotAngle = ... |
% inverted pendulum - parameter file for hw8
addpath ./.. % adds the parent directory to the path
beamParam % general pendulum parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% State Space Pole Placement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tuning parameters
tr_th = .15;%.35; ... |
% Reformat output heatmap: rotate & permute color channels
function [joints, heatmapResized] = processHeatmap(heatmap, opt)
% numJoints = opt.numJoints;
numJoints = size(heatmap,3);
heatmapResized = imresize(heatmap, [opt.dims(2) opt.dims(1)]) ;%- 1;
heatmapResized = permute(heatmapResized, [2 1 3]);
joints = heatmapTo... |
function weights = EntropyWeight(R)
%% 熵权法求指标权重,R为输入矩阵,返回权重向量weights
[rows,cols]=size(R); % 输入矩阵的大小,rows为对象个数,cols为指标个数
k=1/log(rows); % 求k
f=zeros(rows,cols); % 初始化fij
sumBycols=sum(R,1); % 输入矩阵的每一列之和(结果为一个1*cols的行向量)
% 计算fij
for i=1:rows
for j=1:cols
f(i,j)=R(i,j)./sumBycols(1,j);
end
end
lnfi... |
function [m] = combination(u)
B=cell(2,1);
B{1,1}=stretchAudio(u',0.5);
B{2,1}=zeros(1272,2);
t=cell2mat(B);
m=t';
end
|
function [m2] = gen_m2(m2,d)
m2.decomp_mode=1;
m2.operators=@operators;
m2.compute_output_functional = 0;
m2.use_scm = 0;
m2.detailed_simulation = @detailed_simulation;
end
function [A,r] = operators(model,d)
if model.decomp_mode == 1
A = d.AII2;
r = d.r2;
end
if model.decomp_mode == 2
... |
function legos = generateLego(RGB)
% Takes in a M x 3 matrix containing RGB colors
% Gives back a 1 x M cell array containing the legos
% The legos are [30x30x3]-matrices in RGB
% RGB range: [0,1]
load('brickStructure.mat');
legos = cell(1,length(RGB(:,1)));
%%%%%%%%%%%%%%%%%%% CREATE LEGOS %%%%%%%%%%%%%%... |
%%
[num,den] = tfdata(C,'v');
tempFiltered = filter(num,den,tempData);
%%
figure;
plot([tempData,tempFiltered]);
%%
temp = [tempData,tempFiltered];
figure;
pwelch(temp - mean(temp),3000,1500,3000,5000);
%%
fbFilter = designfilt('lowpassiir', 'FilterOrder', 4, 'PassbandFrequency', 600, 'PassbandRipple', 0.01, 'SampleR... |
function [output1,output2] = createGroupColorMaps(inputImages,groupVector,varargin)
% Make an outline and filled colormap for cells in inputImages based on groups in groupVector
% Biafra Ahanonu
% started: 2020.04.18 [20:09:25]
% inputs
% inputImages: [x y N] matrix where N = # of cells
% groupVector: [1 N] vec... |
%% make_grating_pattern
clear all; clc
filename='Pattern_026_drifting_grating_9px_stripes';
path2arenaImage='C:\Users\amoore\akm_matlab\Panels\panels-matlab_071618\Patterns\make_pattern_files\older patterns\arena_image_vertical_grating_9px.mat'
%% Make pattern
numOfPanelsAcross=9;
numOfPanelsVertically=2;
LEDdo... |
%Question 4
[data, TEXT, raw] = xlsread('nutrients.xlsx');
food_items = TEXT(2:end, 1:2);
X = data(:,1:end-1);
disp('4a)');
figure(1);
J = [];
cluster_centres = [];
for k=2:10
[idx, C, sumd] = kmeans(X, k, 'Start', 'sample', 'Replicates',100, 'MaxIter',200);
J = [J; sum(sumd)];
cluster_centres = [cluster_... |
% ====== Add Utility Toolbox and SAP Toolbox to the search path
%addpath d:/users/jang/matlab/toolbox/utility
%addpath d:/users/jang/matlab/toolbox/sap
% ====== Set up the directory of wave files
waveDir='D:\users\jang\books\audioSignalProcessing\voiceRecording\digitLetterRecording\waveFile\921510';
if exist(waveDir)=... |
function[Fang] = calc_fiberang2(X,F,k)
%Undocumented
%CALC_FIBERANG - calculates the angles of the fibers at each points and returns them in
%the form of a field in F and a Length array
% k: number of lag, the number of continous vertices for tangent angle calculation
for fi=1:length(F)
fv = F(fi).v;
Lf = leng... |
function im_out = reconstructFromGradient(I, gx,gy)
% Make sure I is double
[imh, imw, ~] = size(I);
im2var = zeros(imh, imw);
im2var(1:imh*imw) = 1:imh*imw;
% argmin(Ax - b)^2 x(vector): imh * imw
% GX
M = imh * imw;
N = imh * imw;
% constrcut sparse with r,c,v
NUM_ROWS = (imw-1)*imh + imw * (imh-1);
rcv = zeros(... |
clear all
close all
clc
pathA = '..\AnnotatedFaceImageDataBases\Helen\TrainImages\';
list = dir([pathA '*.jpg']);
n = length(list);
idList = {};
for i = 1:n
idList = union(idList,list(i).name(1:end-4));
fprintf(1,'%d/%d\n',i,n);
end |
clear; clc; close all;
w0 = double(rgb2gray(imread('w0.png')));
w1 = double(rgb2gray(imread('w1.png')));
w2c = double(rgb2gray(imread('w2c.png')));
w3c = double(rgb2gray(imread('w3c.png')));
im3_im0=[
264 105
369 84
257 252
367 239
152 141
146 242];
im0_im3 = [
134 10
231 8
132 128
231 127
12 20
11 ... |
function [Hf, Ia, V] = Gau_lower_pass(IA)
% clc
% clear all
% close all
% IA = double(imread('art-depth.png'));
% if (IA >=2)
V = zeros(1,2);
[f1,f2] = freqspace(size(IA),'meshgrid');
D = 100 / size(IA,1); % 100
r = f1.^2 + f2.^2;
Hd = zeros(size(IA));
for i = 1 : size(IA,1)
fo... |
function qtfm_test
% Run qtfm test code.
%
% Copyright © 2008 Stephen J. Sangwine and Nicolas Le Bihan.
% See the file : Copyright.m for further details.
current_dir = pwd;
root = [qtfm_root filesep 'test'];
cd(root)
test
cd(current_dir);
% This file is provided so that test code can be run from the Start menu.
% I... |
function [responseArray, timeVector, F0Array, ObjIdx] = findRespArray(objarray, ROImaskidx, fields)
%FINDRESPARRAY Extract the aligned, interpolated response time-series for
%all trials which match the specified parameters, across an object array
% [responseArray, timeVector, F0Array, ObjIdx] = findRespArray(objarray, ... |
% He Feng
% EE 440 HW 2 Problem 3
close all;
clear all;
% Read the original image.
image = imread('2_1.bmp','bmp');
% Plot the original image.
subplot(1,2,1);
imshow(image)
title('The Original Image');
% Get the negative of each R G B images.
% Plot the negative image.
negative(:,:,1)=255-image(:,:,1);
negative(:,:,2... |
%% Power threshold
detect.threshold = 1000;
detect.min = detect.threshold;
detect.max = detect.threshold;
%% CHANGE PARAMETERS AS NEEDED
% Radio Setings
% USRP Configuration stuff
thisRadio = 'C'; % use 'S' to configure it as Server, use 'C' to configure as client
r.Platform = 'N200/N210/USRP2';
r.IPaddress ... |
function [segEncontrados,finales,vecs,centros,segids,resconexion,resol] = esquinas(puntos,segmentos,conexion,radio,maxangdif)
vecs = zeros(length(segmentos),2);
centros = zeros(length(segmentos),2);
finales = zeros(length(segmentos),2);
resol = zeros(length(segmentos),2);
segids = zeros(length(segme... |
function [new,r_int,r_error] = calc_model_vel(t,u,r,v,tf,graphs)
%CALC_MODEL_VEL - Summary of this function goes here:
% --> INPUT PARAMS:
% @param[in] t,u,r,v,tf: time, input, range, speed, transfer function
% (all vectors must have the same length)
% --> OUTPUT PARAMS:
% @param[out]... |
function x_new = proprnd(x, An, dn, C)
global eee
p = size(An,2);
n = size(An,1);
eee = chi2rnd(ones(n,1));
model = train(eee, sparse(ones(n,1)), sparse(An), ...
sprintf('-s 0 -e 1e-6 -q -c %f', C));
x_new = (model.w);
% x_new = ((An'*An+1e-3*eye(p))\An'*e)';
% x_new = mvnrnd(w0, Sigma, 1); |
function allPawDataFiltered = filterPawData(RatData)
for i = 1:length(RatData.VideoFiles)
end
end
function [allPawDataFiltered] = KnockoutCoordinates(RatData)
for i = 1:length(allPawData)
pawPointsData = RatData.VideoFiles(i).Paw_Points_Tracking_Data;
pawPointsData = allPawData{1,i};
... |
function data = buildDataPacket(speed, dir, turn)
% data = buildDataPacket(speed, dir, turn)
%
% Build the data part of a packet with a single speed/dir/turn command.
% Note: dir should be given as 128 (for forward) or 0 (for reverse);
data = zeros(1,30);
for i=1:15
data((i-1)*2+1) = speed;
data(i*2)... |
function [X]=evaluate_pop(X,size,n)
for i = 1:size
[error_i,cvs_i] = f(X(i,1:n));
X(i,n+1)=error_i;
X(i,n+2)=cvs_i;
end
end
|
function routineModelComp_compareModelsFit(R,WML)
if nargin<2
spreadSession(R);
else
spreadSession(R,WML);
end
closeMessageBoxes;
dttag = {'spec','all'};
close all
%Typelist
%% Sublist
[SAMod,mergeLabels] = loadABCGeneric(R,{'SAMod','mergeLabels'});
%% Get list of data
typlist = [2 1 3 4];
modFit = 0
if modFi... |
function saveSoln(s, fname, id, desc)
% SAVE - Save solution.
%
if nargin == 1
fname = 'soln.xml';
id = 'solution';
desc = '--';
elseif nargin == 2
id = 'solution';
desc = '--';
elseif nargin == 3
desc = '--';
end
stack_methods(s.stack_id, 107, fname, id, desc);
|
clc; clear all; close all;
numsig = 20; # numerot du signal
M = 4000; # nombre d'echantillons du signal
nue = 20000; # frequence d'echantillonage
N = 8192; # nombre de points de la TFD
analysespectrale(numsig,M,nue,N)
|
%% Fixed Output Neuron
classdef FixedOutput < Neuron
% Memory assicatied to this neuron
properties
output = 0.;
end
methods
function obj = FixedOutput(val)
obj = obj@Neuron();
obj.output = val;
end
% Called to make decisions
... |
function sol = EulerHeunSE3N(vecField,action,p,h)
%Computes one time step update with Lie Euler Heun's method
k0 = zeros(length(p),1);
k1 = vecField(k0,p);
k2 = vecField(h*k1, p);
sol = action(exponentialSE3N(h/2*(k1+k2)),p);
end |
function imTrialsToText(DataDir, FileBaseName, inclFiles, outPath,...
outName, chans, chanKeeper)
%DataDir - self-explanatory, no filesep at end
%FileBaseName - wildcard, e.g. *main*
%inclFiles - vector of files to include by their numbering in the
%directory, e.g. [1:50] includes the first 50 files. Leve empty fo... |
% ECE 4006 Real-Time DSP with Dr. Barnwell Fall 2005
%
% Section C Group 1
% Lucas Rangit MAGASWERAN
% Vincent Lacey
% WaiLing Chan
% Justin
% Jaimen
%
% Initialization
clc;
close all;
clear all;
%T = timer;
display('Initialization Complete.');
%Variables
fps = 2;
disp('Running frameGra... |
classdef panner < matlab.mixin.SetGet
%PANNER 此处显示有关此类的摘要
% 此处显示详细说明
% lint settings
%#ok<*MCSUP>
properties (GetAccess = public, SetAccess = immutable)
parent % axes
dlineA uipanner.dragLine % 1st dragLine
dlineB uipanner.dragLine % 2nd dragLine
rect % Recta... |
function output = detectSkin(oriImg, tlow, thigh)
%get size
[m, n, ~] = size(oriImg);
%color transform
cbcr = rgb2ycbcr(oriImg);
cbcr3 = cbcr(:, :, 3);
%skin thredhold
for i = 1 : m
for j = 1 : n
if((cbcr3(i, j) > tlow) && (cbcr3(i, j) < thigh))
cbcr3(i, j) = 255;
else
cb... |
%%%%% Abenezer Taye %%%%%%%%%%%%%%
%%%%% Curve fitting with tournament selection %%%%%
%%%%% North Carolina A&T State University %%%%%%
%%%%% Date: April 2, 2020 %%%%%%%%%%%%%%
clear all;
clc;
x=[0:1:100]';
y=4*exp(-x) +6*x.^3 + 2*x;
y = awgn(y,0.01); % 0.01 is the SNR
Error =zeros(1,20);
% A simpl... |
%This script generates moving noise
% creates several frames of noise and plays by picking a random one
Screen('Preference', 'SkipSyncTests', 1) %REMOVE THIS LATER!!!!
%--------------------
% INITIAL SET-UP
%--------------------
% Clear the workspace and the screen
sca;
close all;
clearvars;
% Setup PTB with some d... |
function muY = opperPredictObservable(pred, fwdFunc, ...
fwdParam, conf )
%OPPERPREDICTOBSERVABLE Predicts observable y = g(f)
% Detailed explanation goes here
% pred : the preditive distribution
% fwdFunc: the fwd function g
% fwdParam: The parameters of the fwd Function
% con... |
function Ahat = colnorm(B,n)
% A = colnorm(B,n);
% If only one argument is used the columns of matrix B is normalized
% Otherwise, a column normed matrix B*n is created
if nargin > 1
B = randn(B,n);
end
% normalizing the columns of Dictionary
for i = 1:size(B,2)
B(:,i) = B(:,i)/norm(B(:,i));
end
Ahat = ... |
fileID = fopen('predictions_val_gen_avg_max_l28.csv','w')
A ={'VideoName','ValueExtraversion', 'ValueAgreeableness', 'ValueConscientiousness', 'ValueNeurotisicm','ValueOpenness'};
fprintf(fileID, '%s,', A{1,1:end-1});
fprintf(fileID, '%s\n', A{1,end});
for i=2:2001
for j=1:2000
if strcmp(VideoName_test{i},Vid... |
for gamma=[0.50 0.10 2.0 4.0 ]
gammaCorrection = inv(gamma)
images = imread('C:\Users\praveen\Desktop\imgp\1\Input Images\11.png');
[rows column depth] = size(images);
if depth==3
images = rgb2gray(images);
end
output = zeros(rows,column);
for l=1:rows
for m=1:column
... |
function DLDA = DLDA(Alpha,Beta)
%Rolling Moment Due to Ailerons
a=[-.041 -.052 -.053 -.056 -.050 -.056 -.082 -.059 -.042 -.038 -.027 -.017
-.041 -.053 -.053 -.053 -.050 -.051 -.066 -.043 -.038 -.027 -.023 -.016
-.042 -.053 -.052 -.051 -.049 -.049 -.043 -.035 -.026 -.016 -.018 -.014
-.040 -.052 -.051 -.052 -.048 -... |
function xyz = mth_lsd2cart(e_b, e_c, a, az, el)
% MTH_LSD2CART comptues Cartesian coordinates given ellipsoid
% coordinates.
%
%-----------------------------------------------------------------------
% Copyright 2020 Kurt Motekew
%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0... |
%chuangdu=length(match);
%c = strrep(sunzibingfa, ' ', '');
c = strings;
%char(c);
c(:)=match{:};
%cLen = length(c);
%raw1d(find(cellfun(@(sunzibingfa)any(isnan(sunzibingfa)),raw1d)))=mat2cell('useless');
%╠Š╗╗cellÍđÁ─NaN▒ń│╔useless
tongji_guwen=tabulate(c(:,1));
tongji_guwen=sortrows(tongji_guwen,-3)... |
clear all; clc;
%% Definiciones
titleSize = 24;
labelSize = 22;
M = 1024;
N1 = 21; % Largo del Sinc
N2 = 101;
N3 = 1001;
wc = 2*pi/3; % Frecuecia de corte del filtro
n1 = 0:1:(N1-1); % Muestras del Sinc
n2 = 0:1:(N2-1);
n3 = 0:1:(N3-1);
%%
h1 = (wc/pi)*sinc((wc/pi)*(n1 - (N1-1)/2));
h2 = (wc/pi)*sinc((wc/pi)*(n2 - (... |
function data = conv_hdecode(code,ieff,en_mode)
%CONV_HDECODE 卷积码硬判决译码函数
% 采用Viterbi译码
%
% 输入参数:
% code 1*n double 卷积码码流
% ieff 2,3 1/编码效率
% en_mode 0,1 编码模式: 0->不收尾, 1->收尾
% 返回值:
% data 1*(n/ieff) 卷积码码流
% 定义译码中的常量
CONV_CODE = [0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1;..... |
function [PP_CFG, PP_DATA] = RTK_postprocessing(PP_CFG, PP_DATA, CFG, DATA, test_idx)
[PP_CFG, PP_DATA] = RT_postprocessing_core(PP_CFG, PP_DATA, CFG, DATA, test_idx); |
% *Input arguments:*
%
% cost
% .fcn @lossHinge - called to get here
% .a slope of loss function
% .b corner points of loss function [1 x 2 ]
% m input mean [D x 1 ]
% S input covariance matr... |
close all
clear all
% Some images
load clown % scale = 81
clown = X;
load spine % scale = 64
spine = X;
load flujet % scale = 64
flujet = X;
camera = imread('cameraman.tif'); % scale = 256
% Image to use to test 2D
im = camera;
scale = 256;
im1 = double(im);
% Generate Meta Image and Filter
inImg = GenerateMetaImage... |
function [cfr] = rls_primal (X, y, opt)
% rls_primal(X,y,opt)
% computes a classifier for the primal formulation of RLS.
% The regularization parameter is set to the one found in opt.paramsel.
% In case of multiclass problems, the regularizers need to be combined with the opt.singlelambda function.
%
% INPUTS:
% -OPT:... |
n = 20;
x = -1:2/n:1;
y = exp(x);
xx = [-0.95 -0.05 0.05 0.95];
yy = exp(xx);
p = LagrInterp( x,y,xx );
disp(yy);
disp(p);
figure(1);
plot(xx,yy,xx,p,'ro');
legend('f(x)','Pn(x)'); |
function [OutStruct] = matchObjBtwnTrials(inputImages,varargin)
% Registers images to a set imaging session then matches objs between sessions to one another and outputs the alignment indicies for a single global cell across sessions. All images cropped to the minimum x,y dimension among all the input imaging session ... |
%%%%%%%%%%%%% DEVELOPMENT ECONOMICS - HOMEWORK 2: QUESTION 2 %%%%%%%%%%%%%%
% Author: Didac Marti Pinto (CEMFI)
% Date: February 8th, 2019
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% kappa wtf is wrong with it?
% Utility function something wrong. it is increasing and convex in h... |
% script to generate VSI pulses
% Jia Guo@UCR, 2019
%% generate RF, G pulses
dt = 1;
gamma = 4257; %Hz/Gauss
% RF
rf = [];
pw180 = 0.5; % ms, 180 FA
pw90 = 0.248; % 90 FA
pwSFA = 0.4; %ms, small flip angle RF
pwcomp = pw180 + pw90*2;
n180 = round(pw180*1000/dt);
n90 = round(pw90*1000/dt);
nSFA = roun... |
function [b] = zadatak3 (A)
[n,m] = size(A);
b = 1:m;
for j = 1:m
min_ind = 1;
for i = 1:n
if A(i,j)<A(min_ind, j)
min_ind = i;
end
end
b(j) = min_ind;
end
end |
% tagList
% Object encapsulating a list of valid tags and tag groups
%
% Usage:
% >> tList = tagList(code)
%
% Description:
% tList = tagList(code) creates an object that holds a list of valid tags
% and tag groups associated with code
%
% Additional information:
% The tagList group also contains static me... |
clc
clear all
close all
format compact
Number_of_analysis=1000;
for iii=1:Number_of_analysis
%% Initialisation and Intensity profiling
I_background= 1000; %counts per event
N_cells=1; %amount of systems we are investigating
max_signal_to_noise_scale=20; %the highest intensity of an event
N_S=5; %# intensity ... |
## Author: valentin <valentin@valentin-laptop>
## Created: 2017-05-06
function [v_histogram] = get_histogram (v_signal, f_start, f_stop, n_bins)
f_step = (f_stop - f_start) / n_bins;
v_edges = f_start : f_step : f_stop;
v_histogram = histc(v_signal, v_edges);
v_histogram = v_histogram / length(v_signal);
endfunction... |
function msgPrint(msg,handles)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
set(handles.txtMsg,'String', msg);
end
|
function [alpha, count]= weakwolfe(f,d,x0,X,y)
alpha=0; t=1; beta=Inf;
c1 = 1e-4; c2 = 0.9;
[f0 g0] = f(X, y, x0);
count = 1;
while (1 ~= 2)
x1 = x0 + t*d;
[f1 g1] = f(X, y, x1);
count = count +1;
if f1 > f0 + c1 * t * g0
beta=t; t=(alpha+beta)/2;
else if g1 < c2 * g0
else
return;
end
end
alp... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fits HGFs for each subject/block and simulates traces
%
% Lukas Vogelsang, May 2018
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function hgfparams = single_subject_HGF_analysis(fol_name, name,default_config)
%... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.