text stringlengths 8 6.12M |
|---|
function freemem = MemoryUsage()
[r,w] = unix('free | grep Mem');
stats = str2double(regexp(w, '[0-9]*', 'match'));
memsize = stats(1)/1e6;
freemem = (stats(3)+stats(end))/1e6; |
function lines = CS5320_Hough_draw_pts(im,H,pts,n,dr)
% CS5320_Hough_draw_pts - draws points which contributed to line
% On input:
% im (mxn array): original image (or edge image)
% H (rxt array): Hough accumulator array (see CS5320_Hough)
% pts (rxt struct): record of points in Hough accumulator
% ... |
%{
sim.TrueLoss (computed) # true loss based on ground truth
-> sim.CovMatrix
-----
true_loss : double
%}
classdef TrueLoss < dj.Relvar & dj.AutoPopulate
properties
popRel = sim.CovMatrix & 'nfolds=1'
end
methods(Access=protected)
function makeTuples(self, key)
... |
function ans = MinshengExotic(StartPrice, CurrentPrice, Vol, TimeToMat, RiskFreeRate, UpperBound, UpperRatio, LowerBound, LowerRatio, Margin, NbPath)
AvgSum = 0;
PriceSum = 0;
N = round(TimeToMat*252);
%simulate p discretized paths at times T/N to T
S = (RiskFreeRate-0.5*Vol*Vol)*TimeToMat/N+... |
function ab_analysis(vars)
%
%% load variables into the current workspace
varnames = fieldnames(vars);
varvals = struct2cell(vars);
for vi=1:length(varnames)
eval(sprintf('%s = varvals{vi};', varnames{vi}))
end;
%% Do plots
f = figure; set(gcf,'Position', [77 117 921 567]);
... |
function Write_ATK(Ind_No)
% Change: created
global POP_STRUC
global ORG_STRUC
Step = POP_STRUC.POPULATION(Ind_No).Step;
numIons = POP_STRUC.POPULATION(Ind_No).numIons;
lat = POP_STRUC.POPULATION(Ind_No).LATTICE;
coord = POP_STRUC.POPULATION(Ind_No).COORDINATES*POP_STRUC.POPULATION(Ind_No).LATTICE;
%%%%%%%... |
function fix_scanlines(file_path,shift_pix)
[img_xyz,info] = tiff_loader(file_path);
[save_dir,filename] = fileparts(file_path);
im_new = img_xyz;
im_new(:,1:2:end) = circshift(im_new(:,1:2:end),shift_pix);
figure;
imagesc(img_xyz);
title('Original image');
figure;
imagesc(im_new);
title(['Corrected image with ',num2... |
function angles = readangles(angles_char)
%M = readmatrix('Properties.xlsx','Range','B11:B12','OutputType','char');
start = true;
intchar = '';
intstr = "";
angles = [];
bracket_end = 0;
while start
for ii = 2:length(angles_char)
if angles_char(ii) == ']'
for jj = 1:length(intchar)
... |
clear
load fetchdata.mat
setup_parameters
event_Otime = datenum(event_info.PreferredTime,'yyyy-mm-dd HH:MM:SS.FFF');
evla = event_info.PreferredLatitude;
evlo = event_info.PreferredLongitude;
evdp = event_info.PreferredDepth;
event_name = datestr(event_Otime,'yyyymmddHHMM');
sta_mat_files = dir([event_name,'/*.mat']... |
% ffmpeg_mvs_x and ffmpeg_mvs_y are the motion vectors for integer block matcher
function MSE_ffmpeg = ffmpeg_mse_calc(previous_pic, current_pic, ffmpeg_mvs_x, ffmpeg_mvs_y)
% global rows;
% global cols;
% Set-up dimension of the image
[rows, cols, ~] = size(previous_pic);
factor = 0.25;
blocksize = 4;
coun... |
function JFrame = getJFrame(hfig)
narginchk(1,1);
if ~ishandle(hfig) && ~isequal(get(hfig,'Type'),'figure')
error('The input argument must be a Figure handle.');
end
mde = com.mathworks.mde.desk.MLDesktop.getInstance;
if isequal(get(hfig,'NumberTitle'),'off') && isempty(get(hfig,'Name'))
figTag = 'junziyang'; %... |
wmax=ceil(max(Cw)+.1*ceil(max(Cw)))
winc=wmax/5
pmax=ceil(max(cat(1,ms,y))+.1*ceil(max(cat(1,ms,y))))
pinc=pmax/5
tmax=max(ts)
ax=axes('position',[0.1 0.1 0.8 0.8]) ;
p=plot(ts',ms','ko','MarkerFaceColor','k') ;
set(ax,'color','white','YLimMode','manual','YLim',[0 pmax],'YTick',[0:pinc:pmax],'XLimMode... |
% FORCE ESTIMATION
clearvars
load folderPaths.mat
%% Load Preprocessed Filtered and Filtered Data
load forcesUnfilteredDataset.mat
load forcesFilteredDataset.mat
load forceTimetableNames.mat
load accUnfilteredDataset.mat
load accFilteredDataset.mat
load accTimetableNames.mat
%% Dataset Selection
forces = [force... |
% function [DATA] = HL_FP_loadWS_parseData(fn)
% load wavesurfer data using WS matlab package (ws.loadDataFile)
% OUTPUT: DATA: -struct
% ch_names: N×1 cell for recording channels
% sr: sampling rate, sample per second
% StiLib: [1×1 struct] copy of stimulus library for figureing out
% ... |
% VX_filter.m [DAFXbook, 2nd ed., chapter 7]
%===== This program performs time-frequency filtering
%===== after calculation of the fir (here band pass)
%
%--------------------------------------------------------------------------
% This source code is provided without any warranties as published in
% DAFX book 2nd e... |
clc;
data = feature3;
train = data(:,1:9);
group = data(:,10);
n = size(train,1);
isInds = 1:(n-10); % In-sample indices
oosInds = (n-9):n; % Out-of-sample indices
%SVMModel = fitcsvm(train(isInds,:),group(isInds),'Standardize',true,'ClassNames',{'0','1'});
%Compa... |
function state = sbmkl_supervised_classification_variational_train(Km, y, parameters)
rand('state', parameters.seed); %#ok<RAND>
randn('state', parameters.seed); %#ok<RAND>
D = size(Km, 1);
N = size(Km, 2);
P = size(Km, 3);
sigma_g = parameters.sigma_g;
lambda.alpha = (parameters.alpha_lam... |
function [c,ceq] = nonlinConstrFunc(initialGuessZ)
ceq = []; % Compute nonlinear equalities at z
testingODE = 1; % select 1 to get an plot of the y and v solution of ode45
if testingODE
testVal = [];
end
cOP = classOptimParam(); % constant Optimization Prameters
n = cOP.n;
h = cOP.tf/n;
initialGuessX = ... |
function [ output_args ] = ICV_getDecimal( lbcodes)
[x, endIndex] = size(lbcodes);
powerIndex = 0;
decimal = 0;
for i=endIndex:-1:1
lbCodeBinary = lbcodes(i);
decimal = decimal + (lbCodeBinary*(2^(powerIndex)));
powerIndex = powerIndex + 1;
end
output_args = decimal;
end
|
classdef cohObj < relationObj
%COHOBJ Generates a standardized coherence data object.
% This data object evaluates the magnitude squared coherence between BOLD and EEG data based
% on the various user-specified input parameters. This object ultimately calls the "mscohere"
% builtin function in MAT... |
function [randomized_rasters] = EventsRandomISI(spike_raster,rep_duration,num_random)
% The function will read in the rasters and create a designated number of
% randomized rasters with the same ISI distribution.
random_dist=[];
spike_dist=[];
if length(spike_raster) < 10
num_extra_rasters = 10 - length(spike_... |
function nav_rate = navrate(v_n,p_n)
[R_N,R_E] = earthrad(p_n(1));
nav_rate(1,1) = v_n(2)/(R_E + p_n(3));
nav_rate(2,1) = -v_n(1)/(R_N + p_n(3));
nav_rate(3,1) = -v_n(2)*tan(p_n(1))/(R_E + p_n(3));
end
|
Het enige wat je hoeft te doen om in plaats van een .txt
file een .csv file te maken is de bestandsnaam naar ‘.csv’
te veranderen.
|
function [predict] = fun_DCOVTest(F_train,F_test,TrainCOV_ID_Form)
% 20110711 test function for DCOV
nTest_COV = size(F_test,2);
nTrain_COV = size(F_train,2);
predict = zeros(1,nTest_COV);
for i = 1:nTest_COV
sample_i = F_test(:,i);
res_m = repmat(sample_i,1,nTrain_COV)-F_train;
res_v = sum(res_m.^2);
... |
function p=botPacket(varargin)
%p=botPacket(varargin)
%
%this function will create a packet.
%You can use this function to do things like: routePacket('all', myPacket)
% "Copyright (c) 2000 and The Regents of the University of California. All rights reserved.
%
% Permission to use, copy, modify, and ... |
close all
% this is the sampling rate representing the
% continuous time
duration = 50; % seconds
dt0 = 0.01;
Nyquist0 = 1/(2*dt0);
t=0:dt0:duration-dt0;
% the continuous function under scrutiny
f = 1; % Hz
xt = 2+ cos(f*2*pi *t) ;
%xt = zeros(size(t));
%xt(1) = 1;
% this is the sampling function of interest
dt =... |
function [SIR maps] = CalcSIR(A,Aest)
% Sergio Cruces & Andrzej Cichocki
% A(:,maps) matches Aest properly. --Added by Guoxu Zhou
% mean value should be extracted first --Added by Guoxu Zhou
A=real(A);
A=bsxfun(@minus,A,mean(A));
Aest=bsxfun(@minus,Aest,mean(Aest));
A=A*diag(1./(sqrt(sum(A.^2))+eps));
Aest=Aest*diag... |
function [ rect ] = ptPairToRect(ptPair)
%PTPAIRTORECT Convert a pair of points [minX, minY, maxX, maxY] to a
%rectangle polygon.
%
% Yaguang Zhang, Purdue, 11/15/2021
minX = ptPair(1);
minY = ptPair(2);
maxX = ptPair(3);
maxY = ptPair(4);
% Note that the output vertices are arragned in a clockwise order.
rect = [min... |
function [D, dist_for_segment, data_info]=read_ATL03_geolocation(filename, pairs, params, geoloc_full, data_info)
if ~exist('pairs','var')
pairs=1:3;
end
if ~exist('params','var')
params=struct();
end
beams=sort([2*pairs(:)-1; 2*pairs(:)]);
if ~isfield(params,'index_range')
for kP=1:length(pairs)
... |
function Z = measurement_model(X)
x = X(1);
y = X(2);
z = X(3);
Z = [x; y];
end |
%
N = 40;
K = 10;
W_line = circshift([ones(1,K+1), zeros(1,N-K-1)], [0, -floor(K/2)]);
W_line(1) = 0;
W = toeplitz(W_line);
W2 = SmallWorldRewire(W, 0.2);
W3 = SmallWorldProbRewire(W, 0.2);
figure(1);
imagesc(W);
figure(2);
imagesc(W2);
figure(3);
imagesc(W3);
figure(3);
imagesc(SmallWorldProbRewire(W, 0.2));
re... |
function [phat] = wbl3pdfFit(data)
custpdf = @(x,a,b,c) (x>c).*(b/a).*(((x-c)/a).^(b-1)).*exp(-((x-c)/a).^b);
datahist = [];
for i = 1:size(data,1)
datahist = [datahist; ones(data(i)*1000,1)*i];
end
opt = statset('MaxIter',1e5,'MaxFunEvals',1e5,'FunValCheck','off');
phat = mle(datahist,'pdf',custpdf,'start',... |
function dec = decMetricPCA(varargin)
% Takes an expmt master struct as an input, extracts all the relevant data
% metrics from the struct, PCAs all the data metrics and determines how
% many PCAs to analyze above the measurement noise.
%% Parse inputs
keyarg='';
fDir='';
save = true;
savedir = '';
for i = 1:length(v... |
function y = Model2psi(t, eta, sigma, c, tau)
y = (eta/sigma) * integral(...
@(x)(((x+t).^sigma - x.^sigma).* x.^(tau-sigma-1) .* exp(-c*x)), 0, inf);
end |
function expParams = QSR2params(w,rect,p,PrePost) %#ok<FNDEF>
% function expParams = genericSRM(w,rect,p,PrePost)
white=[255 255 255]; black=[0 0 0]; gray = white*(2/3);
%% Experimenter-defined parameters:
%%% What is the Excel 5.0/95 format file name?
xlsFile = 'QSR2_questions.xls';
%%% What i... |
function [mu Sigma] = estimation_mu_Sigma(X)
% Author: Gweltaz Lever, ISAE Supaero, All rights reserved.
[dimension,nb_donnees] = size(X);
mu = sum(X,1)/dimension;
X_moyen = mu*ones(dimension,1);
X_centre = X-X_moyen;
Sigma = transpose(X_centre)*X_centre/dimension;
|
load trainSet.txt
x=trainSet(:,1:11251);
y=trainSet(:,11252);
[a b c]=pca(x);
judge=cumsum(c)/sum(c);
for i=1:size(judge,1)
if judge(i)>0.95
k=i;
break;
end
end
temp=b(:,1:k);
temp(:,k+1)=y;
save('trainSetPCA.txt','temp','-ascii'); |
function phalssw2(varargin);
% phalssw2( [...] );
% Software SW2
h = timeplot({'SW2_S'}, ...
'Software SW2', ...
'SW2', ...
{'SW2\_S'}, ...
varargin{:} );
|
format long
clc
clear
%f(x)=sen(x); com x entre [a=-pi/2;b=+pi/2]
n = 1;
a = -1
b = +1
np = 100; %N. de pontos para plotar os resultados aproximados
hp = (b-a)/np;
xp = a:hp:b;
ye = sin(xp); %valores exatos para plotagem
erromaxPn=1;
while (erromaxPn>sqrt(10)*1e-2) %O(1e-2)
n=n+1;... |
function ardSetAutoTau(tau)
% time constant in ms
global ardVar;
ardWriteParam(ardVar.Tau, tau);
ardFlip();
|
% This file creates a file list
path_wave = fullfile('..\data','train_wave','');
directory=dir(path_wave);
l=length(directory);
path_list=fullfile('lists','');
if ~exist(path_list, 'dir')
mkdir(path_list);
end
listfile=[path_list,'\','wavefile.lst'];
fid=fopen(listfile,'w');
for i=3:l
fwrite(fid, sprintf... |
%% LOADING DATA
clear; clc; close all
addpath('D:\course_work\amath582\hw3\data\')
C_3(3) = struct('data', [], 'results', []);
for jj = 1:1:3
temp = load(strcat('cam', num2str(jj), '_3.mat'));
temp1 = fieldnames(temp);
C_3(jj).data = temp.(temp1{1});
end
clearvars temp
%% TRACKING THE PAINT ... |
function trans = filltransmat(transseed, notes)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% trans = filltransmat (transseed, notes)
%
% Description:
% Makes a transition matrix from a seed transition matrix. The seed
% matrix is composed of the states: steady state, transient, sil... |
function listLS = countLS(spins)
N = max(size(spins));
[t1, t2] = find(spins(2:N-1, 2:N-1) == (-1));
listLS = [t1 t2];
end |
%Task 1
close all; clear all
cap_abs = capacitor_FD2(0.5,0.5,2,2,200,1E-3,1);
n_vals = 20:4:80;
%n_vals = [25,50,100,200];
cap_vals = zeros(length(n_vals),1);
i=0;
for n = n_vals
i = i+1;
cap_1 = capacitor_FD2(0.5,0.5,2,2,n,1E-3,1);
cap_vals(i) = cap_1;
end
%cap_2 = capacitor(0.5,0.5,2,2,30,1E-3,1)
figur... |
classdef OptBeamMemberSlave < OptObjectSlave
properties
optNodeA
optNodeB
sectionModulus;
forceAreaVariable
momentAreaVariable
forceVariable
momentVariableA
momentVariableB
forceAreaConstraint
momentAreaConstraintA1
mome... |
classdef (Abstract) AlgorithmModule < matlab.mixin.Heterogeneous & handle
%ALGORITHMMODULE Base algorithm class
% Base class for algorithm implementations to be used on the
% optimization application
properties (Abstract)
%Prefix of the algorithm. Eg.: GA
prefix;
... |
function SYS_define_strings( )
%SYS_DEFINE_STRINGS Define a global struct, STR, with all strings
% This function centrally locate all displayed strings a la define
% statements in C. Also allows for easier translation to another
% language, but I doubt that's gonna happen.
global STR
STR.YES = 'Yes'... |
function [A, B] = covNoise(hyp, x, z)
% Independent covariance function, ie "white noise", with specified variance.
% The covariance function is specified as:
%
% k(x^p,x^q) = s2 * \delta(p,q)
%
% where s2 is the noise variance and \delta(p,q) is a Kronecker delta function
% which is 1 iff p=q and zero otherwise. The ... |
function [r1, r2, r3] = cris_bandsplit(id, rad);
% function [r1, r2, r3] = cris_bandsplit(id, rad);
%
% Split a CrIS radiance array into separate arrays for each of
% the three CrIS bands, with 10 fake channels appended to each
% end of each band. Returns non-empty output only for those
% bands for which complete inpu... |
function x=odd(x,updown)
%function x=odd(x,updown)
%Rounds x to the nearest odd integer
%
%if updown==1 (or is omitted as an input argument) then this function rounds
%to an odd integer greater than or equal to x, otherwise it rounds to an odd integer less than or equal to x
if nargin<2
updown=1;
end
if updown==1... |
%AMIGO_HTML_PE_inputs drafts documentation for the recommended input structure for AMIGO_PE
%
% Syntax: AMIGO_HTML_PE_inputs
%
%
% Author: Attila Gabor
% IIM-CSIC
% July 2014; Last revision: 07-Jul-2014
clc
%%%%%%%%%%%%%%%%%%%%%%
%%% INPUTS
%%%%%%%%%%%%%%%%%%%%%%
inputs = AMIGO_default_options;
inputs_doc = AMIGO_... |
function sue_sc_dis = scSUEDistance(sc_loc_matrix,sue_loc_matrix)
num_SUE = 81;
num_SC = 81;
num_Cell=9;
%load('sc_loc_matrix.mat');
%{--Start-- Base Station to MUE distance Calculation}%
SC_loc_matrix = repmat(sc_loc_matrix,1,num_SUE*num_Cell);
%load('sue_loc_matrix.mat');
SUE_loc_matrix = repelem(sue_loc_matr... |
function [fobj_total FOUND_ITEM MIN_OBJ_FUN IND_WIN IND_GAUSS] = LOOP_loc_JAHO_OBJ_newMULTI(INDICES_gauss,nrows,...
imod,PHI,S,V,max_COND,FOUND_ITEM,fobj_total,ng)
% if nargin == 9
% WITH_VTRAIL = 0 ;
% end
n_total = size(PHI,2);
try
S_trail = S(imod+1:n_total,imod+1:n_total) ;
catch
error('Set NCOMB to ... |
%% Range of movement of Knee in Sagittal Lifting
% Code AUTHOR: Yaiza Benito Molpeceres. DATE: January-May 2020.
% Adapted to Octave by Guillermo Asín Prieto
% Segmentation is based on box signal and consists of five phases shown in figure 1:
% 1: Subject starts at upright position and lowers down to pick the box... |
function [f,fraw,p]=apply_erp_clsfr(X,clsfr,verb)
% apply a previously trained classifier to the input data
%
% [f,fraw,p]=apply_erp_clsfr(X,clsfr,verb)
%
% Inputs:
% X - [ ch x time (x epoch) ] data set
% clsfr - [struct] trained classifier structure as given by train_1bitswitch
% verb - [int] verbosity level
% O... |
function data_d=disjoint(data,N,t)
%the function is used to subdivid the time series into t disjoint time
%series.
%data:the time series
%N:the length of the time series
%t:the index lag
%skyhawk
for i=1:t
for j=1:(N/t)
data_d(i,j)=data(i+(j-1)*t);
end
end |
function [ out ] = matToXML( Mat, MatName)
outFile = fopen([MatName '.xml'], 'w');
n = size(Mat,1);
m = size(Mat,2);
L1 = '<?xml version="1.0"?>';
L2 = '<opencv_storage>';
L3 = ['<' MatName ' type_id="opencv-matrix">'];
L4 = [' <rows>' num2str(n) '</rows>'];
L5 = [' <cols>' num2str(m) '</cols>'];
L6 = ' <dt>f<... |
function plot2(obj )
%get key
keys = fetch(obj);
for k = 1:length(keys)
key = keys(k);
% get trace
trace = fetch1(Traces(key),'trace');
fps = fetch1( Movies(key), 'fps' );
% Load times of the trace
times = fetch1(VisStims(key),'frame_timestamps');
movietypes = [{'natural'} {'phase'}]... |
function n = pote(A, m)
%pote - Description
%
% Syntax: n = pote(A, m)
%
% Funcion que debe calcular el minimo valor del exponente de
% la potencia de A que módulo m es igual a la matriz identidad
%
% Entradas: A: matriz cuadrada de orden 2 y con inversa modulo m
% m: modulo de trabajo
%
% Salida: El valor ... |
function [sys,x0,str,ts] = ctrl_puma_robot(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts]=mdlInitializeSizes;
case {1,2,4,9},
sys=[];
case 3,
sys=mdlOutputs(t,x,u);
otherwise
DAStudio.error('Simulink:blocks:unhandledFlag', num2str(flag));
end
function [sys,x0,str,ts]=mdlInitia... |
function scaled_value = scale_vector_to_unity(a,b,x)
% b upper bound , a lower bound
n = size(x,1);
d = size(x,2);
scaled_value = zeros(n,d);
if (numel(a) ~= d) || (numel(b) ~= d)
error('Scaling to unity not possible.')
end
for i=1:n
for j=1:d
scaled_value(i,j) = (1/(b(j)-a(j))) * (x(i,j)-a(j));
end
end
en... |
% ====== 直接加入 Utility Toolbox 和 SAP Toolbox
%addpath d:/users/jang/matlab/toolbox/utility
%addpath d:/users/jang/matlab/toolbox/sap
% ====== 經由對話窗加入 Utility 和 SAP Toolbox
if exist('recursiveFileList')==0
fprintf('請先下載 Utility Toolbox(http://mirlab.org/jang/matlab/toolbox/utility.rar)並加入搜尋路徑!\n');
dirName=uigetdir(''... |
function [feature] = sift_feature_vector(img)
run('vlfeat-0.9.21/toolbox/vl_setup');
[locations, SIFT_features] = vl_dsift(single(img),'fast', 'Step', 5);
% noOfFeat = size(SIFT_features,2);
% Don't know what to do with the features.
feature = reshape(SIFT_features,128*558,1);
end
|
function match_lims(a,b)
%function copies xlim,ylim from figure(a) to figure(b)
figure(a)
xl = xlim;
yl = ylim;
figure(b)
xlim(xl)
ylim(yl)
end
|
function [Cmatrix, Qmatrix, Wmatrix, Amatrix, IWmatrix, Ematrix, timer, n, Bmatrix] = ArimotoBlahutAlgorithm( P, Q, N, eTollerance, printflogs )
%% Arimoto Blahut Algorithm
%% INPUT
% P = P(Y|X) -- model rows output; columns input
% Q = P(X) -- a priori
% N limit of evaluation -- default 1000
% eTollerance
% printflo... |
function mu = rankKApproximation(mu, k)
% function mu = rankKApproximation(fcn, fcnArgs, k)
%
% returns rank-k approximation of return value of mu
%
[u,s,v] = svds(mu, k);
mu = u*s*v';
end
|
figure, imhist(table)
table2=histeq(table);
figure, imshow(table2)
figure, imhist(table2) |
function writetext(text, file, encoding)
% Write text to a file
%
% writetext(text, file, encoding)
%
% Encoding deaults to UTF-8.
%
% Replaces the original file contents.
arguments
text (1,1) string
file (1,1) string
encoding (1,1) string = 'UTF-8'
end
[fid,msg] = fopen(file, 'w', 'n', encoding);
if fid < 1
er... |
function net=get_orgin_from_lwf_network_fc_shared(task_number,lwf_net_path)
% loads the network of the trained task (task_number)
% Author: Rahaf Aljundi
%
% See the COPYING file.
lwf_net=load(lwf_net_path) ;
if(isfield(lwf_net,'net'))
lwf_net=lwf_net.net;
end
%till the custom layer
index=2;
for i=1:numel(lwf_net.... |
%% Import data from text file
% Script for importing data from the following text file:
%
% filename: F:\github\wearable-jacket\matlab\IEEE_sensors\JCS_data\instrreset\instrreset_WISE+JCS_02-04-2020 21-31.txt
%
% Auto-generated by MATLAB on 05-Feb-2020 07:22:03
opts = delimitedTextImportOptions("NumVariables", 13)... |
function hf=showPIs(LEFTPOS,LEFTBOTTOM)
% A is a N-by-M matrix whose rows consists of the SIR values concerning mode-n
global SIRs NumOfMode NumOfComp tdalabStatus;
global XSpread YSpread ScreenWidth ScreenHeight lFontSize;
if ~tdalabStatus.decomposed
warndlg('Please run algorithm first.','Warning','modal');
... |
function h=textbox(r, tit, texts, name);
% TEXTBOX: Creates a textbox in a frame
%
% h=TEXTBOX(R,TIT,TEXTS,NAME) creates a frame at position R,
% title TIT, and places a set of boxes in it (one per cell
% in TEXTS). The global variable GUI will have a field NAME_h
% with the handles.
%
% svn $Id: textbox... |
function POPULATION = individual_Spin_Init( POPULATION )
global ORG_STRUC
%%%%%%%%%%%%%%%%%%%% START initial SPIN MagMON %%%%%%%%%%%%%%%%%
% RANDSEED for MAGMOM TYPE !! Condition:
%
% 0 < randSeed <= 0.2 NM : MAGMOM= 0...
% 0.2< randSeed <= 0.4 FM-LS : MGGMOM= 1 1 1 ...
% 0.4< randSeed <= 0.6 FM-HS : MGGMOM=... |
function [points] = pose(q)
%in mm
L1 = 135;
L2 = 175;
L3 = 169.28;
alpha1 = 90;
alpha2 = 0;
alpha3 = 0;
%d, a, theta, alpha
dh1 = dhTransform(L1, 0, -q(1), alpha1);
dh2 = dhTransform(0, L2, q(2), alpha2);
dh3 = dhTransform(0, L3, q(3)-90, alpha3);
dh01 = dh1;
dh02 = dh1*dh2;
dh03 = dh02*dh3;
... |
% This is the coordinate transformation matrix of adjacent link
syms alpha a d theta;
syms theta1 theta2 theta3 theta4
syms l1 l2 l3
T = [cos(theta) -sin(theta) 0 a ;
sin(theta)*cos(alpha) cos(theta)*cos(alpha) -sin(alpha) -sin(alpha)*d;
sin(theta)*sin... |
function predictions = make_final_prediction(model,X_test,X_train)
% Input
% X_test : a nxp vector representing "n" test samples with p features.
% X_test=[words images image_features] a n-by-35007 vector
% model : struct, what you initialized from init_model.m
%
% Output
% prediction : a nx1 which is your prediction o... |
clc
clear all
close all
t= 0:0.1:10;
y= cos(t);
subplot(2,2,1)%indicates the quadrants so quadrant 1 here out of 2x2 columns and rows
plot(t,y) %for continuous
hold on
%stem(t,y) %this is discrete graph
%hold off
%figure
x= sin(t)
subplot(2,2,4)
plot(t,x)
legend('sine curve')
axis([1.5 8.5 -1 1])
xlabel('Time')
ylab... |
function OutStateHex = AESShiftRowR(InStateHex, n)
% OutStateHex = AESShiftRowR(InStateHex, n)
% Inputs: InStateHex = 4 by 4 matrix of two hex digits (i.e.,
% byte)
% n = an integer in the range {1,2,3,4}
% Output: OutStateHex = 4 by 4 matrix of two hex digits (i.e.,
% bytes), resulting from cyclically shifting the ele... |
function [output] = read_gml(fileName)
%READ_GML Summary of this function goes here
% Detailed explanation goes here
inputfile = fopen(fileName);
A=[];
l=0;
k=1;
while 1
% Get a line from the input file
tline = fgetl(inputfile);
% Quit if end of file
if ~... |
%--------------------------------------
% Chris Dalke
% CSC 249 - Homework 02
%--------------------------------------
% Takes in a labelled region image and
% finds which objects are hearts.
%--------------------------------------
% Function Definition
%--------------------------------------
function returnImage = Det... |
%% SELECT ALL SESSION PATHS
celldisp(cellstr(EXPERIMENT_DIR));
% List of open inputs
% Named Directory Selector: Directory - cfg_files
nrun = 1; % enter the number of runs here
jobfile = {'/Users/andreirusu/mvpa/mvpa-utils/create_brain_masks_all_subjects_job.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(1, nru... |
addpath 'D:\Dev\Windows Linux\DenseCorrespondences\CPP\SiftFlowMex\x64\Debug';
w = 20;
h = 20;
chnl = 128;
img = reshape(1:h*w*chnl, [h w chnl]);
%% Perform bicubic interpolation
img2 = imfilter(img,fspecial('gaussian',5,0.67),'same','replicate');
img3=imresize(img,0.5,'bicubic');
%% Call pyramids module
[img2_cpp im... |
function sdata = subtracttraces(data1,data2)
%===============================================================================
% SUBTRACTTRACES
% Subtract traces in physiology dataset. Substracts first episode of data set 1
% from first episode of data set 2, etc.
%
% RETURNS
% sdata Subtracted data set (data2-dat... |
function out = MVisa(arg1, arg2, arg3)
% Matlab visa wrapper for Java
% test code:
% viRscName1 = 'TCPIP0::10.0.0.3::inst0::INSTR';
% MVisa('createInstance','agilent', viRscName1);
% MVisa('open',viRscName1,'null');
% viRscName2 = 'TCPIP0::10.0.0.4::inst0::INSTR';
% MVisa('createInstance','agilent', viRscName2);
% MVi... |
function A = compute_A_sparse(nx, ny)
% Generates a sparse matrix A which is discretized Laplace operator.
% nx is the number of points in discretization into direction x.
% ny is the number of points in discretization into direction y.
% Distance between the points in the horizontal direction
hx = 2 / (nx + 1)... |
function [PC_back,intmem_back,cycle_back]=ClearACC(PC,intmem,cycle)
intmem_back=intmem;
%clear ACC
intmem_back(225,1)=0;
%load Rn,PSW
PSW=loadPSW(intmem(209,1));
CY=PSW(1,1);
AC=PSW(2,1);
F0=PSW(3,1);
RS1=PSW(4,1);
RS0=PSW(5,1);
OV=PSW(6,1);
UN=PSW(7,1);
P=PSW(8,1);
... |
function [ Distancia ] = ImageDistance( DF1,DF2,MCOV )
%ImageDistance Calcula la distancia de dos imagenes segun la matriz de
%covarianza dada
% Utiliza la forma simplificada del calculo de la distancia usando la
% fincion KAPPA
Distancia=0;
Ncel=DF1.Nceldas;
for i=1:Ncel
for j=1:Ncel
... |
%% 1
clc;
clear all;
close all;
X = double(imread('lenna.gif'));
% load gatlin2;
F = X + 10*randn(size(X));
% We test with 3 choice of mu
sqepilon=0.0000;%0.01*0.01;
step=0.02;
Mu = [1,3,6,10];
M = length(Mu);
figure(2);
subplot(2,M,2)
imshow(X,[]);
title('Lena')
subplot(2,M,3)
imshow(F,[]);
title('Lena noisy')
h = ... |
function outframes = onlineRecon(moviefile, params, amat, bmat)
% reconstruct using a spatial smoothness regularizer given by bmat
if params.isvid > 0
vsrc = VideoReader(moviefile);
else
vsrc = moviefile;
end
% load from saved datafiles
load(params.cal_datafile, 'iold', 'jold', 'ii', 'jj');
% when online, we ... |
function [FVnormal]= FExtraction(filenamenormal)
Normal=imread(filenamenormal);
bw = logical(Normal);
measures = regionprops(bw, 'all');
numberOfitems = size(measures, 1);
FVnormal=[];
for k = 1 : numberOfitems % Loop through all items.
M1=measures(k).Image();
%... |
function [ y ] = s1( x )
%UNTITLED7 Summary of this function goes here
% Detailed explanation goes here
y = zeros;
y(1) = x(1);
for i = 2:length(x)
y(i) = x(i) - x(i - 1);
end
end
|
%Random surface growth
n=100; %tamanho da matriz
matriz=zeros(n);
matriz(1,:)=1;
h=ones(1,n);
ni=1000; %numero de iteracoes
for i=1:ni
r=randi(n);
h(r)=h(r)+1;
matriz(h(r),r)=matriz(h(r),r)+1;
surf(matriz);view([0,90]);xlim([0,100]);title('Random deposition surface growth');ylabel('altura h(x)... |
function [hdfFile, jsonFile, spyInfo] = save_spy(filename, ...
data, trialdefinition, log, samplerate, channel, dimord, ...
varargin)
% SPY.SAVE_SPY Write data array to Syncopy-compatible HDF5/JSON files
%
% save_spy(filename, data, trialdefinition, log, samplerate, channel, dimord, ...
% {dclass,... |
function [nrm, nflag] = normal(flag,x,y,z,nb)
%
% normal.m
% function nrm = normal(flag,x,y,z)
%
% By Dr. Flynn
% Modified by Dirk Colbry 10-20-03
% Calculates the normal of a range surface
% by fitting a plane to the neighboring surface
[nr nc]=size(flag);
nflag = zeros(nr,nc);
nrm=zeros(nr,nc,3);
rsz = nb; % ... |
function [] = main()
close all
clc
n = 4096; % matrix size: nxn.
% k = 1*n;
k = 512;%round(20*sqrt(n)); % number of samples in X.
rng(1); % set random seed
fprintf('Generating Graph...');
[A_true,X] = generateExperiment(n,k);
S = ((1/k)*X)*X';
clear X;
fprintf('Done\n');
% load('ER_692.mat');
lambda = 0.2;
par... |
%% TIME PLOT OF TRAJECTORY
figure
% PLOT LATERAL
reference_time= trajectory(1,:)';
reference_lat= trajectory(3,:)';
plot(reference_time, reference_lat, '.', 'LineWidth', .01);
xlabel('Time(s)');
ylabel('Lateral Position(m)');
title(['Time Plot of Lateral Displacement']);
figure
% PLOT LONGITUDINAL
reference_ti... |
function sbxPullSignals(mouse, date, runs, use_cleaned)
%SBXPULLSIGNALS After an icamasks file has been created, pull signals and
% run simplifycellsort
% Usually run on all runs in a single folder with the first as a target
if nargin < 3, runs = sbxRuns(mouse, date); end
if nargin < 4, target = runs(1)... |
disp('Standalone version of Bluebot model repository')
disp('Adding DLRRM Libs from local standalone folder')
switch computer
case { 'GLNX86', 'GLNXA64' }
%run '/home/odsw/matlab/dlrrm_0_8_1_setup.m'
%addpath(['/home/odsw/matlab/',version('-release'),'/0.8.0/library/dlrrm']);
case { 'PCWIN', 'PCWIN64' }
... |
c1 = 0;
c2 = 0;
c3 = 0;
c4 = 0;
eul = 1;
tEul = 1;
bEul = 1;
printf('Euler method:');
for x = 0:0.2:10
if (x!=0)
f = eul + 0.2*((x-0.2)/eul);
eul = f;
endif
printf('y%d = %f\n',c1,eul);
c1 = c1 + 1;
plot(x,eul,'^');
hold on
endfor
printf('Modified Eu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.