text stringlengths 8 6.12M |
|---|
%==========================================================================
% CoV_vs_rate.m
% Author: Akira Nagamori
% Last update: 8/27/19
% Descriptions:
% Equations obtained from Destexhe et al. (2001)
%==========================================================================
close all
clear all
clc
%%
Fs = 300... |
function segments = CS5320_line_segs(ime,Hpts,min_len)
% CS5320_line_segs - extract line segments from Hough info
% On input:
% ime (mxn array): edge image (e.g., output of edge)
% Hpts (txr array): Hough points array (see Cs5320_Hough)
% This code is written considering Hpts is the points St... |
clc;
clear;
%% Константы
n = 100;
alpha1 = 1;
alpha2 = 1;
beta1 = 1;
beta2 = 0.1;
x1_star = 10;
T=1;
h=0.1;
%%
x1 = zeros(1,n);
x2 = zeros(1,n);
% Начальные значения кол-ва жертв и хищников
x1(1)=5;
x2(1)=3;
%% Управление
u = @(x1,x2) (-alpha1.*x1+beta1.*x1.*x2 - ((x1-x1_star)./(T)));
%% Цикл
for i=... |
function face = enhanceFace(rgbImg)
figure, imshow(rgbImg);
title('Face Input');
%Face Detection
FDetect = vision.CascadeObjectDetector;
BB = step(FDetect,rgbImg);
% figure, imshow(rgbImg);
% hold on
% for i = 1:size(BB,1)
% rectangle('Position',BB(i,:),'LineWidt... |
function [theLetter] = ArabicAscii(filename,UPXtarget)
% This function to get the the WORD name from a file
strfortext=char(strcat(UPXtarget,filename,'.upx'));
xmlToMatlabStruct = theStruct(strfortext);
theLetter=xmlToMatlabStruct.Children(1,6).Children(1,2).Children(1,2).Children(1,2).Attributes.Value; |
% Test a different way of generating the differentiation matrix for DZ
addpath(genpath('/home/jeguerra/Documents/MATLAB'));
L = 40000.0;
NZ = 100;
%
%% Compute using a different implementation
[zo,w]=legslb(NZ);
W = spdiags(w, 0, NZ, NZ);
s = [(0:NZ-2)'+ 0.5;(NZ-1)/2];
S = spdiags(s, 0, NZ, NZ);
[~, HTD] = lepolym(NZ... |
function pontos_bordejar = simular_bordejar(taxa_dist, angulo_bordejo)
close all;
heeling = 0; %direção do vento referencial de mundo
heading = 0; %orientação do veleiro
%taxa_dist = 80; %dt
%angulo_bordejo = 50; %theta_t
nextLocation = [200; 0]; %destino
la... |
clc;
close all;
clear variables;
I3Directory='../content/';
I2Directory = '../target/';
I1Directory = '../input/';
trainingDirectory_I3 = '../training_patches_varied_256/results/';
trainingDirectory_I2 = '../training_patches_varied_256/target/';
trainingDirectory_I1 = '../training_patches_varied_256/input/'... |
%this loads the eigenspaces, test, and training data, if not already
%in workspace
%load('pre_score.mat');
%
% %display eigenface i from top female grayscale eigs
i = 341;
imagesc(reshape(female_eigs_gray(:,num_female_training-i+1), nrow, ncol));
axis equal;
%display eigenface i from top male grayscale eigs
% i = 3... |
%plots chaos vs time for different mass ratios
MassRatios = [.5,1,2];
Times = linspace(0,5,200)';
Scatter = zeros(length(Times),length(MassRatios));
Eyys = zeros(length(MassRatios),1);
Bees = zeros(length(MassRatios),1);
parfor i = 1:length(MassRatios)
Scatter(:,i) = chaos3(Times,MassRatios(i))';
f = fit(Times... |
clear all;
clc
createDbFlag = 0;
identifyRandomExcerptFlag = 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Database Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if createDbFlag
rootPath = '/media/greg/BE06B21E06B1D81B/Users/Greg4... |
%generate M purely imaginary such that M*it = -ZR*ir
function [M,it] = generateMMatrix(ZR, ir, nt)
nr = length(ir);
if nt<=1 || nt>nr
disp('generateMMatrix: nt must be larger than 1 and no larger than nr');
M = [];
return;
end
%Create the first rows in order to generate a feasible it
m1 = 2i*(betarnd(2,2,n... |
function plot_bnds(headmodel, opts)
figure('visible', opts.figure_windows);
ft_plot_mesh(headmodel.bnd(1), ...
'facecolor', [0.2 0.2 0.2], ...
'facealpha', 0.3, ...
'edgecolor', [1 1 1], ...
'edgealpha', 0.05);
% hold on;
ft_plot_mesh(headmodel.bnd(2), ...
... |
function exp_sink = calc_exp_sink(V, roll, K, Cd0, B)
% Calculate expected thermalling sink.
CL0 = K ./ V.^2;
C1 = Cd0./CL0;
C2 = B*CL0;
% exp_sink = V.*(C1+C2./((cos(roll)).^2));
exp_sink = V.*(C1+C2./(1 - roll.^2/2).^2);
end
|
% run_neuron.m
%
% from run_neuron
% With EXCIT + INHIB inputs = nn_inputs(1,:), nn_inputs(2,:)
%
% run neuron with given statevector (parameters/states) for a given amount
% of time
% (specified in sim) on inputs "nn_inputs"
% returns: new state vector nn_params
%
% $Revision:$
%
function [nn_params, vm, conduct, I_... |
function varargout = fCAERO7(varargin)
func = varargin{1};
switch func
case 'readline'
varargout{1} = readline(varargin{2},varargin{3},varargin{4});
case 'minRows'
varargout{1} = 3;
case 'maxRows'
varargout{1} = 3;
otherwise
error('invalid in... |
function cout = pfc(fftin, normVal)
%PFC generate a color based on FFT contents and a normalization factor
%
% PFC(FFT, NormalizationValue) returns a color (R-G-B triplet) based on
% the frequency breakdown of FFT, with overall brightness mediated by
% NormalizationValue.
%
% See also PGEN, PRAND, PCRE... |
function status = runV3DPipeline(strFNPipeline)
%runV3DPipeline(strFNPipeline) This function demonstrates how to run
% Visual3D and execute a user specified pipeline script.
%
% strFNPipeline: the filename of a Visual3D pipeline to execute. If
% strFNPipeline is not a full path then the location of t... |
% A demo script that instantiates the [Serre et al. 2007] model, learns feature
% dictionaries for each level, and computes feature vectors. Differs from
% fhpkg_cvpr06_run only in that it learns multiple feature dictionaries; see
% that function for detailed comments.
%
% See also: fhpkg_cvpr06_run.
%***************... |
function [s_trainSample, s_testSample]=derivating1(s_trainSample, s_testSample)
%žÃº¯ÊýžùŸÝµŒÊýµÄ¶šÒ圫ÿžöÑù±ŸµÄ¹âÆ×ÇúÏßת»»ÎªÆäµŒÊýÇúÏß
[len1,wi1] = size(s_trainSample);
for i = 1:len1
s_trainSample_temp(i,:)=diff(s_trainSample(i,:));
end
s_trainSample=s_trainSample_temp;
[len2,wi2] = size... |
function ans = ex5();
a = [1 2];
b = [1 -0.5];
[h, n] = impz(a, b);
stem(n, h);
% plot h(n)%
n = 100;
% plot n point%\
freqz(abs(h), n);
% zplane poit b = 0, a = 0%
zplane(b, a);
% u(n)%
u = zeros(size(n));
u = [ n >= 0];
% x(n) = 2*((0.9)^n )* u(n);%
x = 2 * ((0.9).^n).* u;
y = filter(b, a, x);
stem(n, y); |
function K = kmeansFromTrial(T,m_idx)
if nargin < 2
n_idx = 4;
end
n_r = max(T.idx{m_idx});
%use normalization by N since we did that for segmentation
[Xrz,means,stds] = zscore(T.D.X',1);
Xrz = Xrz';
K.xr_means = means';
K.xr_stds = stds';
n_x = size(Xrz,1);
K.z_centers = zeros(n_x,n_r);
for r =... |
function [ ] = plotProj( fignum,Nn,xp,vp,x,sigp,xmin,xmax,t,nx,nodePressure,v,counter,nbot,ntop,nleft,nright,savepic,savedata )
v = [v(1:Nn,:),v(Nn+1:2*Nn,:)];
fig=figure(fignum);
% clf(fig)
% [X,Y]=meshgrid(linspace(0,xmax(1),nx(1)),linspace(0,xmax(2),nx(2)), nx(2));
% plot(x(:,1)... |
function FallingFilmEvaporator()
%PDE of falling film evaporator
%==========================Initialize==========
%initialize evaporator
L = 1.64; %m
cpw = 4187; % J/(kg K), cp water
cpwv = 1996; %J/(kg K), cp water vapour
muw = 0.5e-3; % Pa s
rhow = 1000; %kg/m3
gz = 9.81; %m/s^2 falling
condcop = 400; %W/(m K) therma... |
fprintf('Loading Ionosphare Data..\n');
X_train_ionosphere = getIonosphereX('hw2_data/ionosphere/ionosphere_train.dat', 1, inf);
X_test_ionosphere = getIonosphereX('hw2_data/ionosphere/ionosphere_test.dat', 1, inf);
Y_I_train_ionosphere = getIonosphereY('hw2_data/ionosphere/ionosphere_train.dat', 1, inf);
Y_train_ion... |
FEM.frequency=frequency;
FEM.modeshape=VVsort;
bendingmode=find(ActiveDof<=FEM.NodeNumber);
ActiveBendDOF=ActiveDof(bendingmode);
bendModeNo=length(bendingmode);
%---------------Mode Shape Plot-------------------
if bendModeNo<10
mode=bendModeNo;
else
mode=plotmodenNo;
end
X=zeros(size(FEM.elementNodes,1),... |
function g = findGradient(x, n, c, t, MATRICES)
g = zeros(n*3,1);
s = findS(x,n,MATRICES);
for i = 1:(n*3)
g(i) = t*c(i) - trace(inv(s)*MATRICES(i));
end
end
|
function zflipper(root, keepName)
% function zflipper(root, keepName)
% makes the images flip along the z direction
%
if nargin<2
keepName=0;
end
isNIFTI = 0;
[pth nm ext] = fileparts(root);
if ext=='.nii'
isNIFTI=1;
end
[d h] = read_img(root);
out = zeros(size(d));
for t=1:h.tdim
d2 = d(t,:);
d2 = reshape(d2,h... |
Scenario_number=1;
numtruth = 4; % number of targets
% Initialise model
T = 1;
F = kron(eye(2),[1 T; 0 1]);
Q = 0.01*kron(eye(2),[T^3/3 T^2/2; T^2/2 T]);
%Measurement noise models
kappa=1000; %Concentration parameter of VMF distribution
R_range=3;
range_min=10;
range_max=300;
delta_range=range_max-range_min;
p_s=0... |
function [lats,lons,v_air,v_wat,Tw,mode] = GetPath(model_num)
data = importdata('proj2_path_data.csv');
data = data.data;
model = data(:,(1 + (model_num - 1) * 8):(1 + (model_num - 1) * 8) + 7);
lats = model(:,1);
lats(isnan(lats)) = [];
lons = model(:,2);
lons(isnan(lons)) = [];
... |
function[output] = WSS(CL,V,T_obs,C_obs)
Dose=50;
%C_p = Dose/V*exp(-CL/V*T_obs); %one-compartmental model
%W = 1./(C_obs.^2); %weights
C_p = Dose/V*exp(-CL/V*T_obs); %one-compartmental model
W = 1./((C_obs).^2); %weights
obj_function = W.*((C_obs-C_p).^2); %weighted squares objective function
output = sum(obj_f... |
function result = getSpecialFolder(arg)
% Returns the special system folders such as "Desktop", "MyMusic" etc.
% arg can be any one of the enum element mentioned in this link
% http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx
% e.g.
% >> getSpecialFolder('Desktop')
%
% ans =
% ... |
%both transitter and receiver have hemi-spherical array structures
%no BF
clc;
clear all;
close all;
%delcare the radius
R = 0.1;
%specify azimuth and elevation
az_tx = linspace(0, 180, 2);
el_tx = linspace(-80, 80, 2);
%to 3d grid
[az_grid_tx, el_grid_tx] = meshgrid(az_tx, el_tx);
%specify north and south ... |
%Interpolacion mediante Trazadores Cubicos
%El polinomio de trazadores cubicos tendra la siguiente forma:
%Sj(x)=Aj+bj(x-xj)+Cj(x-xj)^2+dj(x-xj)^3
%Aj=f(xj)
% (Cj+1 - Cj) (Aj+1 - Aj) hj(2Cj + Cj+1)
%dj= ----------- bj= ----------- - ---------------
% 3hj hj 3
%hj-1*Cj-1 +... |
% This script reproduces the experiment of Figure 5 of the paper
% contained in the paper "A Scalable Second Order Method for
% Ill-Conditioned Matrix Completion from Few Samples" by Christian Kuemmerle
% and Claudio Mayrink Verdun.
% It performs a completion task for a highly ill-conditioned 1000 x 1000
% mat... |
function [dataTrain,dataVal,dataTest] = loadHysteresisRelayData()
location = 'Data/HysteresisRelay/';
name = 'hysteresisRelay';
filename = [location,'/',name];
% Training Data Set has noise added on the u values
newFilenameCombined = [filename,'_train.mat'];
dataTrain = load(newFilenameCombined);
% Validation Data Se... |
function [mergedpcl, separatepcl, rotindices2pcl] = main_create_pcl(bagfile, write, path_output)
%{
Wrapper to read the bagfile, detect the person and create the merged
and separate point clouds.
Inputs:
- bagfile: name of the bagfile to read. Character.
- write: flag to choose if write a mat file.... |
function R = resultingRow(n, m, l, boxSize)
R = zeros(1,boxSize(1)*boxSize(2)*boxSize(3));
flag = isOutOfBound(n, m, l, boxSize);
if(flag)
return
else
a = n - floor(n);
b = m - floor(m);
c = l - floor(l);
floorRow = floor(n);
floorCol = floor(m);
... |
clear;
d = 4;
truetheta = repmat(1, d, 1);
value1 = ((0:2)/2*3)';
X1 = zeros(81,4);
X1(:, 4) = repmat(value1,27,1);
value12 = reshape(kron(value1, repmat(1,1,3))',9,1);
X1(:, 3) = repmat(value12,9,1);
value13 = reshape(kron(value1, repmat(1,1,9))',27,1);
X1(:, 2) = repmat(value13,3,1);
value14 = reshape(kron(value1, r... |
function [allParam, allLlk,allMle]=Exp2ModRecov_fit(data,center,envrad,foldName,fName)
% Find the best parameter fits
% 4.8.2015-Created
% 6.16.2015-Exp2ModRecov_fit-Version for model recovery
%% Files
if ~exist(foldName)
mkdir(foldName)
end
%% Restructure data
[allResp, allTarg]=Exp2ModRecov_restruc(data,center)... |
%create a matrix with only zeros
%input = array of dimensions
function f = fillMatrixWithZeros(DIM)
f = zeros(DIM); |
function arnold(foto, A)
%arnold - Description
%
% Syntax: arnold(foto,A)
%
% Funcion que va a ordenar o a desordenar una foto.
%
% Entradas: foto: fotografía que debe ser cuadrada a la que queremos aplicarle una transformacion de Arnold
% A: matriz que se va a usar para desordenar en el caso 1 o que se ha us... |
function [ img, geom ] = mergeOffsetReconVolume( img1, img2, geom, offset, na )
% function img = mergeOffsetReconVolume( img1, img2, geom, offset, na )
% Merge two offest reconstructed volume to a single volume
% input:
% img1 - reconstructed volume 1, at the top
% img2 - reconstructed volume 2, a... |
file='I:\1_MR\1_HQMR\R&D\SYS_APPL\TeamMitglieder\Werkstudenten\Ruben\RespatoryFiles\copy\test';type='rasp'
% file='I:\1_MR\1_HQMR\R&D\SYS_APPL\TeamMitglieder\Werkstudenten\Ruben\sinussignale'; type='sinus'
setwahl = [14];%11:11;
tic
sets = generate_sets(file,type,setwahl);
loadtime = toc;
cleanmethod = 'norma... |
function [L, N, dx, H, roughness, mismatch, aniso, seed, lambda_0, model] = fracture_definition_inputs()
% This function generates all the necesary inputs for rough fracture
% generator
L = 25.4*3; % Fracture length [mm]
N = 2^10; % Numbe... |
%{
Function: Shows the difference minimum tank temperatures and maximum flow rates
needed to achieve sufficient heating power
Input: Worst case heat loss
By Cole Thomson 3/7/19
Edited by Daniel Chan 3/9/19
%}
%User input
q=1153; %worst-case heat loss (W)
t_end=48.5; %water temperature at end of hea... |
function [thit,Qest,Rest] = emFFBSi(y,u,param)
% Extract theta
theta = param.theta;
% Save theta iterations in here
thit = [];
% main loop for EM
for k = 1:param.maxit
% Estimation step
[xp,wp] = bpf(y,u,theta,param);
[xs] = bsi(xp,wp,u,theta,param);
% Maximisation step
[t... |
function c=hermitip(x,fx)
% function c=hermitip(x,fx);
% This function is used to compute the coefficient of
% Hermitian interpolating polynomial
%
% input: x nodes
% fx values of f at x. if x(i-1)<x(i)=x(i+1)=...=x(i+k)<x(i+k+1)
% then fx(i)=f(x(i)); fx(i+1)=f'(x(i)); fx(i+2)=f''(x(i));....
% output: ... |
% Show_Result
% Input: str
% Message on MessageBox
function Show_Result(str)
h=msgbox(str);
th = findall(0, 'Tag','MessageBox' );
boxPosition = get(h,'position');
textPosition = get(th, 'position');
set(th, 'position', [boxPosition(3).*0.5 textPosition(2) textPosition(3)]);
set(th, 'HorizontalAlignme... |
%根据给定的gmm (Gaussian Mixture Models),计算概率,并取对数
function p = calcGmm (gmm, x)
p = realmin; %防止log报错
for i = (1:gmm.K)
p = p + gmm.w(i) * pdf (x, gmm.mu (i, :), gmm.sigma (i, :));
end
|
function x = getCellSubtypes(cellType)
% get the cell subtype
%
% INPUT: cellType string from CellTypes
% OUTPUT: x cellstr of subtypes
%
% 19Jun2017 - SSP - created
switch lower(cellType)
case {'ganglion cell', 'gc'}
x = {'unknown','midget', 'parasol', 'small bistratified',...
'large bistratified', ... |
% Apprentissage pour l'égaliseur de canaux
% ****************************************
disp('Entraînement');
%% 1 - Paramètres d'entraînement
transient = 1000; % Fin du transient
trainEnd = 5100; % Fin de la séquence d'apprentissage
trainSeq = transient+1:trainEnd; % Séquence d'apprentissage
lambda = 0.998; % Taux d... |
function bootstraping_per_ddbb
% This code, by Carlos Figuera
% carlos.figuera@urjc.es
% Mar 2016
%% Initializations
clear all; clc; close all; rng(2);
% Add glmnet package
addpath('./glmnet_matlab')
addpath('./mysvm/')
% Options
w_length = 4; % options: {4,8}
train_rate = 0.... |
x = 0:0.1:10;
x_2 = -10:0.1:20;
y = besselj(1,x);
y_2 = besselj(1, x_2);
cheby100 = chebyshevT(100, y);
cheby92 = chebyshevT(92, y);
cheby8 = cheby100 - cheby92;
cheby100_2 = chebyshevT(100, y_2);
cheby92_2 = chebyshevT(92, y_2);
cheby8_2 = cheby100_2 - cheby92_2;
figure(1)
plot(x, y, 'o', x, cheby100, 'r-', x, cheb... |
function [dists_400, dists_5000, dists_32556] = score_algo_tester(data_400, data_5000, data_32556)
dists_400 = zeros(255, 1);
dists_5000 = zeros(255, 10);
dists_32556 = zeros(255, 4);
for i = 1:1 %handle data_400
i
[~, dists_400(:, i)] = score_distribution_by_noise_level(data_400(:, i), ... |
function d = greedy_strong_cp(m,model,model_data,d)
d.RB = m.detailed_simulation(m,model_data);
red_data = stabilized_lin_stat_gen_reduced_data(m,d);
M_train = d.M_train;
flag=1;
err_seq = [];
ind_seq = [];
K=d.W;
j=0;
while flag
for i=1:size(M_train,2)
mu = d.M_train(:,i);
m.model = m.model.... |
X=[0.3,0.4,0.5,0.6];
Y=log(X);
DY=1./X;
x0=0.45;
y0 = Hermite_interp(X,Y,DY,x0);
disp(y0) |
function [x_Train,bestChannels] = channel_selection(training,trainingLabel,varargin)
inputs = parse_my_inputs(training,trainingLabel,varargin{:});
% features onset and rest class
index = ismember(trainingLabel,1);
f_onset = squeeze(training(index,:));
f_base = squeeze(training(~index,:));
P = [];
nTime = size(f_onse... |
function A=cangweizhi2(leng,chrom0)
m=1;
A=zeros(10,12);
B=[125,125,125,125,125,125,111,111,98,98];
for j=1:length(leng);
if (leng(chrom0(j))<=B(m))
A(m,j)=chrom0(j);
B(m)=B(m)-leng(chrom0(j))-0.8;
q=j;
else
m=m+1;
... |
clear all
close all
clc
%% Test 1
% One Node
% DQN
PPJDQNoneTest1 = [5189.56288490382;5285.60532909983;4617.57290376611;5189.88130902792;3599.04853286212;5075.11678569593;5834.16331157225;5249.51731406859;4616.67897047233;4715.27434819292];
% LEACH
PPJLEACHoneTest1 = [5171.35255136085;5317.12621013903;5183.0674460684... |
function handles = close_OSA_imu(handles)
%Writes into a .CSV file.
handles.osa.stopdate = datestr(now,'dd-mmm-yyyy HH:MM:SS.FFF');
if(handles.osa.k - 1) <= 0
handles.osa.k = 2;
end
fprintf(handles.osa.fid,'Log Start,%s\n',handles.osa.startdate);
fprintf(handles.osa.fid,'Log End,%s\n',handles.osa.stopdate);
fpri... |
% Finds S that minimizes
% || reshape(S) ||_{*}
% subject to
% W = R (S + kron(1 1', mu))
function [X, mu] = find_structure_centroid(projections, use_3P, settings)
N = length(projections.tracks);
F = projections.num_frames;
% Merge equations for all points.
fprintf('Building linear system...\n');
[A, b... |
function SortCalls(hObject, eventdata, handles, sort_type, show_waitbar, select_added)
% Sort current file by score
set(handles.hFig, 'pointer', 'watch')
if nargin < 5
show_waitbar = 1;
end
if nargin < 6
select_added = 0;
end
if show_waitbar
h = waitbar(0,'Sorting...');
end
switch sort_type
case 'score'... |
%几何迭代法第二章37页
clear
a=1;
num=10;%采样点个数
theta=linspace(0,2*pi,num);
x=a*(1+cos(theta));
y=a*sin(theta).*(1+cos(theta));
plot(x,y,'.-','markersize',20)
P=[x;y]';
Pname=['fig2_3-',num2str(num),'.mat'];
pathname='C:\CodeStore\matlab\几何迭代法\data\';
save([pathname,Pname],'P')
|
%Kiran Rao
%ME 2016 - Section B
%902891012
%Computer Project 3
function CP3RaoKiran
format long %to print 8 digits in the results
function [I] = trapezoidal(xVals,yVals) %takes in vectors of x and y values then computes the area of trapezoids formed between each value to approximate the integral
... |
file = 'I:\1_MR\1_HQMR\R&D\SYS_APPL\TeamMitglieder\Werkstudenten\Ruben\RespatoryFiles\copy\test';type='rasp';
setsss = generate_sets(file,type);
setsss = clean_sets(setsss,'normal',0.1);
g = length(setsss);
for k=1:g
% Setwahl
setwahl = [k];
sets = setsss(setwahl);
% Mittlewertset oder übernehem n... |
classdef SimpleChannelFlowDelft2d < SWEPreBlanaced2d
%SIMPLECHANNELFLOWDELFT2D 此处显示有关此类的摘要
% 此处显示详细说明
properties
Length = 10000
Width = 2000
end
methods
function obj = SimpleChannelFlowDelft2d( N, deltax, cellType )
obj = obj@SWEPreBlanaced2d(... |
function [] = forward(AXES1,AXES2)
%% 申明全局变量
global imageGather;
global i;
global maxIndex;
global RSimageGather;
global RSi;
global RSmaxIndex;
%% 浏览原始图片
if mod(i, maxIndex) == 0
i = 1;
else
i = i + 1;
end
axes(AXES1);
imshow(imageGather{i});
%% 浏览结果图片
if mod(RSi, RSmaxIndex) == 0
RSi = 1;
else
RSi = RSi +... |
function state = flipFinalValve(state)
if nargin < 1
state = 1; % flip valves to OPEN state by default
end
global NI valveState
valveState([4,17]) = state;
outputSingleScan(NI,valveState);
% putvalue(NI.Line(4),state)
% putvalue(NI.Line(17),state) |
% Contains scripts from the MATLAB learning book
% Display area of a circle
fprintf('Note: The units will be in inches \n')
radius = input('Please insert the radius: ');
area = pi * (radius ^ 2); % adding ; provides print suppression
fprintf('Your circle has an area of: %.2f inches squared \n', area)
% Display tempa... |
function [ output_args ] = createStatistics( cellClusterM1,indexStates,indexCC_time,numStates,COLORS_STATES,muN,stateMatrix1)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
%%%%%%%%%%%%%%%%
indexCell=1:nrows(cellClusterM1);
cellClusterMT=cellClusterM1;
indToDelete=find(cellClusterM1(:,... |
% Test a new Image
% use code below with giving path to your new image
img = imread('C:\Users\mstfy\Desktop\image_0243.jpg');
[img,face] = cropface(img);
% face value is 1 when it detects face in image or 0
if face == 1
img = imresize(img,[227 227]);
predict=classify(newnet,img)
end
nameofs01 = 'Mustafa';
nameofs0... |
%For the model Z_t(m)=\sum_{j=1}^{p_t(m)} phinp{1,m}(t,j) Z_{t-j}(m)+eta_t(m)
%we first compute alpha, beta, and theta such that, for a given t,
%Z_{t+j}(m)=\sum_{l=0}^{p_{t,j}^{max}(m)} alpha{1,m}(j+pmaxS(m)+1,l+1)Z_{t-l}(m)
%+\sum_{l=1}^{j} beta{m,j}(l) eta_{t+l}(m)
%We then compute (output of the function) the coe... |
function value = debug_packet(varargin)
value = feval(varargin{:});
function void = initialise
global debug
debug.source = 7;
void = -1;
function value = fetch_data(expname);
global rsc debug
mdbmsg = RouteDBMsg;
source_offset = num2str(mdbmsg.offset_source);
amtype_offset = num2str(mdbmsg.offset_amtype... |
function [ ] = Find_points( IR, VIS )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
[movingPoints,fixedPoints] =cpselect(IR,VIS,'Wait',true);
save('Points.mat','movingPoints','fixedPoints')
end
|
clear variables
directorio = 'C:\Users\60069978\Documents\MATLAB\scan24\';
lut = [directorio 'LUT_paso_5_mm.txt'];
datos = importdata(lut, '\t', 1);
datos = datos.data;
x = datos(:, 1);
y = datos(:, 2);
px = datos(:, 3);
py = datos(:, 4);
%%%%%%%%%%%%%%%% X %%%%%%%%%%%%%%%%
px_pedido = 1000;... |
% CombineBatchFiles
%-------------------------------------------------------------------------------
% Script to loop through directories from a distributed batch computation (across
% ranges of tsids) and combine results into a single HCTSA.mat file.
%-------------------------------------------------------------------... |
function [error,predicted_x,weights] = lms_ale(s_realisation,mu,delay,M)
N = length(s_realisation);
predicted_x = zeros(N, 1);
weights = zeros(M, N);
error = zeros(N, 1);
for i = delay+M:N
u = s_realisation(i-delay:-1:i-delay-M+1);
predicted_x(i) = weights(:, i)' * u;
error(i... |
function [Tz_m] = chi_generate_dTdz_m(t1, z1, T1, S1, t2, z2, T2, ...
S2, sdir, use_TS_relation, ...
ChipodDepth, vis)
% [Tz_m] = chi_generate_dTdz_m(t1, z1, T1, S1, t2, z2, T2, S2, sdir);
%
% This function generates an input file for ... |
function svmAccuracy(outputPath, generalProperty, imagingData, BehaveData)
% mkNewFolder(outputPath);
[labels, examinedInds, eventsStr, labelsLUT] = getLabels4clusteringFromEventslist(...
BehaveData, generalProperty.labels2cluster, generalProperty.includeOmissions);
accuracyAnalysis(BehaveData, outputPath, generalPr... |
load('matrixAs_2.mat')
d=20;
mu=zeros(d,1);
sigma=eye(d);
eps=0.05;
xii_=mvnrnd(zeros(d,1),eye(d),5000)';
% save('dataset1.mat')
% save('dataset2.mat')
% save('dataset3.mat')
% save('dataset4.mat')
% save('dataset5.mat')
% save('dataset6.mat')
% save('dataset7.mat')
% save('dataset8.mat')
% save('dataset9.mat')
save('... |
classdef ImageAnnotation < ether.aim.Annotation
%IMAGEANNOTATION Summary of this class goes here
% Detailed explanation goes here
%----------------------------------------------------------------------------
properties
end
%----------------------------------------------------------------------------
properti... |
%%%%%%%%%%%%%%%%% Error 1
T = 273+0; %K
P = 10*100000; %Pa
% C1, C2, C3, nC4, nC5, H2O, CO2, N2
index = [61,100,132,181,223,20,46,29];
n=[0.588235,0.058824,0.058824,0.058824,0.058824,0.058824,0.058824,0.058824];
[Bx,By,Bz,x,y,z,zx,zy,zz]=phase2(T,P,index,n)
%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%% Error 2
% T = 273+0; %... |
function [result,WCL,Irrigation] = Regular_5_cad(ET_cad,Precipitation_cad,t,d)
corn_price = 0.2;
water_price =1;
WCL = zeros(102,1);
WCL(1) = 359;
Irrigation = zeros(102,1);
for j = 1:101
if mod(j,t) == 1
Irrigation(j) = d;
end
Var_x2 = [WCL(j),Precipitation_cad(j),ET_cad(j),Irri... |
function parsivel=PSVncread(file)
% This function reads a NetCDF file from PSV structure and return a
% structure.
% Use: parsivel = PSVncread(file)
%
% JValdivia - 08/2019
time = ncread(file,'time');
RI = ncread(file,'RR');
dbZ = ncread(file,'Z');
SYNOP4680 = ncread(file,'SYNOP4680');
SYNOP4677... |
function [tn,xn]=data_resample(data_file,Fs)
%data_file 风机数据(第一列振动信息,第二列转速信息)长度最好不短于1分钟
%Fs 原始采样频率;
%tn 新的时间序列;
%xn 新的数据序列;
xx=importdata([data_file,'.txt']);
xn = xx(:,1);
vn = xx(:,2);
tn=linspace(0,length(xn)/Fs,length(xn))';
t= tn;
dk= xn;
figure
plot... |
%
% color_weight: calculates weight for target/candidate patch distributions
%
% Input
% image: image input
% xs: x-pos of candidate mask
% ys: y-pos of candidate mask
% q_u: target patch distribution
% p_u: candidate patch distribution
% Ouput
% weight: weights for candidate
%
%
% File:... |
[target_variables, target_names, data, feature_names] = load_hs_vaalikone('T-61_3050_data_vk_training.csv');
% data = bsxfun(@minus,data,min(data));
% data = bsxfun(@rdivide,data,max(data));
% S = sdaeTrainBinary(data,[size(data,2) 200 100 5],32, 500, 5000);
% % S = findSdaeRBM(data,[size(data,2) 500 200 100 2]);
% H ... |
%[iq_fade] = apply_fading_td(iq, f_d, f_s, mpprofile, channel='sos')
%
% Applies specified channel profile to time domain IQ data using specified
% channel profile and fading coefficients generators.
%
% Arguments:
% iq - matrix of time domain samples of size [num_samples, num_TX_ant]
% f_d - Doppler fr... |
function[] = mySVD(path, h, w, num_ids, num_train, num_test, k)
% path = '../../../att_faces/s'; h= 112; w = 92; num_ids = 32; num_train = 6; num_test = 4; k = 50;
d = h*w;
trainSet = zeros(h, w, num_train, num_ids);
testSet = zeros(h, w, num_test, num_ids);
meanArr = zeros(d, 1);
for i = 1:num_ids
newpath = strc... |
% Load test dataset
testDataLength = length(testData.Files);
% Reset head to start of dataset
reset(testData);
% Initialize feature vector before computing
features = cell(testDataLength,1);
% Initialize labels vector
labels = zeros(1,trainDataLength);
% Initialize correct and incorrect predictions of the testing s... |
function [mw_acc, mw_t2, min_RT, rts, acc_minRT, type2_minRT] = moving_window(data, type2)
% Run the moving window with n trials
% Estimate the proportion of correct and incorrect resonses for each window
% Estimate type 2 d prime for each window
% If 10 consecutive windows are above chance level (or without errors) ... |
%% bib2html
% translates .bib to .html
%%
function bib2html(my_pet_bib, destinationFolder, filenm)
% created 2018/08/20 by Bas Kooijman
%% Syntax
% <bib2html *bib2html*>(my_pet_bib, destinationFolder)
%% Description
% Translates a bib-file into a html-file
%
% Input:
%
% * bib: bib.file without extension
% * destina... |
% Sample code for ProgressDialog.
% Copyright 2008-2009 Levente Hunyadi
function example_waitdialog
pause(0.1);
% show progress bar dialog
dlg = ProgressDialog();
maxiter = 50;
for iter = 1 : maxiter
% do any long-running operation
pause(0.1);
% update progress bar
dlg.FractionComplete = iter/m... |
function c=fcoefMaclaurin2(n,a,b)
%f(x)=ln(x)
c(1)=log(0.5*(b+a));
for i=1:n
c(i+1)=(-1)^(i+1)*((b-a)/(b+a))^i/(i);
end #for
end |
function stats = pl(varargin)
%EXPERIMENT.PL PhaseLift experiment.
%
% Options
% solver: (saga)
% solverOpts: ([]) options struct passed to the solver.
% genOpts: ([]) options struct passed to the data generator.
% plot: (false) plot the original and recovered solution.
import util.*
p = inputParser;
p.addParamete... |
function plot_phix_end( params, xspan )
C = linspace(0, 1, 50);
Phix_end = zeros(1, length(C));
for i = 1:length(C)
Phix_end(i) = get_phix_end(params, C(i), xspan);
end
plot(C, Phix_end)
end |
function [kde,xgrid,mker] = kdeSM(data,paramstruct)
% KDESM, Kernel Density Estimate (1-d, Gaussian Kernel)
% Steve Marron's matlab function
% Does 1-d kernel density estimation, using binned (default) or
% direct (either matrix, or loops for bigger data sets),
% implementations, with the bandwidt... |
clear
init
synthdata_2
% load_X
% E_ori = zeros(128,128,64);
taille = 1000;
YY = zeros(taille, taille*taille);
%OO = zeros(taille, taille*taille);
%EE = zeros(taille, taille*taille);
for i=1:100
YY(i,:) = to_vec(X(:,:,i));
% OO(i,:) = to_vec(O(:,:,i));
% EE(i,:) = to_vec(E_ori(:,:,i));
end
fprintf('\n***... |
function add_SR(model)
% adding signal range and partition point in the model for the input
% signals
TARGET = model;
load_system('Simulink'); % Load Simulink library (background)
load_system('MIL_Test');
load_system('LCTC_vTD8_Test_TC0_ref6_2007a');
load_system(TARGET);
TestDataBlock = find_system(TARGET, 'SearchDep... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.