text stringlengths 8 6.12M |
|---|
function startup
% Script for starting examination of the mesh opt problem
% Set path
working_dir = '/home/grad4/itvoyles/Meshopt/Repository/burgers-mesh-optimization/';
% working_dir = 'Z:/Meshopt/Repository/burgers-mesh-optimization/';
exe_path = [working_dir,'bin'];
path(path,exe_path);
exe_path = [working_dir,'sr... |
close all;
img = imread('parrot.jpg');
resol = size(img);
height = resol(1);
width = resol(2);
%imshow(img);
X = img(:,:,1); X = X(:);
Y = img(:,:,2); Y = Y(:);
Z = img(:,:,3); Z = Z(:);
[pts,~,ic] = unique(double([X,Y,Z]),'rows');
%pts = double([X,Y,Z]);
%%
%start of sample solution last time
no = size(pts,1);
clu... |
%% bpm_getsa_all plots
%load SA_Data_Set3.mat % from turn on 10-19-2014
% SA from off
%load SA_DataAll_2014-10-24_50mA.mat % Startup 10-24-2014, static 50mA
% SA from off
% Missed turning off SR03C:BPM7, SR08C:BPM8, SR09C:BPM8, SR10C:BPM7, ...
% SR01C:BPM6 had a 1 point dropout???
% cd /home/physdata/BPM/AFE... |
%% Written by Armeen Taeb, California Institute of Technology, December 2016
%% This is a code that generates the quantities for Figure 1
%% In particular, NS_energy_noise is the no-subampling energy in null directions
%% WS_energy_noise is with-subsampling energy in false directions
root = pwd;
addpath(strcat(root,'/... |
function img = rleLoad(filename)
file = fopen(filename, 'r');
yres = fread(file, 1, 'uint16');
xres = fread(file, 1, 'uint16');
pixels = yres * xres;
ptr = 1;
imgRow = uint8(zeros(1, pixels));
data = fread(file, [1 inf], 'uint8');
for i = 1 : 2 : length(data)
val = data(1,i);
count = data(1,i+1... |
clear all;
clc;
%% data prepared
SNRs=0;
[train1 , fs] = wavread('..\Data\female_train.wav');
[train2 , fs] = wavread('..\Data\male_train.wav');
[valid1 , fs] = wavread('..\Data\female_dev.wav');
[valid2 , fs] = wavread('..\Data\male_dev.wav');
[test1 , fs] = wavread('..\Data\female_test.wav');
[test2 , fs] = wavrea... |
function [x, t] = myIFFT(fftMagnitude, fftPhase, df )
%-------------------------------------------------------------------------------
% Version 20180101, Silviu Rei
% function [x, t] = myIFFT(fftMagnitude, fftPhase, df )
% The function returns the inverse Fast Fourier transform of a signal
%
% Input:
% fftMagn... |
%% springsystem2d force test
global Lref imax jmax
clc
% clear all
imax = 33;
jmax = imax;
Lref = 8;
x = repmat(linspace(-4,4,imax)',1,jmax);
y = repmat(linspace(-4,4,jmax),jmax,1);
% x = repmat(linspace(atan(-4),atan(4),imax)',1,jmax);
% x = tan(x);
% y = x';
springsystem2d_force_setup(imax,jmax)
F = reversesprin... |
classdef ADA2018
%% ADA2018
% $Revision$
% was created 05-Jan-2018 19:26:25 by jjlee,
% last modified $LastChangedDate$ and placed into repository /Users/jjlee/Local/src/mlcvl/mlarbelaez/src/+mlarbelaez.
%% It was developed on Matlab 9.3.0.713579 (R2017b) for MACI64. Copyright 2018 John Joowon Lee.
... |
% Run the results script
plotval2;
figure(1);
semilogy(x, euler);
title('Euler Method');
xlabel('n');
ylabel('y value');
print -depsc gr1.eps
figure(2);
semilogy(x, heun);
title('Heun Method');
xlabel('n');
ylabel('y value');
print -depsc gr2.eps
figure(3);
semilogy(x, midp);
title('Midpoint Method');
xlabel('n');... |
function [data_sv,proj_svr_uniq,proj_spvaf_uniq,proj_svc_uniq,proj_spc_uniq,pvaf_uniq_out]=icID_pvaf(ALLEEG,sets,times,comps,chans,varargin)
%.........................................................................
%Start... Handle inputs...
%.........................................................................
... |
%% Interpolation with zoh, linear, and cubic
clear, clc, close all
addpath('D:\Jose\Dropbox\research\codes\f')
t = linspace(0, 21);
y = @(t) cos(2*pi*0.15*t);
ys = y(0:21);
T = 1;
tlin = linspace(-T, T, 11);
hlin = 1-abs(tlin)/T;
yss = upsample(ys, 5);
yrec = filter(hlin,1, yss);
yrec = circshift(yrec, [0, -5]);
dt... |
function readEditIntegers(src,~)
value=get(src,'String');
try
value=eval(sprintf('[%s]',value));
assert(all(value==round(value)),'ERROR');
value=sprintf('%d ',value);
catch
value=get(src,'UserData');
end
set(src,'String',value,'UserData',value);
end |
function t = datevec2posix(dv)
% t = datevec2posix(dv)
%
%
if nargin==0,
dv = clock ;
end
ref = [1970 1 1 0 0 0] ;
t = round(etime(dv,ref)) ;
|
function p = runCalibrationTrial(p, state, sn)
% function p = pds.tracking.runCalibrationTrial(p, state, sn)
%
% Activate calibration trial from pause state by calling:
% pds.tracking.runCalibrationTrial(p) % i.e. nargin==1
%
% - p.static.tracking object is created by pds.tracking.setup & pds.tracking.postOpen... |
%% 1-1 grid percentage
for i=1:length(actTime2)
minn=find(comparement(:,2)==i,1);
maxx=find(comparement(:,2)==i,1,'last');
percentage(i,1)=length(find(comparement(minn:maxx,1)==i))/length(find(comparement(:,2)==i))*100;
end
%% 1st neighbor percentage
for i=1:length(actTime2)
minn=find(comparement(:,2)=... |
function [omegascaa]= Attitude()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%sc angular velocity data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
av = csvread(" adcs file name");
phi = 0.01*av(:,1);
theta = 0.01*av(:,2);
psi = 0.01*av(:,3);
phidot= 0.001*av(:,4);
thetadot = 0.001*av(:,5);
psidot = 0.001*av(:,6);
%... |
function [counts] = MetropolisHastingsMultiple(p,q,x0,steps,M)
% Inputs
% p - target probabilities of each state
% q - proposal distribution of each state
% x0 - the initial state
% steps - the number of time steps
% M - the number of independently opening/closing ion channels
states = zeros(M,steps); % hold the ... |
data = xlsread('Results.csv');
% Eliminate first time
data = data(2:end,:);
% Plot
plot(data(:, 1));
trials = reshape(data(:, 1), [], 20); |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2016年5月27日
% 该函数用来获取图片超像素节点的各种信息
% 输入:
% superpixels:超像素的标号信息
% input_vals, depth, sin_sal:输入图像的rgb信息,深度信息和单图显著性
% ScaleH, ScaleW:图片预设的大小
% 输出:
% sup_info:cell数组,包含超像素区域的特性,如颜色、深度、位置、面积、个数、单图显著性值,以及该图所有超像素总数
% spnum/agjc:超像素的总数、相邻信息
%%%%%%%%%%%%%... |
addpath('C:\Users\Nabila Abraham\Google Drive\MASc\Thesis\ReadData3D_version1k')
folder = pwd;
imgs = dir(fullfile(folder,'*.mha'));
filename = fullfile(folder,imgs(1).name);
[V,info]=ReadData3D(filename);
V = mha_read_volume(filename);
XV = mha_read_volume(filename);
imshow(squeeze(V(:,:,round(end/2))),[]);
... |
% This script will reconstruct measurements taken with the SwissTOM EIT
% Pioneer Set in a frequency differential way. All parameters for the
% reconstruction as well as the measurement data can be specified by the
% user at the beginning of the script.
%% Clear relevant variables in the workspace
clear;
close ... |
function WriteMatrix32(M)
M = cast(M,'single');
for i = 1:size(M,1)
for j = 1:size(M,2)
fprintf('%f, ', M(i,j));
end
fprintf('\n');
end
end |
function [frequencies, dampings, basis, ahat] = htls(y, fs)
%
% Decompose the signal y using the method of Van Huffel, et al. (1993)
%
% Obligatory arguments:
% 'y' is the FID (a linear combination of complex exponentials).
% 'fs' is the sampling frequency (bandwidth).
%
% Outputs:
% 'frequencies' - frequencies of comp... |
function [RL,f,RTI] = d3psd(x,fs,nfft,gain,device)
%
% [RL,f,RTI] = d3psd(x,fs,nfft,gain,device)
% RL is in dB re uPa/root-Hz
% RTI is in nV/sqrt-Hz
[SL,f]=speclev(x,nfft,fs) ;
% SL is in dB re U/root-Hz where U is 1.0 in Matlab
% convert U to V using the gain of the audio chain and ADC
% preamp gain = ... |
function [nptsperseg] = countPtsSegs(tlims, t, x)
% [nptsperseg] = COUNTPTSSEGS(tlims, t, x)
%
% inputs
% - tlims: limits of the windows in t to count the number of x.
% - t: independent variable associated with x (vector or matrix).
% - x: array that is a function of t. In the case where x is a
% ... |
%%this is a tool used to extract the net configure from the matlab model
%and comply to the format I speced.
%written by oar, 30/04/2016
f = fopen('output/test.cnet','w');
fprintf(f,'7\n\n');
for i = 1:7
if lenet.layers{i+1}.type(1) == 'C'
if lenet.layers{i+1}.type(2) ~= '5'
fprintf(f,'0... |
%%% Difficult terms of the Weddell carbon budget
%%% for the Iter133 2013-2018 carbon budget
%%% testing assumptions and claims made by the tracer_budget document.
%%%
%%% looping this one for multiple 5-day periods
clear all
load('../Iter129/grid.mat', 'hFacC', 'RAC', 'DRF');
volume = zeros(size(hFacC));
%%
toph =... |
function [] = PlayNeighborhoodSearch (mNorm, mNames, mbnds, L, NbrOpts, iterplt, mTrue, filename)
Nvar = size(mNorm,2);
% finds the first two non-fixed parameters to plot
Vars = find(diff(mbnds,[],2) > 0);
if Nvar == 1, return; end
if isempty(mNames), mNames = repmat({''}, Nvar, 1); end
if isempty(iterplt), iterplt ... |
classdef Mvn_MvnDist < CompoundDist
% p(X|mu,mu_Sigma,Sigma) = int_m N(X|m,Sigma) N(m|mu,mu_Sigma)
properties
muDist;
Sigma;
end
%% main methods
methods
function model = Mvn_MvnDist(muPrior, Sigma)
if(nargin == 0),muPrior = [];Sigma = [];end
% MvnMvnDist(muPrior, Sigm... |
clear;
format long;
parameter_initialization_CDCF;
fai=.8;
c_d0=35;
c_f0=0.1;
volume_ratio=fai;
o_p_power=0.5*van_coe*(c_d0-c_f0);
o_p_energy=van_coe*((1-volume_ratio)*c_d0-volume_ratio*c_f0+(2*volume_ratio-1)*sqrt(c_d0*c_f0));
max_deltaP=2*o_p_power;
delta_p=(o_p_power):-.01:o_p_energy;
area_1=0.01:.001:.2;
area=ar... |
%%%%%%%%%%%%%% Modell der Realität
m_real=3;%Masse
g=9.81;%Erdbeschleunigung
c_w=0.1;%Luftwiderstandsbeiwert
%%%%%%%%%%%% Regler Bestimmen
% Masse in Kg für die konstante Kraft des Reglers zur Überwindung der
% Gewichtskrafts
m_regler=1.1*m_real;
% Lineare Zustandsrückführung zum Modellstabilisierung
r=acke... |
function [class,gene, donor]=importdata(name)
formatSpec = '%3s%24s%s%[^\n\r]';
component = textscan(fopen(name,'r'), formatSpec, 'Delimiter', ',', 'WhiteSpace', ' ', 'EmptyValue' ,NaN, 'ReturnOnError', false);
class = component {:,1};
donor = component {:, 2};
gene = component {:,3};
end
|
function edges = loadSupervoxelGraph( p, segCubeIdx, segIDs, numNeighbors, mapping )
%LOADPARTIALGRAPH Loading of the (partial) supervoxel graph.
% Load the edges of the supervoxel graph for the specified cubes.
% Optionally, the supervoxel graph can further be reduced by only
% considering segments with a maximum dist... |
function [param]=pp3chp(input)
% [param]=pp3chp(input)
% Pole placement controller for 3rd order processes.
% This function computes parameters of the controller (r0, r1, q0, q1, q2, p0, p1, p2).
% The dynamic behavoiour of the closed-loop is defined by coefficients of
% characteristic polynomial D = d0 + d1*z^-1... |
% This script analysis performance of UPG EP RP and HAP 1 time
clc; clear variables; close all;
N = 1e6; % number of Monte Carlo
K = 5; % number of cluster (number of user = 2K)
NN = 256; % number of information bit
N1 = NN;
N2 = NN;
% Draw 2K number between 1e-5 and 1e-4 eandomly
% target_BLER = (1e-4 - 1e-5).*r... |
classdef TestUuid < Prep
% TestUuid tests uuid scenarios.
methods (Test)
function TestUuid_testInsertFetch(testCase)
st = dbstack;
disp(['---------------' st(1).name '---------------']);
package = 'University';
c1 = dj.conn(...
testCase.CO... |
% Takes four parameters:
% df: derivative function
% dt: time step
% T: total time
% initialState: initial state
function [timeVec, stateVec] = ForwardIntegrate(df, dt, T, initialState)
timeSteps = T/dt;
stateVec = linspace(0, T, timeSteps);
timeVec = linspace(0,... |
close all
clear all
prates = [0,.4] ;
krates = 0:.05:.8;
k=5;
iter = 1; % number of iterations 1
XX={};
YY={};
semSim = {'WsimTFIDF-'} ;
distSim = {'NN','WS'};
datasets = {'S2','S3','S7','S7CG'}; % the datasets' directories
pos = {'n','v','a','r'} ;
ldist = length(distSim);... |
function snakeclock()
% SNAKECLOCK - Create a clock using the snake toy.
% Copyright (C) 2005-2011 The MathWorks Inc.
figure('units','norm','outerposition',[0 .5 1 .5],'renderer','o')
setappdata(gcf,'noorbit',true);
setappdata(gcf,'oncestepsize',10);
%colonax = axes('pos',[0 0 1 1],'vis','off');
xlim([... |
function ns = nextState()
% this function needs to be called only once. It constructs the
% nextState matrci, necessary fot the trellis structure
% constructing the next states
% nextState(i, 1) ==> Contains the next state of state i, when 0 bit is
% pushed from left to right
% nextSta... |
function a = area_cvip(labeledImage, objLabel)
% AREA_CVIP - calculates the area in pixels of a binary object.Gets the sum of
% pixels whose gray level values equal to a specific label.This label is the
% gray level value of the point of coordinates on the labeled image.
%
% Syntax:
% -------
% a = area_cvip(l... |
% Primary execution function for multilayer reflectance transfer matrix thin film optics.
% Send it Epsilon, phiRange, wRange, and d:
% Epsilon: (Complex) Dielectric functions of each layer
% phiRange: Angle range, in degrees
% wRange: Frequency range, in 1/cm
% d: Layer thicknesses (First layer ignored, assumed b... |
function C = mldivide(A, B)
%MLDIVIDE Compute the set difference between two hyper-rectangles (unions).
% C = A\B or C = mldivide(A,B)
%
% C is the set difference of B in A, i.e. C = A - B (or A\B depending on
% notations).
%
% (C) 2011 by Truong X. Nghiem (nghiem@seas.upenn.edu)
C = A;
% If either of them i... |
function [deriv] = deriv3(dir,data)
%deriv3 defines first order derivative at point xk using tree points.
%
% The entrances are data(1) == f(x1), data(2) == f(x2), data(3) ==
% f(x3), data(4) == h. x3 > x2 > x1.
deriv = inf;
y1 = data(1);
y2 = data(2);
y3 = data(3);
h = data(4);
if (dir == "R" || dir == "r")
de... |
function CharacterSegmentation(im)
%clc; clear all; close all;
%% Read Image
%im=imread('w2.j2c');
%im =imcomplement(im);
%% Show image
%figure(1)
%imshow(im);
%title('INPUT IMAGE WITH NOISE')
%% Convert to gray scale
if size(im,3)==3 % RGB image
im=rgb2gray(im);
end
%% Convert to binary image
threshold = graythre... |
subplot(2,3,6);
imshow(original_RGB);
title('results');
max_Iterator = 5000;
w = 8;
ratio = 0.85;
[B_,L] = bwboundaries(edge_V,'noholes');
count = 0;
hold on;
for l=1:length(B_)
boundary = B_{l};
flag = 0;
for i=1:length(boundary(:,1))-2
if flag
break;
end
for j=1:lengt... |
classdef (Enumeration) TYP_REAR_WIPER < Simulink.IntEnumType
enumeration
CSW_NO_RR_WIPE(0)
CSW_RR_WIPE_INT(1)
CSW_RR_WIPE_CONT(2)
end
end
|
function [out] = laplacian_filter(in)
figure,imshow(in);
title('ORIGINAL');
out = in;
[row,col] = size(in);
len = 3;
lap_mat = [0 1 0 ;1 -4 1; 0 1 0];
m = fix(len/2);
for i=2:row-1
for j = 2:col-1
out(i,j) = sum(in(i-m:i+m,j-m:j+m).*lap_mat,'all');
end
end
figure,imshow(out);
title('Laplacian'); |
function [trimmed_modes] = trim_factor_weight(modes, threshold, iteratively)
% This function trims the factor weights. All weights below the threshold
% on a given eigenvector are set to 0.
%
% Two options exist for running this function, iteratively or not.
%
% If the non-iterative trimming is selected, the factor wei... |
%plot([0 -4], [-3 0], 'b', 'LineWidth', 2);
%axis([-5 5 -5 5]); grid on;
X = [X ones(N,1)];
ii = randperm(N);
Xtr = X(ii(1:N/2),:);
ytr = X(ii(1:N/2),:);
Xts = X(ii(N/2+1:N),:);
yts = X(ii(N/2+1:N),:);
w = randn(3,1);
eta = 0.001;
for iter = 1 : 500
j = ceil(rand*N/2);
if( ytr(j)*Xtr(j,:)*w <0... |
classdef Environment
properties
concreteWalls;
workshopFloor;
cautionPoster;
table;
tray;
cr10;
redLaserXList;
redLaserYList;
end
methods
function self = Environment()
self.concreteWalls{1, 1} = self.getC... |
%% GPU CODE
mexcuda Projection_gpu.cu
mexcuda Filtering_gpu.cu
mexcuda BackProjection_gpu.cu |
%@(#) ssremove.m 1.3 96/02/14 10:30:26
%
function ssremove
hand=get(gcf,'userdata');
hcr=get(hand(32),'userdata');
[ncr dump] = size(hcr)
get(hcr(ncr),'type')
vis=get(hcr(ncr),'visible');
if strcmp(vis,'on')
set(hcr,'visible','off');
elseif strcmp(vis,'off')
set(hcr,'visible','on');
dispcr;
end
|
function g = grad_beale(x)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
x1 = x(1);
x2 = x(2);
w1 = (x1*x2 - x1 + 1.5);
w2 = (x1*(x2^2) - x1 + 2.25);
w3 = (x1*(x2^3) - x1 + 2.625);
t11 = 2*(x2 - 1)*w1;
t12 = 2*((x2^2) - 1)*w2;
t13 = 2*((x2^3) - 1)*w3;
g1 = t11 + t12 + t13;
t21 = 2... |
function [N, signal ] = Signal07()
N = 1000;
signal = zeros(N);
for (i = 1:N)
signal(i) = cos((2 * pi * i / 100)) + sin((2 * pi * i / 100))*1i;
end
end
|
%/**
% Скрипт составления приложения для межсистемных помех L1 - они нам
%*/
clear
close all
clc
path_to_results = [pwd '/results/back_intersystem_L1/Common'];
load([path_to_results '/BackInterSysJam_BoCsin_L1.mat'], 'BackInterSysJam_BoCsin_L1');
load([path_to_results '/BackInterSysJam_BoCcos_L1.mat'], 'BackInterSy... |
function y = ejs(x)
%重伤群众重伤群众
if x == 0
y = 0;
elseif x < 90
y = 2.25*x^0.88;
else
y = 1.180092163535746e+02; %2.25*90^0.88
end
end |
function f_pdf(fname,noPDF,verb,level)
% - export current figure to PDF file
%
% USAGE: f_pdf('fname',noPDF,verb,level)
%
% fname = filename to export to, WITHOUT the extension.
% noPDF = generate PostScript only, no PDF (default = 1)
% verb = display PDF in Preview.app (default = 1)
% ... |
function [process_status, return_code] = GET_PROCESS_STATUS(process_id)
proc = find_proc(process_id);
if proc == []
return_code = INVALID_PARAM;
return;
end
process_status = proc.status;
return_code = NO_ERROR;
end |
%
% stims => trial
%
function stims2trial()
nStims = evalin('base','nStims');
for n=1:nStims
str = ['stims(',num2str(n),').stim'];
type = evalin('base',str);
switch type
case (evalin('base','Globals.stimBit'))
evalin('base','curTrial(5,5) = 55;');
case (evalin('base','Globals... |
function [y,isterm,dir ] = option_fun_var_var_off(t,x)
% option function to stop treatment on variance inclusive model when
% variance get low enough. event marked by change in y value from -1 to
% 1
%set global variables
global beta mu_M D_M psi1 MT T_start
dx_m=@(t,x)metapop(t,x);
change_crit=1;
m=dx_m(t,x... |
function [e d] = compute_g_con3_energy(g, warpg2, aIt2, seg, F, kappa, lambda, lambda_g, lambda_s, aIt20, g0, layer_uv0)
% Data + smoothness prior + temporal consistency term
% for 3 frames involving g (second frame)
% nL = 4;
% sz = [10 10];
% g = randn([sz nL-1]); g= g(:);
% warpg2 = randn([sz nL-1]);
% aIt2 = ra... |
function Data=CheckRandom(NUM_CHECKS,ALL_DATA,varargin)
if isempty(varargin)
load Web_Notation_Data
else
loaded=false(10,1);
annot_sets={'HU6800_Probes','HU6800_Chip', 'U133A_Probes','U133A_Chip',...
'U133B_Probes','U133B_Chip', 'U133P2_Probes','U133P2_Chip',...
'U95Av2_Probes','U95... |
% ============================================
% Author: Alex Chen
% email: alextpf@gmail.com
% 2014
% ============================================
function normal = calNormal(tri,verts)
v1 = verts(tri(2),:) - verts(tri(1),:);
v2 = verts(tri(3),:) - verts(tri(1),:);
normal = cross ( v1, v2);
normal = normal / sqrt(sum(... |
x = load('q1xTrain.dat');
y = load('q1yTrain.dat');
m = length(y);
plot(x, y, 'o');
%Initialize the x0 value w/ bias function as 1
phi = [ones(m, 1), x];
w = zeros(size(phi(1,:)))';
scale = 0.01;
w_actual = (phi' * phi)\phi'*y;
i = 0;
while(norm(w - w_actual) > 0.01)
w = w - scale .* (phi' * phi * w - phi'* y);... |
clc;
clear all;
s=tf('s');
syms s ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% Sick test 2020 %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Lead lag design in frequency domain
% os = 13.25
Ts = 0.1;
% Tp = 2
zeta=0.517;
coreection_factor = 5
% zeta = -(log(os/100)/sqrt(pi^2+(log(os/100))^2))
wbw = 4/(Ts*z... |
Local_Path = [pwd '\' 'Run_Output'];
load(LogFN);
TexFN = '.\Run_Output\Report.tex';
fid=fopen(TexFN,'w');
fprintf(fid,'\\documentclass[english]{article}\r\n');
fprintf(fid,'\\usepackage{lmodern}\r\n');
fprintf(fid,'\\usepackage[T1]{fontenc}\r\n');
fprintf(fid,'\\usepackage[latin9]{inputenc}\r\n');
fprintf(fid,'\\us... |
function p = plot_little_circles_3d(x, y, z, circle, col)
%AG_PLOT_LITTLE_CIRCLES Plot circular circles of relative size circle
% Returns handles to all patches plotted
if nargin < 6
fast = false;
end
[n, d] = size(x);
assert( d == 1);
assert( size(y, 2) == 1);
if size(col, 1) == 1
co... |
function tauT = calc_TouschekPM(TD,dppPM,Trf,Ib,U0,coupling, sigE, emit_x)
%tauT = calc_TouschekPM(TD,dppPM,Trf,Ib,U0,coupling, sigE, emit_x)
%tauT = calc_TouschekPM(TD,dppPM,alpha,Ib,U0,coupling, sigE, emit_x)
% Ib, mA, single bunch current
% U0, MeV, one-turn energy loss
% emit_x, nm-rad
% couplin... |
clear; clc; close all;
%% Constants
X = 1;
Y = 2;
Z = 3;
RLegMin = [
1.7389;
1.7384;
1.7378;
1.7370;
1.7362;
1.7352;
1.7340;
1.7330;
1.7323;
1.7321;
];
%% Import CSV data file
[fileName, filePath, gotFile] = uigetfile('*.csv', 'Select CSV data file');
workspaceData = imp... |
%Frequency domain filtering by generating filters directly in
%frequency domain
%
%using some user created M-functions
f=imread('cameraman.tif');
[f, revertclass]=tofloat(f);
PQ=paddedsize(size(f));
%lowpass filtering using lpfilter() function
DO=0.05*PQ(2);
H=lpfilter('btw',PQ(1),PQ(2),DO);
F=fft2(f,PQ(1),PQ(2));
g=df... |
function loss=cost231(d,nf,kw)
%%
% d is the distance from the AP
% nf is the number of the floors encoutered
% kw is the vector cointaining the number of the type walls met
% - the first element is for Light wall: plasterboard,particle board or thin
% (<10 cm), light concrete wall.
% - the second element is for... |
%% test code for Rig 1
% addpath('C:\Documents and Settings\smithlab\My Documents\Dropbox\smithlab\Ex\xippmex');
% addpath('C:\Users\ripple\Dropbox\smithlab\Ex\xippmex');
status = xippmex;
if status~=1
error('oh no');
end
% maybe check to see 1-32 are stim channels
stimChans = xippmex('elec','stim')
%... |
function plotRanks(tabl, vars)
part = tabl{2,1};
njet = tabl{2,3};
labs = {'KS', 'CM', 'AD', 'R-sqrt', 'R-rice','R-sturge','R-doane','R-scott', ...
'R-kernel'};
nVars = max(vars);
nTest = length(labs);
ranks = nan(nVars, nTest);
for k = 1:max(vars)
for l = 1:nTest
if (tabl{2,3}==2 && k==5)
ranks(k,l) ... |
function [output1] = Inertia_LeftTarsus(var1)
if coder.target('MATLAB')
[output1] = Inertia_LeftTarsus_mex(var1);
else
coder.cinclude('Inertia_LeftTarsus_src.h');
output1 = zeros(3, 3);
coder.ceval('Inertia_LeftTarsus_src' ...
,coder.wref(output1) .... |
% 1) reading target and querry video into frames
% 2) converting them to gray scale video
% 3) converting the target video into short clips of size similar to
% querry video
% 4) Making Qn(window size) odd or local analysis window size odd
% 5) computing weigths of each of the frames or computing 3D-LSK... |
function [runtime,u_soln] = BrusselatorNewmann3Db_IFETDRDPcheck2(dt,steps)
% dt: time step. Default is 0.001
% steps: number of spatial points in each coordinate direction. Default is 11
%% Model Paramters and initial conditions
a = 3; b = 1.0;
% diffusion coefficient
mu = 0.02;
% create nodes
x = linspa... |
function u = RetDeval_panels(tpan,span,dens,paninfo)
% RETDEVAL_PANELS evaluate extra retarded wave eqn DLP term from surface in R3
% NOT YET incl on-surface
%
% u = RetDeval_panels(t,s,dens,paninfo)
%
% Called with no arguments does a self-test (see bottom of code for usage)
%
% dens is time deriv of retarded density... |
%
% find_f_frt_of_min_rmse.m
%
% Input parameter:
% f_frt
%
% Output parameter:
% rmse
%
% function rmse = find_f_frt_of_min_rmse(f_frt)
%
function rmse = find_f_frt_of_min_rmse_2(f_frt, r, s)
%r = 2;
wavefront = cal_wavefront2(f_frt, r, s);
weights = cal_wgts();
rmse = cal_rmse(weights, wavefront);
... |
# Ejercicio 1
v1 = [1 3 8 9];
v2 =[-1 8 2 -3];
pescalar = v1*v2';
#Ejercicio2
pvectorial = v1.*v2;
matrix44 = ones(4,4).*pvectorial;
determinante = det(matrix44);
vpropios = eig(matrix44);
#Ejercicio3
submatrix = matrix44([1,3],[2,3]);
matrixPlusOnes = ones(2,2)+submatrix;
determinanteMatPlusOnes = det(matrixPlusOnes)... |
clc; close all; clear;
globals;
proxnum = 1; subnum = 3;
name = PROXopts(proxnum).submix(subnum).name;
[pos, neg1, neg2, test] = PROXSUB_data(name,proxnum,subnum);
model = trainmodel(name,pos,neg1,neg2,PROXopts(proxnum).K,PROXopts(proxnum).pa,PROXopts(proxnum).co);
% Testing on one image for illustration
i... |
%%
%1)понять супперкадры,обучающие кадры,положение пилотных несущих
%2)доделать нормлаьно экволайзинг и многолучевое распространение
%3)Понять LDPC и принятие мягких регений.
%%
%clear all;
%clc;
function ber = main(SNR)
%%
%Передатчик
SignalTs = transmitter();
%%
%Моделирование канала.
IQ_Ts_Shift_Noise = channel(Sign... |
clear all;
close all;
cv_img = imread('../data/cv_cover.jpg');
desk_img = imread('../data/cv_desk.png');
hp_img = imread('../data/hp_cover.jpg');
%% Extract features and match
[locs1, locs2] = matchPics(cv_img, desk_img);
%% Compute homography
H2to1 = computeH(locs1, locs2);
visualize_results(cv_img,desk_img,locs1,H2... |
%%
% \documentclass[12pt]{article}
%
% \title{ODEbox: A Toolbox for Ordinary Differential Equations\\
% Example 2}
%
% \author{Matthew Harker and Paul O'Leary\\
% Institute for Automation\\
% University of Leoben\\
% A-8700 Leoben,
% Austria\\
% URL: automation.unileoben.ac.at\\
% \\
% Original: January ... |
function b = plot_eigenfunction(M, eigenfunction, varargin)
b = plot_scalar_mesh(M, eigenfunction);
caxis([ -max(abs(eigenfunction)), max(abs(eigenfunction))])
colormap(bluewhitered(256))
default
end
|
%% Fibonacci Search
function [a, b, time, iter] = fibonacci_search(f, a, b, epsilon, max_iter)
% fibonacci initial point
fibonacci_array(1) = 1;
fibonacci_array(2) = 1;
% for plot initial point
l_init = a:0.01:b;
plot_index = 1;
% generate N which satisfies the final interval within epsilon
for i=3:max_i... |
%@(#) dopbundle.m 1.3 98/06/09 13:31:39
%
%function dopbundle(distfil,bunchoice,firstbun,SYMME,utfil);
%Function for giving names to new bundles
% Input:
% distfil - distribution file for new cycle
% bunchoice - BUNTYP, for which the names should be given
% firstbun - name for first bundle
%... |
function arclen = arc_length(contour, a, b)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arc_length function computes the arc_length of two points
% Params:
% contour is the boundary points
% a,b are the point
% Return:
% arclen is the arclength value
%
% ======... |
function [ pos_x,pos_y,Timestamps ] = xy_targets_shortcut( unique_folder,num_targets )
unique_id = unique_folder(1:15);
% defaults
chunksize = 5000;
% Load raw data
[Timestamps, X, Y, Angles, Targets, Points, Header] = ...
Nlx2MatVT([unique_id,'-VT1.nvt'], [1 1 1 1 1 1], 1, 1, []);
% % Index into the data for tr... |
function r = simulateToyCannon_SimplePolicy(a, s)
x = 0:.01:12;
angleNoise = 0;% 1/180*pi;
c = [3 5 6 7];
h = [.3 .3 .4 .2];
scale = [.5 .5 .1 2];
y = zeros(size(x));
ycontext = 0;
for i = 1:length(c)
y = y + h(i) * exp(-(x-c(i)).^2/scale(i));
ycontext = ycontext + h(i) * exp(-(s-c(i)).^2/scale(i));
end
ang... |
% Clean up
close all;
clear;
% Do not forget to run Setup first!
run ../RGBObjectDetectionSetUp.m
% Options
CNN_opts;
% Create the net
net=cnn_initialization_ResNetUnpool2InterConv();
%net=cnn_initialization_ResNetUnpool();
% 1. Load the IMDB file containing all patches
imdb = IMDB.load(opts.imdbPath);
% 2. Learn... |
function Xtest_rank = interpolate_rank(Xtrain,Xtest)
%Takes a test set and projects into the training data rank space
%For example suppose Xtrain is a 1-dimensional set of 3 points: [1;-2;5].
%Then passing to ranks gives Xtrain_rank = [2;1;3]. Now suppose you have a single point
%Xtest = 3. Since Xtest is half between ... |
% function [outtext]=madx2g4bl(P_0,particle,folder)
% tansform madx file into G4BL input file.
%
% Simone Maria Liuzzo PhD@LNF 11-jul-2011
format longe
StepLength=10; % [mm] default is 10mm
Nevents=1; % e+ events and e- events.
disp(['writing G4BL file to simulate: ' num2str(Nevents) ' e+ and ' num2str(Nevents) ' e-... |
push 1
push 2
push 20
push 5
mul
pall
|
function [map,incl] = find_map(A,M,fs,incl)
% [map,incl] = find_map(A,M) % A and M are sensor structures
% or
% [map,incl] = find_map(A,M,fs) % A and M are matrices
% or
% [map,incl] = find_map(A,M,incl) % A and M are sensor structures
% or
% [map,incl] = find_map(A,M,fs,incl) % A and M... |
clear all
% Get regressors
[FileName,PathName] = uigetfile('*.mat','Select the Xk file','/media/sophie2/');
file=strcat(PathName,FileName)
load(file);
Sx=size(Xk);
% Choose the reconstructed 4D nifti file where all values are positive
%(result of the addmin program)
[FileName,PathName] = uigetfile('*.nii','Select the... |
% visualize the preprocessing_comparison data
clc;
clear;
close all;
window_size = 10;
num_groupofdata = 37+26;
load('SIFTmatching_comparison_all200frames.mat');
num_frame = size(num_SIFTfeature,3);
num_windows = floor(num_frame/window_size);
total_sift_features = zeros(num_windows,3,2);
matched_sift_features = zero... |
function [pout, t] = cosseno_levantado(Tb, r, k, fs)
% Pulso cosseno levantado (raised-cosine)
% [pout, t] = cosseno_levantado(Tb, r, k, fs)
% Tb: duracao do pulso em segundo
% r: fator de decaimento (roll-off)
% k: tamanho total de pout 2*k*Tb
% fs: frequencia de amostragem, Hz
% pout: amostras do pulso de duracao 2*k... |
% Modified from copmeasure.m
% Do not fit with the Prieto result, i.e., use all data length for temporal parameters, and use the original sampling frequency
% On June 7, 2008 by Kei
% Original code by Vivian on September 27
% Modified by Kei on September 28
% 'signals' as the input matrix. 1ch-copml, 2ch-copap
% 'trial... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.