text stringlengths 8 6.12M |
|---|
%Check脚本参数配置
%1.是否进行眨眼眼电去除
%'Yes' 是(默认)
%'No' 否
BlinkCheck = 'No';
%1.是否进行水平眼动眼电去除
%'Yes' 是(默认)
%'No' 否
EyeMoveCheck = 'No';
%2.是否进行其他伪迹去除
%'Yes' 是(默认)
%'No' 否
OtherArtifactCheck = 'Yes'; |
function v=normalizeVector(v)
v=v/sqrt(sum(v.^2)); |
function varargout = brainCheck(varargin)
% BRAINCHECK MATLAB code for brainCheck.fig
% BRAINCHECK, by itself, creates a new BRAINCHECK or raises the existing
% singleton*.
%
% H = BRAINCHECK returns the handle to a new BRAINCHECK or the handle to
% the existing singleton*.
%
% BRAINCHECK('CALL... |
function [B, Bd] = assemble_B(s, deg, p)
% serial B and Bd computation
B = spalloc(sum(deg-1), length(p), sum( 2*(deg-1) ));
Bd = spalloc(sum(deg-1), length(p), sum( deg.*(deg-1) ));
idx = 1;
for i = 1 : length(s)
ind = find( p == s(i) );
count = 1;
for j = 1 : deg(i)-1
B(idx,ind(j)) = 1... |
function sv = select_span_vectors(G, varargin)
% SELECT_SPAN_VECTORS Selects a subset of the set of samples sufficient to generate w
%
% SYNOPSIS: sv = select_span_vectors(G)
% sv = select_span_vectors(G, algorithm, params...)
%
% INPUT:
% - G: the matrix of products of sample vectors in feature space, via th... |
function [ params ] = default_params( D )
if nargin < 1
D = 2;
end
R = eye(D);
Q = R;
x_opt_val = zeros(D,1);
f_opt_val = 0;
params = {x_opt_val, f_opt_val, R, Q, 1};
end
|
csc401_a2_defns
delta = 0.00001;
filename_out = '../experiments/perplexity/delta0.00001.txt';
testDir = '/u/cs401/A2_SMT/data/Hansard/Testing';
load('../models/english_LM.mat');
LME = LM;
load('../models/french_LM.mat');
LMF = LM;
fprintf('Computing perplexity with delta = %i.\n', delta);
ppe = perplexity(LME, tes... |
function [] = plotPonceShettyIndices3DTrajectoriesAndText(K_B,...
P_rescaled,V_p_rescaled,ID)
%PLOTPONCSHETTYINDICES3DTRAJECTORIESANDTEXT plot single Ponce and Shetty
% index (K_B) in 3D (contours) and "trajectories" in 2D next to it and
% aridity plot and text below it.
%
% INPUT
% K_B: baseflow fraction
%... |
clc; clear all; close all;
load('100m.mat');
x=val(1,:);
ecg=x';
figure(1);
plot(ecg); grid on;
title('ecg wave'); xlabel('time (msec)'); ylabel('amplitude(mV)');
hold on;
Fc=10;
Fb=8;
M=500;
t = linspace(-15,15);
a = sqrt(Fb).*sinc(Fb*10*t/M);
b = sqrt(-Fb).*sinc(Fb*10*t/M);
c=a+b;
plo... |
clearvars
clustdir = '/home/sofiakp/projects/Anshul/matlab/medusa/data/Jul13/hg19.encode.rna_asinh_rpk500_z2_clust30/';
new_indir = '/home/sofiakp/projects/Anshul/matlab/medusa/data/Jul13/hg19.encode.rna_rpk500_z2';
inpref = 'hocomoco_allOv_gBoost_test4';
params_file = fullfile(clustdir, 'runs', [inpref, '_params.m'])... |
function saveState(obj,user,PARAMS,varargin)
%% Parse inputs
p = inputParser;
p.addParameter('tdx',[]);
p.addParameter('epoch',[]);
p.addParameter('pl',[]);
% parse the results
parse(p, varargin{:});
res = p.Results;
tdx = res.tdx; % Index of full state saving matrices
epoch = res.epoch; % Epoch... |
function [ l_t_current ] = occupancy_grid_mapping( l_t_past,p_t,z_t )
%OCCUPANCY_GRID_MAPPING This function computes the loglikelihood
%of occupancy over a grid given the previous belief, current robot
%position and current measurement
% @param l_t_past {[x,y,l_t-1]} - an nx3 matrix with center of mass of
% grid p... |
classdef Dipole < handle
% Dipole class
%
% Properties:
% name
% length
% field
% gradient
% hgap
% e1
% fint1
% e2
% fint2
% aperture
%
% Methods:
% Track
% TrackSpin
% GetBField
properties
name = ''; %... |
function [I,bck,bcksml] = backgroundSubtraction(I,varargin)
% background substruction of a segmented image.
%
sz = size(I);
if ~isa(I,'double') && ~isa(I,'single')
warning('Data was not in double - tansforming it to be double using mat2gray!!!');
I=mat2gray(I);
end
% default arguments
arg.smoothmethod='spl... |
function yPn = fPn(n, a, xE)
for k=1:length(xE)
b(1) = a(1);
for i=2:n+1
b(i)=a(i)+xE(k)*b(i-1);
end
yPn(k) = b(n+1);
end
end
|
%the core learning algorithm locate
%param:
%p_training_data: the training data set
%p_training_answer: the training answer
%output
%r_learnt_weight: the weight learnt in this training data set
%r_cost_history: the cost history used to plot learning performance
%r_network_struct: the information about this learning alg... |
function display(om, more_set_types)
%DISPLAY Displays the object.
% Called when semicolon is omitted at the command-line. Displays the details
% of the variables, constraints, costs included in the model.
%
% See also OPT_MODEL.
% MP-Opt-Model
% Copyright (c) 2008-2020, Power Systems Engineering Research C... |
T=5
w=2*pi/T
nT=6 %numarul de perioade reprezentate
t1=0:0.002:5*nT
x=1.5*sawtooth(t1*w,0.6)-0.5 %generarea semnalului triunghiular amplitudinea
%este 1.5 si componenta continua -0.5 pentru ca nivelul de maxim sa fie egal
%cu 1 iar cel de minim cu -2
%s=slewrate(x,1/0.002)
subplot(3,1,1)
plot(t1,x)
axi... |
function D = get_distance_matrix(X)
end |
a=0.5;
b=0.21660849392;
plasma_vol=3;
interval=4;
A0=100; %in ug
absorb=0.12;
A=400;
B=0;
amt_interval=2;
time=54;
step_size=0.001;
B_array=zeros(1,time/step_size);
A_array=zeros(1,time/step_size);
rt=0:step_size:time;
j=1;
for i=0:step_size:time
A_array(1,j)=A;
B_array(1,j)=B;
A1=A;
B1=B;
j=j+1;
A=A1-... |
function distance = CalculateDistanceToTarget(src,target,dir)
% Repeat targets
target = [repelem(target(1),size(src,1))',repelem(target(2),size(src,1))'];
% Pass possible sources and target
distance = transpose(Heuristic(src + dir,target));
end
|
function [theta] = gradientDescent(X, y, theta, alpha, num_iters)
m = length(y);
for iter = 1:num_iters
theta = theta - ((alpha / m) * (X' * ((X * theta) - y)));
end
end
|
function [nb,nf,mi,me,m,n,Ae,Ai,be,bi,c] = dataRead(experiment)
meta_path = experiment + "/meta";
Ae_path = experiment + "/Aeq";
Ai_path = experiment + "/A";
be_path = experiment + "/beq";
bi_path = experiment + "/b";
c_path = experiment + "/c";
%read data
[nb,nf,mi,me] = readmeta(m... |
function [ emitdtest ] = LinCom( emitdt, RB_matrix )
% This function finds the coefficients required to rebuild emitdt from the
% reduced basis. It then uses these coefficients with the reduced basis to
% actually recreate emitdt as a vector called 'emitdtest'.
%% Find coefficients
%Find m so that matrix dim... |
% Postprocess the data
close all
clear all
% Mu-Metal :
% Expensive, high permeability
% sigma = 1.61e+06 [1/(ohm.m)]
% mu_r = 50000
% Price/m^3 = 3e+06 $
% AK Steel 400 :
% is one of the most economical chromium ferritic stainless steels
% ... |
function c = cluster1(x,k,particion,distancia)
% CLUSTER1 - Algoritmo de clustering aglomerativo jerarquico !! O(n^2) !!
% "Basic Agglomerative Hierarchical Clustering"
%
% clases = cluster1(x,k)
% clases = cluster1(x,k,p0)
% clases = cluster1(x,k,'d_max');
% clases = cluster1(x,k,... |
subplot(1,2,1)
plot3(dx,dy,dz,'r-', 'linewidth', 3)
subplot(1,2,2)
plot3(dx,dy,dz,'r-', 'linewidth', 3) |
function [ output_file_name_1,output_file_name_2 ] = klein_bottle_emb( N )
% With this function one can sample N^2 points from the image
% of the embedding of the Klein bottle in R^4
%
% Input: number of points N
% Output:
% output_file_name_1: name of text file storing distance matrix
% output_file_name_2: name of ... |
% Q3- RANSAC
%%%%%%$ Harris corner detection %%%%%%%%%%
clear all;
I=im2double(imread('transA.jpg'));
I1=single(imread('transA.jpg'));
H=fspecial('gaussian',[3 3],1);
I_blur=imfilter(I,H,'replicate');
[rows cols]=size(I_blur);
[Ix Iy]=imgradientxy(I_blur);
I_adjoin=[Ix Iy];
r=1;
w=1;
R=zeros(480... |
%a = imread('pixelate.JPG');
global vid rect scra yelrg firstch secondch blackrg bluerg brownrg grayrg redrg greenrg getall getallc bot1rg bot2rg leaveredcones;
leaveredcones =[];
firstch = 0;
secondch = 0;
scra = serial('COM6','BaudRate',9600);
fopen(scra);
vid = videoinput('winvideo', 2, 'MJPG_1024x576');
sr... |
clc;
close all;
clear ;
step=0.05;
% Load the file you wish to register , although it might happen the file
% you load might have a different name , so be careful with the filenames.
load('RegisteredData_P031417_MID114.mat');
%% Rigid Registration
UnregisteredData=Data.Systole;
% To select a mask around the myocardium
... |
% This is material illustrating the methods from the book
% Financial Modelling - Theory, Implementation and Practice with Matlab
% source
% Wiley Finance Series
% ISBN 978-0-470-74489-5
%
% Date: 02.05.2012
%
% Authors: Joerg Kienitz
% Daniel Wetterau
%
% Please send comments, suggestions, bugs,... |
function [lower_bound, upper_bound] = student_interval(x, perc)
% STUDENT_INTERVAL(X, PERC) computes the lower and upper bounds of the 100*PERC percent Student confidence interval
% of X s distribution mean.
%
% X : N-by-1 double
% PERC : 1-by-1 double in [0, 1]
% LOWER_BOUND : 1-by-1 double
% UPPER_BOUND :... |
screenSize = get( 0, 'ScreenSize' );
screen_height = screenSize(4);
screen_width = screenSize(3);
width = screen_width * 0.8;
left = floor( (screen_width - width) / 2 );
height = 170;
bottom = floor( (screen_height - height) / 2 );
figure( 'Position', [ left bottom width height] );
line_width = 2;
%x = rand(10, 1)*10 ... |
clear; clc
model_root = fullfile(ottBari2020_root, 'Data', 'Modeling', 'ModelFits');
task = 'intBlocks';
load(fullfile(model_root, [task '_MLEfits.mat']))
os_int = os;
clear os
int_task = [os_int.Blocks] == 0;
os_int = os_int(int_task);
VP_mask = contains({os_int.Region}, 'VP');
os_int = os_int(VP_mask); % onl... |
function [new_face] = preprocess_face(face, crop_param, target_rescale)
%PREPROCESS_FACE Do some preprocessing on each face before loading
% Crop images, downsample to 29x41, then normalize and zero-mean
% Crop
face = imcrop(face, crop_param);
% Downsample
face = imresize(face, target_rescale);
... |
function f = ResizeIm(k)
%k to stopien zagnierzdzenia
for i=0:5:100
s = strcat(['F1/obraz-',num2str(100-i),'-k=',num2str(k),'.bmp']);
A=imread(s);
A2=imresize(A,2);
s2 = strcat(['F2/obraz-',num2str(100-i),'-k=',num2str(k),'.bmp']);
imwrite(A2,s2);
end
end |
classdef control_set_test < matlab.unittest.TestCase
%control_set_test Summary of this class goes here
% Detailed explanation goes here
properties
controlSet
end
methods(TestMethodSetup)
function setFolders(testCase)
% Add the relevant folders to the current path
... |
classdef MapRegion < handle
%MapRegion Map Region class
% MATLAB OOP for the region detection
properties
left=MapRegion.empty; %empty MapRegion object
right=MapRegion.empty; %empty MapRegion object
top=MapRegion.empty; %empty MapRegion object
bottom=MapRegion.empty; %... |
setMTEXpref('generatingHelpMode',true); % Avoid some artefact (fix issue #5)
%%
mtexdata small
[grains, ebsd('indexed').grainId]=calcGrains(ebsd('indexed'));
ebsd(grains(grains.grainSize<3))=[]; % Remove small grains
grains=calcGrains(ebsd('indexed'));
G=gmshGeo(grains);
%% Set different element size dependi... |
function A = jpeg_decomp(x, n)
pkg load signal
% Paso 1: Convertir vector x en matriz 8x8
Cr = vect2mat_diag(x);
% Paso 2: Multiplicar puntualmente Cr y Q
% Matriz de Cuantificacion
Q = cuantificacion(n);
M = Cr .* Q;
% Paso 3: Calcular la inversa de DCT-2D a M
P = idct2(M);
% Paso 4: Redo... |
function show ( elements3, elements4, coordinates, u )
%
% Parameters:
%
% Input, integer ELEMENTS3(N3,3), the nodes that make up each triangle.
%
% Input, integer ELEMENTS4(N4,4), the nodes that make up each quadrilateral.
%
% Input, real COORDINATES(N,1:2), the coordinates of each node.
%
% Input, real U... |
[im, MAP] = imread('C:\Users\hfa2\Desktop\Processamento_Digital_Sinais---Projeto\Arquivos\doc1.bmp');
%% tentativa de obter o level ideal
level = graythresh(im);
%% Level por tentativa e erro
level = 0.455;
%% Binariza a Imagem
bw = im2bw(im,level);
%% Inverte as cores da imagem binarizada
bc = imcomplement(bw);
%... |
clear;
x = xlsread('data1.xls');
price = x(:,4)';
figure;
plot(price,'k','LineWidth',2);
xlabel('观测序号');
ylabel('沪市日收盘价');
% %盒子法平滑处理
% output1 = smoothts(price,'b',30);
% output2 = smoothts(price,'b',100);
% figure;
% plot(price,'.');
% hold on
% plot(output1,'k','LineWidth',2);
% plot(output2,'k-','LineWidth',2);
... |
% load info from cruise_info
allsettings = add_cruise_info;
% die hier eintragen
allsettings.sbepre_filename = 'm_90_';
allsettings.lonlat = [-95 -70 -20 7]; %[lonmin,lonmax,latmin,latmax] for cruise map
% met_090_1_settings.m
% settings for CTD calibration
allsettings.release = 3;
allsettings.quality_control_indi... |
clear;
f = @(x) (100./(x.^7)).*sin(10./(x.^7));
a = 1; b = 3;
%tol = 0.5; nfmax = 256;
%tol = 0.05; nfmax = 512;
tol = 0.005; nfmax = 2048;
hmin = 1E-5;
[S1, ierr1] = myquad(a, b, tol, f, nfmax);
[S2, ierr2] = myquadadapt(a, b, tol, f, hmin);
I = integral(f, a, b);
nonadpterr = abs(I - S1);
adpterr = abs(I - S2);
|
function [ nn ] = interface_get_aqi_nn(mathInfo,index)
stringToRun='';
stringToRun=strcat(stringToRun, mathInfo.get_aqi_nnFunction);
stringToRun=strcat(stringToRun, '(');
stringToRun=strcat(stringToRun,'mathInfo,');
stringToRun=strcat(stringToRun,'index');
stringToRun=strcat(stringToRun,')');
[bc]=eval(stringToRun);
... |
function [SF] = GetSF(SF,xipos,etapos)
%% shape function
SF = 0.25 * [(1-xipos)*(1-etapos);
(1+xipos)*(1-etapos);
(1+xipos)*(1+etapos);
(1-xipos)*(1+etapos)];
return
|
% mathComplex3.m
% Visualization of a complex valued function
% The phase of the complex function is displayed using colors
% The calculation for the plots may take more than 100 seconds.
% DOING PHYSICS WITH MATLAB
% https://d-arora.github.io/Doing-Physics-With-Matlab/
% Matlab Version 2018a / 180915
% Ian Coo... |
function y = XonOmega(U,V,varargin)
% y = XonOmega(U,V,omega)
% This implicitly forms the matrix A = U*V'
% and then returns A(omega).
%
% y = XonOmega(U,V,I,J)
% does the same thing, but uses subscript indices I and J
% ( where [I,J] = ind2sub( size(A), omega )
%
% y = XonOmega(U,V,OMEGA)
% does the same thi... |
function L = likelihood_probit(Y,theta)
%This function takes in data Y and theta=[alpha,rho,gamma_L,pi]
%and return the likelihood calculated as L = sum(ln(li))
alpha = theta(1);
rho = theta(2);
gamma_L= theta(3);
tao = theta(4);
pi = abs(tao)/(1+abs(tao));
gamma_H=-pi*gamma_L/(1-pi);
[nN,nT] = size(Y);
nT... |
classdef shape3dobject < shapes.shapeobject
%3D shape base class.
%
% This absract class is intended as the mother class for all shape
% object that can be drawn in 3D (surfaces, not lines). It
% implements the draw method from shapeobject by calling an abstract
% method getXYZ, t... |
function [row_temp,col_temp]=Adjacent_1_Location(row,col,channel)
%UNTITLED9 Summary of this function goes here
% Detailed explanation goes here
% the size of the matrix is set 101*101
size=101;
%left
if(row>1)
if(channel(row-1,col)>0)
row_temp=row-1;
col_te... |
function [input_points] = obtaininputssmall(checkerboard_points)
p1 = [checkerboard_points(1,21) checkerboard_points(2,21)];
p2 = [checkerboard_points(1,22) checkerboard_points(2,22)];
p3 = [checkerboard_points(1,27) checkerboard_points(2,27)];
p4 = [checkerboard_points(1,28) checkerboard_points(2,28)];
input_points = ... |
function dCheck(MAT1,MAT2,intP1,intP2)
clc
reshape(MAT1(intP1+1,intP2+1,1,:),1,2)
reshape(MAT2(intP1+1,intP2+1,1,:),1,2)
end |
% ConvertWdfToHDF5.m
%
% Matlab script because of available Matlab libraries for Yokogawa WDF file
% format.
%
% Libraries downloaded from Yokogawa website. Trial version but I do not
% know what the limitation is.
%
%
% Based on:
% MATLAB M-File : WdfSample4.m
% WDF file access sample script- 4
% Copyri... |
function trunca3 = TruncamentoDe3Digitos(expressao)
syms x
resultado = double( subs(expressao,x,0) );
resultado = resultado * 1000;
resultado = fix(resultado);
trunca3 = resultado/1000;
end |
clear all
close all
clc
global path_img path_save format_img;
% the tools used in algorithms are configured in the config_tool.m
run('../config/config_tool');
% the parameter of algorithms is configured in config_para_do
clear all
run('../config/config_para_do');
global path_img path_save format_img;
format_img ... |
%simple signal path plot + DSP detection point mark
%################################################
%input parameters
%oooooooooooooooo
strPath = 'C:\Users\H162437\OneDrive for Business\documents_onedrive\workflow\2019_09_28_offset_investigation\';
strFile = 'MPC_8inch_20bar_nitrogen_no_climate_control_6D_config_SB... |
clear all
close all
addpath ../
setpaths
global RefreshRate; % Stimulus refresh rate (Stim frames per second)
RefreshRate = 100;
%% Start by generating glm parameters and filters
DTsim = 1/RefreshRate;
nkt = 15*RefreshRate/100;
ttk = [-nkt+1:0]';
ggsim = makeSimStruct_GLM(nkt,DTsim); % Create GLM struct with defaul... |
function driftCompute(F)
%+Focused version of driftCompute
% Layers = in.Results.Layers;
RefStack = F.Analysis.RefStack;
RefIndex = F.Analysis.RefIndex;
RefLayers = F.Analysis.RefLayers;
% create wrapper object
m = adapted4DMatrix(F,'source');
mRef = false;
if RefStack % if we wan... |
function f = flops_exp
% FLOPS_EXP Flops for exponential
% FLOPS_EXP returns the number of flops needed to compute the exponential
% of a scalar.
% This flop count is based on timing the Pentium 4.
% A neutral flop count is based on source code for C exp() function at
% http://www.opencores.org/cvsweb.shtml/... |
function chodin6fs(nume,control,verbose)
%
% Simuleaza dinamica imprastierii luminii coerente pe suspensii.
% Parametrii de apel sunt:
% - nume - numele fisierului cu datele de intrarea
% - control; daca control=0 Returneaza un fisier avand un sir de valori,
% intensitatea in acel punct la ... |
%---------------------------------------------------+
% script to calculate the wavelet coherence between |
% rainfall time series in the dead sea region and |
% plot them as periodograms over time. |
% |
% Rob Watson; 21/12/17 ... |
function ADEPTm_GUI
% Creates main page menu and calls other modules to build the other
% menus after their respective buttons are clicked on.
close all;
clear;
clc;
% create and then hide the UI as it is being constructed --------------
hMainMenu = figure('Visible', 'off', 'Position', ... |
function [ x_locKnee, y_knee] = calc_MaxCurv_Kneedle( xVals, yVals,cutOffval,mtdi,top)
% This function will locate the "knee" of a curve.
% mtdi=1
% by finding the location where the curve has the same slope as the line that
% corosses the first and last point (defined by middle percentages)
% mtdi=2
% by finding th... |
function [confPts, confLine] = initconf(s_number,index,eta)
C = hsv(s_number);
confPts = zeros(s_number,1);
confLine = zeros(s_number,1);
for i2=1:s_number
confPts(i2) = plot(index,eta(i2,index),'.','color',C(i2,:));
hold on
confLine(i2) = plot (1:index,eta(i2,1:index),'color',C(i2,:));
... |
function initialize= initialize(x,y,n)
global u;
global nextu;
global v;
global nextv;
for x=1:n
for y=1:n
u(x,y)=.25;
v(x,y)=.015;
if y>n/1.6 & x>n/3.71 & x<y/2.6
u(x,y)=1;
v(x,y)=1;
el... |
function [h, error, y_hat] = clms(y, x, M, lr, leak)
%ANC_LMS Implements ANC with LMS
% Outputs:
% h - dynamics of the weights learnt from the data
% y_hat - denoised signal dynamics
% Inputs:
% x - noise-corrupted signal
% lr - step size/ learning rate for standard, initial for adaptive algs.
h = zero... |
%y可以是向量和矩阵
%plot(x,y)
x=0:0.1:10;
y=sin(2*x);
z=[sin(x)+2;cos(x)+1]
q=[sin(x)+2,cos(x)+1]%这种石油报错的存在的
plot(x,y)
plot(x,z)
plot(x,q) |
% Image_Filter_2D.m
%
% SCRIPT for imlook4d to Gauss filter in plane
%
%
% Jan Axelsson
% INITIALIZE
StartScript
% Export to workspace
%imlook4d('exportToWorkspace_Callback', imlook4d_current_handle,{},imlook4d_current_handles); % Export to workspace
activeROI=get(imlook4d_current_handl... |
function [x, g] = f_lin(X,theta)
% Linear transition function.
%
% USAGE: [x, g] = f_lin(X,theta)
%
% Sam Gershman, Sep 2016
if nargin == 1
b = zeros(1,X);
W = eye(X);
x = [b W(:)'];
else
D = length(X);
b = theta(1:D);
W = reshape(the... |
% script to perform fitting on energy transfer model simulation
% results. Uses RNLFIT, and data from simulation.
% do some copying/rearranging of variables from the simulation:
xdat=t;
% xdat = t; % These two lines for fitting R(t) anisotropy decay
% ydat = datay;
% ydat=fdecay;
ydat=picoav/sum(picoav);
maxy=max(yd... |
function [ precision ] = precision( X, Y, Theta )
Z = repmat(sum(exp(Theta * X)),4,1);
p = exp(Theta * X) ./ Z;
[M predictions] = max(p);
corrects = sum(predictions' == (Y * [1;2;3;4]));
precision = corrects / size(X,2);
end
|
clearvars;clc;
shortCharArray=char(string(input('')));
longCharArray=char(string(input('')));
if length(shortCharArray)>length(longCharArray)
[shortCharArray,longCharArray]=swap(shortCharArray,longCharArray);
end
additionRegister=0;
for i=1:length(shortCharArray)
tempRegister=uint8(str2double(shortCha... |
%% PARAMETRES GENERALS DONATS
%Thrusts
F=50000; %N
%Velocitat
v0 = 0; %[m/s] 600
%Camara combustio
T.t4=1143;
h=43e6;
%Condicions ambientals
T0=288.15; %[K]
P0=101325; %[Pa]
rho0=1.225; %[kg/m^3]
Rgas=287;
% a0=sqrt(rho0*Rgas*T0); %301.6361
a0 = 340.26;%[m/s^2]
% %atmosisa
% height = 9500; %[m]
% [T0, a... |
function neuronNrs=getNeuronNrs(dpxd)
% maxCellNr=neuronNrs(dpxd)
% Find the maximum cell
%
%tic
MAXCELLSPERFILE=2000; % expected with current use max ~50, safety factor 40
neuronNrs=[];
for cellNr=1:MAXCELLSPERFILE
resp_field=['resp_unit' num2str(cellNr,'%.3d') '_type'];
if ... |
function [ col ] = collision_positions( detect, val)
% Get the positions of emissions from "val"
packet_size=40;
pat= val*ones(1,packet_size);
col=strfind(detect,pat);
end
|
function p = drawAxisCube(varargin)
%DRAWAXISCUBE Draw a colored cube representing axis orientation.
%
% output = drawAxisCube(input)
%
% Example
% drawAxisCube
%
% See also
% drawAxis3d, createCube, patch
% ------
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2010-07-2... |
global volume_ratio;
global c_d0;
global delta_h_p;
global c_f0;
van_coe=73.07/100;
c_os=van_coe;
A=1.74;%Lm-2h-1bar-1
B=0.16;%Lm-2h-1bar-1
S=307*10^-6;%m
k=138.6;%Lm-2h-1
D=3600*1.490*10^-6;%10-3m2h-1
C1=1+(S*B)/D+B/k;
q_f0=1; |
% Example 7.3
% from Parameter Estimation and Inverse Problems, 3rd edition, 2018
% by R. Aster, B. Borchers, C. Thurber
% This script demonstrates compressive sensing by denoising a
% 1-d signal that happens to be sparse with respect to the discrete cosine transform basis.
% make sure we have a clean environment
cle... |
function SpecificGeneFigure()
% Franklin-Paxinos atlas:
convertToFP = false;
% Regress out neuron density:
doNNRegression = false;
%-------------------------------------------------------------------------------
f = figure('color','w');
f.Position = [626,875,1296,328];
ax = subplot(1,3,1);
SpecificGenes(false,'XJ',... |
c = randi(3);%%chooses random color
c = uint8(c);
yy = zeros(150,150,3);
yy= uint8(yy);
sat = randi(255);
sat = uint8(sat);
sat2 = randi(255);
sat2 = uint8(sat2);
sat3 = randi(255);
sat3= uint8(sat3);
sat4 = randi(255);
sat4= uint8(sat4);
sat5 = randi(255);
sat5= uint8(sat5);
sat6 = randi(255);
sat6= uin... |
%--------------------------------------------------------------------------
% fine grid size, coarse grid size, dim of coarse grid, num of coarse grid
d=1; dimH=sizeH^d; num=(N/sizeH)^d;
%--------------------------------------------------------------------------
% subsampling
dimh=(sizeh)^d;
idx_loc=floor((size... |
prec_mean_trn = zeros(1,101);
prec_mean_tst = zeros(1,101);
load(fullfile(basedir, 'Runs','OASIS','oasis_ag0.1_pivd1_mind0.05_250cat_trn40tst25.mat'));
[images, labels,files]= load_data(dataset,parms);
[images_trn, images_tst, labels_trn, labels_tst,files_trn,files_tst,parms] = split_images(images, ...
labels,f... |
clear all
close all
clc
% seasons = {'Winter', 'Autumn', 'Spring', 'Summer'};
% years={'2013','2012','2011','2010','2009','2008','2007'};
% years = {'Autumn_2007'};%,...
% 'Spring_2007',...
% 'Summer_2007',...
% 'Winter_2007'};
% years2 = {'Fall: September 1 - December 1'};%,...
% 'Spring: March 1 - ... |
function PlotHypothesis(x, y)
plot(x(:, 2), y, '-');
legend('Training data', 'Linear regression');
end |
%%
figure
ploteta
subplot(5,1,[1 2])
hold on
plot(getspos('BPMx'),-(X4-X5)/(352.220-352.180)*352.200/3e-2/1e6,'.r')
subplot(5,1,[4 5])
hold on
plot(getspos('BPMx'),-(Z4-Z5)/(352.220-352.180)*352.200/3e-2/1e6,'.-b')
ylim([-0.1 0.1])
%%
figure
hold
plot(Z5,'r')
|
function CombineGUI()
drawnow limitrate nocallbacks
f = figure('name','Cell Tracking','Position',[10 10 650 550],...
'MenuBar','none','ToolBar','none','Visible','off');
hTypeTabs = uitabgroup('Parent',f,'SelectionChangedFcn',{@changeTab},'Tag','TabGroup');
hTypeTab(1) = uitab(hTypeTabs,'Title','Main','Tag','Main... |
function results = main(p)
% Endogenous Grid Points with AR1 + IID Income
% Cash on Hand as State variable
% Includes NIT and discount factor heterogeneity
% This is the main function file for this code repository. Given a
% structure of parameters, p, this script calls functions primarily to
... |
function out = jjwater_doubleintegralmethod( matrix, t, dt_in, Ct1)
% PET Water - double integral method
%
% Reference:
% https://doi.org/10.1177/0271678X17730654
%
% Inputs:
% matrix = data with last dimension being frames (could be image matrix, or ROI values)
% t = frame start t... |
%
% Function sskarta('infil','sskartfil')
% Prepares cr-maps from distr.-files
%
% Om infil används ska den innehålla: Title,filnamn,EFPH
% enligt exemplet nedan:
% TITLE FORSMARK 2 - Sim. av cykel 22, 3252 till 9090 EFPH
% /cm/f2/c22/dist/4000.dat 3500
% /cm/f2/c22/dist/4500.dat 4000
% /cm/f2/c22/dist/5000.dat 4500
%
... |
function [SE IE DE LEV_DIST] = Levenshtein(hypothesis,annotation_dir)
% Input:
% hypothesis: The path to file containing the the recognition hypotheses
% annotation_dir: The path to directory containing the annotations
% (Ex. the Testing dir containing all the *.txt files)
% Outputs:
% SE: proportion of substitution ... |
%% main function
% Josh Grant - MAT 128C
% Project 3 - 5/28/14
close all
%% user defined parameters
h = 0.01; % step size
p = 100; % number of steps per point
a = -6;
b = 6;
n = ceil((b-a)/(h*p)) % rounds result up to nearest integer
%%
t=zeros([p+1,1]);
y=zeros([p+1,4]);
int=[a b];
ic=[0 0 0.001 0];... |
function pca_sequence=wifi_pca(amplitude)
L=length(amplitude);
pca_sequence=zeros(12,L);
for steam_start_nums = 1:30:180
[coeff,score] = pca(amplitude(steam_start_nums : steam_start_nums+29 , :)');
pca_num = (steam_start_nums-1)/30 + 1;
pca_sequence(pca_num,:) = score(:,1)';%放入第一主成分
... |
function M=make_transformation_matrix(t,r,s,h)
% This function make_transformation_matrix.m creates an affine
% 2D or 3D transformation matrix from translation, rotation, resize and shear parameters
%
% M=make_transformation_matrix.m(t,r,s,h)
%
% inputs (2D),
% t: vector [translateX translateY]
% r: vector... |
function alfa = AlphaAngle(theta, phi)
% input: theta, phi - coordinates of the particle (1x1, 1x1)
% output: alfa (in radians)
[v(1), v(2), v(3)] = Sph2Cart(1, theta, phi);
% Find an angle between oy and vector v in 3D
oy = [0 1 0];
alfa = acos(dot(oy, v)/norm(v));
end |
function Estimator = Estimator_Direct()
%% estimator class demo
% estimator property をEstimator classのインスタンス配列として定義
Estimator.name="direct";
Estimator.type="DirectEstimator";
Estimator.param=[];
end
|
%& read samples from signal file
d = read_short_binary('~/work/gnuradio/libyunsdr/build/rx_signal_file');
%d = read_short_binary('~/work/gnuradio/libyunsdr/build/rf_txrx_tone');
subplot(2,1,1);
i = d(1:2:end);
q = d(2:2:end);
plot(i);hold on;
plot(q);hold off;
subplot(2,1,2);
plot(i,q);axis equal;
|
function [maxx,maxr,maxk]=compa(A1,A2,s1,s2)
% compares two spare matrixes A1 ans A2
% the size of the dots in the spy figure are a measure of the relatif error
% it the error is > 50% the dot becomes red
% if the value in exactly one matrix is 0 the dot becomes blue
%
% s1 ~= 0, display entries
% s2 ~= 0, gives node... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.