text stringlengths 8 6.12M |
|---|
function RTAU = RTAU(DP) %used by function PDOT
if (DP <= 25.0)
RTAU=1.0; %reciprocal time constant
elseif(DP>=50.0)
RTAU=0.1;
else
RTAU=1.9-.036*DP;
% Checked for accuracy with the stevens model.
end
|
function [ Corner_final ] = False_corner_delete( gray_img, Corner_ori)
% %UNTITLED2 Summary of this function goes here
% % Detailed explanation goes here
% Corner = [];
% img = im2double(gray_img);
% usan = [];
% t=20;
% for k=1:length(Corner_ori)
% i = Corner_ori(k,1);
% j = Corner_ori(k,2);
% tmp = img(... |
function kjm_errbar(x,y,u,l,bcol,ecol)
% this function plots vertical barplots with errorbars
%
% it expects:
% x - the number on the horizontal ordinate
% y - the value at ordinate x (usually a mean) (with colors bcol)
% u - the upper error at ordinate x (must be >0, takes abs val)
% l - the lower erro... |
clear; clc;
% Initial data
h = 0.0001;
L = 3;
x = 0;
u = [2 4 6];
A = [-5 0.03 2; 0 -800 0; -1 -0.005 -2];
f = @(x, u) A * u';
% Matlab Runge-Kutta
options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[T, Y] = ode45(@runge, [x:h:L], u, options);
% Plot graphics
figure(1);
plot(T,Y(:,1),'b',T,Y(:,2),'r',T,Y(:,3)... |
data_vec=rand(1,20)*0.5;
data_vec2=rand(1,20)*0.5+0.2;
figure;
% You have to plot bar by bar, first the first bar
x_position_bar=1; % position of the bar on the x-axis
data=data_vec;
colorBar='r'; % color of the bar (can be a string or a 3-digit RBG code)
colorError='k'; % color of the error-bar (can be a string or a... |
% do forced alignment batch
clear all;
cd C:\Praat\FAVE
warning off;
load D:\Corpus\GMU\audiodata\FileWav16kHz;
root = 'D:\Corpus\GMU\audiodata\wav16kHz';
rootto = 'D:\Corpus\GMU\audiodata\wav16kHzTextGrid'; mkdir(rootto);
pycmd = 'C:\Praat\FAVE\faav.py';
for i = 1:length(accnames)
% for i = 150
% Create scr... |
function nll = nll_YGivenXC(X_C,Y,w,theta)
mu_Y=theta(1);
l_YC = - log( 1+exp(-(X_C-mu_Y)) ) - (1-Y) .* (X_C-mu_Y);
nll = -mean(w .* l_YC);
end
|
function colour_out= Vpixx2Vamp(desired_trigger)
%Vpixx2Vamp.m - 2015 - Kyle Mathewson and Sayeed Devraj-Kizuk
%takes as input the desired trigger value for recorder software and outputs
%the colour values necessary to change the top left pixel in the Vpixx
%monitor
des = desired_trigger;
bin = dec2bin(des,8)... |
function[] = Display_Designed_Track(matrix)
%% the structure of matrix:
% Each row: AP ML DV angle
%% ENTER PARAMETERS AND FILE LOCATION
% directory of reference atlas files
annotation_volume_location = 'E:\prJ\neuropixels\histology location analysis\allenCCF\annotation_volume_10um_by_index.npy';
structure_tree... |
function opt1D = initOptnlpp4m(opt1D)
if nargin ==0
opt1D = struct;
atom = initAtom1D(); % {sigma Z ion LsCell NsCell}
opt1D.atom = atom;
else
atom = opt1D.atom;
end
hs = 0.1;
opt1D.Ne = sum(atom.Z);
opt1D.Ls = atom.LsCell * atom.NsCell;
Ls = opt1D.Ls;
opt1D.NsGrid = 2 * round(opt1D.Ls / hs /2);
opt1D... |
function done = checkInputs(info)
done = 0;
validInputs = ['1'; '0'];
R_Loc = utm2ll(info.Coord_Rx(2), info.Coord_Rx(3), info.Coord_Rx(1));
T_Loc = utm2ll(info.Coord_Tx(2), info.Coord_Tx(3), info.Coord_Tx(1));
tmpDir = strrep(info.saveDir, '\', '\\');
if info.useECsign
Hsign = 'eddy covariance w''T''... |
function t = temperature(r)
% TEMPERATURE - temperature
%
t = reactormethods(26, reactor_hndl(r));
|
figure(1);clf;
smithchart([1, 0, 0], 1);
set(gca, 'xdir', 'reverse');
hax = axes();
smithchart();
p1 = 50 * [.2 - j*0.5];
h = plotz(p1, 'o');
set(h, 'markersize', 18, 'linewidth', 6)
p1e = 50 * [.2 + 1j*2];
h = plotz(p1e, 'x');
set(h, 'markersize', 18, 'linewidth', 6)
% Ans: use SERIES INDUCTOR
%%
figure(1);clf;
smi... |
%clear
clearvars
raray = load('raray.txt');
X=raray;
datos_x=raray(:,1:2);
datos_y=raray(:,3);
Clase_1=datos_x(datos_y==1,:);
Clase_2=datos_x(datos_y==2,:);
Clase_3=datos_x(datos_y==3,:);
Clase_4=datos_x(datos_y==4,:);
Promedio_C1=mean(Clase_1);
Promedio_C2=mean(Clase_2);
Promedio_C3=mean(Clase_3);
Promedio_C4=mean... |
function edgeImage = hysteresis_thresholding(edgeStrong, edgeWeak)
% Input: strong and weak edges
% Output: the canny algorithm edge
[height, width] = size(edgeStrong);
edgeImage = edgeStrong;
% make the weak edge pixels to be 0.5 for easily processing
edgeImage(find(edgeWeak)) = 0.5;
[vForeground, uForeground] = fi... |
function [] = animate(type,fig_width,fig_height,filenames,folder,outname,framerate)
%%debug presets
%[filenames,folder]=uigetfile('*.txt','MultiSelect','on'); %%debug
%fig_width = 400;
%fig_height = 200;
%type.colormap = 'jet';
%outname = 'default';
%%debug presets
pause(1);
%exit is no files selected
... |
function [pixelsize,startdate] = readCCSEMstubsummary(txtfile)
%this reads the stubsummary and finds the pixelsize in um
fid = fopen(txtfile,'r');
rowcnt = 1;
while feof(fid) == 0;
line = fgets(fid); %fgets advances the line of text being read
pixidx = strfind(line,'Pixel size');
starttim... |
% FCell_FCX_r3_in.m ADVISOR 2003 input file created: 07-Apr-2003 17:55:25
global vinf
vinf.name='FCell_FCX_r3_in';
vinf.drivetrain.name='fuel_cell';
vinf.fuel_converter.name='FC_ANL50H2';
vinf.fuel_converter.ver='fcell';
vinf.fuel_converter.type='net';
vinf.motor_controller.name='MC_PM49';
vinf.energy_storage.name... |
function T = perform_surftensor_remapping(Umin,Umax,l_min,l_max)
% perform_surftensor_remapping - compute tensor from tangent plane vectors.
%
% T = perform_surftensor_remapping(Umin,Umax,l_min,l_max);
%
% T is the tensor
% Umin,Umax are eigenvector fields.
% Cmin,Cmax are eigenvalues field.
l_min = l_min(:)'... |
% Test Cases:
[str1] = schrodingersCat(arr1, start1);
[str1_soln] = schrodingersCat_soln(arr1, start1);
% str1 => The dead cat was found at position (1,2) after 6 steps.
%
[str2] = schrodingersCat(arr2, start2);
[str2_soln] = schrodingersCat_soln(arr2, start2);
% str2 => The dead cat was found at position (4,11) a... |
function NP_makeFigure2(params_comp,cur_roi,opt,dirPth)
fontSize = 15;
roi_idx = cur_roi.roi_idx;
roi_comp = cur_roi.roi_comp;
x_param_comp_1 = params_comp.raw.x_comp_1;
y_param_comp_1 = params_comp.raw.y_comp_1;
ve_param_comp_1 = params_comp.raw.varexp_comp_1;
x_param_comp_2 = params_comp.raw.x_comp_2;
y_param_co... |
function [h,err,res] = remez(order, ff, aa, varargin)
%REMEZ Parks-McClellan optimal equiripple FIR filter design.
% REMEZ is obsolete. REMEZ still works but may be removed in the future.
% Use FIRPM instead.
%
% See also FIRPM.
% Author(s): L. Shure, 3-27-87
% L. Shure, 6-8-88, revised
% T.... |
scatter(ALGORITHMS, SCENARIOS, TPS * 50, NFFT, 's', 'LineWidth', 10)
set(gca, 'XTick', [0:1:2])
set(gca, 'XLim', [-0.25, 2.25])
set(gca, 'YTick', [1:1:5])
set(gca, 'YLim', [-0.25, 5.25])
pot_legend('1024', '2048', '4096', '8192')
|
function utilities = RBES_compute_utilities(sciences,costs)
%% RBES_compute_utilities.m
%
% Usage: results.utilities = RBES_compute_utilities(results.sciences,results.costs,used_params)
global params
weight_cost = params.WEIGHTS(2);
if length(sciences)>1
u_science = (sciences - min(sciences))./(max(sciences)- min(... |
% load gebco bathymetry
clear all, close all
pbathy = '/nobackupp2/mpschodl/data/ibcao_v3/';
pgrid = '/nobackupp2/mpschodl/llc/prep/llc_540/';
pout = '/nobackupp2/mpschodl/llc/prep/llc_540/bathy/ibcao/';
pout_t = '/nobackupp2/mpschodl/llc/prep/llc_540/tmp_llc540/';
nx=[541,541,541,1621,1621];
ny=[1621,1621,54... |
% 学生証番号: 854030
% 氏名: 山本昂平
% 信号の条件指定
Fs = 44100; % サンプリング周波数44100Hz
F0 = 300; % 基本周波数(音の高さ)
A = 1.0; % 信号の振幅(音の大きさ)
time = 1.0; % 音の持続時間
t = 0 : 1/Fs : time; % 0からtimeまで音を再生する
n = 100; % 重ね合わせる高調波の数の指定
% のこぎり波の値の計算
sigma = 0;
for harmWav = 1:n
sigma = sigma + 0.5*sin( 2*pi*F0*harmWav*t ) / harmWav ;
end
sounds... |
function [total,Directed,Undirected] = FS_merge_data(input)
% input = {'LYY_10_06_16.mat','LYY_10_07_16.mat','LYY_10_08_16.mat','LYY_10_09_16.mat'}
%input = {'data1','data2'}
for i = 1:size(input,2)
load(input{i},'roi_ave','directed','undirected');
A = exist('total')
if A<1;
total.analogIO_dat = roi_ave.analogIO_d... |
clear all
syms x y
y=2*exp(-0.5*x).*sin(2*pi*x);
ezplot(x,y) |
%
% irpGetObject3D is used to scan an arbitrary object with the structured light
% approach.
%
% [DistanceMap Points3D] =
% irpGetObject3D(GrayMaskObj,PlaneNormals,PlaneDs,f,s,cc);
%
% Needed variables:
% - GrayMaskObj: the gray code mask of the scanned object (from irpGetGrayMask)
% - PlaneNormals: th... |
function convertedImage = RGBtoLST(inputImage)
%Create output image of equivalent size using LST format
[height,width,~] = size(inputImage);
convertedImage = zeros(height,width,3);
for x = 1:width
for y = 1:height
r = double(inputImage(y,x,1));
g = double(inputIm... |
function process_fista_redist(filename)
%% Redistribute event index and related event stats to individual files.
S=load(filename);
if isfield(S,'f_mat')
range=S.range;
elseif isfield(S,'f_name')
range=1:length(S.f_name);
end
X1=[S.fista.X1;zeros(length(S.fista.template1)-1,1)];
X... |
function prtyprint(n)
figure(n);
orient tall;
orient landscape
print -dpsc -Pdragonprt;
disp(' ');
disp(['Figure(',int2str(n),') is being printed.']);
|
%==========================================================================================
% features_structural_mask_of_functional_Petersen.m
%
% This script takes in the top x% of connections (pairs of ROIs) ranked by their
% average mean_non_zero connectivity values and populates a feature vector of
% functional ... |
function [ttr, xtr, tte, xte, g] = gen_simudata(MU, S, Ntr, Nte, varargin)
% Generate simulation data
%
% Copyright (c) 2009, Okito Yamashita, ATR CNS, oyamashi@atr.jp.
[Nfeat, Nclass] = size(MU);
if ndims(S) == 2,
SS = repmat(S,[1,1,Nclass]);
else
SS = S;
end
Ntot = Ntr+Nte;
% simulation data generation... |
KK = getK();
z = find(KK==0);
KK(z) = NaN;
z = find(KK==6);
KK(z) = NaN;
[X,Y,Z] = ndgrid(1:size(KK,1), 1:size(KK,2), 1:size(KK,3));
pointsize = 30;
nonans = ~isnan(KK);
scatter3(X(nonans), Y(nonans), Z(nonans), pointsize, KK(nonans));
xlim([0 250])
ylim([0 250])
zlim([0 250])
% slice(KK, [], [], 1:10:size(KK,3));
% ... |
%{
This function will breed the child from
two of the parents within the mating pool.
%}
function [Y] = breed(X1,X2)
%Dimensions for parents.
[~,c1,~] = size(X1);
%[~,c2,~] = size(X2);
%__________________________________________________________________________
% %{
% First Method will be splitting the DNA of
... |
function [data] = volume_transformer(file_path_resolver, file_name_resolver, params)
for iterator=1:1:length(params)
param_array = params(iterator);
validate_property_exists(param_array, 'execution')
file_name = file_name_resolver(param_array);
file_path = file_path_resolver(param_array);
fpr... |
% This is an example of how to use the NNLS, BNNLS, NMF, and RNMF
% classifiers.
clear
% load data
% suppose the current folder is the one containing the NMF toolbox
load('.\data\ALLAML.mat','classes012','D');
classes=classes012;
clear('classes012');
kfold=3;
ind=crossvalind('Kfold',classes,kfold);
indTest=... |
clear
clc
% ---------- Kommentarer ----------
% Den lösningen kan skrivas om i generell form, vi får då systemet:
% [x_k, x_k+1] = [0, 1; -0.5, 2.25]*[x_k-1, x_k]
% D.v.s. x_k = A*x_k-1
% Vi studerar A för att förstå hur stabilt/robust/känsligt systemet är
A = [0, 1; -0.5, 2.25]
lambdas = eig(A)
conditionA = cond(A) %... |
% Digital Communication Lab 3
% VUB BRUFACE
% Yu Liu, Bohan Zhang, Xianjun Mao
%
% Lab 3
% Simple system model: NO preamble, NO Synchronization, ONLY include the
% Channel equalization based on the known channel model
%% setting of the basic parameters
clear all
addpath('functions/');
addpath('misc/');
%... |
clear;close all;clc;
%%
%程序实现的功能
%1、把指定路径的数据(已按类别放置在不同的文件夹中),随机的把其中的75%的划分为训练集,25%划分为测试集
%2、训练集按类别放在指定路径的train文件夹中,测试集按类别放在指定路径的val文件夹中
%3、在train和val文件夹的同级文件夹按照caffe需求生成对应的train.txt和val.txt的label
%%
%程序中用到的之前不清楚的函数如下
%1)disp:用来在界面上显示一些必要的信息,方便查看程序进度。disp(' ')可以起到在界面上换行显示的作用
%2)str2double:带起之前一直使用的str2num,matlab的提示是这样函数... |
clear; clc;
% The toolbox was created at Laureate Institute for Brain Research
% For technical issues, code and bugs please contact Obada Al Zoubi
% obada.y.alzoubi@gmail.com
% For sharing and general questions, please contact Dr. Jerzy Bodurka,
% Laureate Institute for Brain Research
% This script is demo for runnin... |
Xmin = 400000;
Xmax = 400200;
Ymin = 3554400;
Ymax = 3554600;
Zmin = 0;
Zmax = -880;
load('./vel.mat');
%%
vel_pad = vel;
vel_pad = padarray(vel_pad,[64,0,0],'replicate','pre');
vel_pad = padarray(vel_pad,[14,0,0],'replicate','post');
vel_pad = padarray(vel_pad,[0,80,0],'replicate','pre');
vel_pad = padarray(vel_pad,[... |
%See FeasibleFuture class for more information.
%This class implements the feasible future as a unitary set of elements. The element is
%the one which maximizes the sum of the charges. If stop_if_threshold_reached=true, it
%also searches for a final solution
classdef FFGreedyCurrent < FeasibleFuture
properties(Cons... |
load signals.dat;
set(0,'defaultlinelinewidth',3);
kep1=kep2=0.035;
ktrans1=ktrans2=0.011;
vp1=vp2=-0.1;
J1=J2=zeros(size(Cp,1),3);
integral1=integral2=zeros(size(Cp));
dintegral1=dintegral2=zeros(size(Cp));
Ct_k1=Ct_k2=zeros(size(Ct));
% Cuadrados mínimos no-lineal
k=0;dbeta1=dbeta2=1;
while( k<1000 && (norm(dbeta1)>... |
function z = zernikeVector(mask)
% normalise size of shape - what size to use?
size = 150;
mask = cropZernikeShape(mask);
img = imresize(mask, [size size]);
%[img, normtform, xdata, ydata] = imnorm(mask); % affine normalisation
%[row, col] = size(img);
%if (row>col)
% s = row;
%else
% s = col;
%end
%img = imre... |
function opt_pre(name)
% Store the current vehicle parameters to be reopened in the new Matlab workspace
global vinf
gui_save_input(name)
disp(['Current vehicle params saved as ',[name,'_in.m'],'.']);
% store optimization parameters
evalin('base','params1=getfield(vinf,''control_strategy'');')
evalin('base','params... |
function S_int = solve_system_threshold_RK(S,aux_fil,actin_dyn,P)
delta_t = P.delta_t;
count = 0;
% solve system
S_int = solve_system_RK(S,aux_fil,actin_dyn,delta_t,P);
% fix vertices corresponding to the PSD and neck, note that the 2
% adjacent vertices to the neck are also fix, because we area... |
function y=scaling_YM(j,j_max,deg)
%generate phyHAT(j,0)--the fft of the scaling function--in the periodic setting.
%% deg=deg of the Meyer wavelet (1,2,3).
omega_pos=(0:1/(2^j):10/(2*pi));
n_pos=length(omega_pos);
nn=2^j_max;
%omega_neg=(-10/(2*pi):1/(2^j):-1/2^j);
%n_omega=2*length(omega_pos)-1;
%n=2^j_max-n_omega;
... |
%% This code plot four PI in same picture
%Position is red
%Speed is blue
%synergy is black
%redundancy is green
close all;
clear all;
code_folder = pwd;
exp_folder = 'C:\Users\hydro_leo\Documents\GitHub\retina_personal\0503';
%exp_folder = 'C:\Users\llinc\GitHub\retina_personal\0409';
cd(exp_folder)
load('oled_boundar... |
function [ wimg ] = WindowImageUS(mx,my,wsize,img )
%Take a scaled windowed image from a picture; UnScaled
% Input: mx, my wsize, img
mx=round(mx);
my=round(my);
img_wide=zeros(size(img,1)+2*wsize,size(img,2)+2*wsize);
img_wide(wsize+1:end-wsize,wsize+1:end-wsize)=img;
wx=(mx-wsize:mx+wsize)+wsize;
wy=(my-wsi... |
function [FT1] = FTcalculation(x,a,b)
[CrossArea_max,CrossArea_integration,CrossArea_mean,CrossArea_std,CrossArea_variation] ...
= Fstatistics(x.CrossArea(a:b));
[MajorAxis_max,MajorAxis_integration,MajorAxis_mean,MajorAxis_std,MajorAxis_variation] ...
= Fstatistics(x.MajorAxis(a:b));
[MinorAxis_max,MinorAxis_... |
function [nareas, nareaconns] = predict_nareas(brwt, bvol)
% Predict # of cortical areas using allometric regression,
% using data from Changizi & Shimojo (2005)
global g_nareas g_nareaconns
% convert to native units
if ~exist('bvol','var'), bvol = predict_bvol(brwt); end;
if isempty(g_nareas) || ... |
function [E,E_noisy]=preprocess_emc(axisT2,emc,firstTE,snr,denoise_flag,ETL,type)
E=[]; E_noisy=[];
% Normalize EMC databases
% ----------------------------------------------------------------------------------------
emcNorm = normalize_5D_EMC(emc);
% Calculate a decay matrix for each simulated EMC vector accorting... |
A= imread('breastcone.jpg');
save('breastcone.mat','A'); |
function out = CalcForward(w, x)
out = sigmf(w * x', [1, 0]);
end
|
clear
%timeit(factorial(40))
%Using tic toc for the base case took 160 seconds numSims = 1e6;
%Using tic toc for the base case took 17 seconds numSims = 100000;;
tic
diceSimulation
toc |
function p = addpathExcept( pathList, exceptList )
% addpathExcept recursively adds all folders below a directory except for
% paths that match items in the exception list.
%
% INPUTS:
% pathList - 'string' or 'cell array of strings' that you wish to add
% to the path
% exceptList - 'string' o... |
% MEAS_LANDMARK
% 16-833 Spring 2020 - *Stub* Provided
% Simple function to predict a nonlinear landmark measurement from a pose
%
% Arguments:
% rx - robot's x position
% ry - robot's y position
% lx - landmark's x position
% ly - landmark's y position
%
% Returns:
% h - odometry m... |
function [h]=conditionedPlot(data,varargin)
%% plots the conditioned pscychometric
% inputs
% - data: a table of real or simulated data containing the variables 'evidence',
% 'confidence' and 'outcome', if there is a variable 'percept', data
% is plotted as a fit, if there is no variable 'percept', data i... |
function [C, R] = NonlinearPnP(X, x, K, C0, R0, I)
% refine choices of C and R usinf nonlinear optimization
if size(x,2) == 2
x = [x, ones(size(x,1),1)];
end
if size(X,2) == 3
X = [X, ones(size(X,1),1)];
end
% convert rotation matrix to quaternions
q0 = R2q(R0);
qC0 = [q0;C0]... |
function [G, sprememba, steviloUnicevanj] = onesidejacrot(G,j,k, eps)
% ONESIDEJACROT(A,j,k) za dano matriko G naredi enostranskehga Jacobija
% pri racunanju SVD za G'*G, tako da z ortogonalno rotacijo unici
% elementa na mestu (j,k).
% Bor Plestenjak
% 23.5.1994
Ajj=G(:,j)'*G(:,j);
Ajk=G(:,j)'*G(:,k);
A... |
function [KinE, IntE] = plan3gEd(Me,vel,ep,eff)
% PLAN3gEd Calculates kinetic and internal energy for a triangular 3-node
% element
% Me element mass matrix
% vel velocity
% ep=[E v] material properties
% eff deformation gradient
% Kinetic energy
KinE = 0.5*vel'*Me*vel;
% Strain energy
F = [eff(1:2)' 0; eff(3:4)' 0;... |
function [tonout,n,mn,sigma] = MomentsRateChange(ton,spikediff)
% MomentsRateChange: Calculate the mean & std dev. of the firing rate change
% [tonout,n,mn,sigma] = MomentsRateChange(ton,spikediff)
% See RateChange and PlotMeanRateChange
nstim = length(ton);
ncells = size(spikediff,2);
for i = 1:nstim
% Determine whic... |
%% ECE 4445 - Audio Engineering
%% Final Project - Part 1
%% Jiwon Lee, Mason Totri
clear
clc
% Unpack the measured off box data
A = importdata('mason jiwon off box.dat');
masonjiwonoffbox = A.data;
x = masonjiwonoffbox(:,1); % Frequency
y = masonjiwonoffbox(:,2); % Magnitude
z = masonjiwonoffbox(:,3); % Angle
% ... |
UpperRotor = Rotor();
UpperRotor.R=1; |
function [ f ] = f_function( p_star,p,rho )
% f(p_star) function of Godunov Scheme
% p_star: static pressure after the wave
% p: static pressure before the wave
% rho: density before the wave
% f: value of f(p_star)
global gamma R;
T=p/R/rho;% ideal gas
c=sqrt(gamma*R*T);
if p_star>p
f=(p_star-p)/rho/c/s... |
clear workspace;
clearvars;
close all;
bagName = 'Dummy_Horizontal_1.bag';
bag = rosbag(bagName);
disp(bag.AvailableTopics);
bagSelect = select(bag,'Topic','/feuerwerr_siso_demo/FeuerIRImage');
numMessages = bagSelect.NumMessages;
for i= 1:numMessages
msgs = readMessages(bagSelect,i);
imgTemp = ro... |
clear
doSpectra = 0;
showPlots = 0;
doMeanCenter = 0;
warning off
doGLS = 0; % other wise it's OLS
rho = 0.9;
TR = 1.4;
nyq = 1/(2*TR);
tlen = 258;
NITER = 1;
doNewMatrix = 1; % generate a new design matrix or read it from a file?
nlevels = [0.5 1:15 20 30];
% Blocked Design
DesignType=1;
ResultsFile='Block_sim_res... |
function visualisation(choice, aircraft, color)
addpath('trajectory');
tf = aircraft.tf; coeffs = aircraft.coeffs; N = aircraft.N;
t = linspace(0,aircraft.tf,1000);
if strcmp(choice, 'state')
X = zeros(length(t),3);
for i = 1:length(t)
sigma = get_traj(t(i), tf, coeffs, ... |
%
%plot(R,'r');hold on;plot(L,'b');
graphcolor=['k*';'r*';'g*';'b*'];
result=zeros(4,1);
for position=1:4
position
tmpVr=eval(['R',num2str(position)]);
tmpVl=eval(['L',num2str(position)]);
[~,PositionsR]=max(abs(tmpVr(1:400,:)));
[~,PositionsL]=max(abs(tmpVl(1:400,:)));
rpos = PositionsL./Posit... |
% for i = 0:100
% plot(vibro(6).value(i*3000+1:(i+1)*3000))
% pause
% end
chns = size(vibro,2)
step = 1000
sz = 24000
for i = 1:chns
time_str = datestr(vibro(i).timestamps + 693960,'yyyy-mmm-dd');
subplot(chns,1,i), plot(vibro(i).timestamps, vibro(i).value)
% set(gca, 'XTickLabel', time_s... |
% As we have been learning about matrices, strings, loops, etc we've paused
% a few times to check graphically that what we were doing made sense. In
% this tutorial we will spend more time exploring different types of plots
% and figures in MATLAB.
% Our goals are to introduce the basic plot commands (plot, bar) as w... |
path = 'D:\miccai_data\MICCAI_BraTS17_Data_Training\LGG'
disp(path)
d = dir(path);
isub = [d(:).isdir]; %# returns logical vector
nameFolds = {d(isub).name}';
nameFolds = nameFolds(3:end);
disp(nameFolds) |
% Assignment 7 ; problem 4
function dT = fun4assign7(t,T)
dT = -2.2067*10^(-12)*(T.^4-300^4);
end |
% ----- cfg settings
cfg.host = 'localhost';
cfg.port = 1972;
cfg.overlap = 0; % seconds of overlap between reads
% note last will miss samples
cfg.bufferdata = 'last'; % whether to start on the 'first or 'last' data that is available (default = 'last')
cfg.jumptoeof = 1; % whether to skip to the end of the stream/fil... |
function [allpairs, events1_wo, events2_wo] = extract_pairs(events1, events2, timing_relation, mapping, args)
%% Overview
% Finds moments from two cevents that match a specified temporal relation
%
% This function will loop through all events from Variable1 (by either specifying a csv file
% or a variable name) and f... |
function [ tri ] = find_triangle( edgList )
adjList = edgList_to_adjList(edgList);
% start at 1, find a neighbour u, to form a trianlge
% choose a vertex common to both their neighbourhoods
nbhd_1 = adjList{1};
nbhd_u = adjList{nbhd_1(1)};
nbhd_both = intersect(nbhd_1, nbhd_u);
tri = [1,nbhd... |
addpath 'C:\Users\Jason\Documents\compsci_stuff\matlab\tsne';
action_dir = 'state_data\';
iter_mult = 10000;
dir_list = dir(action_dir);
files = {};
for i = 1:length(dir_list)
f_name = dir_list(i).name;
if (~strcmp(f_name, '.') && ~strcmp(f_name, '..'))
files{end + 1} = f_name;
f_name
end... |
%%
[nota,b,c]=textread('notalar.txt','%s %s %s');%notalar txt deki değerleri okur
fs=8192; %örnekleme frekansı
ds=round(fs/100); %durma süresi
go=round(fs/10); %gecikme süresi
notalar=zeros(1,fs); %dizi olusturduk örnekleme frekansı kadar
a=zeros(1,length(notalar)); %0 matrisi olusturduk
durak=zeros(1,ds); %durma sü... |
function lateralInhibition( filename, excitatoryCenter, inhibitorySurround, centerWeight )
% Program that takes in several parameters, and returns a 2D lateral
% ... inhibition model
% Parameters:
% filename -- A string for the image filename
% excitatoryCenter -- The standard deviation of the e... |
function [ y ] = myfunctionConejo(ndg)
y = uint8(200*exp(-300/(double(ndg)-100)));
%y = uint8(500*exp(-50/(double(ndg)-60)));
end
|
function [PP_CFG, PP_DATA] = RTD_postprocessing_multi(PP_CFG, PP_DATA, CFG, DATA, test_idx)
[PP_CFG, PP_DATA] = RT_postprocessing_core_multi(PP_CFG, PP_DATA, CFG, DATA, test_idx); |
%泰坦尼克号生存预测 逻辑回归 梯度下降
%特征数据预处理
Age=completion(Age,1);
Fare=completion(Fare,1);
Embarked=completion(Embarked,2);
%类别特征处理
% Pclass=classcode(Pclass,3);%对类别特征进行编码
% Sex=classcode(Sex,2);
% Embarked=classcode(Embarked,3);
A=[Age,Fare,Parch,Pclass,Sex,SibSp,Embarked];
[m,dim]=size(A);%dim特征维度 m数据维数
for i=1:m
A(i,... |
function [X] = funcMyDFT(x, M)
%funcMyDFT computes the DFT of x of length M (DFT length)
% If M>N then zero pad the rest
% If M<N truncate to M
% outputs the DFT to the variable X (capital X)
%determine long or wide vector
[v,q] = size(x);
N = max(v,q);
if(v>=q)
X = zeros(M,1);
end
if(v<=q)
X = zeros(1,M);
end
%... |
function Out = parseMouseAccumumation(fname);
[behavior] = textread(fname,'%s', -1,'delimiter','\t');
%
% %separating file into LED state and timestamps
% LEDstate = behavior(1:2:end-1);
%
% %convert to an aray of doubles
% timestamps = behavior(2:2:end);
[LEDstate, timestamps] = correctMissingStamps(... |
function price = AmPutLattice(S0,K,r,T,sigma,N)
deltaT = T/N; %calculate delta t
u=exp(sigma * sqrt(deltaT)); %calculate rising rate
d=1/u;%calculate decrasing rate
p=(exp(r*deltaT) - d)/(u-d);% calculate the probability of rising
discount = exp(-r*deltaT);
p_u = discount*p; % risk-neutral probability of going up
p_d =... |
% calculate rate of OH + Ethylbenzene -> products
% Updated 6/10/15
% Based on MCM v. 3.3
% rate = kOHethylbenzene(T,M)
% Ethylbenzene
function j = kOHethylbenzene(T,M)
j = 7e-12; |
data = dlmread('output_day19.txt');
data(9:108,6:105) = 0.5*ones(100,100)
figure()
imshow(data,[0,1]) |
%test banch for universal primal gradient method
clc; clear;
e = 0.1;
L = 1;
x = [1;2;3];
[f, grad] = exfun(x);
%Number of interation
Num = 2002;
for k = 1:Num
i = 0;
while true
M = (2^i) * L;
x_new = Beta(x, gra... |
function [dWdp_p,dWdq_p,dWdb_p] = Compute_dWdp_p(obj,dWduvi,p)
%Compute_dWdp_p Summary of this function goes here
% Detailed explanation goes here
[duidp_p,dvidp_p] = obj.Shape2UV(obj.Compute_duvidp_uvip(p));
dWdp_p = [dWduvi * duidp_p;dWduvi * dvidp_p];
dWdq_p = dWdp_p(:,1:obj.n_q);
dWdb_p = dWdp_... |
% Ayelet Zalic March 2018
%%% Initialization script for He3 system
close all;
clear smdata;
global smdata;
smdata=createsmdata;
chan = 0;
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
% Initialize Keithley1
Keith... |
function fenorm=mypca(data,dim)
[nr, nc, nb]=size(data);
dataV=reshape(data,nr*nc,nb);
dataMin = min(data(:));
dataMax = max(data(:));
datanorm=(dataV-dataMin)/(dataMax-dataMin);
[~,~,EigenV1] = svd(datanorm,'econ');
EigV=EigenV1(:,1:dim);
Pcs=datanorm*EigV(:,1:dim);
fe=reshape(Pcs,nr,nc,dim);
feMin = min(fe(... |
function z = func_lin(t,y,A1,B1,u)
z = A1*y+B1*u;
end
|
function m = det3(A)
% The determinant of 3-order square matrix
% See also tr3, det3, inv3, adj3, svd3, foam
% Copyright(c) 2009-2020, by Gongmin Yan, All rights reserved.
% Northwestern Polytechnical University, Xi An, P.R.China
% 28/01/2020
m = A(1,1)*(A(2,2)*A(3,3)-A(2,3)*A(3,2)) - ...
A(1,2)*(A(2,1)*A(3,... |
[X, labels] = generate_data('swiss', 2000, 0.05);
d = round(intrinsic_dim(X));
Y1 = compute_mapping(X, 'LLE');
Y2 = compute_mapping(X, 'LLE', d, 7);
Y3 = compute_mapping(X, 'Laplacian', d, 7, 'JDQR');
Y4 = compute_mapping(X, 'LTSA', d, 7);
Y5 = compute_mapping(X, 'CCA', d, 'Matlab');
subplot(3, 2, 1), scatter3(X(:,1), ... |
clear all;clc;
%load the trained model
load model.mat
imaqreset
depthVid=videoinput('kinect',2);
%%
triggerconfig(depthVid,'manual');
depthVid.FramesPerTrigger=1;
depthVid.TriggerRepeat=inf;
set(getselectedsource(depthVid),'TrackingMode','Skeleton')
start(depthVid);
himg=figure;
while ishandle(himg)
... |
[m, n] = size(loc);
a = [0 0 m m 0];
b = [0 n n 0 0];
plot(a, b, 'k');
for i = 1:1:size(objects,1)
x = objects(i,1);
y = objects(i,2);
a = [x x x+1 x+1 x];
b = [y y+1 y+1 y y];
hold on
plot(a, b, 'k');
end
hold on
plot(out.pos1.Data(:,1), out.pos1.Data(:,2), 'g');
hold on
plot(out.pos2.Data(:,1)... |
%
% kincontrol3link.m
% script for the kinematic control of a 3 link planar arm
%
clear all;close all;
% link lengths
l1=2;
l2=2;
l3=1;
P=[[0;0],[l1;0],[l2;0],[l3;0]];
% location of the obstacle ball
c=[3;3];
% true radius and the assumed radius (with buffer)
rtrue=1.0;r=1.5;
%%rtrue=2.5;r=2.8;
%%rtrue=2... |
function [bin_map,boundary_set,building_set] = test_Edge_Detection (urban_data,height_thr,enlarg_factor)
%% test_Edge_Detection %%
load(urban_data);
building_height_thr=height_thr;
enlarg_factor=enlarg_factor;
[~,build_num]=size(Buildings);
[~,bound_len]=size(Boundaries);
%% Big Loop Boundaries %%
bound_x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.