text stringlengths 8 6.12M |
|---|
clear all
clc
%Simulação para análise gráfica das faltas
%Autor: Guilherme Lopes
%Universidade Federal do Piauí
faltas_polo_polo = './faltas_polo_polo/';
faltas_polo_terra = './faltas_polo_terra/';
falta = 'L30R5.000.mat';
nome_polo_polo = strcat(faltas_polo_polo,falta);
nome_polo_terra = strcat(faltas_polo_terra,... |
function customwrite(filename,output,delimiter,mode)
% original (cell2csv.m) by Sylvain Fiedler, KA, 2004
% modified by Rob Kohr, Rutgers, 2005 - changed to english and fixed delimiter
% modified and adapted by Matthias Scharfe, 2014 simpler code
%mode: 'w': create new file and overwrite
%'a': append
% Open the file
... |
function b = buildBoundsStruct()
global parami iparam pMax pMin baseParameters fparam
keys=baseParameters.keys
for i=1:length(keys)
k=keys{i};
if fparam(k)==1
end
end
end |
function [bar_torque,hyst_torque,gyro_torque,gg_torque,aero_torque,sun_torque,eddy_torque,res_torque]...
=plotT(T,time,q,w,B_in,Bhyst,eci,vel,dens,sun,m,hyst_l,hyst_d,nrods)
% function [bar_torque,hyst_torque,gyro_torque,gg_torque,aero_torque,sun_torque,eddy_torque,res_torque]...
% =plotT(T,time,q,w,B_in,Bhyst,... |
% This function implement copula distance L2
function s4 = copula_distance_L2(xin,yin)
% Parameters
% ----------
% xin: observations for random variable X
% yin: observations for random variable Y
%
% Returns
% -------
% s4: Copula correlation coefficient between random variables X, Y
% according to their observations ... |
clear
clc
close all
%% Simulated time-varying MVAR model
% Reference of the simulated model:
% [1] M. Winterhalder, B. Schelter, W. Hesse et al., “Comparison of linear
% signal processing techniques to infer directed interactions in multivariate
% neural systems,” Signal Processing, vol. 85, no. 11, pp. 2137... |
function [Parent1, Parent2] = SSelection(pop)
M = length(pop.Chromosomes);
[sorted_fitness, sortedx] = sort([pop.Chromosomes(:).normalized_fitness], 'descend');
for i = 1 : M
temppop.Chromosomes(i).Gene = pop.Chromosomes(sortedx(i)).Gene;
temppop.Chromosomes(i).fitness = pop.Chromoso... |
function Poly = POLYSUB(P1, P2)
%
% Subtracts two polynomials, P1 - P2, on the form An*s^n + An-1*s^n-1+,,,+ a0
%
% Toolbox for ANALOG FILTERS USING MATLAB, Springer, 2009
%
% Author: Lars Wanhammar 1983-03-15
% Modified by: LW 2007-07-12
% Copyright: Divison of Electronics Systems
% Dept. Electr... |
% Linear Regression Example
% Solves Ax=b using the method of least squares
%
% %%%%%%%%%%%%%%%%%%%% Example 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% Step 1: Find the first best fit line %%%%%%%%%
clear;
clc;
% Random Point Values Set 1
x1 = [1.1, 2.3, 4.3, 5.7, 6.3, 7.0, 8.8, 9.2, 13.0, 15.2];
b1 = [1.3... |
N = 5;
X = sin((N+0.5)*Omega)./sin(Omega/2); % Theoretical sinc
X(end/2) = 2*(N+0.5); % Remove the indetermination at the origin
subplot(211), plot(Omega,X)
% Signal in time domain
x2 = [ones(1,N+1) zeros(1,256-2*N-1), ones(1,N)];
% Its transform
X2 = fftshift(fft(x2));
subplot(212), plot(Omega,X2) |
function plot_sub_mesh
% plot_sub_mesh is used by cmsplot (with simulate 5 res file input) and
% plots a part of the core with submesh data.
%
% See also get_positions_for_submeshplot PlotSubMeshData
% Mikael Andersson 2012-01-05
%% get data from cmsplot and set some default data
hfig=gcf;
cmsplot_prop=get(hfig,... |
function [ JAMatrix ] = IKinFixed(S, M, Tsd, theta0, epsw, epsv )
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
if(size(theta0, 2) > 1)
theta0 = theta0';
end
epsilon = 10^-5;
if (numel(size(M)) ~= 2 || size(M,1) ~= size(M,2))
disp('M is not a valid transformation matrix eithe... |
function [found] = existence_submatrix(total,sub)
% finds if the submatrix is present withing the total matrix
found = false;
for x = 1:size(total,1)-size(sub,1)+1
for y = 1:size(total,2)-size(sub,2)+1
for z = 1:size(total,3)-size(sub,3)+1
block = total(x:x+size(sub,1)-... |
function out = convcomp(img, kernel_re, kernel_im, kernel_w)
kernel = kernel_re + 1j * kernel_im;
img_out = convrgb(img, kernel, 'same');
img_out = convrgb(img_out, transpose(kernel), 'same');
out = kernel_w(1) * real(img_out) + kernel_w(2) * imag(img_out); |
function [Gx, Gy, Gz] = getVideoGradients( flow )
%GETVIDEOGRADIENTS Returns discrete spatio-temporal derivatives (x,y, and time)
% Input:
% flow - [height x width x 2 x numFrames] flow field. If numFrames==1 or
% the flow is unknown, set flow = zeros(height,width,2,numFrames)
% to return only spatial... |
function [xtilde] = InexactLSR(A, b, s, type)
% This is the Inexact Least Square Regression algorithm
% ======================================
% Input: A, b: the LSR problem is min|Ax - b|_2
% s: the parameter to generate CountSketch
% ======================================
d = size(A, 2);
if type == 1
sket... |
function create_occipital(session_dir,subject_name,SUBJECTS_DIR)
% Creates an occipital ROI using freesurfer, based on all occipital labels
% in the aparc.a2009s annotation
%
% Usage: create_occipital(session_dir,subject_name,SUBJECTS_DIR)
%
% Written by Andrew S Bock Feb 2015
%% Set defaults
if ~exist('session_d... |
function [res1 res2] = findstring(str, fileData, astLines)
%=========================================================================
%[FileName,PathName] = uigetfile('*.txt','Select any text file');
%FileName = [job '.inp'];
%PathName = pwd;
%PathName = 'C:\Documents and Settings\afp07\My Documents\MATLAB\';
%y= [Pat... |
function iv_out = RemoveIV(cfg_in,iv_in)
%REMOVEIV Remove intervals that are too short or too long. Also checks for
%doubles with the option of removal. Corresponding usr data is also
%removed.
% iv_out = REMOVEIV(cfg,iv_in)
%
% INPUTS:
% cfg: config struct with fields controlling function behavior
% ... |
family = 'TRACIR';
names = {'X-00469'};
group = HebiLookup.newGroupFromNames(family, names);
cmd = CommandStruct();
t0 = tic(); T_poke = 4;T_retract = 4;T_wait = 5;
start_pos = 1.2
end_pos = 1.8
slope = (end_pos-start_pos)/T_poke; count = 1;
while(toc(t0)<T_poke)
fbk = group.getNextFeedback();
t = toc(t0);... |
classdef comet_incremental < metric_learning_abstract
% coordinate descent of PSD similarity matrices
% TBD
properties
% init variables
examples_trn
labels_trn
% debug
prevW
prevsW
prevEtaUpdate
prevu
% working ... |
gPhi_X=zeros(sizeX,sizeZ);
gPhi_Z=zeros(sizeX,sizeZ);
EX_XZ_map=zeros(sizeX,sizeZ);
EZ_XZ_map=zeros(sizeX,sizeZ);
% smooth_potential_map=smooth_small_map(Epot_XZ_map);
VZ=(3:sizeZ-2);
for (x=3:sizeX-2)
gPhi_X(x,VZ)=(1/12)*(-Epot_XZ_map(x+2,VZ)+Epot_XZ_map(x-2,VZ))+(2/3)*(Epot_XZ_map(x+1,VZ)-Epot_XZ_map(x-... |
function earthPlot(body)
% earthPlot Generate a plot of the Earth in the current axes
%
% Inputs:
% body - value indicating body to plot
% 1 = Earth (Default)
% 2 = Moon
if ~exist('body', 'var')
body = 1; % Set default body to Earth
end
% Options
npanels = 180;
alpha = 1; % g... |
function [ ddz ] = MHDgradZ( zcomp ,z )
%Given the Z component of a function and z, MHDgradZ, will output the
%derivative of zcomp with respect to z,(d(zcomp)/dz).
%
%Meathods: 4th order inneards and second order edges.
Z=zcomp;
% Width=size(Z,2);
row=size(Z,1);
dz=z(2)-z(1);
ddz=-((1/12).*circshift(Z,[-2,0])-... |
%hPDSCHConfiguration PDSCH configuration
% [PDSCH,TRBLKLEN] = hPDSCHConfiguration(ENB,DCI,RNTI)
% decodes the physical downlink shared channel configuration PDSCH and
% transport block length TRBLKLEN from received downlink control
% information message DCI, eNodeB configuration ENB and radio network
% tempo... |
function [ xr ] = idfb2s_rec(Y2, outputmode )
%IDFB2S_REC Summary of this function goes here
% Detailed explanation goes here
if nargin < 2, outputmode = 0; end
load('filters_D_F2.mat');
if outputmode
y0 = qupz(Y2{1},2);
y1 = qupz(Y2{2},2);
y2 = qupz(Y2{3},2);
y3 = qupz(Y2{4},2);
... |
function out1 = arrayReplace(arr1, arr2, num)
% Create an index vector of the values of num
mask1 = find(arr1 == num);
% Replaces the values from arr2 with those from arr1
arr1(mask1) = arr2(mask1);
% Sets the output
out1 = arr1
end |
function [dcmp] = decompose_in(proj,label_id,hd)
%% ----------------------------------------
%% Calculate dynamcs from IN
%% Specialized IN idss
in_ids = find(label_id==1);
cue_ids = find(label_id==2);
feel_ids = find(label_id==3);
rest_ids = find(label_id==4);
%% Length params
Nstim = 1;
Ncue = 1;
Nfeel = 4;
Nrest ... |
% Plot E-field magnitude on layer surface
function E_plot = plotLayersE(layersE,layer_num,mode,normE,color_map,cam_view,shift_dir,vecs_on)
if nargin < 8
vecs_on = 0;
end
if nargin < 7 || isempty(shift_dir)
shift_dir = [0,-35,0]; % vector of direction of shift -14 for S116
end
if... |
clear all;
clc;
close all;
A0 = 5e3;
N00 = 2e10;
N10 = 20e10;
delta0 = 1e-5 * N00;
delta1 = 1e-5 * N10;
b0 = 100;
b1 = 600;
db = 1;
b = b0:db:b1;
t0 = 0;
tmax = 172800;
dt = (db*1000)^2/(2 * A0)
t = t0:dt:tmax;
Nmax = 10e11;
bmax = 350;
wN = 10;
Ni0 = Nmax * exp(-((b-bmax).^2)/wN^2);
Ni0 = N... |
%% specify data perameters
numChannel = 30;
numERP = 1000;
dataLength = 550;
scaleERP = false;
subjectSet = [22,23,24,25,26]; % Needs Specification [1,3,4,5,6,7,8,9,10,11] [12,13,14,15,16,17,18,19,20,21
numSubject = size(subjectSet,2);
sti1 = 'BWcelebs'; sti2 = 'BWfood'; sti3 = 'BWgabor';
sti4 = 'BWtext';sti5 = 'color... |
function ber = precodingMIMO(ants,M,R,SNRdB,data,H,DataBits)
%{
Sends the data through a flat fading channel and uses precoding and
receiver shaping. Returns the BER.
Inputs:
ants : (1, ) Number of Tx and Rx antennas (ants by ants system)
M : (1, ) M-ary QAM (2,4,16,64)
R ... |
% rng('default') % for reproducibility
n = 100;
p = 1000;
S =100;
Et = zeros(S, 1);
optlam =zeros(S,1);
Bt = zeros(p+1, S);
for k =1:S,
X = randn(n,p); % generate a random design matrix
X = [ones(size(X,1),1) X];
b = zeros(p+1,1); % true signalfirst ten predictors are 5
b([1, 2,... |
function rk2_ode
f=inline('-x^2+y') % the right side of ODE
h=0.1;
x0=0; % intial argument
y0=-1; %initial value y(x0)
xn=1; % terminal argument
x=x0:h:xn;
y(numel(x))=0; %memory allocation
y(1)=y0;
for i=1:numel(x)-1
k=ss(f, h, x(i), y(i));
y(i+1)=y(i)+1/2*h*(k(1)+k(2));
end
disp([x',y'])
plot(x,y)
function solut... |
function [bx_comp_int,by_comp_int,bz_comp_int,tt] = interp_time_v(bx_comp,by_comp,bz_comp,t_B,sc)
t1 = t_B(:,1);
bx1 = bx_comp(:,1); bx1 = bx1(t1 ~= 0 & ~isnan(bx1));
by1 = by_comp(:,1); by1 = by1(t1 ~= 0 & ~isnan(by1));
bz1 = bz_comp(:,1); bz1 = bz1(t1 ~= 0 & ~isnan(bz1));
t1 = t1(t1 ~= 0 & ~isna... |
function f=ep(b,x)
f=(b(1)*exp(-b(2)*x));
% f=100 * (b(1)+b(2) * x +b(2) * b(3)*tanh(b(4)*(x-b(5))));
|
FocusTable=zeros(2,4);
FocusTable(1,1)=c(5);
FocusTable(2,1)=c(1);
FocusTable(1,2)=c(6);
FocusTable(2,2)=c(2);
FocusTable(1,3)=c(7);
FocusTable(2,3)=c(3);
FocusTable(1,4)=c(8);
FocusTable(2,4)=c(4); |
function subplots
global subpl
prompt= {'# ROWS','# COLUMNS','Selected SubPlot'};
title= 'Subplots';
lines= 1;
resize= 'off';
default= {num2str(subpl(1)),num2str(subpl(2)),num2str(subpl(3))};
tmp= inputdlg(prompt,title,lines,default);
if size(tmp,1) > 0
subpl= [str2num(cell2mat(tmp))];
end
|
function SPEA2PRO(Global)
% <algorithm> <S>
% Strength Pareto evolutionary algorithm 2
%------------------------------- Reference --------------------------------
% E. Zitzler, M. Laumanns, and L. Thiele, SPEA2: Improving the strength
% Pareto evolutionary algorithm, Proceedings of the Fifth Conference on
% Evolutiona... |
function MOVIE=stan_cadata_crop_movie(FRAMES,X,Y,PAD)
% given ROI x and y points, crop out movie
%
%
%
if nargin<4
PAD=50;
end
bbox=[min(X) max(X);min(Y) max(Y)];
bbox_pad=round(bbox+[-PAD PAD;-PAD PAD]);
[height,width,nframes]=size(FRAMES);
bbox_pad(bbox_pad<0)=1;
if bbox_pad(1,2)>width
bbox_pad(1,2)=width;... |
tic
dinfo = dir(['Variables\', '*.mat']);
n_data = length(dinfo);
ListaBuenosCompletos = zeros(3, n_data-2);
resolucion = 50;
for K = 1:n_data-2
tic
filename = dinfo(K).name;
load(sprintf('Variables/cmd%s.mat', filename(4:end-4)));
%Columnas de variables
% heading: log(L), log(Teff), log(g), mass_... |
%CIM_4_4:Lennard_Jones optimization
clear;
%-------------------------Parameters Setting-----------------------------%
global n;
sigma=1;
epsilon=1;
n=15;
h=1;
global coordinate distance;
All_coordinate=zeros(n,300); %Store all coordinates
All_energy=zeros(100,1); %Store all energy
... |
function[S] = samptorus(n,R,r)
S = zeros(n,3);
theta = zeros(n,1);
for i = 1:n
theta(i) = 2 * pi * rand();
tmp = rand();
phi = newtontor(tmp,R,r);
S(i,:) = [(R+r*cos(phi))*cos(theta(i)), (R + r*cos(phi))*sin(theta(i)), r*sin(phi)];
end
[~,ind] = sort(theta);
S = S(ind,:);
end
|
clear; clf;
% Precizarea limitelor de integrare
x0=0; xf=2.5;
% Specificarea conditiilor initiale
y0=[0 4];
% Apelarea functiei destinata integrarii
% ecuatiei diferentiale
% - in x si y sunt stocate solutiile
[x y]=ode45(@fsist,[x0,xf],y0);
% Reprezentarea derivatei de ordinul I.,
% memorata... |
%% Dual Arm Position Control - Hardware Implementation
% Author: Felipe Nascimento - January 2019
%
%% Initialization
clear all
close all
clc |
% test for fast marching and geodesic extraction
%
% Copyright (c) 2004 Gabriel Peyr�
n = 600;
name = 'road2';
name = 'constant';
name = 'mountain';
[M,W] = load_potential_map(name, n);
rep = 'results/geodesic-2d/';
if not(exist(rep))
mkdir(rep);
end
warning off;
imwrite(rescale(W), [rep name '... |
%% fef
% fname = '/home/joschu/Proj/code/grasping/blend/brain.obj';
% fname = '/home/joschu/Data/grasping/obj/m161.obj';
wobj = read_wobj(fname);
[verts_v3,faces_f3,normals_f3] = wobj_verts_faces(wobj);
[~,cents_f3,~] = get_contact_wrenches3d(verts_v3,faces_f3,normals_f3);
%% fef
VTK = vtkinit();
vtkplotmesh(gcvtk, ve... |
function y = hexc2dec_24(hex)
temp = hex2dec(hex);
bin = dec2bin(temp);
while(length(bin) < 24)
bin = ['0',bin];
end
if(bin(1) == '1')%负数
bin(2:24) = 97 - bin(2:24);%取反 为什么是97?
y = -(bin2dec(bin(2:24))+1);
else
%y = bin2dec(bin(2:24));
y = temp;
end |
%here is the Scandanavian wolf data
winterYearStart = 1980:2000;
winterYearEnd = winterYearStart+1;
minTotalWolves = ...
[2 3 3 8 6 7 5 6 10 8 8 16 19 ...
16 29 34 41 50 62 67 87];
maxTotalWolves = ...
[6 3 3 8 6 7 5 6 10 8 8 18 22 ...
30 39 45 57 72 78 81 97];
%this expression obtains most... |
classdef (Hidden, Sealed) RelaxSymmetricGaussSeidel < amg.relax.AbstractRelax
%RELAXSYMMETRICGAUSSSEIDEL Symmetric Gauss-Seidel relaxation scheme.
% This class executes a symmetric Gauss-Seidel relaxation sweep
% (forward LEX, then backward LEX) to the linear system Ax=b.
%
% See also: RE... |
function result = mJacobiSN( X, M )
%MJACOBISN Jacobi's elliptic function sn.
% MJACOBISN(X,M) computes Jacobi's function sn for elements of
% argument X and parameter M. X and M must all be real and the same size
% or any of them can be scalar.
%
% See also JACOBISN
% MJACOBISN is a wrapper function which... |
set(0,'DefaultFigureWindowStyle','docked')
fileNames = {};
folderFiles = dir;
for i = 3:numel(dir)
fileNames{i-2} = folderFiles(i).name;
end
%%
tic
for i = 1:numel(fileNames)
figure
a(i) = devMCanalysis(fileNames{i});
end
toc
|
function [ z_hat ] = Inner_Loop3( y, flatwin_w, B )
%UNTITLED9 この関数の概要をここに記述
% 詳細説明をここに記述
z = zeros(B, 1);
for k = 1:B
for j = 0:floor(flatwin_w/B) - 1
z(k) = z(k) + y(k+j*B);
end
end
z_hat = fft(z);
end
|
function object=create(object,varargin)
object.Name='Sesame object';
object.GraphicOptions=SMASH.General.GraphicOptions;
object.GraphicOptions.Marker='none';
object.GraphicOptions.LineStyle='-';
Narg=numel(varargin);
assert(Narg>0,'Must Enter at least material number');
if Narg==1 % prompt user to select file
... |
function output_img = mySpatiallyVaryingKernel(image, image_no, alpha)
[h,w,b] = size(image);
image = double(image);
if image_no == 1
% %doing image segmentation
% hc = 0.2;
% hs = 20;
% n = 10;
% result = myMeanShiftSegmentation(image, hc, hs, n, 1, 1... |
function [ y ] = hill_eq( x, V, k, n )
%HILL_EQ is a generic hill equation function
y= V .* ((x.^n)./((x.^n)+(k.^n)));
end
|
function L = isnan(x)
%PREAL/ISNAN Overloaded ISNAN function for class preal.
L=isnan(double(x)); |
function traverse_map_plot_fcn(src,evt,hplot)
set(src, 'Pointer', 'hand');
% ax=ancestor(hplot,'geoaxes');
% cp=ax.CurrentPoint;
% objt=findobj(ax,'Tag','tooltipt');
% xlim=get(ax,'XLim');
% dx=diff(xlim)/1e2;
%
% if isempty(objt)
% text(ax,cp(1,1)+dx,cp(1,2),hplot.UserData.txt,'Tag','tooltipt','EdgeColor','k','Ba... |
%Semnal dreptunghiular cu rezolutie temporala de 2 ms
t=0:0.002:4;
F=0.5; %f=1/T
duty=25; %factorul de umplere, care reprezinta 1/4 din semnal
x=(0.75*square(2*pi*F*t,duty))-0.25;
%intrucat square(t,duty)genereaza un semnal simetric,
%ecuatia trebuie modificata ca sa corespunda cerintei
figure(1)
plot(t,x,'... |
%% ELE 503 Homework 8
%
% Noah Johnson
%
%% Problem 1
%
% See attached paper.
%
%% Problem 2
%
% See attached paper.
%
%% Problem 3a (Choosing Ts)
load sroots;
A = [0 1 0; -4 -.4 40; 0 0 -4];
B = [0;0;2];
x0=[0.34;0;0]; %Given Initial State
Ts = 4.5; %Given Settling Time
plantPoles = eig(A)
%%
%
% Note ... |
%% SYS800 - Reconnaissance de formes et inspection
% M'Hand Kedjar - December 2016
% Course Project on Age and Gender Classification
clc, clear, close all
% path_to_age_adiencefaces_256 = '..\..\databases\age\adienfaces_256'; % Base 1 '..\databases\age\adienfaces_256'
% path_to_gender_adiencefaces_256 = '..\..\d... |
classdef InterpolationMethod
%InterpolationMethod Method for interpolation
enumeration
Linear, Nearest, Next, Previous, PChip, Cubic, V5Cubic, Spline
end
end
|
clc
clear
xn_1 = 20;
xn = 100;
while abs(fx(xn_1)) > 0.01
xn1 = xn - fx(xn)*((xn - xn_1)/(fx(xn) - fx(xn_1)));
xn_1 = xn;
xn = xn1;
end
disp(xn)
xnn_1 = 0;
xnn = 1;
while abs(fx2(xnn)) > 0.01
xnn1 = xnn - fx(xnn)*((xnn - xnn_1)/(fx2(xnn) - fx(xnn_1)));
xnn_1 = xnn;
xnn = xnn1;
end... |
function modelvar = datafit(dataT, Y, par, Tmark)
% dataT: 'n' by 'm' matrix, 'n' is the number of time-steps, where 'm' is
% the number of processes;
% Y : the index in {1, .., m} of process looking at,
% par : a vector of indices of parents we are considering, and
% Tmark : the Markov order (can ignore it for ... |
load datas.mat
load MC.mat
K = 1;
u = zeros(402,1);
u(S_Class=='A') = 1/0.60;
u(S_Class=='B') = 1/0.66;
u(S_Class=='C') = 1/0.72;
w = zeros(402,1);
w(S_Class=='A') = 1.2;
w(S_Class=='B') = 1.1;
w(S_Class=='C') = 1.0;
C = zeros(402,3);
C(:,1) = S_Class=='A';
C(:,2) = S_Class=='B';
C(:,3) = S_Class=='C';
supply = P3... |
%% Introduction to Programming and Data Processing
% module 006 - Assignments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Assignment 6B Production cost
clear all; close all; clc;
rItMtrx = [6, 3, 0; 17, 11, 9; 4, 2, 12];
rCost = [101.25, 84.00, 75.50];
computeItemCost(rItMtrx, rCost)
%% Assignment 6C Mov... |
function S_obj = userplot_makeSpatialFieldMovie(cav_dir,num,x0,beta,t0,t1,numframes)
S_EcoeffsAll = structdata_load(cav_dir,num,'E','coeffs',1,x0,beta);
time_inds = helpers_getSptlFldMovTimeIndices(S_EcoeffsAll,t0,t1,numframes);
S_dataArray = structdata_getDataArray(S_EcoeffsAll,'time',time_inds);
... |
function [resD,resM,matchD,matchM,dist,mse] = matchChar(descriptor, template, transform)
[~,N] = size(template);
dist = zeros(1,N);
mse = zeros(1,N);
for i = 1:1:N
dist(i) = sqrt(sum((descriptor - template(:,i)) .^ 2));
mse(i) = immse(descriptor,template(:,i));
end
[~,index] = m... |
u = ones(3,1)
for iter = 1:2
u = 2*u
end |
% Generates a Hilbert matrix
% J Schott
% CSI 700
function genhilbert(nmax, inc)
cnt = 0;
resultSize = nmax/inc-1;
result = zeros(resultSize,4);
fprintf('cnt\tn\tr\tc\tmax\t\n');
for n=2:inc:nmax
cnt = cnt + 1;
A = zeros(n,n);
x = ones(n,1);
... |
function l=getWatchedLabelsphosph3P2X7()
l=['O1';'O2';'O3';'O4';'S3';'S4'];
end |
function y = thomas(a, b, c, z)
n = length(z);
v = zeros(n,1);
y = v;
w = a(1);
y(1) = z(1)/w;
for i=2:n
v(i-1) = c(i-1)/w;
w = a(i) - b(i)*v(i-1);
y(i) = ( z(i) - b(i)*y(i-1) )/w;
end
for j=n-1:-1:1
y(j) = y(j) - v(j)*y(j+1);
end
end |
function varargout = cal5(varargin)
% CAL5: A calibration tool developed for graphically and statistically
% assessing the performance of the Chesapeake Bay Program's Phase 5 HSPF
% model of the Potomac Watershed.
%
% USAGE: Type 'cal5' at the command line to launch.
%
% Written by: Joe Vrabel, U.S. Geological Survey, ... |
function [ ] = AppendRegressionOutputs( pathToCsv )
% Ovaa funkcija gi dodeluva presmetanite faktori na prepletka kako posleden
% atribut vo podatocnoto mnozestvo
% Citanje na podatocnoto mnozestvo
data = csvread(pathToCsv, 1, 0);
% Razdeluvanje na instancite od sekoj klaster oddelno
cluster1 = data(da... |
addpath('C:\Documents and Settings\Michele\Meus documentos\Dropbox\Spl\PhD\Lab\BAc\Imina via AuHg\Oct\BAc_lib');
[y x] = load_nova(argv(){1});
[r c] = BAc_treat_func(x, y);
file = argv(){1}(1 : end - 4 );
save([file ".rBAc"], 'r', '-ascii');
save([file ".cBAc"], 'c', '-ascii'); |
function []=Successive_Approximation()
eqn_orig = input('Enter the equation in variable x : ','s');
x0 = input('Enter the starting root : ');
gx_orig = input('Enter g(x) : ','s');
err = input('Enter the allowed error : ');
round_off = input('Enter the number of decimal places : ');
eqn = in... |
function PlotMDS()
subj = load('/data/supervoxel/output/group468/ddCRP3000_dist_mds_subjprocrustes');
group = load('/data/supervoxel/output/group468/ddCRP3000_dist_mds');
paths = [...
55 54 60 61; ...
141 140 145 146; ...
8 17 16 0; ...
93 101 100 0];
RSC = [13 98];
figure... |
function image_register_save_as_multitiff
%% Register images in X-Y
% User Input
Data_Folder = '/Users/seetha/Desktop/Michelle_OB_Thunder/Data/141010 Fish2 Deconvolved/';
Result_Folder_Name = '/Users/seetha/Desktop/Michelle_OB_Thunder/Data/141010 Fish2 Deconvolved/'; %Result FOlder name
Stim = {'30ugHAM', '3ugHAS', '3... |
function pc=expfall(arg,data)
%
% function expfall(arg)
%
% To be used in conjuction with the Matlab function 'fminsearch' in
% order to fit a falling exponential function of the from:
%
% arg(1)*exp(-(rawdata(:,1)-arg(2) )/arg(3) ) +arg(4)
%
% where 'rawdata' is a global variable containing the data to
% be fit
% ... |
E = 70e6; I = 16e-6; A = 8e-3; P = 1000; w = 500;
L1 = 0.2; L2 = 0.5; L3 = 0.08;
% Element 1
x1 = [0, 0, 0, L2];
k1 = elestiff(E, A, I, x1);
f1 = eleload(0,w, x1);
% Element 2
x2 = [0, L2, L1/2, L2+L3/2];
k2 = elestiff(E, A, I, x2);
% Element 3
x3 = [L1/2, L2+L3/2, L1, L2+L3];
k3 = elestiff(E, A, I, x3);
% Asse... |
a=real(vector_complex);
mean(a)
for i = 1:length(vector_complex)
b = vector_complex(i)*vector_complex(i)
end
vector_complex.' * vector_complex |
% Algorithm:
%
% - afChangingTimes contains the list of the times when a controller should be changed
% - astrChangingControllers contains the list of the strings corresponding to the various controllers
%
% the current controller is that one for which its changing time is the first one being smaller than the curre... |
classdef psf < handle
%PSF very important class that hold the PSF of a single emitter and is
%able to sample it to get its image on a frame.
properties
NA
outDim % Dimentions of the output psf, [x y z], nm
deltZ % Distance between z planes in nm
pixSize
emissionW... |
clear all;
angle_a = 40*pi/180; %define the three angle
angle_b = 25*pi/180;
angle_r = 30*pi/180;
d_LR = 20; %the distance between L and R
d_MO = 15; %the distance between M and origin of coordinate
yR = d_LR/2;
xC = yR/tan(angle_a);
r = yR/sin(angle_a); %the radium of the first round
xB = xC - r*cos... |
function DrawSequence(SEQ, hObject, eventdata, ax)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% Written by Jeronimo Maze, July 2007 %%%%%%%%%%%%%%%%%%
%%%%%%%%%% Harvard University, Cambridge, USA %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Ne... |
function [feature, label]=load_Keck(num)
% load the Keck dataset
name=['keck_person_',num2str(num),'.mat'];
load(['Datasets/Keck_feature/',name]);
feature=keck_feature;
label=keck_label; |
function [ t,to,tf,deltaT ] = GetTimeInformation( AEDAT )
t = AEDAT.data.polarity.timeStamp;
to = min(AEDAT.data.polarity.timeStamp);
tf = max(AEDAT.data.polarity.timeStamp);
deltaT = (tf - to);
end
|
function scores = recognize_bboxes_of_image(model, image, bboxes)
% recognize_bboxes_of_image given a recongiotion model, an image and a set
% of bounding boxes it returns the confidence scores of each bounding box
% w.r.t. each of the C categories of the recognition model. Those
% confidence scores represent the lik... |
function predictions = make_final_prediction(model,X_test,X_train)
% Input
% X_test : a nxp vector representing "n" test samples with p features.
% X_test=[words images image_features] a n-by-35007 vector
% model : struct, what you initialized from init_model.m
%
% Output
% prediction : a nx1 which is your prediction o... |
% MTLT1VVC.M
% T1 time in ms (mtlt1txt)
% Called by MTLTM
mtlt1txt = str2num(get(mtluit1vv, 'String')) ;
if isempty(mtlt1txt) ; % Check for number
set(mtluit1vv, 'String','ERR', ...
'BackGroundColor', 'red') ;
return ;
else ;
if mtlt1txt < .001 ; % Check that positive
set(mtluit1vv, 'String','ERR', ...
'B... |
function [ lim_va ] = limiter_vanalbada( neq,r )
%Function "limiter_vanalbada"
% Adapted for MATLAB from Joe Derlaga's "limiter_vanalbada.f90", 071213.
% Van Albada limiter.
lim_va = zeros(neq,1);
for eq = 1:neq,
lim_va(eq) = (r(eq).*r(eq) + r(eq)) ./ (r(eq).*r(eq) + 1);
if (r(eq) < 0),
... |
function dbValue= Linear2DB(linearValue)
dbValue = 10*log10(linearValue);
end |
function [ L dXc dXn dXf ] = lmnn_grads_euc( Xc, Xn, Xf, margin )
% Compute gradients of standard LMNN using Euclidean distance.
%
% In addition to the standard penalty on margin transgression by
% impostor neighbors, impose an attractive penalty on distance between
% true neighbors and a repulsive ... |
classdef (Sealed) Options < handle %matlab.mixin.Copyable
%OPTIONS Multi-level algorithm options.
% Includes both model parameters and cycle parameters. Sets default
% values for parameters that can be overriden by the user.
%======================== CONSTANTS ===============================
... |
function [PI,Pxy,MI,Hxy] = pmi(N)
% pointwise mutual information operator [I,Pxy] = pmi(N)
%
% From a count matrix, N, describing the occurrence of joint events of two
% different phenomena, this obtains the pointwise mutual information (I) in bits of
% those events, which is the logarithm (base 2) of the quotiens of t... |
function [output_data] = EuclideanForward(input, layer)
input_data = input.data;
label = input.label;
sz = size(input_data, 2);
output_data = (input_data-label).^2;
output_data = 0.5 * 1/sz * sum(output_data(:));
end
|
close all;
clear all;
clc;
a=input('Enter the matrix a:');
b=input('Enter the matriz b:');
if a==b
disp('Matrices are equal.');
else
disp('Matrices are not equal.');
end
|
function re = phai(u,th1,th2)
%PHAI 此处显示有关此函数的摘要
% 此处显示详细说明
if u<th1
re=0.8*u/th1;
elseif u<=th2
re=0.8+0.2*(u-th1)/(th2-th1);
else
re=1;
end
end
|
function y = myReplication(x, fitValue, n)
% 用于从原来的种群选择一些个体放入下一代种群,用的是轮盘赌
% n表示要选择出多少个个体
[fitValue, t11] = unique(fitValue);
x = x(t11, :);
t1 = min(fitValue);
t2 = fitValue-t1+1; %把fitValue都变成非负数
t3 = double(t2)/sum(t2); %轮盘赌的每部分的概率
t4 = length(fitValue);
t5 = []; %表示范围
for i = 1:t4
if i == 1
t6 =... |
function LabourSteadyState = solveLabour(Lst)
% Purpuse of this function:
% evaluate expression at zero to obtain steady state value of labour
% we load struct named 'paramValues' which has all the parameter values
% needed to evaluate the expression
load paramValues
eta = paramVa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.