text stringlengths 8 6.12M |
|---|
clear all
close all
clc
xml_file = 'maksssksksss358.xml';
image = 'maksssksksss358.png';
img = im2uint8(imread(image));
figure, imshow(img)
objects = extract_from_xml(xml_file);
labels = [''];
for i = 1:length(objects)
I = imcrop(img,[objects(i).xmin,objects(i).ymin,objects(i).height, objects(i).width]);
I =... |
function [h, hdata] = mlphess(net, x, t, hdata)
%MLPHESS Evaluate the Hessian matrix for a multi-layer perceptron network.
% Check arguments for consistency
errstring = consist(net, 'mlp', x, t);
if ~isempty(errstring);
error(errstring);
end
if nargin == 3
% Data term in Hessian needs to be computed
hdata = dat... |
function measureLatency()
global trackingParams;
latSpacing = .25;
nMeasures = 500;
setLaserDistribution({@laserLatencyMeasure,[]});
disp('Set laser distribution to: @laserLatencyMeasure');
trackingParams.latencyList = [];
trackingParams.oldInvert = trackingParams.invert;
trackingParams.invert = true;
... |
function CS4640_A6_driver
% CS4640_A6_driver - driver for A6 functions
% On input:
% N/A
% On output:
% N/A
% Call:
% CS4640_A6_driver
% Author:
% Kyl Heaton
% UU
% Spring 2018
%
binary = imresize(imread('binary.png') > 1, [15, 15]);
lights = imread('lights.jpg');
S_model = CS4640_Hough_... |
function [ RpriorCholj, KcBc, Atj, wtj, retLikelihoodPred ] = create_prior( theta, ...
MAX_LEVEL_M, knotsb, RpriorCholb, KcBb, dataj, varargin )
%% CREATE_PRIOR creates prior values
% for current region and ancestry; this function contains optional input
% and output arguments depending on whether the level is ... |
function CSX = CreateSIW_Ports(CSX, SIW, resolution)
%% FeedingPorts
CSX = AddMetal( CSX, 'PEC' );
portstart = [ -SIW.FL-SIW.LX/2, -SIW.LY/2, SIW.SH];
portstop = [ -SIW.LX/2, SIW.LY/2, 0];
[CSX,port{1}] = AddMSLPort( CSX,900, 1, 'PEC', portstart, portstop, 0, [0 0 -1], 'ExcitePort', true, 'FeedShift', 10*reso... |
function X = read_acousonde(fbase,depid,species,owner,df,fnums,chs)
% read_acousonde(fbase,depid,species,owner)
% or
% read_acousonde(fbase,depid,species,owner,df)
% or
% read_acousonde(fbase,depid,species,owner,df,fnums)
% or
% read_acousonde(fbase,depid,species,owner,df,fnums,chs)
%
% ... |
clear params;
params.Gridjob.runLocal = true;
params.Gridjob.jobname = 'layer1Conn0p15only100Conns';
params.Gridjob.requiremf = 3000;
params.ProbabilisticConn.inCorrFile = '../layer1Cov/patchCorr.mat';
params.ProbabilisticConn.outWeightsFolder = 'layer1Conn0p15only100Conns';
params.ProbabilisticConn.numExc = 100;
para... |
function a = Acceleration( positionForce, force, centreMasseGlobal, momentInertie, vi )
%Acceleration Calcul l'accélération angulaire en fonction de force
%appliquée sur l'objet
% positionForce : vecteur position d'application de la force
% force : vecteur représentant la force
% centreMasseGlobal : position du c... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% energeticos.m
%This function calculate energy related room acoustic parameters Clarity,
%Definition and Center Time.
%A squared room impulse response should be inputed, with its sampling
%frequency.
function [C50,C80,D50,D80,CT]=energeticos(energia,Fs);
... |
%% 20180418_234506
%% Load VPAScan data
folder = 'N:\NaCsLab\Data';
f = load([folder '\20180418\' 'VPAScan_20180418_234506.mat']); % Description
filelist = f.filelist;
VPATempList = f.VPATempList;
%VPAslope = f.VPAslopeWM; %WM
%VPAoffset = f.VPAoffsetWM; %WM
fWavemeter = f.fWavemeter; %wavemeter frequencies
length(fi... |
function O_P=MPPT_PO(u)
deltaP=u(1);
deltaV=u(2);
power_old=u(3);
deltaP_old=u(4);
stepsize=u(5);
power=deltaP*deltaV/36;
d_power=power-power_old;
d_P=deltaP-deltaP_old;
if d_power>0
if d_P>0
O_P=stepsize;
else
O_P=-stepsize;
end
else
if d_P>0
O_P=-stepsize;
else
O_P... |
function [informaMutuaMax, informaMutua] = InfoMutua6c(fonte,fonte1)
[query,Fs] = audioread(fonte);
[target,Fs_] = audioread(fonte1);
target_esq = target(:,1);
q = audioinfo(fonte1);
q = q.Duration;
query_esq=query(:,1);
query_esq = query_esq(:);
step = round(length(query_es... |
function [UVW]=HKLtoUVWnotemp(a,b,c,alpha,beta,gamma,HKL)
%CTERun License
%Copyright (c) 2012, The Kriven Research Group. All rights reserved.
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions are met:
%1. Redistribution... |
clear all ; close all
subs = {'alex','dina','genevieve','jeremie','karl','russell','tegan','sukhman','valerie'} ;
for sub=3%:length(subs)
cd(['c:/shared/badger_eeg2/',subs{sub}]) ; ls
mov = dir('weights*movie*set') ;
EEG = pop_loadset(mov(1).name) ;
EEG = pop_chanedit(EEG,'lookup','C:\eeglab8_0_3_5b\plugins\di... |
function [ out ] = createTemplate( letters,folder )
%Receives the letter and saves in the folder as specified
end
|
function runLetterDescrip()
% function runLetterDescrip()
% Inputs: None
% Outputs: None (creates image with instructions for Letter test)
close all;
plot(0)
color = [rand() rand() rand()];
set(gca,'Color',color)
axis([0 100 0 100])
s = sprintf('You will be shown a 2-dimensional\narray of characters. You will be\nask... |
function plotflow(x,y,u,maxamp)
% USAGE : plotflow([x,y],u,[maxamp])
% FUNCTION : Shows the 2D flow stored as a complex image u, at the position (x,y). If
% the field 'maxamp' is present, all the values of abs(u) that are larger
% than maxamp are saturated to this value.
%
% The choice of the representation is eith... |
% Collect baroclinic tide models and interpolate to track points
% Arin Nelson
% on 04/09/2021
%
% Last updated by Arin Nelson on 09/12/2021
%==========================================================================
clc; close all;
% Switches
Switch = zeros(9,1);
Switch(01) = 0; % Read in Richard Ray's baroc... |
function x60l_h = importfile(filename, dataLines)
%IMPORTFILE Import data from a text file
% X60L_H = IMPORTFILE(FILENAME) reads data from text file FILENAME for
% the default selection. Returns the data as a table.
%
% X60L_H = IMPORTFILE(FILE, DATALINES) reads data for the specified row
% interval(s) of text fil... |
%%AMO, Projket II zestaw AK, nr 2, Arkadiusz Piorkowski 259079
clear all;
global N D x10 x20
%pass data
N=50; %number of samples
t0=0; %start time
tf=1; %end time
D=(tf-t0)/N; %Delta
x10=0; %x1(0)
x20=-1; %x2(0)
%Initial point for x1,x2 and u
ini... |
for i=10000:99999;
c=rem(i,10);
d=(rem(i,1000)-c)/10;
a=(i-rem(i,1000))/1000;
if i==(a*d+c)
disp(i)
end
end
|
[spmatrix, tokenlist, trainCategory] = readMatrix('MATRIX.TRAIN');
trainMatrix = full(spmatrix);
numTrainDocs = size(trainMatrix, 1);
numTokens = size(trainMatrix, 2);
prob_spam = zeros(numTokens, 1);
prob_non_spam = zeros(numTokens, 1);
count_spam_words = 0;
count_nonspam_words = 0;
% trainMatrix is now a (numTrai... |
function [x, x2, stat, aggregateSize, numAggregates] = ...
aggregationSweep_matlab(bins, x, x2, stat, aggregateSize, numAggregates, N, D, W, ratioMax, maxCoarseningRatio)
%AGGREGATIONSWEEP Loop over bins of undecided nodes and aggregate nodes by
% updating the stat flag array and aggregateSize array. x and x2 (=... |
function [val] = dU_min_TS(dU_f, x, dU_hist, des_h2, mpc, i)
x0 = x(2) * ones(mpc.N(i), 1) + mpc.Mp(:, :, i) * dU_hist;
val = (des_h2 * ones(mpc.N(i), 1) - x0 - mpc.M(:,:,i) * dU_f)' * (des_h2 * ones(mpc.N(i), 1) - x0 - mpc.M(:,:,i) * dU_f) + mpc.lambda(i) * dU_f' * dU_f;
end |
function [ new_I ] = histeqlzer( I )
[ n v ] = my_hist(I);
cumu = 0;
[ l w ] = size(I);
new_I = zeros(l,w);
pdf = v ./ (l*w);
cpf = zeros(1,256);
for i = 1:256
cumu = cumu + pdf(i);
cpf(i) = cumu;
end
tr = round(cpf.*255);
for i = 1:l
for j = 1:w
new_I(i,j) = tr(I(i,j)+1);
end
... |
function[A,a_ij,b_ij]=finding_corr_constants(X,U,a,b,c,d,noise_var,lambda)
C = X*X'/length(X)-noise_var*eye(size(X,1));
U = kron(U,U);
a_ij = -((a*a')./(c*ones(1,length(c))+ones(length(c),1)*c'));
a_ij = a_ij - ((a*b')./(c*ones(1,length(c))+ones(length(c),1)*d'));
b_ij = -((b*a')./(d*ones(1,length(c))+ones(length(c... |
function grafika3dc
%wykres konturowy
x = -4:.1:4; y = -3:.1:3;
[X,Y]= meshgrid(x,y);
Z = X.^2 - 2*(X.*Y) + 3*Y + 2;
contourf(X,Y,Z);
axis([-4 4 -3 3 -15 40]);
return
|
%* Unit Test for Type A (MET-Structured) LDPC Encoder
%*
%* References:
%* [1] Physical Layer Protocol, document ATSC A/322, ATSC, Sep. 2016
%* [2] MathWorks, "Error Detection and Correction", Available:
%* https://www.mathworks.com/help/comm/ug/error-detection-and-correction.html
%*
%* Author: T.J... |
function testOptions()
%testOptions Runs unit test of Dimple's option mechanism.
%
% This only tests the overall option mechanism, not the behavior
% of individual option settings.
env = DimpleEnvironment.active();
env.clearLocalOptions();
fg = FactorGraph();
v = Bit(2,2);
fg.addFactor('Xor',v);
% Make sure all ... |
lott = [0 0 0 0 0 0 0 0;
0 3 3 4 4 2 7 0;
0 0 9 9 0 2 7 0;
0 14 5 8 8 1 1 0;
0 14 5 0 10 12 0 0;
0 0 13 13 10 12 15 0;
0 ... |
function output = getSquaredDistanceToPointXYZ(obj,point)
[X,Y,Z] = ndgrid(int32(1:size(obj.volume,1)),int32(1:size(obj.volume,2)),int32(1:size(obj.volume,3)));
point = obj.getIndicesOfPointInVolume(point);
X = (X - point(1)) * obj.resolution(1);
Y = (Y - point(2)) * obj.resolution(2);
Z = (Z - point... |
function [] = launch(filename)
close all
vd_orig = VideoReader(filename);
numSkip = 0;
count = 0;
c2 = 0;
outFrame = [];
while hasFrame(vd_orig)
frame = readFrame(vd_orig);
% imtool(frame)
frame = rgb2gray(frame);
%call frame processing function
% % frameQual = findPlate(frame);
% % % Try to ski... |
%****
%las cosas suelen salir mal al usar esta matriz para casos de esfuerzo
%plano, sugiero usar rigidez_esfplano
%****
%matriz de rigidez para pasar deformaciones a esfuerzos
%caso general
%young en MPa, deformacion axial en epsilon (epsilon = gama / 2)
function r = rigidez(young, poisson)
lambda = (young * pois... |
function drawband(Tendons)
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
global haxes
axes(haxes);
names=fieldnames(Tendons);
if size(Tendons.(char(names(1))),1)==3
for i=1:size(names,1);
band=Tendons.(char(names(i)));
bname=char(names(i));
if (bname(1)=='t... |
function [pe] = canal_binario(p1, pe0, pe1)
%{
Projeto 2
Seja um canal de comunicação binária, onde o símbolo 1 é transmitido com
probabilidade p1 (e consequentemente o símbolo 0 é transmitido com probabilidade
p0=1-p1). Dado que a probabilidade de detecção com erro quando o símbolo 1 é
transmitido é dada por pe1, e q... |
% STAT 4630
% Anant Kharkar & Haotian Li
% Setup and data importing
% Note that this will take a solid few minutes
test;
clean;
cross;
% --- Discriminant Analysis ---
% LDA
[lda_model, lda_hat, lda_acc] = lda(x_lda, y_lda, x_test, y_test, 'pseudolinear');
% QDA
[qda_model, qda_hat, qda_acc] = lda(x_lda, y_lda, x_te... |
function RATA_mocap = mocap_processing_fxn(mocap_ascii_filename, marker_config)
mocap_filename = mocap_ascii_filename;
mdata = readmatrix(mocap_filename, 'FileType', 'text');
%% Assign x,y position data of each marker to variables
% thigh
th1 = mdata(:,1:2);
th2 = mdata(:,3:4);
th3 = mdata(:, 5:6);
%shank... |
%Program to rename videos in ascending order starting from 1
a ='C:\Users\91700\Desktop\Car-number-plate-detection\img\'; %Path where the videos are stored
A =dir( fullfile(a, '*.jpg') ); %Reading videos
fileNames = { A.name };
for iFile = 1 : numel( A )
newName = fu... |
% Comparsion of results classification using Linear Discriminant Analysis (LDA),
%Fisher Discriminant Ratio (FDR) and principal component analysis (PCA)
%Story: We have the results of 5 medical tests performed on two groups of people:
%Group 1 consists of 100 subjects with no risk of developing the heart diseas... |
function [ ellipse_level ] =no_enclosure( ellipse_level )
%FIND_POSITIVE_CURVATURE Summary of this function goes here
% Detailed explanation goes here
frags=[];
for i=1:1:size(ellipse_level,1)
a = ellipse_level(i,1);
b = ellipse_level(i,2);
left_x = ellipse_level(i,3) - a;
right_x = ellip... |
clc
clear all
close all
dims = 1
% 1D
syms n m1 Mx
fx = [ m1 ; m1^2/n; m1/n*Mx ];
vars = [n ; m1 ; Mx ];
for j = 1:3
Ax(:,j) = diff(fx,vars(j));
end
syms dpdn
Ax(2,1) = Ax(2,1) + dpdn;
disp('Ax eigs')
[V,D] = eig(Ax)
return
disp('--------------------------------------------------------------')
% 2D
c... |
% layout = readcmp('\\NEST\SmithLab\data\mapfiles\WileE_RH_1024-0472.cmp');
layout = readcmp('E:\Data\booBooRfMap\BooBoo_RH_1024-0445.cmp');
layout = rot90(layout,2);
%%
stimDuration = 0.2;
meanMap = mean(cell2mat(reshape(map,1,1,[])),3);
%%
imagesc(reshape(meanMap(:,3),numel(unique(meanMap(:,2))),numel(unique(m... |
function valid = find_hkl_doubles(hkl,intensity)
valid = true(size(hkl,1),1);
for i = 1:length(valid)
if(valid(i))
ind = find(hkl(:,1) == hkl(i,1) & hkl(:,2) == hkl(i,2) & hkl(:,3) == hkl(i,3));
if(length(ind)>1)
[~,max_ind] = max(intensity(ind));
valid(ind(ind ~= ind(... |
function [c,T,A] = mutare_player(T,A,player)
ok=0;
while ok == 0
c=input("Alegeti o pozitie:","s");
%daca s-a introdus 'q' se iese din joc
if c == 'q'
return;
endif
%parcugem matricea care contine pozitiile disponibile si cautam mutarea
%aleasa de jucator
for i=1:3
for j... |
clear all ;close all ;
subs = {'alex','charest','esteban','fabio','gab','gabriella','genevieve','gina','guillaume','jeremie','julie','katrine','lisa','marc',...
'marie','mathieu','maxime','mingham','patricia','po','russell','sunachakan','tah','vincent'} ;
elabs = load('C:\shared\all_white_normals\a2_good\elabs... |
clear all; close all; clc
figure
subplot(121)
load bmode_1.0.mat
imagesc(bws*1e3,deps*1e3,env,[-40 0]), colormap gray
xlabel('y (mm)'), ylabel('z (mm)')
axis equal, axis tight
title('1 MHz')
% cbar=colorbar; title(cbar,'dB')
subplot(122)
load bmode_1.5.mat
imagesc(bws*1e3,deps*1e3,env,[-40 0]), colormap gray
xlabel('... |
function result = Euler(start,finish,stride,u0)%依次是 起点,终点,步长,初始值
n = (finish - start)/stride;%结点数
t = start;%t(0)
u=[];u(1) = u0;%初始值相同
for i = 1 : n
u(i+1) = u(i) + stride * t * u(i)^2;
t = t + stride;
end
result = u;
% xlswrite('E:\学习\计算机\微分方程数值解\结课上机\实验项目一\result.xlsx',u,'Sheet1','B2');
end
|
function [zpts, xygpts] = subsetin2D(xypts, x, y, z, rlim)
% [zpts, xygpts] = subsetin2D(xypts, x, y, z, rlim)
%
% inputs:
% - xypts: Nx2 array.
% - x:
% - y:
% - z:
% - rlim (optional): radius
%
% outputs:
% - zpts: subsetted values of input z.
% - xygpts: values of (x, y... |
function val = get(this, key)
% Return the object stored in the table with key, or [] if no such key is
% found.
[i,j,val] = find_key(this, key);
|
function addregsemilogy(Dn,Pneu,showqudratic,linestyle)
%addreg(Dn,Pneu,showqudratic,linestyle)
if nargin<3
showqudratic=1;
end
if nargin<4
linestyle='r-';
end
Dn=Dn(~isnan(Pneu));
Pneu=Pneu(~isnan(Pneu));
Pneu=Pneu(~isnan(Dn));
Dn=Dn(~isnan(Dn));
%plot(Dn, Pneu,'.')
[orixy]=axis;
stepl=(max(Dn)-min(Dn))./... |
function fval = myFuncInt(x)
fval = 2-x+log(x);
end |
%original function
X = [-5:1:5]';
Y = X;
Z = exp(-X .* X * 0.1) * exp(-Y .* Y * 0.1)' - 0.5;
mesh (X, Y, Z);
axis([-5 5 -5 5 -0.7 0.7]);
%reshape function
[gridsize, gridsize] = size(Z);
ndata = gridsize * gridsize;
targets = reshape (Z, 1, ndata);
[xx, yy] = meshgrid(X, Y);
patterns = [reshape(xx, 1, ndat... |
function f=hcFinalSize
C=[1.7112 0.4927 0.4049 0.0293;
0.3919 2.5527 0.4753 0.0348;
0.3234 0.5548 0.8996 0.0728;
0.0528 0.1904 0.3744 0.3830];
h=[0.0018,0.0030,0.0582,0.1348]';
NNbar=[4064198,12192593,36577778,13005432]';
NNsum=sum(NNbar);
A=C;%.*repmat(NNbar',4,1... |
function A = vector_area_matrix(F)
% Constructs the symmetric area matrix A, s.t. V(:)' * A * V(:) is the
% **vector area** of the mesh (V,F).
%
% A = vector_area_matrix(F)
%
% Inputs:
% F #F by 3 list of mesh faces (must be triangles)
% Outputs:
% A #Vx2 by #Vx2 area matrix
%
% number of ... |
% scan Scan for active IP addresses
%
% This method scans for active IP addresses. Addresses can be specified
% explicitly:
% list=scan('192.168.0.100');
% or with respect to the local host.
% list=scan('*');
% list=scan('0-10');
% The output "list" is a cell array of active IP4 addresses.
%
% See also Digit... |
function comparePerformance(varargin)
% This function takes in string as argument {'DDPGAgent','TD3Agent','SACAgent'}
% and plots the performance comparisons between those respective agents.
%
% Note:
% 1) Make sure that different agents that need to be compared have their
% respective folders with files from different... |
function updateScenariosRets(gen_rets_file,temp_rets_file)
%this function update the returns in gen_rets_file using those stored
%in temp_rets_file
rets=dlmread(temp_rets_file);
dlmwrite(gen_rets_file,rets);
end
|
function [tf] = myTuningFrequencyEstimate(x, blockSize, hopSize, fs)
%% Estimate the tuning frequency of an input music signal
% Input:
% x: N*1 float vector, input signal
% blockSize: int, size of each block
% hopSize: int, hop size
% fs: float, sampling rate in Hz
% Output:
% ... |
function [temperature]=ComputeTemp(temp,V,eps,Hessian_W_cor,N)
temperature = temp;
for i=1:N
for j=1:N
temperature(i)=temperature(i)+eps*V(j)*(temp(j)-temp(i))*(Hessian_W_cor(1,i,j)+Hessian_W_cor(2,i,j));
end
end
|
function connectA(coords, order, color)
coords = coords';
% Define the color based on the input string
if strcmp(color, 'black')
truecolor = 'k';
else
truecolor = color(1);
end
[rows cols] = size(coords);
xVec = coords(1:rows);
yVec = coords(rows+1:end);
... |
data1s = [];
data500ms = [];
prev_pkt = zeros(1,(1000000 / props.samplingInterval)/2);
new_pkt = zeros(1,(1000000 / props.samplingInterval)/2);
processed_eeg = [];
unprocessed_eeg = [];
data500ms =... |
% Guided Stochastic Gradient Descent (GSGD) Beta 2.0
% Code has been simplified
% Copyright (c) 2018, Anuraganand Sharma - All rights reserved.
% GSGDv2: This is a simplified Matlab code orignially proposed by Anuraganand Sharma in
% the paper:
% A. Sharma, “Guided Stochastic Gradient Descent Algorithm for inconsi... |
%% 孔管扫频扫频
function pressure = doubleVesselFrequencyResponse(varargin)
pp = varargin;
responseType = 'n';%响应类型:m M序列 n:理想冲击,r,高斯随机信号
% massFlowE1 经过fft后的质量流量,直接对质量流量进行去直流fft
% 长度 L1 l Lv1 l L2 l Lv2 l L3
% __________ __________
% | | | |
% ... |
function [f] = pref_loghyp_optCV(loghyp, x, prefs, fPrior, ridge, siga, samples)
if ~isempty(fPrior)
absoluteFeedback = 1;
else
absoluteFeedback = 0;
end
CV = 5;
hyp = exp(loghyp);
w = hyp(1:end-3);
sigf = hyp(end-2);
sigp = hyp(end-1);
siga = hyp(end);
n = length(w);
W = diag(w.^-2);
Si... |
clear;close all;
bkgdName = 'w4';
sgnlName = 'w3';
bkgdFile = [bkgdName,'-step0.01MeV-nml.mat'];
sgnlFile = [sgnlName,'-step0.01MeV-nml.mat'];
falseNeg=(1:60)';% 计算的时间范围
plotOrNot = 0;
falsePosList = [0.1;0.05;0.02;0.01];
for j = 1:size(falsePosList,1)
falsePos = falsePosList(j); % 漏报率图对应的误报率
for i = 1:size(fal... |
% Set controllers gains for the horizontal flight mode.
function Controllers = set_controllers_horizontal(dt, angle_ini, x_vel_ini, alt, max_control, desired_angle_ini)
Controllers.function = @control_6DOF_horizontal;
% Pitch PID with system output pitch and input dpitch
Controllers.PID_Pitch.Dt = dt... |
% Get Coordinates
sites= {'US_Ho1', 'US_MMS', 'US_UMB', 'CA_Ca1','US_Bar', ...
'US_Seg', 'US_Ses', 'US_Vcm', 'US_Wjs', 'CA_Ca2', 'US_Mpj', 'CA_Ca3', ...
'US_Men', 'US_FR2', 'US_Pnp', 'US_ARc', 'US_ARM' };
LatLon = {[45.2041, -68.7402], [39.3232, -86.4131], [45.5598, -84.7138], [49.8673, -125.3336], [... |
function savecsv(fname,hdr,s)
%
% savecsv(fname,hdr,s)
% Create a CSV file with header hdr and content
% equal to a cell array of strings s, one cell for each field.
% hdr can be a FORM structure or a cell array of strings.
%
[f,msg] = fopen(fname,'wt') ;
if f<0,
logtoolerror(msg) ;
return
en... |
clear all;
addpath ('C:\Users\Kathleen\Documents\MATLAB\MATLAB\FastICA_25;')
addpath ('C:\Users\Kathleen\Documents\MATLAB\suplabel;')
%addpath ('/home/kt-fitz/Documents/MATLAB/MATLAB/FastICA_25;')
%addpath ('/home/kt-fitz/Documents/MATLAB/suplabel;')
%{
There was no need to resample although if that is necessary, you... |
function [trainData,labels]=getFingerprint3(isGetFingerprint ,wipeOutData,fan,hairdryer,kettle,mipad,pc)
%%%%%%%%%%s0初始状态%%%%%%%%%%%%%%%%%%%%%%fan,hairdryer,kettle,mipad,pc
if(isGetFingerprint==1)
fprintf('go get the fingerprint3!\n');
%%%%%%%%%%s1-fan1%%%%%%%%%%%%%%%%%%%%%%
[aveValue,varVal... |
function [ tilt ] = face_tilt( face, landmarks )
%FACE_TILT calculates tilt of a face based on its landmarks
%landmarks should be a list of landmarks that are expected to lie on a
%horizontal line on a non tilted face e.g. pupils of the eyes
%See also HEATMAP_TILT
if nargin < 2
landmarks = [3, 4, 5, 6]; %Kaggle eye ... |
function result = hotspot_overlap(rec, hotspots, map)
result(1:length(rec)) = 0;
max_length = max(hotspots(:,1));
move = round(max_length * rand(1,length(rec)));
%permutation over all snp locations, instead of all base pair positions
move2 = 1 + floor(length(map) * rand(1,length(rec)));
move3 = 1 + floor(length(ma... |
function [ input, ok ] = prepare_data_for_test( root, list, param )
% input{1} : imgs
% input{2} : featuremap label
% input{3} : bbox regression
% input{4} : pts regression
% input{5} : box valid
% input{6} : pts valid label
% input{7} : pts valid (each axis)
ok = 0;
input = cell(length(param.gpu_id));
boxc... |
function [updateAvailable msg] = updateToolbox(doUpdate)
if ~exist('doUpdate', 'var'); doUpdate = true; end
updateAvailable = false;
msg = '';
try
str = urlread('http://www.quantiacs.com/data/MatlabToolboxVersion.txt');
catch
return;
end
if ~isempty(str)
str = regexprep(str, '\r', '');
... |
function output_value = RRMSE(image1, image2)
output_value = (sqrt((sum(sum(((abs(image1)-abs(image2)).^2))))))/(sqrt(sum(sum(abs(image1).^2)))); |
function [ error ] = MPC_obj( x0,u0,y0,ysp,dt,Hc,Hp,par,U_fut,Pgs )
%Receives [u(t+1);u(t+2) ... ;u(t+Hc)]
%Hc is control horizon
%Hp is prediction horizon
%x0 and u0 are the initial state and control position
%dt is delta t
%ysp are the setpoints
global u
global Dist k
u_fut=[U_fut(1:2:end),U_fut(2:2:end)];
... |
clear;
clc;
close all;
load vinalhaven;
x1=vinalhaven(1:800);
x2=vinalhaven(2:801);
x3=vinalhaven(3:802);
x4=vinalhaven(4:803);
x5=vinalhaven(5:804);
x6=vinalhaven(6:805);
x7=vinalhaven(7:806);
x8=vinalhaven(8:807);
[cor5,lags5]=crosscorr(x1,x6);
cor5=cor5(lags5==0);
[cor4,lags4]=crosscorr(x2,x6);
cor4=cor4(lags4==0)... |
function varargout = spartan_basic(varargin)
% SPARTAN_BASIC M-file for spartan_basic.fig
% SPARTAN_BASIC, by itself, creates a new SPARTAN_BASIC or raises the existing
% singleton*.
%
% H = SPARTAN_BASIC returns the handle to a new SPARTAN_BASIC or the handle to
% the existing singleton*.
%
% ... |
%1.)
[s, Fs] = audioread ('xbazik00.wav'); s = s';
%2.)
y = fft(s);
show = abs(y(1:Fs/2+1));
k = 0:Fs/2;
plot(k,show);xlabel('f');
%3.)
c = find(show==max(show));
%4.)
A = [1.0000, 0.2289, 0.4662];
B = [0.2324, -0.4112, 0.2324];
zplane (B,A);
p = roots(A);
if (isempty(p) | abs(p) < 1)
disp(... |
function [ ] = Sierpinski
clear; clc; clf;
a = 40; % Side length of the Sierpinski triangle
sierpinski_help(0, 0, a, a);
axis([-10 50 -10 50]);
axis equal;
function [ ] = sierpinski_help(x,y,a,b)
if a < 0.1
plot(x,y,'.','MarkerEdgeColor','g','MarkerSize',1);
... |
model = 49;
fname = sprintf('PhiData_M=%d.mat', model);
load(fname, 'test', 'testLen', 'testOut' ,'Phi' , 'validOut', 'valid', 'validLen');
fname2 = sprintf('ParameterValues');
load(fname2, 'w');
lambda = 0.001;
n = 1;
%--------------------------------------------------------------------------------------------------... |
clear all ; close all ;
subs = {'sub_alex','sub_charest','sub_esteban','sub_fabio','sub_gab','sub_gabriella','sub_genevieve','sub_gina','sub_jeremie','sub_julie','sub_katrine','sub_lisa'...
,'sub_marc','sub_marie','sub_mathieu','sub_maxime','sub_mingham','sub_patricia','sub_po','sub_russell','sub_sunachakan'... |
classdef SingleObservationAndWindowStrategy < IWindowingStrategy
%UNTITLED Summary of this class goes here
% Detailed explanation goes here
methods
function obj = SingleObservationAndWindowStrategy(WINDOW_SIZE)
obj@IWindowingStrategy(WINDOW_SIZE,1);
end
... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Ghaida El-Saied
%Project 1
%Finite Element Analysis
%University of California at Berkeley
% Force is given
% A program to solve the fh = -(k^2*sin((pi*k*xh)/L))/A - (2*xh)/A;
% Boundary value problem
% Conditions
% global stiffness = 1
%%%%%... |
classdef (Sealed) UTestCycleCounters < amg.AmgFixture
%UTestCycleCounters Unit test cycle index logic.
% Test that the level visitation counters lead to a correct
% visitation pattern in the multigrid cycle.
%=========================== PROPERTIES ==============================
properties (... |
function m_SensorEx = create_SensorEx(deviceNumber)
domain = System.AppDomain.CurrentDomain;
assemblies = domain.GetAssemblies;
flag = 0;
for i= 1:assemblies.Length
asm = assemblies.Get(i-1);
fin = strfind(char(asm.FullName), 'Sensor Ex Client Basic');
if size(fin,1) > 0
flag = 1;
en... |
function z = apply(w,p,param)
%NEGDIST.APPLY Apply weight to input
% Copyright 2012-2015 The MathWorks, Inc.
[S,R] = size(w);
Q = size(p,2);
if isa(w,'gpuArray')
z = iNegDistApplyGPU(w,p,R,S,Q);
else
z = iNegDistApplyCPU(w,p,S,Q);
end
end
function z = iNegDistApplyCPU(w,p,S,Q)
z = zeros(S,Q);
i... |
function dy = dstrogatz(varargin)
%DSTROGATZ Strogatz sleep wake cycle model
% Returns the function handle for the differential equation, ready to be
% integrated by ode45 or any other Matlab solver.
%
% Output:
%
% dy(1) = @(t,y) theta_1' (circadian cycle phase's derivative)
% dy(2) = @(t,y) theta_2' (sleep... |
function H = directionMeasurementMatrix(ref_vector_I_skew, q_BI)
%#codegen
% Measurement matrix:
A = quaternion2dcm(q_BI);
H = [-2 * A * ref_vector_I_skew, zeros(3), zeros(3)]; |
function [idxVisibleVertices] = visibility_check(world, x)
%Checks visibility between point x and every vertex within world, returns
%the list of indices of vertices which are visible from x
% world is a world structure defined previously
% x is a 2x1 vector containing the point (x,y)
idxVisibleVertices = [];
polyf... |
function [ field ] = generatefieldarray( gameState )
field = gameState.wall;
if isfield(gameState,'snake')
for i = 1 : length(gameState.snake)
if gameState.snake(i).lose, continue; end
for j = 1 : length(gameState.snake(i).pos)
field(gameState.snake(i).pos(j,1),gameState.snake(i).pos(j,... |
function fgbgFeatures = calcFeaturesAfterPrep(Mask, I_bright, I_lCntrst, I_cct, I_S, I_H)
% MASK: input, 1 channel, 0-1
Mask = im2bw(Mask);
STATS = regionprops(Mask, 'BoundingBox');
bndbx = STATS.BoundingBox;
xwid = bndbx(3); ywid = bndbx(4); % size of the bounding box
%% %% %% %% Foreground %... |
% open window with 1000x1000 pixels
[w, rect] = Screen('OpenWindow', 1, [], [0 0 1000 1000]);
nlines = 25;
% evenly spaced with a small border
xs = linspace(100,rect(3)-100,nlines);
ys = linspace(100,rect(4)-100,nlines);
centers = combvec(xs,ys)';
% size of 1 side of texture box
side = ceil(max(diff(centers(1:2,1)))... |
function out = lab8_HT_egg()
global a b
a = 0.07853;
b = 23.79756;
t = 0:5:100;
[t, T] = ode45(@dTdt, t, 373);
T = T - 273;
figure;
plot(t, T, 'r');
hold on
T_FDM(1) = 373;
T_FDM = FDM(t, T_FDM);
T_FDM = T_FDM - 273;
plot(t, T_FDM, 'b');... |
%Systembeschreibung eser Piezo Drucksensores
clear;
%close all;
clc;
R = 100E+6;
C = 1E-6;
RD = 1E+9;
CD = 10E-9;
Kp = 2*10^-12;%As/N
v0 = 100E+3;
w0 = 10;
AD = tf(v0,[1/w0 1]) %Op-Amp
kR = tf([RD*CD , 1],[ CD*(R+RD), 1+CD/C]) %Rückkopplung
kF = tf([1 , 0] , [C+CD , 1/R+1/RD]) %Führungsgröße
A = -(kF*AD)/(1+kR*... |
% This script initializes initial conditions for the trajectory of a drone
% in steady flight conditions (hovering) then calls the ODE45 function to
% numerically integrate the position of the drone with respect to the
% initial conditions, along with plotting the results answering Question
% 7
%
% Author: Benj... |
function oxygenEnvelope(model,targetRxn,options)
% Zachary King 1/31/2013
if ~exist('options','var')
options = struct();
end
if ~isfield(options, 'maxOxygenUptake'), options.maxOxygenUptake = 20; end
if ~isfield(options, 'biomassRxn')
options.biomassRxn = 'Ec_biomass_iJO1366_core_53p95M... |
function varargout = interface(varargin)
% INTERFACE MATLAB code for interface.fig
% INTERFACE, by itself, creates a new INTERFACE or raises the existing
% singleton*.
%
% H = INTERFACE returns the handle to a new INTERFACE or the handle to
% the existing singleton*.
%
% INTERFACE('CALLBACK',hO... |
function [sequenceLength] = collatz2(n)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NAME: Alexander Price
% JMU-EID: priceat
% DATE: January 24, 2013
%
% PROGRAM: collatz2.m
% PURPOSE: This returns the length of the collatz sequence of the inputed number
% CREDIT:
%
% VARIABLES:
% n = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.