text stringlengths 8 6.12M |
|---|
%增广状态反馈控制
clear all;
close all;
clc;
n=2;
num = [2];
den = [40 1 0];
[a,b,c,d] = tf2ss(num,den)
m = ctrb(a,b);
n = rank(m);
ts = 10;
fai = 10;
jieta = sol_jieta(fai);
wn = sol_wn(ts,jieta);
JR =-wn*jieta;
JI = j*wn*sqrt(1-jieta^2);
Ahat = [a zeros(n,1);-c 0];
Bhat = [b;0];
Chat = [c 0];
J = [5*JR JR+... |
function varargout = plot2DKinemetics(data_2DKinematics,results_2DKinematics)
%PLOT2DKINEMATICS Plots ultrasound's 2D Kinematic results.
% varargout = PLOT2DKINEMATICS(data_2DKinematics,results_2DKinematics)
% returns the resulting figure.
%
% See also: ANALYZE2DKINEMATICS, MAIN, MAIN_... |
function expectValue=ComputeECu(m , lambda , T)
expectValue = m-ComputeEN(m , lambda , T) ;
end |
clc;
clear all;
close all;
import PhysicalModels.*;
fLatitudeInDegrees = 50;
fLongitudeInDegrees = 30;
fTimeZoneInHours = 0;
% construct the main object
tEnvelope = ...
PhysicalModels.ZoneEnvelope( ...
40, ... fAzimuthInDegreesOfFirstWall
fLatitudeInDegree... |
function res = paperPlot04StraightPipeNatureFrequency(straightPipeCombineData,isSavePlot)
%绘制倍频
figure;
paperFigureSet('large',6);
fh = figureExpNatureFrequencyBar2(straightPipeCombineData,1:3,{'1倍特征频率','2倍特征频率','3倍特征频率'});
set(fh.legend,'Position',[0.142983160407072 0.621898741198966 0.26272911980535... |
% This script propagates an orbit, displays the ground track, and identifies
% ground station passes. Function currently only supports *one* ground
% station
%
% You can enable/disable the plotting and logging functionality by setting
% propagator.make_plot = true/false
% propagator.enable_logging(true/false)
% L... |
function [mlp_str, mlp_str_nice] = getMLPstr(networkOpts, niceOutput_fields)
HU = networkOpts.nHiddenUnits;
mlp_str_nice = '';
doNiceStr = exist('niceOutput_fields', 'var') && ~isempty(niceOutput_fields);
% nUnits_str = '';
if isempty(HU)
nUnits_str = 'X';
if doNiceStr
% ... |
% Draw various graphs obtained from the same point set.
%
% output = drawSampleGraphs(input)
%
% Example
% drawSampleGraphs
%
% See also
%
% ------
% Author: David Legland
% e-mail: david.legland@inrae.fr
% INRAE - BIA Research Unit - BIBS Platform (Nantes)
% Created: 2020-06-04, using Matlab 9.8.0.1323502... |
function filenameOut = genIgsStationObsDataName(statCode,Year,dayNum,settings)
% function to look for and produce name of obs data from IGS mgex stations
% (files contained locally)
obsMatDir = settings.mgxObsDir;
dirName = [ obsMatDir int2str(Year) '/' num2str(dayNum,'%03d') '/'];
if ~exist(dirName,'dir')
% dire... |
% Model of the combined calcium + granule compartments, as per Yi-der Chen,
% Shaokun Wang, and Arthur Sherman, doi:10.1529/biophysj.107.124990
% Identifying the Targets of the Amplifying Pathway for Insulin Secretion
% in Pancreatic β-Cells by Kinetic Modeling of Granule Exocytosis
% Based on the original XPP model,... |
%fftplot(x,Fs)
%x = signal vector
%fs = sampling rate
function fftplot(x,Fs,col, fn)
% TRACE COLOR
if ~exist('col', 'var') || isempty(col), col = 'b'; end
if ~exist('fn', 'var') || isempty(fn)
figure;
else
figure(fn);
hold on
end % ;
%% FFT Decomp
n = length(x);
y = fft(x)/n;
f = Fs/2*linspace(0,1,n/2+1)... |
% runpickGUI.m
%
% This script initiates the picking GUI for a list of events.
%
% DKane 20130620 verification update.
% DKane 20130919 Mw update (formerly used ML by accident), SS events will
% be Mw!!
%% Clear previous work and command window:
clear; close all; clc; format compact
addpath /Users/dkane/Documents/R... |
function [ match ] = Nearest_Neighbor( PCA_training, PCA_test )
match = zeros(1,40);
for i = 1:40
energy = zeros(1,360);
for j = 1:360
distance = PCA_test(:,i) - PCA_training(:,j);
energy(j) = dot(distance,distance);
end
[~,index] = min(energy);
match(i) = floor(index(1)/9) + 1;
end
... |
% clear up everything
clear all; close all; clc;
A=2*ones(5)
exp(A) |
%% aoStimReconMany
%
% Description:
% Call aoStimRecon with many combinations of parameters.
%
% See also: aoStimRecon
% History:
% 08/15/22 dhb Wrote after converting aoStimRecon to a function
% 08/26/22 dhb, chr Convert to main file, edit cone mosaic options
% 09/22/22 chr Convert to its own dichrom f... |
%HW7
% Name: Xiao Peng
% Date: 11/17/2019
% Note: a revised version will be uploaded tmrw
% Problem 1. Curve fitting.
%% Part 1. Take 10 values for x on the interval 0 < x <= 10 and then create y
% values from the x values by plugging the x values into a third order
% polynomial of your choice. Add random noise to th... |
function [A,P,tD,tRm] = FFTReconSingle(p,nPh)
% tRm is the RMS of the recon.
p = p-mean(p);
t=[0:nPh-1];
temp = fft(p);
A = abs(temp(2))/(nPh/2);
P = angle(temp(2));
tD = A.*cos(P+t.*2*pi/nPh);
% tRm = sqrt(sum((tD-p).^2)./nPh)/A;
tRm = sqrt(sum((tD-p).^2)./nPh);
%%% Same as angle function
% Truth(1)... |
function y = yh1(x, lambda1)
y = lambda1*norm(x,1);
end |
clc, clear all, close all
int_n = 4;
p1 = sqrt(1/3);
xi = p1*[-1 -1;
1 -1;
1 1;
-1 1];
int_weights = [1 1 1 1];
N = zeros(4,1);
N(1) = (1+xi(1,1))*(1+xi(1,2))/4;
N(2) = (1+xi(2,1))*(1+xi(2,2))/4;
N(3) = (1+xi(3,1))*(1+xi(3,2))/4;
N(4) = (1+xi(4,1))*(1+xi(4,2))... |
function [kx,ky,kz]=global_basis_rec(obj)
a0=2*pi/0.5431;
kx=a0.*[-1; 1; 1];
ky=a0.*[1; -1; 1];
kz=a0.*[1; 1; -1];
X=(j1.*kx+j2.*ky+j3.*kz)/obj.arrays_sizes;
kx=X(1)-obj.coord_limits(1)-obj.coord_stps;
ky=X(2)-obj.coord_limits(1)-obj.coord_stps;
kz=X(3)-obj.coord_limits(1)-obj.coord_stps;
|
clear all ; close all;
currs = {'AUDCAD','AUDCHF','AUDJPY','AUDNZD','AUDUSD','CADCHF','CADJPY','CHFJPY','EURAUD','EURCAD','EURCHF',...
'EURGBP','EURJPY','EURUSD','GBPCHF','GBPJPY','GBPUSD','NZDCHF','NZDJPY','NZDUSD','SGDJPY','USDCAD','USDCHF','USDJPY','USDSGD'} ;
spreads = [ 2.5, 2.5, 0.95, 2.33, ... |
% Wraps a covariance function as a noise function
% A covariance function isn't accepted by default - you have to explicitly
% request it. We can't wrap all covariance functions
classdef CovNoise < tacopig.noisefn.NoiseFunc
properties(GetAccess = 'public', SetAccess = 'private')
noisefn
end
... |
function [max_accuracy] = linearClassifier(option,train,test)
%MCM linear classifier with soft margin at option=2 and hard margin at
%option=1 this is margin option
%option=3 if soft margin gausian kernel
%-------------------------------hard margin------------------------%
if option==1
tic
%data = importdata(... |
function [seq_line] = parallel2series(p2s)
% Convert the sequence line vector [N*1] to a matrix format
% [number of subcarrier , N/number of subcarriers]
dim = size(p2s);
seq_line = reshape(p2s , 1, dim(1)*dim(2));
end |
%% Parte 4 - Diferentes declives no custo
function[tc,f,r]= flowvec3lvl(A,s,l)
[~,edges]=size(A);
[~,inst]=size(s);
[levels,~]=size(l);
cvx_begin
variable f(edges,inst,levels)
variable r(edges,levels)
tc=dot(l(:,2),sum(r,1));
minimize(tc)
subject to
for i = 1:inst
for j = 1:levels
0 <= ... |
function obj= OpenDRIVEXML(obj,DataInPath)
%OPENDRIVEXML Parsing the XML to the corresponding classes and properties
%
%----------------------------------------------------------------------
% BSD 3-Clause License
%
% Copyright (c) 2020, Jonas Wurst, Alberto Flores Fernández
% All rig... |
function helperPlotConfidenceEllipsoid(M,C,n,color)
%helperPlotConfidenceEllipsoid Plot confidence region for 3D data.
%
% This function is only in support of
% CentrifugalPumpFaultDiagnosisUsingSteadyStateExperimentsExample. It may
% change in a future release.
% Copyright 2017 The MathWorks, Inc.
%Compute the surfa... |
function [] = gaussianIdentity()
% 10 Data Blocks
D = cell(10, 1);
% 10 Label Blocks
L = cell(10, 1);
% Initialize blocks.
for i = 1:10
dataFileName = strcat('data/fData', strcat(int2str(i), '.csv'));
labelsFileName = strcat('data/fLabels', strcat(int2str(i), '.csv'));
D{i} = csvread(dataFileName);
L{i} = csvr... |
% unirPuntos(color,frame,varargin)
%
% función que permite graficar en el espacio 3d lineas que unen puntos de
% ese espacio para un frame determinado. Es util para representar segmentos
% formados por dos centros articulares o dibujar el miembro inferior
% completo para un frame determinado.
% ENTRADA
% color: es ... |
function analyze_SEL2_scanner_ret()
% A meta-function to run the function 'analyze_retrieval' on multile files
% See below for details about 'analyze_retrieval' function
file_list = {...,
'240715TP-SEL2_scanner_CR.log',...
'250715LK-SEL2_scanner_CR.log',...
'250715AG-SEL2_scanner_CR.log'...
'250715EB-SEL2_sc... |
load trainFeature;
wordsCount = size(trainFeature, 2);
%%
%Address of train files and get them
addressHam = ('enron1\Train\ham');
addressSpam = ('enron1\Train\spam');
mailfilesHam = dir([addressHam '/*.txt']);
mailfilesSpam = dir([addressSpam '/*.txt']);
%%
%Get number of train files
nfilesHam = length(mailfi... |
fid=fopen([file_path,'vtk/wall.vtk'],'w');
%--------------------------------------------------------------------------
%Header
fprintf(fid,'%s\n','# vtk DataFile Version 3.1 ');
fprintf(fid,'%s\n','Visualization for wall');
fprintf(fid,'%s\n','ASCII');
fprintf(fid,'%s\n','DATASET UNSTRUCTURED_GRID');
%-----------------... |
%% Multioutput Support Vector Rregression (MSVR)
% - C : penalization (regularization) parameter
% - epsilon: tolerated error, defines the insensitivity zone
% - sigma : lengthscale of the RBF kernel
% - tol : early stopping tolerance of the IRWLS algorithm
ker = 'rbf'; epsilon = 0.1; C = 2; sigma = 1; tol... |
%% 30000 5000
TestA11=[0.001;0.009;11.485;35.995;36.130;11.197;24.920;36.451;14.424;2.823];%%ok
TestA12=[0.0001;0.022;0.045;0.013;0.008;0.016;0.031;0.011;0.026;0.525;]; %% queue empty
TestA22=[0.081;0.051;0.366;0.590;0.035;0.083;0.202;0.097;0.455;0.260];%%2
TestA42=[8.3;8.4;1.2;7;11.9;12.5;11;10;13;13];%%4
Tes... |
% Use is m.file to test the frequency calculater function for that you will
% need the Angle.mat file which contain a real measured signal with
% freuqncy changing between 50 Hz to 55% in three differnt ways:
% 1- A jump (step change) of the frequency
% 2- ramp change of the freuqnecy with 10 Hz/s
% 3- ramp change... |
function lsf = poly2lsf_my(a)
%POLY2LSF Prediction polynomial to line spectral frequencies.
% LSF = POLY2LSF(A) converts the prediction polynomial specified by A,
% into the corresponding line spectral frequencies, LSF.
%
% POLY2LSF normalizes the prediction polynomial by A(1).
a_temp = a;
a_temp = a_... |
function [result,tf] = str2num(expression) %#ok<INUSD>
%STR2NUM Wraps MATLAB's str2num in evalc to avoid stdout
% NOTE: str2num does input validation that is easiest to reuse by calling
% str2num in evalc instead of just the expression
% NOTE: this does not introduce any further security vectors
func_path = full... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% %%%
%%% COUNT NUMBER OF UNITS WE RECORDED %%%
%%% %%%
%%%%%%%%%%%%%%%%... |
n=200000;
x = floor(sqrt(n));
a=ones(n,1);
a(1) = 0;
for i=2:x
for j=i^2:i:n
a(j) = 0;
end
end
count = 1;
k =1;
while count < 10001
k=k+2;
if a(k) == 1
count = count +1;
end
end
disp(k) |
function [pL,qL,pR,qR] = bcfun(zL,dcAdz,zR,cAR,t)
% BOUNDARY FUNCTION
cA0 = 1;
D = 1*10^(-5);
pL = -D*dcAdz;
qL = 0;
pR = cAR;
qR = 0;
end
|
function PostObservabilityAnalysis(Setup, Results)
c = Setup.PostOptions.c;
%% Pre Processing Results
% Get States, structure as follows: x_true = [x y z u v w];
x_true = [
Results.Invader.States.Pos(1,:) - Results.Defender.States.Pos(1,:)
Results.Invader.States.Pos(2,:) - Results.Defender.States.Pos(2,:)
... |
function [cost, X, X_h] = cost_zeta(K_AC, K, S_AC, weight)
% K_AC: Kalman filter
% K: Kalman Gain
% S_AC: System
% weight: Weight
%%%%% initialize
data_amount=400;
state=2;
in=2;
A_Kf = [K_AC(1), K_AC(2); ...
0, K_AC(3)];
C_Kf = [K_AC(4), 0];
B_Kf = eye(2);
%%%%% convert the system(X) into the observe form(... |
% This example demonstrates how to generate graphical output files
% without actually displaying any graphics at all on the screen.
%
% This is particularly useful when you are running MATLAB in batch
% mode or running MATLAB remotely via a text-only line-mode terminal.
% In these situations it is not possible to di... |
function varargout = SimpleCamera(varargin)
% SIMPLECAMERA MATLAB code for SimpleCamera.fig
% SIMPLECAMERA, by itself, creates a new SIMPLECAMERA or raises the existing
% singleton*.
%
% H = SIMPLECAMERA returns the handle to a new SIMPLECAMERA or the handle to
% the existing singleton*.
%
% SI... |
function outSentence = preprocess( inSentence, language )
%
% preprocess
%
% This function preprocesses the input text according to language-specific rules.
% Specifically, we separate contractions according to the source language, convert
% all tokens to lower-case, and separate end-of-sentence punctuation
%
% I... |
function output = TrainPostDec_(params)
%% load parameters from params struct
%lambdaMat = [lr1 lr2 ; lg1 lg2]
%gaussMat = [mr1 mr2 stdr1 stdr2 ; mg1 mg2 stdg1 stdg2]
nStates = params.nStates;
nChannels = params.nChannels;
discStates = params.discStates;
if isempty(discStates),
discStates = ones([1 nStates]);
end
n... |
clc;
clear all;
close all;
kp=3;
ki=5;
r=1;
T=1;
k=1;
st=100;
dt=0.001;
ts=1;
lp1=fix(st/ts);
lp2=fix(ts/dt);
xi=0;
y=0;
a=exp(-dt/T);
b=1-a;
n=0;
for i=1:lp1
e=r-y;
xp=e*kp;
xi=xi+e*ki*dt;
u=xp+xi;
for j=1:lp2
n=n+1;
y=y*a+k*u*b;
Y(n)=y;
... |
function [intF Area] = trap_sum2d(x,y,f)
%setup indexing
[imax,jmax] = size(x);
i = 1:imax-1;
j = 1:jmax-1;
%vectorize cell boundaries
v1(i,j,1) = x(i+1,j)-x(i,j);
v1(i,j,2) = y(i+1,j)-y(i,j);
v2(i,j,1) = x(i,j+1)-x(i,j);
v2(i,j,2) = y(i,j+1)-y(i,j);
v3(i,j,1) = x(i,j+1)-x(i+1,j+1);
v3(i,j,2... |
function [ seq ] = identifyPhoneSeq( filename )
% identifyPhoneSeq Identify phone tone sequence from a given file
% Params: filename - file's name to analyze
% Returns the tone sequence that was in the file
if (false == exist(filename, 'file'))
error('File does not exists');
end
[signal, Fs, n... |
function [newLabel] = MibiMergeLabels (L, labelID, labelTargetID)
% function [newLabel] = MibiMergeLabels (L, labelID, labelTargetID)
% function receives a label matrix L. It merges the pixels with label
% labelID into labelTargetID
object1 = L == labelID;
object2 = L == labelTargetID;
newLabel = L;
%% 1. Change labe... |
function openCalibrationPanel(bench)
% open the calibration pannel
global naomiGlobalBench;
if nargin<1; bench=naomiGlobalBench;end
if isempty(naomi.findGui(naomi.KEYS.G_CALIB))
naomi.gui.calibGui(bench);
movegui(naomi.findGui(naomi.KEYS.G_CALIB), 'north');
end
end |
%% Vast
%% KNN
%% 2017.10.29
clc
clear all;
addpath(genpath(pwd));
run_SONAR();
run_USPS();
run_IRIS();
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Construsting the table RecapVid %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% note to my self try doing it in R next time
% Create a .csv with all video detailed using the arborescence to identify each Video and ffmpeg to get video Metadata such as time and duration
clear
addpath('E:\ordi G... |
function [f, gradf, hessf] = svmobj(a, K, y, C, t)
% SVMOBJ Returns value, gradient and hessian for objective function
% t/2*a'*diag(y)*K*diag(y)*a - 1'*a - 1'*log(a.*(C.-a))
% [f, gradf, hessf] = svmobj(a, K, y, C, t) for labels y : n x 1, kernel
% K : [n x n] kernel matrix n = # training data
% Lagrange multiplier a... |
function Force = GetForceVect(P1,P2,Param,Fabs)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
Points=CreateBand(P1,P2,20);
angMAX=0;
MAXn=size(Points,2);
for i=2:size(Points,2)-1
Points(:,i)=pushoutShort(Points(:,i),Param);
ang=abs(getangle(Points(:,i)-Points(:,1),Points(:,siz... |
//
// MACCameraActionCommand.m
// MultiAirCam
//
// Created by Martin Gratzer on 21.12.12.
// Copyright (c) 2012 Martin Gratzer. All rights reserved.
//
|
classdef MarkedNetwork < handle
%MarkedNetwork marks on a network
properties (SetAccess = immutable)
net % a network
edge_network % edgelist representation: [edge_index distance]
%MD % matrix of shortest distances between mark
edge_coordinates_ordering
end
properties
... |
function [C_left, C_right, left_papillary, right_papillary, Ref_l, Ref_r, k_l, k_r, k_0, k_multiplier] = unpack_chordae(chordae)
% Copyright (c) 2019, Alexander D. Kaiser
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the follo... |
% importing data
words = importdata('vocabulary.txt');
stoplist = importdata('stoplist.txt');
train =importdata('train.data');
train_label = importdata('train.label');
% removing stop words and updating data
valid = find(~ismember(words,stoplist));
valid_train = find(ismember(train(:,2),valid));
updated_train = train... |
load NJGAS.dat;
resample_size=length(NJGAS);
sample_mean=mean(NJGAS);
% Resample the data for 1000 times.
resample_time=10000;
index=randi([1 resample_size],resample_time,resample_size);
resampled_data=NJGAS(index);
% Calculate the confidence interval.
erd=sum(resampled_data,2)/resample_size-sample_mean;
erd_sorted=sor... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Algorithme de test
clear variables
close all
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VARIABLES
%
pSize = 8;
overflow = 3;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Dict = getDataset();
% X... |
% function ELJ = ELJ(ELOFreq)
% Input : ELOFreq - lower stated energy in MHz
% Output: ELJ - lower state energy in Joules
% ELJ = ELOFreq * 1e6 * h
% h = 6.62606E-34
function ELJ = ELJ(ELOFreq)
h = 6.62606E-34;
ELJ = ELOFreq*1e6*h; |
function SaveTactToFile(hObject, eventdata, handles)
% Callback from button in TACT figure
%handles=guidata(handle); % Handles to imlook4d instance creating the button
% RECORD
try
if (handles.record.enabled == 1)
EOL = sprintf('\n');
handles.record.edito... |
filename='sensor_hall_min2_c.log';
filename2='sensor_opto_min2_c.log';
Hall=dlmread(filename,' ');
Opto=dlmread(filename2,' ');
[rows,colums]=size(Hall);
[rows2,colums2]=size(Opto);
t=dlmread(filename,' ',[0 0 rows-1 0]);
x=dlmread(filename,' ',[0 1 rows-1 1]);
y=dlmread(filename,' ',[0 2 rows-1 2]);
z=dlmread(filen... |
function [data] = plotting_makegif_1D(DGsolution,tnow,data,nstep)
% written by Pierson Guthrey
font = 16;
if nstep == 0
delay = 1;
elseif tnow == data.Tfinal
delay = 1;
else
delay = 0.1;
end
foldername = [data.problemname '_M' num2str(data.M) '_r' num2str(data.r_param) '_' num2str(data.Nv1)];
mkdir('results/'... |
% Connected component exploration algorithm
% Author: Will Chang
function marked = explore(image)
%
% image is a 2D array that contains values (zeros and ones)
% corresponding to the binarized image.
%
s = size(image);
width = s(1); height = s(2);
marked = zeros(width, height); % marked image
mark... |
function [len,con] = f_mst_mex(dis,method)
% - create a minimal spanning tree (MEX version)
%
% USAGE: [len,con] = f_mst_mex(dis);
%
% dis = symmetric distance matrix
% method = 1: use MatlabBGL Toolbox (default)
% 2: use Bioinformatics Toolbox
%
% len = length of edges
% con = corresponding pairs ... |
%% 检查系统配置
deviceInfo = gpuDevice;
computeCapability = str2double(deviceInfo.ComputeCapability);
assert(computeCapability > 3.0, ...
'This example requires a GPU device with compute capability 3.0 or higher.')
%% 数据集
datasetsFolder = '../../datasets/caltech101'; % define output folder
url = 'http://www.vision.calt... |
function start_points = perform_lloyd_mesh(vertex,faces, start_points, options)
% perform_lloyd_mesh - perform lloyd relaxation to sample point on a mesh
%
% start_points = perform_lloyd_mesh(vertex,faces, start_points, options);
%
% Copyright (c) 2007 Gabriel Peyre
options.null = 0;
if size(vertex,1)>size(verte... |
%%% Weddell blocky box carbon budget, layerwise
%%% for the Iter133 2013-2018 carbon budget
%%% looping this one for multiple 5-day periods
clear all
load('../Iter129/grid.mat', 'hFacC', 'RAC', 'DRF');
volume = zeros(size(hFacC));
%%
for k=1:52
volume(:,:,k) = hFacC(:,:,k).*RAC(:,:)*DRF(k);
end
wkstart = 1;
wkend ... |
function varargout = drawCircleArc3d(varargin)
%DRAWCIRCLEARC3D Draw a 3D circle arc.
%
% drawCircleArc3d([XC YC ZC R THETA PHI PSI START EXTENT])
% [XC YC ZC] : coordinate of arc center
% R : arc radius
% [THETA PHI] : orientation of arc normal, in degrees (theta: 0->180).
% PSI : r... |
function TSbegin
% Leads the user through the creation of an Experiment structure by reading
% the Excel spreadsheet containing all the required information. Older code,
% which is now more or less irrelevant [Sept 2015], sets up
% folder structure, copies script and helper functions into MatlabCode
% subfolder, and pu... |
function [d,pair] = hausdorff(VA,FA,VB,FB)
% HAUSDORFF compute the Hausdorff distance between mesh (VA,FA) and mesh
% (VB,FB). This is the
%
% d(A,B) = max ( max min d(a,b) , max min d(b,a) )
% a∈A b∈B b∈B a∈A
%
% Known issue: This is only computing max(min(va,B),min(vb,A)). This... |
function [ min_idx ] = find_min_distance_idx( desc_single, desc_collection )
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
%Y=sqrt(sum((repmat(desc_single(:,:), 1, size(desc_collection,2)) - desc_collection(:,:)) .^ 2));
%min_idx = find(Y == max(Y(:)));
min_idx = 0;
mt... |
//
// ILSettingKeys.m
// 01-ItcastLottery
//
// Created by apple on 13-12-27.
// Copyright (c) 2013年 itcast. All rights reserved.
//
// 摇一摇机选
ILDefineConstStr(ILSettingShakeChoose)
// 声音效果
ILDefineConstStr(ILSettingSoundEffect)
// 开奖推送设置
// 双色球
ILDefineConstStr(ILSettingAwardPushSSQ)
// 大乐透
ILDefineConstStr(ILSet... |
path = 'C:\Users\jeann\OneDrive\Documents\ELN\Wild Penguins\eln1-project-2020-wild-penguins\data\ConductiveProbe\';
freq = [];
V1=[];
V2=[];
for k=0:4
file = [path 'R10k_' num2str(k) '.csv'];
data = readmatrix(file, 'Range', 2);
freq(:,k+1) = data(:,1);
V2(:,k+1) = 10.^(data(:,3)/20).*exp(1j*data(:,4)*pi/180);
Amp2(:,... |
function res=gh(inp)
inp=fftshift(fft2(rgb2gray(imread(inp))));
[a,b]=size(inp);
m=zeros(a,b);
c=5;
for i=1:a
for j=1:b
d=(i-a/2)^2+(j-b/2)^2;
m(i,j)=1-exp(-d^2/(2*c^2));
end
end
res=m.*inp;
res=uint8(abs(ifft2(ifftshift(res))));
imshow(res);
e... |
function emailGen(file)
fid = fopen(file, 'r');
filelength = length(file);
namelength = filelength - 4;
newfile(1:namelength) = file(1:namelength);
newfile(namelength+1:namelength+10) = '_email.txt';
fh2 = fopen(newfile, 'w');
proceed = true;
newcontents = [];
while proceed
line = fgetl(fid);
proce... |
%To run, you must have matlab 2017a, and you must have access to N drive
%on computer because the N drive calls it.
%% load data using time ranges
%Here I have put the wavemeter log fits for each scan as an argument to
%combine_data2. o.x is the frequency axis.
figure(4); clf; clear o;
VPAslope = 24.7;
VPAoffset... |
cd('/Users/tj_florence/Desktop/thermalAnalysis/laserCycleColumator')
mkdir('analysisFrame')
%%
files=dir('*.imb');
numFiles = length(files);
for aa = 1:numFiles
% get current file frame
file=[files(aa).name];
data=fopen(file);
f_header=fread(data, 10, 'int16');
f_data=fread(data, [320 240], 'int... |
function v = logmap_spd(P,X)
%LOGMAP_SPD maps Y on GL(n)/O(n) to a tangent space of manifold M at X.
%
% The tangent space is a set symmetric matrices(n)
if norm(P-X) < 1e-18
v = zeros(size(P));
return
end
[U D] = eig(P);
g = U*sqrt(D);
invg = inv(g);
y = invg*X*invg';
[V S] = eig(y);
H = g*V;
v = H*diag(log... |
% Ankur Parikh
% SAILING Lab
% Carnegie Mellon University
function full_tree_matrix = trace_ancestors(tree_matrix)
[V V] = size(tree_matrix);
full_tree_matrix = zeros(V,V);
% not very efficient but assumes tree depth is short
for v=1:1:V
curr_node = v;
count = 1;
wh... |
% memory plot
clear, clc
model_name = 'scannet_m16_rep2_residualTrue-000000650';
% avg with memory from pmserver
f_mem = {
'result_memory_1.csv';
'result_memory_2.csv';
'result_memory_3.csv';
'result_memory_4.csv';
};
main_dir = strcat('../Result/alienware/', model_name, '/Backup/');
f_random = strc... |
% Copyright (c) 2003-2016 Xsens Technologies B.V. or subsidiaries worldwide.
% All rights reserved.
% Redistribution and use in source and binary forms, with or without modification,
% are permitted provided that the following conditions are met:
% 1. Redistributions of source code must retain the above copyright no... |
function phaseoscillator
clc;
fprintf('The Phase Oscillator\n');
par=param(1);
ini=[0.1;0.1];
trans=0; tend=100; tstep=0.1;
integration(par,ini,trans,tend,tstep);
% ========== Integration =================================
function integration(par,x0,trans,tend,tstep)
[t,x] = run(x0,par,trans,tend,tstep,[],[]);
... |
function fig=stan_plot_singleunits(COLORS)
%
%
%
%
[options,dirs]=stan_preflight;
if nargin<1 | isempty(COLORS)
COLORS='jet';
end
% get listing of single units
%
tmp=dir(fullfile(dirs.agg_dir,dirs.su_plot_dir));
unit_dirs={};
unit_names={};
for i=1:length(tmp)
if tmp(i).isdir & tmp(i).name(1)~='.'
unit_dirs{en... |
function ivim__separate_Sbover1(iSubj,iPrePost)
global vars init_vars
%%
for k = 1:vars.params.slices
for j = 1:length(vars.ivim.b)-1
SbSo(:,:,k,j) = vars.ivim.Sb(:,:,k,j)./vars.ivim.So(:,:,k);
SbSo_mask(:,:,k,j) = SbSo(:,:,k,j).*vars.mask.mask(:,:,k);
end
end
mask_over1 = zeros(128,128,22);
... |
function [rn,w]=calc_weigths(rn, dataset)
% [rn,w]=rbf_net_lsrc_w_fast.calc_weigths(rn, dataset)
%
% G. Raetsch 1.6.98
% Copyright (c) 1998 GMD Berlin - All rights reserved
% THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of GMD FIRST Berlin
% The copyright notice above does not evidence any
% actual o... |
function stats = runDAG(dagnet, imdb, getBatch, varargin)
% RUNDAG Returns statistics generated by running a CNN using the
% given options.
% Configure the DAG to use sensible values
opts = configureDAG(varargin{:});
% Check that we have a directory for the experiment
if ~exist(opts.expDir, 'dir'), mkdir(opts.expDir)... |
function figs()
clc;close all
resetEnv();
global figpath figfmt
figpath = 'D:\Kivy\Desktop\lego\report\fig\';
figfmt = 'pdf';
% fig1()
fig2()
% fig3();
end
function fig3()
Fig = figure(...
'Units', 'pixels',...
'Name', 'move',...
'NumberTitle', 'off',...
'IntegerHandle', 'off'... |
function [cfgLLAdv,pktCnt,crcCnt,startIdx, payloadFinal] = ...
helperBLEPhyBitRecover(rcv,prbIdx,pktCnt,crcCnt,bleParam)
%helperBLEPhyBitRecover Recovers the payload bits
% [CFGLLADV,PKTCNT,CRCCNT,STARTIDX] =
% helperBLEPhyBitRecover(RCV,PRBIDX,PKTCNT,CRCCNT,BLEPARAM) returns the
% advertising... |
function G = greens_fn( k, x, y )
r = sqrt( (x-y)'*(x-y) );
G = exp( i*k*r )/(4*pi*r); |
%% Illustrating ParTI on a synthetic dataset
% This script illustrates ParTI on a synthetic, 2D triangular data
% set of 100 points. Each point has features a single discrete attribute.
% This script gives a quick feeling for the ParTI method.
%
% Load the data into Matlab from a comma separated value (CSV) file
% The... |
classdef YangL2norm < dagnn.ElementWise
methods
function outputs = forward(obj, inputs, params)
now = yang_l2norm_forward([], struct('x', inputs{1}), []);
outputs{1} = now.x;
end
function [derInputs, derParams] = backward(obj, inputs, params, derOutputs)
pre = yang_l2norm_backward([], ... |
% 2.1(b)
ny = 0:10;
x = ones(1,6);
y = conv(x,x);
stem(ny,y);
xlabel('n'); ylabel('x[n]*x[n]');
title('Graph for y[n]=x[n]*x[n]'); |
function [ssi,ati,sti,st_std,tri,logE,m]=initSC(Trs,ntrials,Tguess,nBins,b,p_spike,A,ef,tau,Dt,offsets,rescalings,a_min)
%initialize spikes and trace
ssi = []; %initial set of shared spike times has no spikes - this will not be sorted but that shouldn't be a problem
ati = cell(ntrials,1); % array of lists of individ... |
clear all ; close all;
subs = {'anne_marie','felix','florence','greg','jf','joel','lyes','mael','nic','russ','valerie'};
bades = {[],[],[],[48],[],[],[],[],[],[],[]};
subcomps = {[4,9],[4,7],[3,5,6],[2,5,7],[4,7],[3,8,9,10,11],[11,13,20],[6,8],[5,18],[11,16,27],[6,8,15]};
stims = {'S 1','S 2','S 3','S 4'};
... |
connection=tcpip('0.0.0.0',30002,'NetworkRole','client');
fopen(connection);
function Write(obj,str,varargin)
if numel(varargin)>0
obj.key=obj.key+obj.maxInstances;
str=sprintf('%s_%u',str,obj.key);
obj.shmObj.(str)=shmobject(str,varargin);
... |
function process_image_to_polygen(img_name, is_satellite)
img = imread(img_name);
img = im2double(img);
img_bw = sum(img, 3) / 3;
polygen_r = process_single_layer(img(:,:,1), is_satellite);
polygen_g = process_single_layer(img(:,:,2), is_satellite);
polygen_b = process_single_layer(img(:,:,3), ... |
clear all ; close all
subs = {'alex','dina','genevieve','jeremie','karl','russell','tegan','sukhman','valerie'} ;
for sub=7%:length(subs)
cd(['c:/shared/badger_eeg2/',subs{sub}]) ; ls
mov = dir('bcgica*movie*set') ;
EEG = pop_loadset(mov(1).name) ;
EEG.data = eegfiltfft(EEG.data,250,1,250) ;
EEG = pop_chanedi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.