text stringlengths 8 6.12M |
|---|
function ModRegFal = ModRegFal(f,a, b, n)
format long;
%a = input('Enter a value for lower boundary a: ');
%b = input('Enter a value for upper boundary b: ');
%n = input('How small should should the error be (to what -power)? ');
if (f(a)*f(b) > 0 )
disp ('Invalid values of a and b. Program Closing')
return;
... |
function table_ploth_textboxes(figure1)
% Create textbox
annotation(figure1,'textbox',...
[0.050968454258675 0.454698795180726 0.0857507886435331 0.0361445783132608],...
'String',{'DIV22'},...
'FitBoxToText','off',...
'LineStyle','none');
% Create textbox
annotation(figure1,'textbox',...
[0.050... |
%% Function, calculate Jacobian
% For the first linkage
function j_out = cal_J_el(th1, th2, th3, l1)
% thetat degree 2 rad
th1 = deg2rad(th1);
th2 = deg2rad(th2);
th3 = deg2rad(th3); % not use
j_out = [0, l1*cos(th2), 0;...
-l1*cos(th1)*cos(th2), l1*sin(th1)*sin(th2), 0;...
-l... |
function [u_cmd, a_cmd] = thrust_allocation_3(t_ref)
% parameters
lx_1 = 0.3875;
lx_2 = -0.4574;
ly_1 = 0.055;
ly_2 = -0.055;
K1 = 1.03;
K2 = K1;
K3 = 2.629;
K = diag([K1, K1, K2, K2, K3]);
B = [
1 0 1 0 0;
0 1 0 1 1;
ly_1 lx_2 ly_2 lx_2 lx_1;
];
% Calculate thrust cmd using pseude inverse method
u_star... |
%% SEIR Model ODE Equations using non-homogenous coverages
function Xdot = Yaws_ODE_FileV2(t,X)
global rho ...
betaONE ...
betaTWO ...
mu ...
alpha1 ...
alpha2 ...
gamma1 ...
gamma2 ...
proportion ...
epsilon ...
eta ...
t... |
function rho=intervalEstimationOfCorrCoeff(r,n)
% rho=intervalEstimationOfCorrCoeff(r,n)
%
% Provides a 95% confidence interval for the underlying correlation coefficient rho
% See page 502 of Fundamentals of Biostatistics (6th edition) by Bernard Rosner
% or page 460 of the 7th edition
z=0.5.*log((1+r(:))./(1-... |
clc;clear;
%% Model Shape
lambda_i = 0.35;% inner radius
lambda_o = 0.55;% outer radius
delta = 4; % focal radius, cm
Nphi = 200;
phi = linspace(0,360,Nphi)/180*pi;
Nl = 100;
lambda = linspace(lambda_i,lambda_o,Nl);
Ni = 100;
ita = linspace(0,120,Ni)/180*pi;
[PHI,LAMBDA,ITA] = ndgrid(phi,lambda,ita);
x = de... |
function [w_n,y_hat,e_n] = DFT_CLMS(y,x_n,mu,gamma)
%Implementation of the DFT-CLMS algorithm
%filter weights adapted using CLMS algorithm, and will converge to DFT
%solution if learning rate = 1
N=length(y);
y_hat = complex(zeros(N,1));
w_n = complex(zeros(N,N));
e_n = complex(zeros(N,1));
for i =1... |
function [matrix] = create3Dmatrix(size1,size2,size3)
matrix = zeros(size1,size2,size3);
end |
function cloud_point(mesh)
%»æÖƵãÔÆÍ¼ ÊäÈëmesh
count1=0;
model_vert = mesh.m_verts;
[n,~] = size(model_vert);
for i=1:n
count1=count1+1;
verts(count1,1)=model_vert(i,1).x;
verts(count1,2)=model_vert(i,1).y;
verts(count1,3)=model_vert(i,1).z;
end
scatter3(verts(:,1),verts(:,2),verts(:,3));
axis equal
... |
%{
vis2p.StatsImages (computed) #
-> vis2p.StatsImagesParams
mouse_id : smallint unsigned #
exp_date : date #
scan_idx : smallint unsigned #
movie_num : tinyint unsigned # the number of the movie shown
movie_type : varchar(10) # the type o... |
% ADVISOR file: fuzzy_target_compute_emissions.m
%
% Notes:
% This file is accessed from the control block to determine the optimal
% IC Engine torque point, calculated based on minimizing a cost function
% based on emissions and fuel efficiency
% Created on: 28-Oct-2001
% By: AR, OSU, rajagopalan.11@osu.edu
%
% Rev... |
function [Q,x,t,cons] = advComp(xSteps,ratio)
%Problem 2.1 Lax-Friedrich method
%given variables
Tend = 2.5;
L = 10;
H = 1;
g = 9.8;
w = 0.1*L;
%calculate number of steps
dx = L/xSteps;
dt = ratio*dx;
tSteps = round(Tend/dt);
%flux function
f = @(u) [ u(2) , u(2)^2./u(1) + 0.5*g*u(1).^2];
%Lax-Friedrich flux function
... |
function plot_color_cloud(H, colorspace)
if nargin < 2
colorspace = 'rgb';
end
[rbins, gbins, bbins] = size(H);
mask = H(:) > eps * 10;
S = (H(mask) ./ max(H(:))) * 200;
[X, Y, Z] = meshgrid(1:rbins, 1:gbins, 1:bbins);
switch colorspace
case 'rgb'
C = [double(Y(mask)) / rbins, double(X(mask)) / gbins,... |
% Model for a variable stiffness (VS) cable actuator using torsion spring
% coils.
%
% Please cite the following paper when using this VS actuator:
% S.H. Yeo, G. Yang, and W.B. Lim, "Design and Analysis of Cable-Driven
% Manipulators with Variable Stiffness", Mech. Mach. Theory, Vol. 69, pp.
% 230-244, 2013.
%
% Auth... |
function [] = Engage_Space2()
global H
global XStimParams
global TDT
global FN
global C_
global M_
global GUI
% Engage_Space2
TDT.buf_pts=1000;
% short buffer length seems to alleviate overplaying glitch
%*******************************************************************************
% The Space Test ... |
% MLBBATCH Automatically import data from multiple files.
%
% Demonstrates using a FOR-loop in conjunction with programmatic import
% methods to import data from multiple files. In this example, three
% separate course files -- i.e., 'mlb07al_east.dat', 'mlb07al_central.dat',
% and 'mlb07al_west.dat' -- contain data t... |
function [imageB] = csvreadfile(image)
R1 = 9;
C1 = 0;
data = csvread(image,R1,C1);
% dataA = uint16(gray2ind(data(:,3)));
dataB = uint16(65535*mat2gray(data(:,3)));
% imageA = vec2mat(dataA,2048);
imageB = vec2mat(dataB,2048);
% imageC = imdivide(imageA,imageB);
% Ia = flip(imageA,1);
% Ib = flip(imageB,1);
% Ic =... |
% $Header: svn://.../trunk/AMIGO2R2016/Postprocessor/Post_Report/AMIGO_report_local_rank.m 2202 2015-09-24 07:10:57Z evabalsa $
% AMIGO_report_local_rank: reports local ranking of unknowns
%
%******************************************************************************
% AMIGO2: dynamic modeling, optimization and cont... |
function w = Hanning(N)
% returns a Hanning window of N points
n = 0:1:(N-1);
arg = 2*pi/N;
w = (1-cos(n*arg))./2;
end
|
global fonttype
global fontsize
markerSZ = 75;
lineWD = 1;
load('rawMaterial\4_300.mat')
N = 0.5*(length(X)-1);
fprintf("\n*******************\nGoal 1 : PS performance on stiff systems for VDP \nwith mu = +- %.2f and N = %d\n*******************\n", mu, N);
prm.model = 'vanderpol';
prm.mu = mu;
trajData = getTrajDat... |
function [ V, E, adjList, faceList, Gamma ] = embryoInitGraph( GT, spacing, optInitSpline, parallel )
%EMBRYOINITGRAPH Compute initial splines and vertices from ground truth.
%
% INPUTS
% GT: ({0,1}^2 matrix) Ground truth of embryo image.
% spacing: (scalar) spacing between each control point in pixels.
% optInitSpline... |
function out = diffpoles(polesA, polesB, len)
% diffpoles - compare xfer functions of 2 allpole filters
% out = diffpoles(polesA, polesB, len)
%
%------------
% returns:
% out : the mean squared error
%------------
% arguments:
% polesA : poles of the first filter. should be complex conjugate pairs for a real impul... |
% this takes in two sets of vertices marking boundaries of two polygons of
% the same type that are too close
% This code ASSUMES that the two polygons are only close in ONE PLACE. It
% WILL break if they are close in two places. It throws an error if this
% occurs
function newVertices = resolveTwoSame(vertices1,ver... |
%%% LSTM网络结合实例仿真
%%% 作者:xd.wp
%%% 时间:2016.10.08 12:06
%% 程序说明
% 1、数据为7天,四个时间点的空调功耗,用前三个推测第四个训练,依次类推。第七天作为检验
% 2、LSTM网络输入结点为12,输出结点为4个,隐藏结点18个
clear all;
clc;
%% 数据加载,并归一化处理
[train_data,test_data]=LSTM_data_process();
data_length=size(train_data,1);
data_num=size(train_data,2);
%% 网络参数初始化
% 结点数设置
input_num=12;
cell_... |
n=100;
x = rand(n, 500);
xbar = mean(x);
histfit(xbar); |
duration = 10;
for lambda = [50 100 200 300]
for Amul = [1 2]
lambdaA = lambda * Amul;
lambdaC = lambda;
fprintf("lambdaA = %d, lambdaC = %d\n", lambdaA, lambdaC);
CSMA1A
CSMA1B
CSMA2A
CSMA2B
end
end |
function table = pascalTable(n)
table = zeros(n+1,n+1);
for i = 1:n+1
table(i,1) = 1;
table(i,i) = 1;
for j = 2:i-1
table(i,j) = table(i-1,j-1)+table(i-1,j);
end
end
end |
% Add the functions folder and the mcmcstat-master to the path before to run other codes
yourpath = '~/Dropbox (Personal)/2019Demory_bioRxiv/';
addpath(strcat(yourpath,'/Functions/'));
addpath(strcat(yourpath,'/mcmcstat-master/'));
|
function [result, centers, result_scales] = ...
multiscale_detection_results(frame, scores, scales, object_size, ...
suppression_factor, number)
% function [result, centers] = ...
% multiscale_detection_results(frame, scores, hand_size, ...
% sup... |
function [ K ] = kernel_function( a, lambda, bandwidth )
x = (a*transpose(a))/(bandwidth^2 );
if x <= lambda
K = 1;
else
K = 0;
end
end
|
function [ S ] = PCF( R, F, beta, gamma, lambda )
%UNTITLED14 Summary of this function goes here
% Detailed explanation goes here
disp('Parameters: ')
fprintf('beta=%f\n', beta)
fprintf('gamma=%f\n', gamma)
fprintf('lambda=%d\n', lambda)
[m,n] = size(R);
d = size(F,2);
H = eye(n) - 1/n;
FH = F'*H;
Q = FH*F + beta*e... |
function [d,v] =perim_distance(w,g)
%computes distance from ignition to furthest point on perimeter, avg ROS to get there
%in straight line
% input - w, struct with tign
% g, struct with detections
%output -d,v distance (m), ros (m/s)
r = subset_domain(w);
min_t = min(r.tign_g(:));
max... |
function [data, stim] = Vortex_initialise(varargin)
% initialise all variables
% function [data, stim] = Vortex_initialise([ppnr], [ntrials], [nblocks])
%% DEFAULT VALUES
optargs = {99 400 10};
% Now put these defaults into the valuesToUse cell array,
% and overwrite the ones specified in varargin.
specif = find(~ce... |
f=fopen('coriolan.txt');
A=fread(f,inf,'uint8');
fclose(f);
[C,IA,IC]=unique(A);
table=histcounts(IC,1:(length(C)+1));
bar(C);
p=table/sum(table)
entropy=sum(-p.*log2(p)); |
% 2019-02-02 This function calculates long complex signal
function [signal_complex] = calc_signal_complex(z, T, F, Fs, phi)
% input:
% z - received signal (Rx signal)
% T - window of filter (quantity of samples per one BPSK/OOK symbol)
% Fs - sample rate
% F - carrier frequency of signal,... |
function [] = interactiveTopoSpecPlot(data,allFreqs,sigFreqs)
%function [] = interactiveTopoPlot(data,x)
%
% helpful help here
%
%Do some sanity checks here
%if wrong
%dosomething
%end
if nargin<2
x = 1:size(data,1);
sigFreqs = [];
elseif nargin<3
sigFreqs = [];
x = allFreqs;
else
x = allFreq... |
function [net1,net2,net3,net4,net5,net6] = TrainLM()
% %script imports saturated steam table values from Steam_Tables.xlsx sheet
% P in bar
% T in C
% v in m3/kg
% u in KJ/kg
% h in KJ/kg
% s in KJ/(kg K)
%import steam table values
filename = 'Steam_Tables.xlsx';
satval = xlsread(filename,'Saturated','C5:I4032');
s... |
function x = Solve6DOF(F,x0,P,dt,varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Function Name: Solve6DOF
% Function Author: Steve Clark
% Class: AAE 568
% Term: Sp2018
%
% SCRIPT DESCRIPTION:
% Calculates... |
%> @file data.m
%> @brief A generic class used for holding a list of values
%> @brief A generic class used for holding a list of values
%> @author Ben Nordin
%> @date 2011-09-01
% ======================================================================
%> @brief A generic class used for holding a list of values
%> @brief... |
function [Jac,detJ,Jhat] = C3D8_El_Jacobian(NE,xi,eta,mu,xyz,DNshape)
Jac = zeros(3);
for i=1:NE
Jac(1,1) = Jac(1,1) + DNshape(i,1)*xyz(i,1);
Jac(1,2) = Jac(1,2) + DNshape(i,1)*xyz(i,2);
Jac(1,3) = Jac(1,3) + DNshape(i,1)*xyz(i,3);
Jac(2,1) = Jac(2,1) + DNshape(i,2)*xyz(i,1);
Jac(2,2) = J... |
function blkStruct = slblocks
% This function specifies that the library 'matlabinput_lib'
% should appear in the Library Browser with the
% name 'MatlabInput'
Browser.Library = 'matlabinput_lib';
% 'matlabinput_lib' is the name of the library
Browser.Name = 'MatlabInput';
% 'MatlabInput'... |
% File: VPrintf.m @ M4DAC16
% Author: Urs Hofmann
% Mail: hofmannu@ethz.ch
% Print output of command only if flagVerbose is enabled
function VPrintf(dac, varargin)
if dac.flagVerbose
fprintf(varargin{:});
drawnow;
end
end |
clear all
close all
clc
f0=0.2; %frecventa fundamentala,ce reprezinta un parametru de intrare pentru functia definita
T=1/f0; %este egal cu 5, adica perioada noastra este de 5 secunde
t= 0:0.002:T; %Vom afisa o perioada a semnalului, cu rezolutia temporara de 2ms
figure(1);
plot(t,fc(t,f0)),grid,title('Pentru 2m... |
clearvars
close all
% auto recognizing the number of files to work on:
numf = dir('*.wfm');
numfil = size(numf,1);
tic
filetitle='mso64';
names=zeros(20,20);
wfm=dir('*.wfm');
wfmcell=struct2cell(wfm);
namcell=wfmcell(1,1:numfil);
for i=1:numfil
nam=cell2mat(namcell(1,i));
names(i,:)=nam;
na... |
function [X,snaps,T,N,beta,gamma] = funAB(lig,x0,par)
%% Parameters
T = par{1}; %foraging time
L = par{2}; %domain
dt = par{3}; %timegrid
dx = par{4}; %space grid
v = par{5}; % swimming velocity
beta = par{6};
gamma = par{7};
saveInt = par{8};
N = par{9};
folder = par{10};
profNum = par{11};
seed = pa... |
function newclust=selectspikes(chanclust,fnum,current,offset,lev1,lev2)
%This function accepts a list of spikes, and returns those spikes that occurred when 'current' is between lev1 and lev2
%chanclust: g.chanclust, a subfield of the variable "g" contained in the sorted spike .mat file from groupcw
%fnum:filenum
%curr... |
function [fmu,fvar] = predRegStructured(m, conf, x, xstar)
%% pred regression for structured case
%PREDREGRESSION [fmu,fvar,yvar] = predRegression(m,conf,xstar)
% Prediction by a regression model with single latent function.
Q = m.Q; Nx = m.Nx;
s_rows = (0:(Q-1))'*Nx + 1;
e_rows = (1:Q)'*Nx;
nBinary = Q^2;
s_rows = ... |
push 1
push 4
push 6
push 3
pall
div
pall
|
%Hra 'Dožene tě příšera' spočívá v následujícím principu
%Matlab 2015b
% Máte panáčka, muže či ženu, v další případě oba a házíte kostkou. Jakmile
% uděláte tři tahy vyjede za Vámi hrůzostrašný Roshan (pokud hrajete za dva,
% tak máte dohromady tahů šest), který jakmile Vás chytí tak vás sežere,
% tím pádem ztrác... |
function stl2fv2sat( varargin )
%STL2FV2SAT converts an .stl geometry to .mat patch and .sat format.
% The geometry can be shifted to a desired location.
% The following functions by Adam H. Aitkenhead are used:
% - READ_stl
% - WRITE_sat
% ... |
function VMT_BuildTecplot_XSBathy(V,savefile)
% Takes the processed data structure and writes a TecPlot ASCII data file
% containing the mean cross section bathymetry.
% Modified from code by Frank L. Engel, USGS
%
% P.R. Jackson, USGS
% Last Edited: 2/20/2013
%
% 11-7-11: Fixed the issue with improper IJK dime... |
function [t,p,df,M]=gonesampttest(data,k,outliers,printoutput)
% usage: [t,p,df,M]=gonesampttest(data,k,outliers,printoutput)
% assumes outliers coded 0 and 1
if nargin<2, k=0; end
if nargin<3, outliers=zeros(size(data,2),1); end
if nargin<4, printoutput=0; end
%SO: aka if there are no outliers
if length(uniqu... |
function skeleton_object = attach_skeleton_object(complete_skeleton, object_data_3d, numberOfObjects, action_length)
matnumberOfObjects = cell2mat(numberOfObjects);
MaxNumObjects = max(max(max(matnumberOfObjects(:,:,:))));
skeleton_object = zeros(size(complete_skeleton,1),size(complete_skeleton,2),size... |
%%
% 28*28 image
tr = csvread('train.csv', 1, 0); % read train.csv, read
%from row 2 column 1
sub = csvread('test.csv', 1, 0); % read test.csv
%%
figure % plot images
colormap(gray) ... |
function data = preprocess(data)
indice = find(data>40);
data(indice) = min(data(indice)+30,255); |
classdef Protocol < handle
%% Protocol
% 连接仪器
% open、close、delete
%% Comment
% address格式为一维元胞,且address{1}固定为连接协议类型:VISA-GPIB、VISA-TCPIP、GPIB、TCPIP
%% 以下为正文
properties(Access = public)
handle
address
end
methods
%% connect
... |
% clear
% close all
% load FRcnn480.mat
[filename,pathname]=uigetfile({'*.jpg','car1'});
if(filename==0),return,end
global FILENAME %定义全局变量
FILENAME=[pathname filename];
img=imread(FILENAME);
% img=imread('D:\腾讯\Tencent Files\综合课设\Part2设计图片库\车牌识别训练库\sub_test_pics\车牌识别测试库\90.jpg');
img_temp=imresize(img,FRc... |
%starcon transforms a starpolygon into a polycon and
%constructs the polycon "Wachspress Coordinates".
%GADJ finds the common divisor from the adjacent factors.
%12/2/2016
display('x and y are vertex coordinates counter-clockwise')
display('with a = 0 for concave and 1 for convex vertices')
nodes = input('[a...; ... |
function lineGraph(app)
% coded by mk mcguirk
% plots the first line graph
myRow=findCountry(app.countryDropDown.Value);
[x,y]= arrayMaker(myRow);
if size(x)==0
plot(app.plotAxes,0,0);
else
plot(app.plotAxes,x,y,'b-');
end
end |
function [learner] = configureRandomSampling(~,~,~,~,~,k,~)
%Random sampling has no parameters to configure, we are simply using this
%wrapper function for convenience and consistency.
learner.train = @(X,y) randomSampling(X,y);
learner.featureType = 's';
learner.labelSize = k;
learner.name = 'Random Sampling';
end |
A = [12,23,12,34];
B = [12;21;2;3];
multiply_vectors(A, B); |
clear;
close;
clc;
%Finding a
a=linspace(0,2,100);
i=sqrt(-1);
z=1+(a*i);
y=imag(z.^3);
a_theoretical=roots([-1 0 3 0]);
ind = find(a_theoretical > 0);
a_val = a_theoretical(ind)
plot(a,y,'LineWidth',4, a_val,0,'ro','LineWidth',4);
grid
xlabel('a')
ylabel('Im(z)')
legend('','solution',"location","northeast")
print -de... |
% modified by veena to work with OSX BART and KBQUEUE
% 12/30/07
if ~exist('ntrials'),
fprintf('load the data file first!');
return;
end;
for t=1:ntrials,
if trial_info(t).finished==0,
ntrials=t-1;
break;
end;
end;
pay_levels=[0.25];
pl=zeros(1,ntrials);
bl=pl;
explod=pl;
tt=pl;
npress=... |
function [U] = getU_surface_e(surface_id)
global Infor_surface
[A] = Infor_surface{8, surface_id};
[A_noOpenning] = Infor_surface{9, surface_id};
UA = 0;
UA_win=0;
if isstruct(Infor_surface{5,surface_id})
Num_openning = length(Infor_surface{5,surface_id});
for i_openning = 1:Num_ope... |
function [lin_corrs, fft_corrs] = correlate(testset, database)
%% Function input
% input1 and input2: The two input data matrices to correlate
%% Function output
% output:
%% Function implementation
testset_smaller = 1;
% Get the number of videos we are correlating
tests... |
function [dt]=deseason(y,dates);
% dates em numero juliano
dd = round(mean(diff(dates)));
T = length(y);
if dd == 1
nn = 365;
elseif dd == 30
nn = 12;
end
% figure
% plot(dates,y)
% hold on
% datetick('x')
% Smooth the data using a 13-term moving average.
sW13 = [1/(nn*2);repmat(1/nn,nn-... |
function [ output_args ] = plot( obj)
%plot » K Chart with high low open close
% range vector, ÀýÈç[5:100]
% --------------------------------------------
% ver1.0; Cheng,Gang; 20130404
candle(obj.high, obj.low, obj.close, obj.open );
end
|
% Calculate neighbours matrix
function nb = calc_neighbours(labels)
nlabs = max(max(labels)) ;
nb = zeros(nlabs,nlabs) ;
for rc=1:size(labels,1);
for cc=1:size(labels,2);
if(rc<size(labels,1));
nb(labels(rc,cc),labels(rc+1,cc)) = 1 ;
nb(labels(rc+1,cc),labels(rc,cc)) = 1 ;
... |
close all
clear all
%% Beleg Betriebsfestigkeit
%Aufgabe 3: oertliches Konzept
%Variablendeklaration
%Kennwerte der ZSD - Kurve und DWL
syms sigma_f b epsilon_f c K_s n_s
%Laufvariable d. ZSD u. DWL
syms sigma N
%Daten aus Aufgabenstellung
epsilon_a=[0.0081;0.008;0.005;0.0035;0.003;0.0028;0.0024;0.0021;0.002;0.0019;0... |
clc;close all; clear all;
% im = iread('im3.jpeg');
im = iread('3_shapes.png');
im = imresize(im, [300 NaN]);
imr = double(im(:,:,1))./255.0;
img = double(im(:,:,2))./255.0;
imb = double(im(:,:,3))./255.0;
imR = (imr./(img+imb+imr));
imG = (img./(img+imb+imr));
imB = (imb./(img+imb+imr));
imR = imR < 0.3;
imG = imG < 0... |
function diff = centerSurroundDiff(I2,I3,I4,I5,I6,I7,I8)
%% centerSurroundDiff
% I0: Imagen de entrada
% diff: Diferencia centro-al rededor
method = 'bilinear';
% Interpolacion
I25i = imresize(I5, 8,method); I26i = imresize(I6,16,method);
I36i = imresize(I6, 8,method); I37i = imresize(I7,16,method);
I47i = imresi... |
function path = ofc_learning_choosing_path()
% Edit this to be the path to the folder where you have checked out
% the ofc-learning-choosing-paper repo
path = 'C:\Users\kjmd1\Documents\Github\Code_for_projects\ofc-learning-choosing-paper';
end |
function [CRF,freqVec1,freqVec2] = crossfreqCoh(S1,S2,freqVec,Fs,nfft,width);
% function [CRF,freqVec1,freqVec2] = crossfreqCoh(S1,S2,freqVec,Fs,nfft,width);
%
% [CRF,freqVec1,freqVec2] = crossfreqCohHann(Data,Data,2:2:100,1200,2048,6);
% imagesc(freqVec1,freqVec2,CRF);axis xy
% xlim([0 100])
%
%
% width = 6 or 7
%
% ... |
function pramati01()
close
th = linspace(0,360,100);
x = cosd(th);
y = sind(th);
axis([-1 1 -1 1]);
hold on
for count = 1:numel(th)-1
plot([x(count) x(count+1)], [y(count) y(count+1)], '-ko', 'markerfacecolor', 'r')
pause(0.1)
end
end |
function qPd = quantize_pd(model)
n_zones = model.n_zones;
fov_len = model.fov_len;
phi = model.phi;
qPd = quantize(n_zones,fov_len,phi);
end
function qPd = quantize(n_zones,fov_len,phi)
qPd = zeros(1,n_zones);
dmin = 17;
dmax = 92;
d = 0:0.1:100;
sense = zeros(1,length(d));
for i=1:length(d)
sense(i) = P... |
function [fitresult, gof] = bindingCurve(chamber, ratio,name)
%CREATEFIT(CHAMBER,RATIO)
% Create a fit.
%
% Data for 'Binding Curve' fit:
% X Input : chamber
% Y Output: ratio
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT... |
% generuju c soubor
data = fopen('data.c', 'w');
% generuju h soubor
headers = fopen('data_headers.h', 'w');
fprintf(data, '#include "data_headers.h"\n\n');
% for all images
for i=1:26
fileName = ['image' num2str(i) '.mat'];
image = load(fileName);
printMatrixC(data, ['int8_t image' num2st... |
address1 = 'http://www.hbets.cn/index.php/index-show-tid-11.html';
%address2 = '.jhtml';
j = 0;
for k = 1:1868,
if k == 1,
address=address1;
[s, error] = urlread(address);
else
address=strcat(address1,'?p=',num2str(k));
[s, error] = urlread(address);
end
sep1 = strfind(s,'<div class="fu... |
%%Problem 4
% Program to Obtain the steady state fully developed flow profile for the liquid flowing through a cylindrical pipe
clc;
clear all;
close all;
mu = 0.001; %viscocity of liquid in Kg/m.s
L = 0.2; %length of a pipe in meter
R = 0.025; %radius of a pipe in meter
dP = 0.1; %pre... |
function [ hx ] = homogeneousCoords( x )
% This function converts data points of different scales to a common
% scale of 1. Note that points with scale of 0 are left unchanged.
%
% Input elements
% -->x: input data points
%
% Output elements
% -->hx: output data points
% Check for valid data points array
if (size(x,1)... |
clear
clc
load inputdata.mat
warning('off');
KK=5;
r=0.5;
% based on LPLNS-WKNKN
md_adjmat_new=WKNKN( md_adjmat, miRNA_sim, disease_sim, KK, r );
% based on LPLNS
%md_adjmat_new=md_adjmat;
%disease based LPLNP
interaction_matrix=md_adjmat_new';
neighbor_num=50;
alpha=0.5;
similairty_matrix=Label_Propagation(in... |
%similar to parser, but generate the data online from a feasible future model and the instaces
function [x_nr_unique,y_nr_mean,y_nr_err, x_nt_unique,y_nt_mean,y_nt_err, x_t_unique,y_t_mean,y_t_err,success_vector] = solve_and_plot_charging(nFiles, folder, prefix, alg, use_vector)
x_nr=[];
y_nr=[];
x_nt=[];
y_nt=... |
function Meta = IPM_parameters_fit(Species,Site,Type)
% Create all parameters used in the IPM statespace model
% 'Species' is a string giving 4-letter species code
% 'Type' is pre2007, post2007MPA (MPA sites) or post2007fished (fished
% sites)
% 'Site' is a string giving the MPA region to be modeled
Meta.Species = {... |
% script para chequear de manera rápida si una calibración sigue teniendo
% validez.
% El input es la medición de una misma punta con las dos cámaras
clear variables
% hay que unificar estos dos criterios
path_datos_1 = 'C:\Users\60069978\Documents\MATLAB\medicion38\intento_simple\';
path_datos_2 = 'C:\Users\... |
% $Header: svn://.../trunk/AMIGO2R2016/Kernel/AMIGO_lFIM.m 770 2013-08-06 09:41:45Z attila $
function [FIM]= AMIGO_lFIM(ntheta,ssquare,sens,dssdy,inputs,privstruct,iexp);
% AMIGO_lFIM: computes the Fisher Information Matrix for local unknowns
%
%************************************************************************... |
function [Rs, ts] = approx_pose_min(projs, vis_p)
b = -[1;0;0];
wvec = zeros(36*6, 1);
us = zeros(6, 6);
vs = zeros(6, 6);
ind = 1;
ind_w = 1;
for pi = 1:3
%vs cam 1
for mi = 1:2
for oi = 3:4
if (vis_p(pi, mi)==1 && vis_p(pi, oi) == 1)
... |
function [r_idx,r_zdist] = kmeansRegion(Xr,K)
% If input is full state, convert to region state
if size(Xr,1) == 16
Xr = fullToRegionState(Xr);
end
%Zscore normalize vector to compare to means in region space
Xrz = bsxfun(@minus, Xr, K.xr_means);
Xrz = bsxfun(@rdivide, Xrz, K.xr_stds);
r_idx = zeros(... |
function [H, V, time] = get_peri_saccade(locs, data, n, r)
%%
global hfig
H=[];
V=[];
time=[];
if ~isempty(locs) && isfield(hfig, 'peri_saccade')
time = 1/r.sampf : 1/r.sampf : 400 * 1/r.sampf;
time = repmat(time', [1, length(locs)]);
H = time;
V = time;
for i = 1:length(locs)
t_point = (l... |
classdef DSP_IO < handle
properties
HEADER_FILE_NAME = '__HEAD__.txt';
CONTENTS_FILE_NAME = '.contents.txt';
DESCRIBE_FILE_NAME = '.describe.mat';
SESSIONS_FOLDER_NAME = 'sessions';
OUTER_HEADER_CATEGORIES = { 'days' };
INNER_HEADER_CATEGORIES = { 'monkeys', 'drugs', 'days' };
SAVE_SEGM... |
%MULTIPLE_MLS_2P5D Summary of this function goes here
% Detailed explanation goes here
function mlsD1 = MLS_2p5D_multiple( D, P, h )
[M,N] = size(D);
mlsD1 = zeros(M,N);
parfor i=1:M
for j=1:N
r = [i, j, D(i,j)];
if( ~isnan(r) )
q = MLS_2p5D_single(P, r, h);
mlsD1(i,j) = q(3);
e... |
1;
graphics_toolkit("gnuplot");
## Installing the package.
%pkg install discontclust-0.1.0.tar.gz
## Importing useful packages.
pkg load io
pkg load image
pkg load statistics
pkg load discontclust
## General plot parameters.
projectionType = 'equalarea';
symbolSize = 5;
## Import data from 'txt' file.
filename = 'v... |
clear variables;
close all;
% 1 cf feuille waw g réussie seule presque !
N = 10000;
lambda = 0.3;
mu = 0.5;
alpha = lambda + mu - lambda*mu;
X = zeros(1, N);
Y = zeros(1, N);
Z = zeros(1, N);
for k = 1: N
X(k) = LoiGeometrique(lambda);
Y(k) = LoiGeometrique(mu);
Z(k) = min(X(k), Y(k));
end
m = max(max... |
classdef poolLayer
%POOLLAYER Summary of this class goes here
% Detailed explanation goes here
properties
method;
poolSize;
stride;
pad;
input;
output;
delta;
end
methods
function layer = poolLayer(method, poo... |
function X = gauss(A,B,n)
[A, B] = pivoteamentopar(A, B, n);
x = substituicaoreversa(A, B, n);
X = x;
#round(X .* 1000)/1000
endfunction
function [a, b] = pivoteamentopar(A, B, n)
for j = 1:n
# printf("\n\nFASE: %d\n\n",j)
[pivo, k] = maior(A, j, n);
#permutação da matriz A -> linha j com a l... |
function calc_voigt_shapes_allisotopes(hitran_folder,wn,gasvec,alt,air,T,P,densmat,output_folder)
% calc_voigt_shapes_allisotopes(wn,gasvec,alt,air,T,P,densmat,output_folder)
P_atm = P/1013.25;
for gasloop=1:length(gasvec)
gas = cell2mat(gasvec(gasloop));
dens = densmat(gasloop,:);
disp('')
... |
% import to check
clear all
close all
clc
listing = dir('../Anchor1/copyFromPi/Footstep/');
count = 0;
for i = 1 : length(listing)
if sum(ismember(listing(i).name,'txtout')) == 9
count = count + 1;
signal1{count} = importdata(['../Anchor1/copyFromPi/Footstep/' listing(i).name]);
end
end
listi... |
%ABSTRACT
% Library function for SDCM. Weighted empirical CDF:
function [SX,CDF,mass,SI] = ecdfW(X,W)
%Initialize:
bWeighted = nargin>=2 && all(size(W)==size(X));
BValid = ~isnan(X);
if(bWeighted) BValid = BValid & ~isnan(W); end
%compute the CDF over sorted positions:
[SX,SI] = sort(X... |
function SimulateCells(aImarisApplicationID)
% ImarisXT: simulate cells in 3D image with the desired models.
%
% DESCRIPTION
%
% ImarisXT: Simulation of cells given a mask where they are allowed. The user is
% asked the number of simulations to be included. Two distributions are
% created: a common Poisson distr... |
clear;
close all;
IMG = imread('Nautilus.pgm');
p = size(IMG,1);
q = size(IMG,2);
sigma = 1;
N = ceil(sigma*6 + 1);
gauss = zeros([N,N]);
for i = 1:N
for j = 1:N
gauss(i,j) = (i-N/2)^2 + (j-N/2)^2;
end
end
if (N==1)
gauss = 1;
else
div = 1/(2*pi*sigma*sigma);
g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.