text stringlengths 8 6.12M |
|---|
%% Returns info where line starts and ends. Each row is for one line
function [ lines ] = getLinesBegEndIndexes(textImage)
lines = [];
[y, x] = size(textImage);
linePixelsSum = sum(textImage');
% pick threshold (wheather or not treat line as text line - works but
% unnessesery
% RE... |
classdef W_PWA_Papandreou < W_PWA & iC_Papandreou
%W_PWA_Papandreou Summary of this class goes here
% Detailed explanation goes here
methods
function obj = W_PWA_Papandreou(w)
obj = obj@W_PWA(w.rf,w.tri,w.interp);
end
end
end
|
function w=updtmvi(w,l1,l2,p1,p2,ambi,elevang,recllh,ipp,ionop,cst,prn)
%
% Function updtmvi
% ================
%
% This function updates the misclousure vector for IONO delays
% computation
%
% Sintax
% ======
%
% w=updtmvi(w,l1,l2,p1,p2,ambi,cst)
%
% Input
% =====
%
% w -> misc... |
ch=128;
freqs=30;
ep=5;
tr=50;
clear j xf xch xep PC0 PC7 FC0 FC7 xtr
Y=0;
nsource=2;
Options=[];
G=[];FC=[];PC1=[];PC2=[];xf=[];xch=[];xtr=[];ph=[];
for si=1:nsource
xf(:,si)=rand(freqs,1);
% xch(:,si)=randn(ch,1);
xch(:,si)=normpdf(1:128,mod(19*si,128),10);
xch(:,si)=xch(:,si)/norm(xch(:,si));
... |
classdef SymExpression < handle
% An object that represents a symbolic expression in Mathematica
%
% Copyright (c) 2016-2017, AMBER Lab
% All right reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted only in compliance with the BSD ... |
%testni primer 1
% X = [1/4;3/4;0;1/2;1;1;1;1/2;0;0];
% Y = [1/2;1/2;0;0;0;1/2;1;1;1;1/2];
% TRI = [1 3 4; 1 3 10;1 9 10; 1 8 9; 1 2 8; 1 2 4; 2 4 5;2 5 6;2 6 7;2 7 8];
% t = TriRep(TRI,X,Y);
% p = @(x,y) 1+0.*x;
% q = @(x,y) 1+0.*x;
% r = @(x,y) 0.*x;
% f = @(x,y) 1+0.*x;
% g = @(x,y) 0.*x;
% [u,A,b] = mke(p,q,r,f,t,g... |
%% Simulate the sum of rolling 6 dice 1e6 times.
clear
%numSims = 1e6;
numSims = 1e5;
%for i = 1:numSims
% % Create 6 random integers in the range [1, 6]
% dice = randi([1, 6], 1, 6);
%
% % Sum the six integers and store the result
% diceSum(i) = sum(dice);
%enddice
for i = 1:numSims
... |
function [epochs,epochs2reject] = artefact_epochs_rejection(epochs,threshold)
nEpoch = size(epochs.data,1);
nChannel = size(epochs.data,2);
epochs2reject = [];
% amplitude range
peak2peak = zeros(nChannel,nEpoch);
for iChannel = 1: nChannel
for iEpoch = 1:nEpoch
thisEpoch = squeeze(epochs.data(iEpoch,i... |
%STARTTENTAMEN
%
%
% ||
% \/
%
%
% Druk op de button RUN (F5)
%
%
% /\
% ||
%
%
% ------------------------------------------------------------------------
% Copyright (C) 2017 M. Schrauwen (marksch... |
function usableInds = findUsableIndsGroup(correctArray, jointCentreName, modelInstance, featureSet)
% find that joint centre's composition markers
jointCentreInd = [];
for i = 1:length(modelInstance.jointCentreArray)
if strcmpi(modelInstance.jointCentreArray{i}{1}, jointCentreName)
joint... |
function time=run_robot()
clear all
addpath('C:\Users\thoma\OneDrive - University of Cambridge\Desktop\sensor-dyna\UR5RobotControlV3.2')
rng(100)
%
% channel7 = addAnalogInputChannel(s,'Dev1','ai6','Voltage');
% channel7.TerminalConfig = 'Differential';
%
% channel8 = addAnalogInputChannel(s,'Dev1','ai7',... |
function []=genWaterfall(Name)
close all;
az=16; el=66;
if ~nargin
[FileName,PathName] = uigetfile('*.mat',...
'Select Horizon File','.\Horizon Output');
if isempty(FileName)
disp('No file selected.... Exiting!!!');
return;
end
Name = fullfile(PathName,FileName);
e... |
SB=1000;
f0=60; P01=500/SB; P02=400/SB;
R1 = SB/600*0.06;
R2 = SB/500*0.04;
DPL= 90/SB;
disp('(a) D = 0')
Dw = -DPL/(1/R1+1/R2)
Df = Dw*f0, f=f0+Df
DP1=-Dw/R1;
DP2=-Dw/R2;
P1=(P01+DP1)*SB
P2=(P02+DP2)*SB
disp('Graphical demonstration')
%P=0.2:0.01:0.6;
P=0:0.01:0.6;
f1=-0.10*P+1.050;
f2=-0.08*P+1.032;... |
clear ;clc;close all;
addpath ..\CoDDA
load cls.txt;
load realresult.txt; % 导入数据集的真实社区
load strike.txt; % 导入数据集的邻接矩阵
data = strike;
k = 3; % 社区个数
LPA = cls;
[~,m] = size(data);
t = length(unique(cls));
%% STEP : 聚类结果验证
% 社区评价标准:Fname 是对社区结果与真实社区的交叉和近似程度的衡量指标,范围是[0,1],数值越大说明结果越准确
% cls是结果社区,realresult是真实社... |
function M = adjoint(A)
% adjoint: (conjugate) transpose of cofactor matrix of a square matrix
% usage: M = adjoint(A)
%
% arguments: (input)
% A - Any square double or sympoly array
%
% M - The adjoint of A
%
% See also inv
%
% Author: John D'Errico
% e-mail: woodchips@rochester.rr.com
% Release: 1.3
% Release date... |
%% Trajectory Plotting
function [] = traj_plot_ShawnFig(z_list, WP)
% This scripts generates the interpolated data for the reference trajectory
close all;
% Use the following call once z_list and dd are uploaded into workspace
% traj_plot_ShawnFig(z_list_clean(:,1:800), dd(1:180,:))
% WP =...
% [0 0 0;
% 25... |
M = zeros(6,6);
for i=1:5
% diag(M,i)=ones(1,(6-i))*6-i;
M=M+diag(i*ones(1,6-i),i) + diag(i*ones(1,6-i),-i);
end |
function self=setRobin(self,label,fun,ar,Lm)
idxlab=self.Th.find(self.d-1,label);
if length(idxlab)==1
%assert(length(idxlab)==1)
if ~isempty(ar)
LopD=Loperator(self.dim,self.d-1,[],[],[],ar);
else
LopD=[];
end
if nargin<=4
Lm=1:self.m;
end
if isempty(self.pdes{idxlab})
... |
function saveanddisplay3_2(inputimage)
map = evalin('base', 'map');
% ensure we have the right input parameters
if (nargin==1)
map = [0:255]'*ones(1,3)*(1/255);
end
i=1;
for N=[4 8 16]
C=dct_ii(N);
cell=dctenc(inputimage,C);
[x(i) f(i)]=goldensearch3(inputimage,cell,17,17,C);
compressionratio(i) = ca... |
function write_lsdyna_hex(filename, nodes, hexes, constraints, parts,...
vectors, faclabels)
%WRITE_LSDYNA Write out tetrahedral mesh in LSDYNA format.
% If flabel is present, write it out also.
fid = fopen(filename,'Wt');
iscontraints=true;
isvector=true;
isssegment=true;
if(nargin<4)
iscontraints=false;
... |
function results = fmsFitToCurvePavlovianBlockingTask( methode, conditions )
%fmsFitToCurvePavlovianBlockingTast performs an optimization of parameters minimizing the
%distance between the model's simulation curves and the curve of the
%experimental data in the Pavlovian Blocking Task of Marios Panayi and
%Simon Kilcro... |
function h = sigmoid_activation(x)
h = 1./(1+exp(-x));
end
|
function D=KLGamma2(shape1,scale1,shape2,scale2)
D=(shape1-shape2)*digamma(shape1)-gammaln(shape1)+gammaln(shape2)+shape2*(log(scale2)-log(scale1))...
+shape1*(scale1-scale2)/scale2;
end
|
% Nima Ghaviha (nima.ghaviha@mdh.se)
% 2016-10-17
% This function is used to import the data binary file to be used on the
% train for the online advisory system.
function [VopOut, t, x, vS, TripTime, TripDistance, MaxSpeed, Mass, SL, Elev, minusT, plusT, Arr, Brr, Crr, ACMPower, MaxTrac, MaxBrake, BRPoint] = im... |
function a = bullseye(n)
if n == 1
a = 1;
return;
end
a=(ceil(n/2))*ones(n);
a((2:end-1),(2:end-1)) = bullseye(n-2);
end |
% This function is responsible for the init phase.
% The lsl library is loaded and eeglab is started with all its
% consequences.
function initLSLAndEEGLab(startSample)
global initialized EEG_labels leftOrRightTrialsCounter
global samplecounter eventcounter eeg_outlet nchans paused stopit srate marker_outlet
%% instan... |
## Copyright (C) 2023 Gabriel Zalles
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distri... |
P1 = 3; % kW
n2 = 70;% r/min
T2 = 9.55e6*P1*0.8/n2;
disp('******************************************')
T = 84.84;%支撑泵的最大扭矩
yita = 0.8;%效率
Fs = 5*9.8;%人能持续提供的力
R = 0.05;%手柄的半径5cm
M = 56; %kg
g = 10;
%%确定传动比,
i = T/(Fs*R*yita);disp(sprintf('传动比i = %.2f',i)); %需要的传动比
i = round(i);disp(sprintf('校正传动比i = %.2f',i));
z1 =... |
% sallenKey2ndOrder.m
C1 = .5e-6;
C2 = .5e-6;
R1 = 10e3;
R2 = 10e3;
num = R2;
den = [C1*C2*R1*R2^2 , (C1*R1*R2 + C2*R1*R2 + C2*R2^2 - C1*R1), R1+R2];
[H,W] = freqs(num,den);
% Finding H,W, using bilinear() function
Fs = 48000;
[b,a] = bilinear(num,den,Fs);
[Hd,Wd] = freqz(b,a,4096,Fs);
semilogx(W/(2*pi), 20*log10(... |
function score = cluster_analysis(output, label)
%output = {output_tsne, output_lmnn, output_scgl, output_sclo, output_oasi, output_gblm};
%tsne
%for i=[1:5]
%for j=[1:4]
%score_tsne(i,j) = cluster_eval(output{1}{i,j}, label);
%end
%end
score_tsne = cluster_eval(output{1}, label);
%lmnn
for i=[1:5]
... |
% investigate the rudder efficiency
clear all
clc
table_trim_redundant_prop_delta_e_power_5load = readtable('trim_redundant_prop_delta_e_power_5load.csv');
table_trim_redundant_prop = readtable('trim_result_redundant_prop.csv');
run init_build.m
%%
% calculate from trim table
U = 50;
table_slice = table_trim_redunda... |
%Model Optimisation under Uncertainty
%Author Dessy Amirudin
%Master Student
%Operational Research with Computational Optimization
%The University of Edinburgh
%terminating parameter
epsilon=1e-6;
P= [0 1 0 0;
0 0 1 0;
0 0 0 1;
0 0 0 0];
Q=inv(eye(4)-P');
%C1 is buffer 1 and 3
%C2 is buffer 2 and 4
C=[... |
%% a clean slate
%close all
%clear
%clc
tic
%% Implementation details
% Version 5 - detritus + variable diffusion coefficients. square grid, no
% transform! the
% This code implements a system of equations based on the work by Jäger et
% al. (2010) with an additional benthic algal layer at the bottom,
% in two spat... |
% Example script that compares the iteratively reweighted least squares
% algorithms 'MatrixIRLS' of [1,2] with 'HM-IRLS' of [3].
%
% For a description of the random model on the sampled entries, see
% documentation of "sample_phi_MatrixCompletion.m". For a description of
% the model for the matrix X0 to be completed,... |
function [ x] = adjustSNR( signal, noise, snrdB )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
C = sqrt(var(signal)/(var(noise)*10^(snrdB/10)));
x = signal + C*noise;
end
|
n = 4;
s = tf('s');
G = -625/((s+5)^n);
h = nyquistplot(G);
opt = getoptions(h);
opt.Title.String = 'Nyquist Plot with k = -625, and n = 4';
setoptions(h,opt)
|
function G = histogram_personal(A)
% % % A = [1,2,7;3,2,1];
% im = imread('/Users/INNOCENTBOY/Documents/MATLAB/pic/256/4.1.01.tiff');
% A = rgb2gray(im);
B = A(:);
%% Unique value in matrix Calculation
a1 = A(:).';
a2 = sort(a1);
a3 = diff(a2);
a4 = a3 ~= 0;
a4 = [true, a4];
C = a2(a4);
%% BSXFUN , Calculating no ... |
function A = gauss_elim(A,e,k,n)
%Functia de elimanare gauss cu pivotare partiala
%INPUT: A - matricea, e - vector de indici, k si n - indici
%========================================================================
%Copyright Andreas Mihalea 2019
%==================================================================... |
clc
clear all
close all
%
%% P1 - AirBeam Data -
% Put all data in one time table with the following headers - dateTime, pm1
%, pm2.5 pm10
dataFolder = "/media/teamlary/Team_Lary_1/gitGubRepos/data/mintsData";
dotMatsFolder = dataFolder + "/dotMats";
grimmDataFolder = dataFolder + "/Spectrometor... |
%
% Plot Qc - Plot the Qc parameter for the shot combination phase correction
%
figure
for S=1:Ns
subplot(Ns,1,S);
plot(Zc,Qc(S,:),'b.')
xlabel('radians')
title([ 'Qc Plot - Shot',int2str(S),' C min = ',num2str(C_min(S)) ]);
grid
end |
function comparedTab = compareTabs(agregatePerturbationScore1, aggregatePerturbationScore2)
lind_trp = ismember(agregatePerturbationScore1(:,1), aggregatePerturbationScore2(:,1));
tmp_ut_trp = agregatePerturbationScore1(lind_trp,:);
tmp_ut_trp = sortrows(tmp_ut_trp,1);
lind_std = ismember(aggregatePerturbat... |
function cfc_print(hpc_LF,hpc_HF,label1,labelconditions,iii,n1,n2)
[hpc_hpc]=xfreq(hpc_LF,hpc_HF,'coh','no');
plot_cross(hpc_hpc,label1,n1,n2)
printing(strcat('CFC_',labelconditions{iii},'_',label1{n1*2},'_vs_',label1{n2*2}))
close all
end |
function [output] = Varian( image )
varian=0;
[a b]=Rataan(image);
[x y]=size(image);
for m=1:x
for n=1:y
varian=((image(m,n)-a)^2)+varian;
end
end
varian=varian/numel(image);
output =sum(sum(varian));
end
|
function t = text_corner(varargin)
%% function t = text_corner({{ax}}, txt, {corner}, {{{[color]}}} )
% this function generates a text (txt) in the corner of the
% axis (ax) with color (color), where (t) is the text property handel
%
% t = text_corner(ax, txt, corner)
%
% t = text_corner(txt, corner)
%
% t = te... |
function beta = generalized_least_squares(X, Y, Q)
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
% The coefficients of a linear model are given by
beta = (X'*Q*X)\X'*Q*Y;
end |
function AAA = playbeep()
AAA=0;
fs=44100;
[AAA ,fs]=audioread('playbeep.wav');
sound(AAA,fs);
% ===========================================
end
|
function [ image_rehaussee ] = Rehaussement_Contour( image, K )
% Detailed explanation goes here
masqueGaussien = 1/16 * [1,2,1;2,4,2;1,2,1];
Ig = Convolution(image, masqueGaussien);
masqueLaplacien = [-1,-1,-1;-1,8,-1;-1,-1,-1];
ImgLapl = Convolution(Ig,masqueLaplacien);
%[m,... |
varExist = exist('onePlotOnly','var');
if varExist == 0
onePlotOnly = false;
end
%% Performing Classification
timeBeforeEvent = 2;
timeAfterEvent = 3;
params.params_featExtraction.ws = 0.5;
% Feature Extraction
clc
timeInfo.training{1} = struct('noverlap',params.params_featExtraction.wshift,'timeInterval',[-... |
function [A,j] = accumCon(A,thr)
[U,S,V]=svd(A);
sum=0;
for i=1:256%算一下累计贡献率
sum=sum+S(i,i);
end
sum2=0;
con=zeros(1,256);
for i=1:256%算一下累计贡献率
sum2=sum2+S(i,i);
con(i)=sum2/sum;%累计贡献率
end
%记录到哪一个奇异值贡献率超过0.9
j=0;
for i=1:256
if con(i)>=thr
j=i;
break;
end
end
A=U(... |
function [Cleff, Cdpeff, Cdfeff, dCleff_daeff, dCleff_dMeff, dCleff_dReeff, dCdpeff_daeff, dCdpeff_dMeff, ...
dCdpeff_dReeff, dCdfeff_daeff, dCdfeff_dMeff, dCdfeff_dReeff, dCleff_dX, dCdpeff_dX, dCdfeff_dX] = ...
Airfoil_analysis(AC,n2d,Eff,CSTi,Mode,iter)
global Restart
ModeNum = AC.Wing.Airfoils.ModeNum;
... |
function experiments = getExperimentData(room)
% VARIABLES
% room: An optional variable that indicates
% which room user wants experiments from.
% Options include 'all', 'S1', 'S2', or 'S3'.
% Default is 'all'.
% Loads experiments int... |
%% 1
clear;clc
lista=[];
n=1;
while n==1
lista(end+1)=input("Ingresa un valor\n");
if length(lista)>6
disp("Quieres seguir metiendo valores? 1) Sí 2) No")
n=input("Opción = ");
end
end
x=randsample(lista,1);
disp("Número a evaluar = "+x)
logaritmo=log(x);
if isreal(logaritmo)
disp("Logar... |
function [MZ,X,xy,xy2D,numPoints,opts] = h5waters(filename,opts)
% h5waters - convert a Waters RAW file to an H5 file in order to be able to
% batch process a series of the files, e.g. overnight
% Easily check that this isn't a Mac
if ismac
error('DOES NOT WORK ON MAC');
end
tic
% Define a special case
special =... |
clc;
clear;
x=randperm(21)
Ascending_order=sort(x)
mean_val=mean(x)
median=Ascending_order(ceil(length(x)/2))
stdev=std(x) |
function [A,t,p] = createGraph(num_workers,num_tasks,varargin)
p = inputParser;
defaultMethod = 'random';
expectedPrior = {'random','project','random_connected','custom'};
addOptional(p,'method',defaultMethod,@(x)(any(validatestring(x,expectedPrior))));
addOptional(p,'frac_edges',0.5);
addOptional(p,'graph',[]);
parse(... |
function dy = DDFT_nlin(t,y,k2,N,y00)
if nargin > 4 && ~isempty(y00)
%k=0 component is omitted
k0flag = true;
y = [y00;y(:)];
else
k0flag = false;
end
y = real(ifftn(reshape(y,N)));
% mu = y - y.^2/2 + y.^3/3;
mu = log(1+y);
fmu = reshape(fftn(mu,N),[],1);
if k0flag
fmu(1) = [];
en... |
% RUN NFKB model simulation
clear all;
NFKB_SM % Calls the script with the inputs:
% Model
% Experimental scheme (number of experiments initial
% & stimulation conditions, final time - per experiment)
... |
%defining time-grid and sampling the signa
t_fine = 0:0.001:2;
Ts=0.1;
t_samples= 0:Ts:2;
xn=xt(t_samples);
n=1:length(xn);
%interpolations
interxt1= interp1(t_samples,xn,t_fine,'nearest');
interxt2= interp1(t_samples,xn,t_fine,'linear');
interxt3= sinc_interp(n,xn,Ts,t_fine);
%plotting
figure;
subplot(2,2,1);
plot(t... |
Bl = fir1(64,0.2,'low');
Bb = fir1(64,[0.2,0.4],'band');
Bh = fir1(64,0.6,'high');
A = zeros(1,length(Bl));
ns = 1:64;
sin1 = sin(2*pi*0.1*ns);
sin2 = sin(2*pi*0.25*ns);
sin3 = sin(2*pi*0.7*ns);
fvtool(Bb, 1);
title('Filtru banda');
fvtool(Bl, 1);
title('Filtru trece-jos');
%%figure(3);
fvtoo... |
% Merge a list of DBNFactory classes, outputed by e.g.
% make_ode_dbn_descriptor()
function [merged_dbn_factory]= merge_dbn_factories(varargin)
if nargin==0
error('Cannot merge zero dbn descriptors')
end
merged_dbn_factory= copy(varargin{1});
for i=2:nargin
merged_dbn_factory.merge(varargin{i}... |
% jump
% for any function yita, compute [yita]_x_i1
%alpha=1*2n
function [Jumpoverxi1,vecD]=jump(alpha, delta, m, i)
%% Parameter
h = delta/m;
n = 1/h;
%%
vecD=zeros(2*n,1);
vecD(2*i,1)=-1;
vecD(2*i+2,1)=1;
Jumpoverxi1=alpha*vecD;
|
% 2.28 Rotorcraft trim
clear all
clc
h = 100; % flight altitude
[~,~,~,rho] = atmosisa(h);
table_trim_states = readtable('trim_result_no_redundant.csv');
%% build object
run init_build.m
%% hover/foward trim X,Y,Z,L,M,N=0,[theta_0,theta_diff,theta_1c,theta_1s,theta,phi,v_i1,v_i2]
Rotorcraft.DoubleRotorHelicopter.U ... |
%% 对数据寻找极值点,根据极值点信息给出所有点所在的趋势,趋势量化为[3-(-3)],其中,用到了未来信息
% Zhang,Yan
% load('sPrice.mat');
% data=price;
%
load('Y:\qdata\IF\intraday_bars_30s_monthly\IF0Y00_201006.mat')
bars = IF0Y00_20100609;
price = bars.close;
%% 生成 target
[trendsig_short]=tgt.trendsignal(price,0.015,0.015,4);
[trendsig_medium]=tgt.trends... |
function [ DAG ] = DAGGenerate( )
%UNTITLED3 此处显示有关此函数的摘要
% 此处显示详细说明
end
|
function phandles = tsEvaPlotReturnLevelsGEV( epsilon, sigma, mu, epsilonStdErr, sigmaStdErr, muStdErr, varargin )
%
args.minReturnPeriodYears = 5;
args.maxReturnPeriodYears = 1000;
args.confidenceAreaColor = [189 252 201]/255; % light green
args.confidenceBarColor = [34 139 34]/255; % dark green
args.returnLevelColo... |
%% YPOLOGISTIKH NOHMOSUNH 2021 PTUXIAKH EXETASTIKH
%% NIKOLAOS ISTATIADIS AEM:9175
clear;
clc;
close all;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CAR CONTROL A
FIS_names = {'First','Final'};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% EPILOGH... |
function fs = VecComputeFeature(ii_ims, ftype_vec)
%UNTITLED7 Summary of this function goes here
% Detailed explanation goes here
fs = ii_ims*ftype_vec;
end
|
clc;
fprintf('============================[ FNMsphericalshell.m ]============================\n\n');
fprintf('This example calculates the continuous-wave pressure for a spherical transducer\n');
fprintf('using the Fast Nearfield Method. It will output a plot of the pressure, the\n');
fprintf('error of the calculation c... |
function Output = Opdracht1(nh,out)
ni = 10; % Amount of input neurons
no = 7; % Amount of output neurons
alpha = 0.1; % Constant of learning rate
trainingset = 60; % Percentage of data used for training set
validationset = 20; % Percentage of data used for validation set
epochs = 20; % Number o... |
oi = readfis('Fuzzy-Adaptation');
figure,
plotfis(oi);
title('Fuzzy adaptation block diagram')
figure,
plotmf(oi,'input',1);
title('MFs of E')
figure,
plotmf(oi,'input',2);
title('MFs of R')
figure,
plotmf(oi,'output',1);
title('MFs of H')
axis([-1 2 0 1.1]) |
%% Choose periodization mode for wavelet decomposition
%close all;
dwtmode('per');
addpath(genpath('.'));
clc;
%% Load data to be reconstructed and the mask
load yesmove_raw_invitro.mat; % t,ch,x,y % data provided on 27/10/2017 % already multiplied by weights
load yesmove_mask_invitro.mat;
%load nomove_raw_invitro.ma... |
% Performs some data download, compilation, and messaging operations on first initialization of the repository
global PID
% Create a file in PROJECTROOT/tmp/ to know whether it has been accessed before
tmp_fname = 'tmp/first_init';
if exist(tmp_fname, 'file')
clear tmp_fname
return;
end
if ~isdir('tmp'), mkdi... |
% newstring = doubleToSingleSpacing(oldstring)
%
% This function changes all multiple spaces (' ') within string OLDSTRING to
% single spaces (' ') and then returns the modified string. Works with
% double spacing, triple spacing, and more.
%
% This function is helpful when spaces are being used to count words.
%
% ... |
function [B,detJ] = matrixB_barra2D (coord_n,xg,e_VG)
%******************************************************************************************
%* EVALUACION DE LA MATRIZ B PARA UNA BARRA 2D *
%* ... |
xstart = [-1 2];
% basic usage with anonymous function and numerical derivatives
[x fval exitflag output] = fminunc(@(X) (1-X(1))^2 + 100*(X(2)-X(1)^2)^2, xstart)
% now specify gradient and Hessian analytically
opts = optimset('fminunc');
opts = optimset(opts, 'GradObj', 'on', 'Hessian', 'on');
[x fval exit... |
% ls -l --full-time pickup_000*data > ~/pickup.txt
fid=fopen('pickup.txt');
tme=[];
while(~feof(fid))
tmp=fgetl(fid);
tme=[tme datenum(tmp([44:62]))];
end
fid=fclose(fid);
difftme=diff(tme(3:end))*24*60;
tme(1:3)=[];
clf reset
orient landscape
wysiwyg
plot(tme,difftme,'b.')
axis([datenum(tme(3))-1/24 datenum(t... |
function params = WongWang_params(varargin)
% convert input into structure format
params_in = varargin2struct(varargin) ;
% make default parameters
params = struct ;
params.a = 270 ;
params.b = 108 ;
params.d = 0.154 ;
params.gamma = 0.641 / 1000 ;
params.tau_s = 1... |
%#eml
function [SuppPolyLines,SuppPolyFillIndex] = Jojo_Calc_SuppPolyLines(SuppPoints,valid_size)
max_nr_of_supppolylines = 12;
SuppPolyLines = zeros(5,max_nr_of_supppolylines); % Attention!!! TODO: if more than 8 foot points are given, this value has to be changed
SuppPolyFillIndex = 1;
anzPoints = valid_size;%size(Su... |
%% TrajInGridUnits.m
%
% Converts a trajectory in grid units.
%
% INPUTS: * trajectory in rad/m (Nx2 matrix)
% * field of view in meters (can be 2x1 vector)
% * matrix size for reconstruction, optional (can be 2x1 vector)
%
% OUTPUT: * trajectory in grid units (Nx2 matrix)
% * given or s... |
classdef DiscreteDist < ScalarDist & ParallelizableDist
properties
dof;
params; % params.T stored as nstates-by-ndistributions
prior;
support;
end
methods
function model = DiscreteDist(varargin)
if nargin == 0 ;return; end
[model.params.T , model.support , model.p... |
fs=1000; nfft = 512;noverlap=256;window=512;
% frequency (bin) resolution = sample_rate/fft_size= 1.953Hz, time resolution =
% (wind-noverlap)/fs=.112s , Hamming window
% as overlap increases processing time increases and noise immunity
% The length of the FFT is a tradeoff between frequency and time resolution
... |
function O = hist_eql (I)
ID=double(I);
[N,M]=size(I);
O=zeros(N,M);
%Let's compute the histogram of our image and store it as an array h(k)
h=imhist(I);
%Let's normalise the histogram by dividing the vector h by total no of
%pixels hn(k)
for i=1:256
h(i)=h(i)/(N*M);
end
%Let's compute the cumulative distribution c... |
function [sig_long, sig_short, sig_rs] = Kdj(bars, thred1, thred2, nday, m, l, type)
%计算kdj值以及对应的交易信号(-1,0,1)
%输入 ClosePrice,HighPrice,Lowprice,n,type其中,n表示周期的长度
%type 表示ma计算过程的系数选择方式
%type 1 [2/3 1/3] type 2 [(n-1)/n 1/n]
%输出 pos 交易信号,kdj 计算的kdj值
% Yan Zhang version 1.0 2013/3/12
%
% sig_long 当K上穿30时,买入,信号为1... |
%THIS CODEALGO IS ACTUALLY THE MAINSCRIPT FOR MULTIHOP
% numTimeSlots = int(input("Enter no of Time Slots: "))
% numNodes = int(input("Enter no of Sensor Nodes: "))
ourFindings = [];
theirFindings = [];
nodes = 200; % min no of nodes for which this code runs
max_nodes = 600; % max no of nodes for which ... |
%% Script to run the fft2_spod_modes.m for plotting the spectra
clc; clear;
close all;
set(groot,'defaultAxesTickLabelInterpreter','latex');
set(groot,'defaulttextinterpreter','latex');
set(groot,'defaultLegendInterpreter','latex');
% x = [10; 15; 20; 25; 30; 35; 40; 45; 50; 55; 60; 65; 70; 75; 80; 85; 90; 95; 100... |
function [sp,sm,ep,em,ro,rlim,slim] = findLimitS(sfun, efun, ri, rf, dr, R)
global threshold;
sp= sfun(R,0)+2*threshold;
rsp = findZeroPrev(@(r) sfun(r,sp),ri,dr,R);
sm = sfun(R,0)-2*threshold;
rsm = findZeroPrev(@(r) sfun(r,sm),ri,dr,R);
rval1 = [R rsp rsm];
rval1 = rval1(~isnan(rval1));
... |
%Lotanna Ezenwa, Problem Set 2, #4
%PS2_4.m
%% Due Wednesday, April 6th, 2016
clear
me = LotaEzenwa();
code = me.id;
PS_2_4 %To obtain given information
%Given an Ideal Current Source at V_0
I_s = 10; %Amps
%Given Nonideal Voltage Source at V_n+1
V_s = 10; %Volts
r_s = 5; %Ohms
n = 3;
r = 4; %Ohms
nr = r*n;
... |
%lab 4, Жильцов Никита, var = 5
clear all
clc
%graphical
load A5.DAT
global n
n = length(A5)
x = 1:(n);
subplot(1,2,1);
scatter(x, A5);
xp = [0 n];
tmp = mean(A5);
yp = [tmp tmp];
line(xp, yp);
title('raw data');
data = A5 - tmp;
subplot(1,2,2);
scatter(x, data);
title('centered data');
%abbe
meth... |
% Script M-File: MyLagrange.m
% Written By: Christian Gruss
% Creation Date: 11/11/2016
%--------------------------------------------------------------------------------------------------------------------------------
% DISCLAIMER: All content of this file is the intellectual property of Christian Gruss.
% Any reprodu... |
function RBES_Show_Penalties3(sats,SAVE)
global params
nsats = length(sats);
fsz1 = 11;%14 for eos
fsz2 = 13;%18 for eos
w = 3.0; % width of satellite box (1.6 for EOS and 2,0 for Decadal on Dell laptop)
delta = w/16;% a small value
dx = delta;% x spacing between satellite boxes
w2 = w-2*dx;%width of an instrument box... |
function [x_hub, varargout] = huber(x)
% weighted arithmetic mean with Huber weights
% mean = huber(x);
% [mean, sigma] = huber(x);
% [mean, sigma, sum_w] = huber(x);
% [mean, sigma, sum_w, w] = huber(x);
%
% July 2002, Nils Olsen, DSRI
x = x(~isnan(x)); % remove NaN
epsilon = 0.001; % interrupt iteration if rela... |
%Model with no age-dependent parameters
%TODO: Ideally a parameter fit for contact rate in order to compare non
%age-structured and age-structured population
% clear all
% load constants_noage
% [t,y] = modello(simulength, susc, cont_mat, tau, delta_E, prob_symp, gammaI, gammaA, initS, initE, initI, initA, initR, first... |
function [Zgm] = geopotentialToGeometricHeight(Zgp, Lat)
%GEOPOTENTIALTOGEOMETRICHEIGHT Height conversion from Zgp to Zgm.
%
% INPUTS:
% Zgp - Geopotential Height in meters (numeric)
% Lat - Latitude in degrees (numeric)
%
% OUTPUTS:
% Zgm - Geometric Height in meters (numeric)
%
% NOTES:
% Validated by ...... |
%#eml
function [P_proj_circle] = Project_to_circle(P,P_center,R)
P_proj_circle = P_center + R*JojoUnitVector(P - P_center); |
function [logMLE, theta, sterr, u_hat, non_par_u_hat, V_u_hat, u_hat_conditional_w1w2, V_non_par_u_hat] = nested_AppLoglikelihood_ALS77(y, x1, x2, x3, theta0)
Options = optimset('TolX', 1e-8, 'TolFun', 1e-8, 'MaxIter', 20000, 'MaxFunEvals', 6 * 20000, 'Display', 'Off');
[theta, logMLE] = fminunc(@AppLoglikeliho... |
function x = compute_hadamard_quadratic(F,G,M,N,i,j)
x = 0;
for k=1:size(F,3)
x = x + 2*(F(i,i,k)*G(j,j,k) + M(i,j,k)*N(i,j,k));
end
x = real(x); |
function passed = test_obtain_neighbor_tets
tets = [ 1,2,3,4; % 1
2,3,4,6; % 2
1,2,3,7; % 3
1,2,4,5; % 4
1,3,4,8; % 5
];
[sibhfs]=determine_sibling_halffaces(8,tets);
sibhfs=int32(sibhfs);
[sibhfs_struct]=determine_sibling_halffaces(8,tets,true... |
function [x, it] = zeroBisection(f, a, b, errMax)
it = 0;
while true
c = (a+b)/2;
if abs(f(c))<errMax
x = c;
return;
elseif f(a)*f(c)<0
b = c;
it = it+1;
continue;
elseif f(c)*f(b)<0
a = c;
it = it+1;
continue;
else
%error
... |
% code by mg
% transforms physical coordinates into image coordinates. Documentation is
% on Matlab "Single camera calibrator"
% a cameraParams.mat file is required which can be obtained with the matlab
% camera calibrator app.
imgNumber = 1;
physCoord = [400,0,0,1]; % units are in mm
% load the cameraParams
... |
net = selforgmap([3 3],100, 3, 'gridtop', 'linkdist');
x1 = randn([2,20]) + [20;0];
x2 = randn([2,20]) + [0;20];
x3 = randn([2,20]) + [0;0];
x4 = randn([2,20]) + [15;15];
x5 = randn([2,20]) + [4;10];
x6 = randn([2,20]) + [10;4];
P = [x1, x2, x3, x4, x5, x6];
net = configure(net,P);
plotsompos(net,P)
net.trainParam.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.