text stringlengths 8 6.12M |
|---|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Importance Sampling - Parallel Dynamic Programming (IS-PDP) Toolbox
%
% This toolbox purpose is to solve the curse of dimensionality of multi-reservoir
% impoundment operation, in an example of three-reservoir system (Li-Yuan,A-hai,
%... |
function iv_out = TSDtoIV2(cfg_in,tsd_in)
% TSDTOIV2 Create interval data from tsd by thresholding.
%
% iv = TSDTOIV2(cfg,tsd)
%
% INPUTS:
% cfg: config struct with fields controlling function behavior
% tsd_in: tsd struct
%
% CFG OPTIONS:
%
% cfg.method = 'zscore';
% 'raw' - threshold raw in... |
%% Result comparison with single hop star topology
% [1] Energy efficiency optimization by resource allocation in wireless body area networks
% 2016-05-04 by Yang Zhou
% There are only 17 implanted sensors and one coordinator in the WBSN. Each
% sensor transmit to the coordinator directly
clc;
clear all;
close all;
cv... |
RC = load('allData.txt'); %原始数据
%% 价格-成功失败图
figure
plot(RC(:,3),RC(:,4),'b*');
title('价格-成功失败图');
xlabel('价格(元)');
ylabel('未完成(0),完成(1)');
set(gca,'XLim',[63 87]);%X轴的数据显示范围
set(gca,'YLim',[-0.3 1.3]);%X轴的数据显示范围
|
clear
ybar = cell(1,4); dt = [0.001 0.0001 0.00001 0.000001];
error = cell(1,4);
for i = 1:length(dt)
time = 0:dt(i):10;
input = u(time);
y = out(time,input);
ybar{i} = least_squares_parametric(y,3,2,dt(i),1);
end
for i = 1:length(dt)
time = 0:dt(i):10;
input = u_test(time);
y = out(time,in... |
% caculator PR
% NX: the upbound of x =5
% NY: the upbound of y =5
% MAXD: the upbound of demand, MAXD =5
% x: St
% y: how much order
% K: the fixed fee of placing order
% r: the selling price per unit
% c: ordering price
% h: holding cost per unit
% s: shortage cost per unit
% u: demand-propability matrix... |
function [rec_img_lap8,img_rm_noise,img_adjust] = image_enhance(us_img,mask)
% Apply Enhancement
% noise removal
img_rm_noise = medfilt2(us_img);
% Contrast Enhancement
img_adjust = imadjust(img_rm_noise,[0.1 0.5]);
img = img_adjust;
% Apply filter to the image for edge detection
% lapla... |
%% Import data from spreadsheet
% Script for importing data from the following spreadsheet:
%
% Workbook: /Users/Jenna/Documents/GitHub/ECON-4008-Macro-Modeling/Code/Project/Model Final/markovchain.xlsx
% Worksheet: markov chain
%
% Auto-generated by MATLAB on 28-Apr-2019 12:29:54
%% Setup the Import Options
opt... |
function value = myFunc(n);
if n<=1
value = 1;
else
value = myFunc(n-1)*n;
end |
function d2fdx2val = findif_loglik_d2fdx2(data,times,y,p,more)
x1 = findif_loglik_dfdx(data,times,y,p,more);
[m,n] = size(x1);
x = zeros(m,n,size(y,2));
for i = 1:size(y,2)
ty = y;
ty(:,i) = y(:,i) + more.eps;
x(:,:,i) = (findif_loglik_dfdx(data,times,ty,p,more)-x1)/more.eps;
end
d2fdx2val = x;
end
|
%% Quick check if unwrapping is performed on the center
% 0. Created by Tianyi Yang on 5/20/2016
% 1. change dir to your working directory.
% 2. change the number in 'GRX\' to the folder that you want to visit.
% 3. If the designated folder does not contain out_wrapped.mat or
% out_unwrapped.mat, an error will occ... |
function value = estimator_COV(probes1, probes2)
EXY = estimator_EX(probes1.*probes2);
EX = estimator_EX(probes1);
EY = estimator_EX(probes2);
value = EXY - EX.*EY;
end |
function [h_precondition,h_new_precondition ] = precondition( x,y,u,v )
[x,y] = normalization(x,y);
[u,v] = normalization(u,v);
% for h33 = 1
index = 1;
N = size(x,1);
A = zeros(2*N, 8);
for i=1:2:2*N
A(i,1) = x(index);
A(i,2) = y(index);
A(i,3) = 1;
A(i,7) = -1*x(index)*u(index);
A(i,8) = -1*y(i... |
function result = ex_fixAndStimStaircase(e)
% ex file: ex_fixAndStimStaircase - Adam C. Snyder adam@adamcsnyder.com
%
% (needs documented. -ACS)
%
global params codes behav allCodes trialData; %#ok<NUSED> %added trial data here so it can be updated with stimulation information
numRuns = 20;
... |
%%
pTxPath = '/Users/ytong/Documents/MATLAB/Temp/20171013_F7T_2013_40_387';
ptxFMObj = DicomFM.WTCpTxFieldmaps(pTxPath,'B1String','dt_dream_wIce_60deg_80VRef__B1',...
'B0String','fieldmap_ptx7t_iso4mm_trans_RL','LocaliserString','fl_tof');
%ptxFMObj = DicomFM.WTCpTxFieldmaps(pTxPath);
... |
function str = gds(fmt)
% get date string
% WTJ, 20181216
if nargin < 1
fmt = 30;
end
if ischar(fmt)
fmt = round(str2double(fmt));
end
str = datestr(now,fmt);
end
|
clc
clear
load \\10.106.67.26\matlab-data\EUMETSAT\LAT_LONG\LONG_20110518;
load \\10.106.67.26\matlab-data\EUMETSAT\LAT_LONG\LAT_20110518;
% load \\10.106.67.26\matlab-data\EUMETSAT\R01\R01_20120226_P3;
load Dust_animation
% Interpolation
% X1 = (flipud(LAT(:,1)))';
% Y1 = LONG(1,:);
% [X Y] = ndgrid(X... |
function [nSh,CnSh]=nullShapleyLB(n,method)
% NULLSHAPLEYLB determines a basis of the null space for the
% Shapley-value for n-persons by a linear basis approach.
% Source: Yokote et al. (2013)
%
% Usage: kSh=nullShapleyLB(n,'sparse')
%
% Define variables:
% output:
% nsh -- A basis of the null space for the Sha... |
%Initialize figure count and size
fig_cnt = 1;
fig_size = [0.2 0.2 0.8 0.8];
%Initialize font sizes
label_font_size = 24;
title_font_size = 24;
%QUESTION G)
disp("QUESTION G)");
%Default I_app
I_app = 0;
%Get Nernst potentials of sodium and potassium
pars = param2();
E_Na = pars.E_Na;
E_K = pars.E_K;
%Set ratios... |
clear;
clc;
T = 1/15;
t = 0:T/30:2*T; %change later
yOne = 4.5*cos(30 * pi * t + ((35*pi)/180));
yTwo = 7.2*cos(30 * pi * t + ((80*pi)/180));
ySum = yOne + yTwo;
hold;
plot(t, yOne, '-r');
plot(t, yTwo, '-b');
plot(t, ySum, '-g');
xlabel('time');
ylabel('Amplitude');
clear;
|
mseArr=zeros(1,4)
mseArr(1)=10
|
% This class represents the internal state of individual tracked objects observed as bbox.
classdef SortObject
properties
% Maximum Age 'age of not being detected' and if More than that it will be removed
MaxAge= NaN
% Minimum number of times the object needs to be seen to be considered an o... |
function obj = instance(varargin)
% This file is what locks the instance in memory such that singleton
% can perform properly.
% For the most part, varargin will be empty, but if you know what you
% are doing, you can modify/use the input (just be aware of singleton_id)
mlock;
persistent Object... |
function [ x,time ] = syn_sin( fk, Camp, sample, dur, tstart)
% A count variable is created to keep track of for loop for x value
count = 1;
% X variable is loaded in to createa 1 x sample vector for the summed x
% values at specific times.
x=0;
% Determine length of frequency and amplitudes.
l1 = length(fk... |
function run = copse_millsg3_millsg3_expts(basemodel, expt, comparedata)
% COPSE reloaded experiments
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% run control
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
run = paleo_run;
run.config = 'copse_... |
function j = costFunctionRegularized_Team4(x, y, teta, lambda)
%définir la fonction d'erreur J
%le but est de minimiser la valeur de teta
m = size(x,1);
n = size(teta,1);
somme = 0;
%calculer l'erreur
%si y = 1 => cost = -log(h(x))
%si y = 0 => -log(1- h(x))
for i = 1 : m
... |
classdef BayesianNetwork < handle
properties
Nodes = {};
Evidences = {};
Graph;
IncidenceMatrix;
InferenceEngine;
end
methods
AddNodes(obj, varargin);
Exist = ExistNode(obj, Node);
AddEvidences(obj, varargin);
RemoveEv... |
function [ result ] = isCollideObstacle( filed, nextHeadPos )
result = filed(nextHeadPos(1),nextHeadPos(2))~=0 && filed(nextHeadPos(1),nextHeadPos(2))~=5;
end
|
clear; clc;
% read images
S = imread('images\II\mengA16777.jpg');
I = rgb2gray(S);
% process images
X = imcrop(I, [3.5 6 220 50]);
X = otsu(X);
subplot(2,1,1);imshow(S); title('mengA16777');
subplot(2,1,2);imshow(X); |
% MRLGMC.M
% To read slider
% for gmax (max gradient in mT/m)
% Called by mrlrm.m
% Check for replot turned on ***********
if mrlreplv == 1 ;
set(mrluirepl, 'Visible', 'off') ;
set(mrlreplb, 'Visible', 'off') ;
mrlreplv = 0 ;
end ;
% Proceed *************
mrlgm = (10^(get(mrluigm,'Value'))) ;
% Calc new dwell... |
function [P] = Enumerate_Base(n,k)
P = [];
for i = 1:k
Division(i) = n;
end
[Base] = InitGrid(k,Division);
for j = 0:Base(k+1)-1
[f] = GridCoords(k,j,Base);
%f = f+1;
[lex] = Lexico(k,f);
if lex == 1
P = [P; f];
end
end
return
end... |
function postProc(projectPath)
% Usage: postProc 'rundir' 'outputdir'
addpath('lib')
send2storage(projectPath)
etaPlotter(projectPath)
% generateShoreline(projectPath,varargin)
end
|
function matching_r=normalize_row(matching,gmmhmm1_weights)
matching_r=bsxfun(@times,matching,1./gmmhmm1_weights');
end
%
% function matching_r=normalize_row(matching,gmmhmm1)
% matching_r=bsxfun(@times,matching,1./gmmhmm1.weights');
% % matching_r=zeros(size(matching));
% % for i=1:n
% % if gm... |
function corrected = applyMultipleCorrections(coeff, data, frames)
%ceoff should be a matrix of Bernstein coefficiants of the polynomial
%data is the distorted data (from the EM tracker).
num_readings = length(data) / frames;
for f=1:frames
startIndex = (f-1)*num_readings + 1;
endIndex = startIndex + ... |
function train_multi_stage()
p = get_paths();
stage = p.stage;
branch = p.branch;
miss_rate = p.miss_rate;
data_dir = sprintf('%s/%d_%f',p.data_dir,p.feature_len,p.miss_rate);
if ~exist(data_dir,'dir')
mkdir(data_dir);
end
p.data_path = data_dir;
feature_dir = fullfile(data_dir,'feature');
if ~exist(feat... |
% match chrmaticity
load dba.mat
variabsxt=atVariableBuilder(RING,{'SF','SD'},{{'PolynomB',{1,3}}});
ConstrChrom=[...
atlinconstraint(1,{{'chromaticity',{1}}},0,0,1)...
atlinconstraint(1,{{'chromaticity',{2}}},0,0,1)];
tol=1e-8;
RINGchrom0=atmatch(RING,variabsxt,ConstrChrom,tol,1000,4);
|
% In this script I visualize the new data
clc
clear
close all
% %% spikes
Path = "/Users/annavybornova/EPFL/Master_4/GEM/GEM_part2/01_Data/20180424EEGspikes/";
Filename = "sub-19.mat";
load(strcat(Path, Filename))
figure,
plot(data(:,channels_to_keep, 1))
%% resting state
clear Path Filename
Path = "/Users/a... |
classdef dspType
%dspType Template DSP type from which to inherit.
% Represents requirements for a DSP method. Template is FIR.
properties (Access = protected)
n
end
methods
function obj = dspType(n)
obj.n = n;
end
function obj = getFi... |
function c=Anomasks2d(X,n,m)%this function computes A(X), or, which is the same, the coefficients c in the paper
%X should be an n^2 matrix, m as in paper
Y=zeros(2*m,2*m);%Y has to be bigger than 2n for the modulo operations in the end
X=reshape(X,[n,n,n,n]);%turns the matrix into a 4 tensor as in the paper, we can... |
% Plik konfiguracyjny
% Zawiera stałe dla symulacji
global Qd1 Qd2 w1 w2 Ta Tb;
global Qd01 Qd11 Qd21 Qd31 Qd02 Qd12 Qd32;
global m1 m2 I1 I2 L1 L2 b1 b2 g fs1 fs2;
global q qd;
m1 = 4.0; % kg
m2 = 3.0; % kg
I1 = 0.083; % kgm2
I2 = 0.04; % kgm2
L1 = 0.5; % m
L2 = 0.4; % m
b1 = 0.5; % Ns/rad
b2 = 0.3; % Ns/rad
g =... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function convertWildDatabase
% Converts the WILD database to my own xml format (for easy retrieval of ground truth, etc)
%
% Input parameters:
%
% Output parameters:
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
%=========================================================================
%
% Program to estimate linear regression by maximum likelihood.
%
%=========================================================================
function linear_estimate( )
clear all;
clc;
RandStream.setDefaultStream( RandStream... |
%%90 degrees rotation of an image
i=imread('C:\Users\hpl\Desktop\lena.jpg');
i=rgb2gray(i);
[r,c]=size(i);
j=zeros(c,r);
j=uint8(j)
for m=1:r
for n=1:c
j(n,m)=i(m,n);
end
end
subplot(2,1,1)
imshow(i)
subplot(2,1,2)
imshow(j) |
function [left,right,left_indices,right_indices] = GetMatchedTrials(cfg_in,metadata,ExpKeys)
% function [left,right] = GetMatchedTrials(cfg_in,metadata,ExpKeys)
%
% left_indices and right_indices are the trial numbers for left and right
% trials in the full original sequence (which includes bad trials).
%
% MvdM
% AC ... |
function traffic_compute(N,T,cfl,rhom,um,godunov_compute,filename,handles)
% Variables para facelas chamadas:
%a=-5000; %m
%b=5000; %m
%N=100;% INPUT
%T=3; %min% INPUT
%cfl=0.95;% INPUT
%rhom=0.218; %coches/m % INPUT
%um=100*1000/3600; % m/min (= 100 km/h)
%w0=@w0_cte; % Condici�n inicial constante
% Estado inicial:
... |
% 7DOF WAM arm example
% use workspace orientation constraint for end effector to stay horizontal
% use workspace pose constraint for end effector goal
% @author Mustafa Mukadam
close all
clear
clc
import gtsam.*
import gpmp2.*
%% arm: WAM arm
arm = generateArm('WAMArm');
end_conf = [-0.8,-1.70,1.64,1.29,1.1,-0.106... |
%% inverseA.m
%
% genrate a 440Hz tone with inverse FFT.
%
Fs = 4000; % sampling rate
L = 8000; % sample length
f = zeros(L,1);
f(880) = L;
yt = ifft(f); % inverse FFT
sound(real(yt), Fs);
|
%%
colorz=lines(3);
nopoints=length(dB);
dspl=0.25;
df0=0.25;
rel = Total;
FDATATEST=scatteredInterpolant(MIDI,dB,rel, 'natural','none');
[xq,yq]=meshgrid(min(MIDI):df0:max(MIDI),min(dB):dspl:max(dB));
vq=FDATATEST(xq,yq);
figure ; mesh(xq,yq,vq)
hold on ;
%plot3(MIDI,dB,Total)
%%
colorz=lines(5);
for m=1:5
pl... |
path = '../../MPEG7_CE-Shape-1_Part_B/';
% namen der angezeigten klassen
classes_chosen = {''};
classes_all = {'apple' 'bat' 'beetle'};
classes = {'apple' 'bat' 'cattle' 'bone' 'brick'};
%%%%%%% CLASSIFY %%%%%%%
%
% wenn euler < 0 -> cattle
% wenn aspectRatio < ?1.8? -> apple
% wenn aspectRatio > 4 -> bone
% wenn wen... |
clear all;
close all
clc
%comment unwanted data sets
nyi=[1:6];
nxi=[7];
load('C3.mat')
UY=train;
UY1=test;
% load ('../../local safis/dataSet/Classification/UCI/glass.tra');
% UY=real(glass);
% load ('../../local safis/dataSet/Classification/UCI/glass.tra1'); uy1=glass;%uy1(10,:)=uy1(10,:)+1;
% uy2=uy1(nyi... |
for i = 1:size(uTF,1);
TFname = uTF{i};
% Finds the TF-specific interactions from the TRN
x = strmatch(TFname,BIGtf_05_2013_Rv2621(:,1));
eval([TFname 'ints = BIGtf_05_2013_Rv2621(x,:);'])
% isequal(' TFname 'ints(:,2),unique(' TFname 'ints(:,2),'stable'))
% Finds the Metabolic Target genes
... |
function [theta, J] = trainLinearRegressionFmincg(X, y, lambda)
%TRAINLINEARREGRESSIONFMINCG Trains linear regression given a dataset (X, y) and a
%regularization parameter lambda
% [theta] = TRAINLINEARREGRESSIONFMINCG (X, y, lambda) trains linear regression using
% the dataset (X, y) and regularization parameter ... |
function outputarray = linarray(start,spacing,numpoints)
% outputarray = linarray(start,spacing,numpoints)
%
% The function linarray generates an row vector based on a start value, a
% spacing, and a number of points. For example: linarray(1,.1,5) returns:
% [1.0000 1.1000 1.2000 1.3000 1.4000]
%
%... |
function [x1,y1,x2,y2,x3,y3,x4,y4]=cteFI2CaCOCaCOSil
%paramétros del compuesto
%la convención para escribir los puntos aquí es tomar primero el punto de la izquierda arriba, luego izquierda abajo, derecha abajo y derecha arriba
x1=0.585; y1=1;
x2=0.585; y2=0.827;
x3=0.6065; y3=0.8185;
x4=0.6065; y4=1;
end |
function TagName = SOM_ClusterDefinition(net,P,Value)
% Define the number of cluster based on threshold value which is determined
% by the user. If 'Value' (segregation value) is not defined, the default
% is 1.
%
% TagName = SOM_ClusterDefinition(net,P,Value)
%
% where net is the neural network trained using ... |
% Load Breast Cancer Dataset
% MATLAB version
% load cancer_dataset
%
% data = cancerInputs';
% [n_instances,n_features] = size(data);
% % construct breastcancer label
% label_true = ones(n_instances,1)*999;
% for i = 1:n_instances
% label_true(i) = find(cancerTargets(:,i) == 1);
% end
% http://www.cais.ntu.edu... |
function net=subsasgn(net,subscripts,v)
%SUBSASGN Assign fields of a neural network.
% Copyright 1992-2015 The MathWorks, Inc.
% Convert Network to Struct
net = struct(net);
netname = 'NET';
net = network_subsasgn(net,subscripts,v,netname);
function net = network_subsasgn(net,subscripts,v,netname)
persistent FIELD... |
%%
% CellShapeAnalysis.
% Copyright (C) 2020 J. Stegmaier
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicabl... |
function [M] = powerMod(N,e,m)
%powerMod returns M = N^e mod m
if N ==0
M=0;
elseif e==1
M = mod(N,m);
else
M = 0;
if (mod(e,2)==0) % e even
M = powerMod(N, e/2,m);
M = mod(M*M,m);
else % e odd
M = mod(N,m);
M = mod(M*powerMod(N,e-1,m),m);
end
end
... |
% init VNA for coupling
znb.frange(100e3,5e9); |
function [ otvet ] = GroupImages(viborka)
pogrMax=0; %max average deviation at the time... intitally = 0 (max possible average relative error)
lenInitial=length(viborka(1,:));
for i=1:lenInitial
indexesRest(i)=i;%this array contains indexes of remaining images to be grouped and ranged
end
indexesMatch=0; %indexes t... |
function [VX,VY] = GetPIV(im1,im2,X1,Y1,EdgeLength, histequilize)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% GetPIV computes PIV flow field estimate based on image1 (im1) and
% image2 (im2) using the Phase Correlation method implemented in xcorr2fft.
% im1 & im2 are assumed to have the sam... |
% Test1_AC_1pD.vcsv
close all;
clear all;
%
% File information
%
FOLDER = 'D:\Documents\My Documents\My Homework(Fall 2014)\Simulation Results\Results - GTBE-A_Device_FT_no_cancellation_test\';
FILENAME = 'Test1_AC_1pF.vcsv';
% Parse Data
[freqs, voltage, signalNames, units] = virtuoso_importVCSV_AC(FOLDER, FILENAME)... |
% a list of bulb hotspots to be analyzed
disk = pwd;
disk=disk(1)';
pPChotspotmapList=[];
% :\Data\December\Dec 29 OMP aPCX 2 electrodes\'
%1
pPChotspotmapList{1}.dirPath = [disk ':\Data\2011\Jan\Jan 13 OMP pPCX\'];
pPChotspotmapList{1}.neuron = 3;
pPChotspotmapList{1}.cluster = 0;
pPChotspotmapList{1}.th = ... |
%% INVERSE SOLUTION FOR PENDULUM
% Script used to implement a numeric inverse solution for a pendulum problem.
%
% S.Yakovenko © 2009
function [trq] = pendulum_inv(T,X)
bPlot = 1;
if nargin>0
tStep = T(2)-T(1);
else
tStep =.001;
end
if nargin<2 || isempty(X)
[T,X] = getTarget('bPlot',0);
end
% 1st
TH1(1,:) =... |
%%
% This is an example of how to create a simple stem plot in MATLAB®.
%
% Read about the <http://www.mathworks.com/help/matlab/ref/stem.html |stem|> function in the MATLAB documentation.
%
% For more examples, go to <http://www.mathworks.com/discovery/gallery.html MATLAB Plot Gallery>
%
% Copyright 2012-2014 Th... |
function ApplyColorToBiplot(hbi,Grouping,ListOfGroups,ColorSet,SizeForMarkers)
% Function to apply colors on data points plotted on a biplot
% Manipulate plot colors
% Code inspired by the thread:
% URL:[https://stackoverflow.com/questions/19052317/configuring-biplot-in-matlab-to-distinguish-in-scatter]
% and ... |
%solution for control 4_1
% Governing differential equation
% x_dot=k_v*V/A;
% Parameters
k_v=0.5;
A=0.02;
% [Task 1]
% Open-loop transfer function
s=tf('s');
tf_actuator=(k_v/A)*(1/s);
% [Task 2]
% Closed-loop transfer function when K=1.25
K=1.25;
tf_servo=K/(1/tf_actuator + K);
% [Task 3]
% Closed-loop system... |
% plot team offence skills
figure;
subplot(2, 2, 1);
noTeam = size(teamSkills, 1);
teamSkillMean = zeros(noTeam, 1);
for idxTeam = 1:noTeam
teamSkillMean(idxTeam) = teamSkillsPoisson{idxTeam, 1}.Mu + teamSkillsPoisson{idxTeam, 2}.Mu;
end
bar(1:noTeam, teamSkillMean-min(teamSkillMean)+1)
title('Poisson-off... |
function x = redundant_idft(y, r)
%REDUNDANT_IDFT Summary of this function goes here
% Detailed explanation goes here
nr = length(y);
n = nr / r;
x = ifft(y);
x = x(1:n) * sqrt(nr);
end
|
function [ distance_pelvis_to_stance_toe_fun ] = distance_pelvis_to_stance_toe( nlp )
%distance_pelvis_to_stance_toe constraint for distance_pelvis_to_stance_toe
% Creates SymFunction for a distance_pelvis_to_stance_toe constraint
%
% Author: Ross Hartley
% Date: 2018-03-19
% Choose frames
switch nlp.P... |
clear paramsAll;
clear params;
params.Gridjob.runLocal = true;
params.Gridjob.requiremf = 2500;
params.Gridjob.wc_host = '!(*saturn*|*c01grid*|*ramsauer*|*kuma*)';
params.Gridjob.jobname = 'Connectome';
params.Gridjob.continue = false;
params.Gridjob.initRandStreamWithJobid = true;
params.Gridjob.combParallel = false... |
function [Golden,deviation,upper,lower]=initialize(data,goldenvalue)
Golden=getGolden(goldenvalue);
Deviation=getDev(Golden,data);
[upper,lower]=findEnv(Deviation);
|
function [w,b] = perceptron(X, y,lambda)
% X(i,:) is i'th case, y(i) = -1 or +1
% X should not contain a column of 1s
% lambda l2 regularizer
% Based on code by Thomas Hoffman
[n d] = size(X);
w = zeros(d,1);
b = zeros(1,1); % offset term
max_iter = 100000;
for iter=1:max_iter
er... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
% Problem 4- Equivalent Frequency Response to
%
%
%
% 3(jw)^2-4jw+1
% H(jw)=---------------
% ... |
function [Fn,Ln] = fibs3(n)
% fibs: vpi tool to efficiently compute the n'th Fibonacci number and the n'th Lucas number
% usage: [Fn,Ln] = fibs3(n)
%
% For efficiency, fibs3 uses a variety of tricks to
% maximize speed. While computation of fibonacci numbers
% is commonly done recursively, fibs3 does so using a
% direc... |
function [ output_args ] = axis_update( UD)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
xlim(UD.ax(1:2));
return;
end
|
clc; clear all; close all;
N=8; M=8;
k=input('enter the total no.of samples');
for n=0:1:k
for i=0:1:7
for j=0:1:7
y(n)=x(n-i+1);
z(n)=x(n-i);
x(n)=y(n)-z(n);
x1(n)=x(n)*x(n);
x2(n)=abs(x1(n));
a(n)=x(n)*(N-i+1);
b(n)=a(n-j... |
%@(#) sfg2pool.m 1.2 10/09/09 10:42:27
%
%function sfg2pool(sfgfil,poolfil);
function sfg2pool(sfgfil,poolfil);
tx=readtextfile(sfgfil);
sbr=strmatch('SAFE',tx(:,2:5));
j=1;
for i=1:length(sbr)-3
for row=sbr(i)+4:4:sbr(i+1)
chk=tx(row,2:6);
if strcmp(chk,remblank(chk))
pos(j,1:5)=chk;
t=rem... |
%SP1= Strategy Player 1; SP2= Strategy Player 2
%Trust versus Win-stay Lose-shift
%Cooperate=1, Defect=0
function [SP1, SP2]= WSLS(z3,w1,SP2,PP2,SP1,n)
if z3(n)>w1(n)
SP1(n)=1;
else SP1(n)=0;
end
if PP2(n-1)<0 && SP2(n-1)==1
SP2(n)=0;
elseif PP2(n-1)<0 && SP2(n-1)==0
SP2(n)=1;
elseif PP2(n-1... |
function [ crt ] = compute_parameter_from_idx( measure, parameter, idx )
%The function to compute specific parameters such as temporal, numClust,
%alpha, and r given a range of parameter want to try and the idx yielding
%the best correlation. Useful to find best parameter combinations.
%
% INPUT: measure - a s... |
function [cov, cor] = sar(gSC, k)
if isscalar(k)
b = inv(eye(size(gSC))-k*gSC);
else
b = inv(eye(size(gSC))-repmat(k,1,66).*gSC);
end
bb = b*b';
cov = bb;
autocov = sqrt(diag(cov));
cor = cov ./ (autocov * autocov');
end |
function [pass,maxerr] = test(opt)
% Check apodization has an effect on spectrum
t = linspace(0,1/mean(2*10)*100,100);
S = exp(-t).*cos(2*pi*5*t);
[nu1,spec1] = fftspec(t,S,'Type','abs','Apodization',false);
[nu2,spec2] = fftspec(t,S,'Type','abs','Apodization',true);
% Pass: spectra are different due to apodization
... |
function pred_y = q6_predict(X, Y, xtest, tau)
% Predicts the output value of the input example xtest, given the training
% set X, Y, parameter tau, and the test example
%
% INPUT
% X : [m x d] matrix, where each row is a d-dimensional input example
% Y : [m x 1] vector, where the i-th element is the correc... |
function FunctionalClasses()
% Suggested by John Murray
% Show T1w:T2w for different groupings of brain areas
%-------------------------------------------------------------------------------
% Settings:
structFilter = 'ABAcortex';
whatLabeling = 'Harris';
% Import T1w:T2w data:
structInfo = ImportT1T2();
T1T2_marker ... |
function varargout = CIEgui(varargin)
% CIEGUI M-file for CIEgui.fig
% CIEGUI, by itself, creates a new CIEGUI or raises the existing
% singleton*.
%
% H = CIEGUI returns the handle to a new CIEGUI or the handle to
% the existing singleton*.
%
% CIEGUI('CALLBACK',hObject,eventData,handles,...) ... |
function jointDensity = create_joint_density(nKernels,kernelType,nMarginals,rho)
% check that we have a coherent number of dimensions
assert(nMarginals >= 2);
assert(round(nMarginals) == nMarginals);
% create marginals:
for m = 1:nMarginals
jointDensity.marginal{m} = create_mixture_density(nKernels,kernelType);
e... |
clearvars;
filenameforexcel='C:\Users\Lenovo\Documents\MATLAB\statsforserver84.xlsx';
% filenamenosac='C:\Users\Lenovo\Documents\no microsaccades.xlsx';
[numms,textms,rawms]=xlsread(filenameforexcel,2);
[num,text,raw]=xlsread(filenameforexcel,1);
idall=num(:,1);
idall=idall(1:292);
% [nomic,crap,crapola]=xlsread... |
%% Initialization of simulation.
% Needed functions: noquantumsim.m, plotlattice.m, fillfield.m, checkfree.m
% here we choose the variables which define our simulation
% in this version probability for predators is proportional to preys
clear;clc;
% Death value for sigmaz:
deathvalue=-0.8;
% grid dimension... |
function py = recover_y(p0,v0,U,h,N,n_var,K)
% recover_y takes as inputs p0 - initial position, v0 - initial velocity, U -
% acceleration, h - sampling time, n_var - number of design variables and
% computes the y-coordinate of position for every Nth vehicle and Kth state
% This is the "double" type version which can... |
function [ output_args ] = prmGraphValidity( input_args )
%CHeck whether the graph generated obeys the constrains imposed
% Detailed explanation goes here
% close all
adjDirectory = '/home/khan/phd_ws/traversability/adjacency/long_roads_quasi2/road_long';
configDirectory = '/home/khan/phd_ws/traversability/configs... |
function [] = vnlsetp2(m,n,L)
% Variational Nonlinear Schrodinger Equation
% Tensor-preconditioned Newton-Krylov method
% Polar coordinates
% m Gauss-Legendre-Lobatto nodes
% n Fourier modes, must be even
% Ansatz
%spin=0; del=0; ep=pi/4; a0=2; a1=2; a2=a1;
%spin=1; del=pi/4; ep=pi/4; a0=0.7830; a1=2.7903; a2=a1;
%spi... |
%Analyzing the path of photon inside the glass and acrylic cover
%Data
Initial_position=Tracing(1:42,1:1);
Final_position=Tracing(1:42,18:18)-Tracing(1:42,1:1);
%Plotting
%scatter(Initial_position,Final_position);
xlabel('The initial position of the photon')
ylabel('Deviation of the photon')
%Calculation of the standar... |
% creates face aligned video
% reads the node list of traversal. align the face from the node and make video.
function main(output_folder)
current_folder = cd;
ramanan_folder = [current_folder '/../../../../feature_representation/featureVector_edgeWeight_extraction'];
addpath(ramanan_folder);
videos_folde... |
clear all;
addpath(genpath('../PhiToolbox'))
N = 4; % number of units
T = 10^6; % number of iterations
tau = 1; % time delay
N_st = 2; % number of states
%% params
params.tau = tau;
params.number_of_states = N_st;
%% generate time series from Boltzman machine
beta = 4; % inverse temperature
% connectivity matrix
... |
function res = cfft(x,dim)
% centered Fourier transforms for MRI: image space ---> k space
% Zhiyong Zhang (zhiyongxmu@gmail.com)
if nargin < 2
dim = 1;
end
res = 1/sqrt(size(x,dim))*fftshift(fft(ifftshift(x,dim),[],dim),dim); |
scrsz = get(0,'ScreenSize');
figure('OuterPosition',[1 scrsz(4)/3 scrsz(3)*3/4 scrsz(4)/3]);
clear scrsz;
number = 1;
sbps = 1;
ebps = length(sampled_markerlist);
% sbps = 12900;
% ebps = 13050;
%
% sbps = 28000;
% ebps = 30000;
% sbps = 8500;
% ebps = 8700;
% sbps = 13000;
% ebps = 13400;
% sbps = 6000;
% ebps... |
function plotProgresskMeans(X, centroids, previous, idx, K, i)
%PLOTPROGRESSKMEANS is a helper function that dipslays the progress of
%k-MEans as it is running. It is intended for use only with 2D data.
% PLOTPROGRESSKMEANS(X, centroids, previous, idx, K, i) plots the data
% points with colors assigned to each cent... |
function [FrontNO,MaxFNO] = ENS(FunctionValue,Operation)
% This function sorts the population by ENS
[~,kind] = ismember(Operation,{'all','half','first'});
[N,M] = size(FunctionValue);
FrontNO = inf(1,N);
MaxFNO = 0;
[FunctionValue,rank] = sortrows(FunctionValue);
while (kind<=1 && sum(Fro... |
%% rename files
source = 'C:\Users\Joshua\Dropbox\Projects\fMRI Analysis\stimuli\temp';
files = dir(source);
files=files(3:end);
target = 'C:\Users\Joshua\Dropbox\Projects\fMRI Analysis\stimuli\allStim2';
prefix = 'M_';
for i = 1:length(files)
movefile([source '\' files(i).name],[target '\' prefix files(i).name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.