text stringlengths 8 6.12M |
|---|
classdef (Abstract) Annotation < sbfsem.core.EntityType
% ANNOTATION Prepares a single annotation for 3D render
properties (SetAccess = protected, GetAccess = public)
Z
parentID
end
properties (Transient = true, SetAccess = protected)
boundingBox = [];
binaryImage = [];
end
me... |
function [args,scaninfo,kinfo] = rec_setup1(rawfile,varargin)
%function [args,scaninfo,kinfo] = rec_setup1(rawfile,varargin)
%
% $Id: rec_setup1.m 1677 2015-02-26 16:49:01Z klitinas $
% $HeadURL: svn+ssh://klitinas@woo.engin.umich.edu/work/repos/matlab/recon/trunk/rec_setup1.m $
%
% some default paramters
%
outscale ... |
function fixintelpmc(time, cpu, ht0, cmiss)
% fixamdpmc - Deal with data issues with the PMC counters
ltime = length(time);
t = time(1);
h0 = ht0(1);
miss = [0 0];
lastm = miss;
miss(cpu(1)+1) = cmiss(1);
lasth0 = h0;
count = 1;
fprintf('time , FSB, c1c2missC0,c1c2missC1\n');
for... |
function [PDSI,X1,X2,X3,Pe,montho]=PDSIr(Z);
nmonths=0;
X1=zeros(size(Z));X2=X1;X3=X1;Uw=X1;Ud=X1;Pe=X1;PDSI=X1;Ze=X1;
% start off not in dry or wet spell
XX=Z(1)/3;
if XX>0 X1(1)=XX;else X2(1)=XX;end
if abs(XX)>=1 X3(1)=XX;nmonths=1;end
PDSI(1)=XX;
% loop over time
for i=2:length(Z)
XX=Z(i)/3;
Ud(i)=XX*3-.15;
Uw(i... |
function EIB_main(subjID, run)
% % 566 seconds, IPS=283
% e.g., = EB_main('SAX_SLOC_01', 1)
%
% exact presentation schedule must be determined in advance for each subject for each run (stored as e.g. sax_eib_01_sched_run01.mat)
% subjID = MUST END IN TWO NUMBERS (i.e., 01, 02, etc.)
% run = current run
%
% 8 runs;... |
function q = isoquaternion(z, a)
% ISOQUATERNION Construct a quaternion from a complex number, preserving
% the modulus and argument, and using the axis of the second
% argument as the axis of the result.
%
% Copyright © 2006, 2008 Stephen J. Sangwine and Nicolas Le Bihan.
% See the file ... |
clear;
close all;
clc;
smallWorldExample
SIZE = 5000;
C = 6;
%
% graph = GenerateCircularGraph(SIZE, C);
% 3/4*(C-2)/(C-1)
graph = A;
CalculateClusteringCoefficient(graph)
VisualizeGraph(graph); |
function [W,mu,sigma,COEFF] = obtainCCA(dataAll,KK,K,reg,l)
%% apply individual-subject PCA and across-subjects CCA
% Date Programmers Description of change
% ==== ================= =====================
% 09/10/2016 Qiong Zhang Original code
%%% INPUT... |
t1=turnim(1,:)
t2=turnim2(1,:)
%%
%%
nr_bins=50;
elements=floor(length(t1)/nr_bins);
for j=1:nr_bins
bin1(j,:)= t1((j-1)*10+1:elements*j);
bin2(j,:)= t2((j-1)*10+1:elements*j);
[p(j,:),h(j,:)] = signrank(bin1(j,:),bin2(j,:));
end
%%
%%
plot(t1)
hold on
plot(t2)
%%
|
clc; clear all; close all;
% parameters
xa = -15;
ya = 18;
d = 0.90;
m = 85;
I = 1.7;
rho = 20;
Fmax = 180;
Mmax = 10;
Ts = 0.05;
n = 10;
% continuous system
A=[0 0 0 1 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1;
0 0 0 -rho/m 0 0;
0 0 0 0 -rho/m 0;
0 0 0 0 0 -0.01/I];
B=[0 0 0;
... |
function [biais, Eq, Emean, Estd, Eqmean, Eqstd, Q] = test_estimateQ(n,m,k)
% n : number of traces
% m : number of element in a trace
% k : graph order
A = getRandomAdjacency(k, 0.575);
Q = getQTeleport(A, 0.5);
pi_0 = ones(1,k) / k;
X = zeros(n,m);
Q_est = zeros(n,k,k);
biai... |
function g = DAE_g(in1,u1,in3,alpha)
%DAE_G
% G = DAE_G(IN1,U1,IN3,ALPHA)
% This function was generated by the Symbolic Math Toolbox version 8.0.
% 13-Jan-2019 22:22:05
lambda2 = in1(4,:);
g = lambda2+u1.*1.0;
|
%% Description
%
% We investigate the correlation between the confidence index (CI) and the
% estimate errors (RMSE).
%
% Fabien Boux - 02/2020
Init
disp(['Running experiment ' mfilename '.m'])
%% Setting
% Execution settings
verbose = 1;
backup = 1;
% Signal settings
int = [0.01 1];
nb_param = 3;
nb_train_si... |
% get a slide from point cloud perpendicular to one of the axis
% of the co-ordinate system with a tolerance
% parameters:
% fname - input coordinate file (default lidar.txt)
% coo - coordinate of section (default 1000)
% col - coordinate column (default 3)
% tol - tolerance to co-ordinate (default 0.2)
% sep... |
clear all;
clc;
x=linspace(1,100,100);
y1=power(x,3);
y2=power(x,-3);
figure1=figure('windowstate','maximized');
axes1=axes('Parent',figure1);
plot(x,y1,'-b')
legend(axes1,'show')
ylabel({'Y units'})
xlabel({'X units'})
title({'Exponential Graph'})
hold(axes1,'on')
plot(x,y2,'LineStyle','-.','Color',[1 0 1],'Marker','... |
%Methode zur Erstellung der 1D Curl-Curl-Matrix eines einfachen
%Eigenwertproblems einer eindimensionalen Wellengleichung (TE-Mode).
%
% Eingabe
% n Stuetzstellenanzahl (n>=3 fuer ord=2, n>=5 fuer ord=4)
% ord Ordnung des Verfahrens (ord=2 zweite oder ord=4 vierte Ordnung)
% bc Randbedingungen (... |
function [dC, eEusage, pRusage] = multi5enzyme(T, C, gamma, lambda, hpar, cpar, eE, pR)
%% multienzyme
%
% Subfunction which produces the ODEs needed to simulate the expression of
% multiple enzymes.
%
% [dC, eEusage, pRusage] = singlegene(C, gamma, lambda, hpar, cpar, eE, pR)
%
% Need to ribochoose as global variab... |
%% Opdracht 2
% In de onderstaande code staan fouten. Los de foutmelding op.
% Let op! Bij het oplossen mag je geen variabele verwijderen of index
% veranderen. De tangentieleVersnelling moet 4 worden.
t = 1:0.01:10;
(hoekKogelSlingeraar) = sin(t);
if length(hoekKogelSlingeraar)== lengh(t)
tangentleleVersnelling=4... |
%%
V = 20; %volt
Kt = 0.46; % Nm/A
Kb = Kt; % Nm/A
R = 0.76; %ohm
L = 0;
J = 0.07;
c = 0.5;
ca = 0.1;
cn = 0.075;
m = 0.8;
l = 0.3;
Wmax = 2*pi;
Wmax_dot = Wmax/0.2;
Tmax = J*Wmax_dot+ca*(30/3.6)^2+c*Wmax+m*l*25;
% N=1, n=0.98
subplot(2,2,1)
N=1;n=0.98;
Wm_free = V/Kb;
WL_free = (1/N)*Wm_free;
... |
function star_set(lst,ellim,maglim,lat, minuteDiff)
% star_set(lst)
%
% Find the set of stars which are bright and available for pointing
% at a given LST
%
% To get the lst type "print $time(lst)" in szaViewer
%
% e.g.: star_set(19.1)
%
% Take the resulting list of numbers and paste it into
% /home/szadaq/carma/sza/ar... |
% Compare accelerometer measurements vs. modelled
close all
xmin = 0; xmax = 35; ymin = -1000; ymax = 1000;
% run('/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl_ForceEstim/FFT_currents.m'), close all
% lower_i_1, lower_i_2, lower_i_3, lower_i_4, lower_i_5, lower_i_6
sample_start = 100;
sample_en... |
function Y = subs(S,old,new)
% Symbolic substitution. Also used to evaluate expressions numerically.
% SUBS(S,OLD,NEW) replaces OLD with NEW in the symbolic expression S.
% OLD is a symbolic variable, a string representing a variable name, or
% a symbolic expression. NEW is a symbolic or numeric... |
function [dObj,gradObj] = inverseDyn(u,q,dq,p)
dObj =0;
gradObj = zeros(size(u,1)*size(u,2),1);
for i=1:size(u,2)-1
[f1,df1du] = f_forward(u(:,i),q(:,i),dq(:,i),p);
[f2,df2du] = f_forward(u(:,i+1),q(:,i+1),dq(:,i+1),p);
s_half = 0.5*([q(:,i);dq(:,i)]+[q(:,i+1);dq(:,i+1)])+p.sampT/8*(f1-f2);
u... |
function re = Q9Re(nodes, BdrIdx, st, dim)
% re = Q9Re(nodes, BdrIdx, st)
% function for compute consistent nodal load
% for Q9 mesh under the following conditino
% uniform stress on boundary that is horizontal
% and straight, the edge node of elements on
% the boundary has to be in the middle
% nodes - the nodes par... |
function data=PlotNavioXLS(file,column,titletext)
path = 'C:\Users\jl3y9\Desktop\UAV data';
%file = '100C.csv';
filename = fullfile(path,file);
data = xlsread(filename);
%% Plot
% need to find time column in xls data
%plot(data(:,2)/1e6,data(:,column))
plot(data(20:end,column))
xlabel('time(s)')
grid on
if nargin >2
... |
%function converts signal from long form to short. For example, long signal is [-1 -1, 1 1], samples = 2, then short singnal is [-1, 1]
% This is sampler function
function [sign_short] = long_to_short(sign_long, samples)
% input:
% sign_long - long signal
% samples
% output:
% SignShort - short signal
% sign_long =... |
function [ local_hurst, e_h, v_n, log_n, log_rs, e_rs ] = Hurst_local(data_close, time_window, move_average )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
% 消除收盘价线性依赖
data_close_residuals = Utility_AR(data_close);
% 对收盘价进行移动平均处理(建议使用20个交易日)
data_close_MA = zeros(time_window * 2, 1)... |
d=4;
N=2^d;
W=exp(-2*i*(pi/N));
a=[0:N-1];
J_K=a'*a;
F_d=W.^(J_K)
% a= [ 2 3 ; 3 4 ];
% A=[a a*2 ; a.^2 a-2];
b=reshape(F_d,2,2,2,2,2,2,2,2);
c=permute(b,[1,5,2,6,3,7,4,8]);
d=reshape(c,4,4,4,4);
E=tt_matrix(b);
F=tt_tensor(d);
E.core'
F.core'
|
%
% draw the PCA score for different observations of Expression data,
%
function h = pca_analysis(score,batch_labels,tumor_labels)
legend_labels = {'1-tumor';'1-non-tumor'; ...
'2-tumor';'2-non-tumor'; ...
'3-tumor';'3-non-tumor'; ...
'4-tumor';'4-non-tumor'; ...
... |
function h = color_hist(img, n)
if size(img, 3) ~= 3
error('Not RGB image');
end
r = img(:,:,1);
g = img(:,:,2);
b = img(:,:,3);
h = [hist(r(:), n) hist(g(:), n) hist(b(:), n)];
h = h ./ norm(h);
end |
clear all
close all
clc
%%
load ('StatTable.mat');
mean_EXO_0 = mean(Table4Stat.iEMG_mean(Table4Stat.EXO == 1 & Table4Stat.Trial == 0 ,:));
std_EXO_0 = std(Table4Stat.iEMG_mean(Table4Stat.EXO == 1 & Table4Stat.Trial == 0 ,:));
mean_EXO_1 = mean(Table4Stat.iEMG_mean(Table4Stat.EXO == 1 & Table4Stat.Trial =... |
function lencomp=complen(x)
[m,n]=size(x);
x=reshape(x,m*n,1);
x = x-min(x);
symbols = unique(x);
%If image has only one color cant build hist
if(symbols==0)
symbols=1;
end
freq=hist(x,symbols);
p=freq/sum(freq);
dict=huffmandict(symbols,p);
lencomp=0;
lencomp=lencomp+nextpow2(max(x))*length... |
function avoid_obstacle(h,p1,p2,startAngle)
sensorsCurrentValues = [0;0;0;0;0;0;0;0];
calibrated=[3500,3;3900,3;3700,3;3900,3;3900,3;4000,3;4000,3;4000,3];
currentAngle=degtorad(startAngle);
lastPulsesNum = [0;0];
lastPlotPosition = p1;
c = getDistance(p1,p2);
angle = getAngle(p1, p2, startAngle);
impulses = getImpuls... |
%{
single iteration of mandelbrot set generation.
z0, z, c must be square matricies of same size.
c is the map for the mandelbrot set
k is the iteration number
%}
function [z, c] = step(z0, z, c, k)
z = z.^2 + z0; %generate next number in sequence
c(abs(z) < 2) = k; %update map for those pixels... |
function plotCaAmpByDistance(sheet, header)
% Code to parse header
% Need cell names, single amp, doublet amp, distance
requests = {'Cell','Condition','Distance','Amp. (single)','Amp. (train)','Obs/exp.'};
indices = parseHeader(header,requests);
cell_names = string({sheet{:,indices(1)}});
conditions = string({sheet{... |
function [sys,x0]=animation_poleCart(t, x, u, flag, ts); %u is [x theta]
% IPM Animation %
% ---------------- %
% DECLARATION PART %
% ---------------- %
% global variables
global hLEG hTYRE1 hTYRE2 hCART hGROUND % IPM Leg and Center of Mass
l = 1;
w = 0.7*l;
h... |
function z=extract2DHor(hor,x,y)
[val,k]=min(abs(hor(:,2)-y));
y=hor(k,2);
x1=hor(hor(:,2)==y,1);
z1=hor(hor(:,2)==y,3);
z=interp1(x1,z1,x,'linear','extrap');
end
|
%{
invoke the uigetfile2table function to bring in .csv data into a table
structure, call the table structure "data", when you call this function
pick any of the .csv files representing the data from a single drop which
are contained in the "03-18_CampRoberts\GoodNavData" directory
%}
data = uigetfile2table()... |
function [facts,values] = get_all_intervals(templ,slot,varargin)
fact = templ;
getme = slot;
if nargin>2
TALK = varargin{1};
else
TALK = true;
end
jess(['defquery REASONING::temp-query ' ...
'?f <- (' fact '( ' getme ' ?v)' ')']);
result = jess('run-query* temp-query');
... |
clear
clc
close all
%import the robot model for the simulation
load robot
%Model Coefficients
p1 = 0;
p2 = 30.79;
robot_width = 0.125;
wheel_radius = 0.021;
%time step
dt = 0.01;
%playback speed multiplier, something to make the simulation run a bit
%faster
play_speed = 1;
%PWM commands for l... |
%% Carregando o som
clear, close, clc
[y,Fs] = audioread('num02.wav');
f1 = 941;
f2 = 1336;
fa = 4000;
ta = 1/fa;
fim = 2;
t= 0:ta*2:fim-1;
w1 = sin(2*pi*f1*t);
w2 = sin(2*pi*f1*t);
wtot = w1 + w2;
%% Reproduzindo o som
%sound(y,Fs)
%% Visualizando o som no DT
time = [0:length(y)-1]'/Fs;
%figure(1),plot(t',wtot'... |
figNum = 1;
plotNames = {'p0','p1','p2','r0','r1','r2', ...
'backFB','backAxial','backLateral', ...
'rshldrPrism','rshldrElev','rshldrAbd','rshldrExtRot','relbowFlex','relbowSup', ...
'lshldrPrism','lshldrElev','lshldrAbd','lshldrExtRot','lelbowFlex','lelbowSup', ...
'... |
classdef person_with_shoes < handle
%PERSON_WITH_SHOES Summary of this class goes here
% Detailed explanation goes here
properties
x
y
theta
x_noise
y_noise
theta_noise
vx_int
vy_int
w_int
recovered_v
sigma_theta
... |
function [u0,energy,relmse,psnr_n]=CS_TV(Fp,Fmask,opts)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% min TV(u) s.t. RFu=f, where R is a subsampling matrix, and F is Fourier transform
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Fp: [M,N] complex matrix --------- given Fourier measur... |
% Starting in the top left corner of a 2×2 grid, and only being able to
% move to the right and down, there are exactly 6 routes to the bottom
% right corner.
%
% How many such routes are there through a 20×20 grid?
A = zeros(21);
A(1,:) = 1;
A(:,1) = 1;
A(1,1) = 0;
for i=2:21
for j=2:21
A(i,j) = A(i,j) +... |
function [g, Gr] = vertexOpt(u, v, structA, structC, structD)
I2x = structA.I2x;
w = structC.w;
fvert = structD.fvert;
DfvertDv = structD.DfvertDv;
d = 2;
% gradient
% (w x w) | compute weights for vertices
vweight = vWeight(structC);
% (w x w) | vertex residual at every point in window
f_k = fvert(u, v, structA, str... |
a=imread('aerial.bmp');
b1=zeros();
b2=zeros();
b3=zeros();
b4=zeros();
b5=zeros();
b6=zeros();
b7=zeros();
b8=zeros();
b9=zeros(256,256);
for m=1:256
for n=1:256
t=de2bi(a(m,n),8,'right-msb');
b1(m,n)=t(1,8);
b2(m,n)=t(1,7)*2;
b3(m,n)=t(1,6)*4;
b4(m,n)=t(1,5)*8;
b... |
function varargout = brf_cameraSettings(varargin)
% BRF_CAMERASETTINGS MATLAB code for brf_cameraSettings.fig
% BRF_CAMERASETTINGS, by itself, creates a new BRF_CAMERASETTINGS or raises the existing
% singleton*.
%
% H = BRF_CAMERASETTINGS returns the handle to a new BRF_CAMERASETTINGS or the handle to
%... |
% ---------------------------------------------------------
% dynReadMLC
% ---------------------------------------------------------
% Dynalog Analysis Package
% Michael Hughes 2010-2011
% ---------------------------------------------------------
% Reads in data from Varian MLC File to struct array. This
% struct is ge... |
%% LOCKIN SR830
%inicializo el lockin, conectado con la interfase USB - GPIB
li = gpib('ni',0,11);
%reconoce al generador
% gf = visa('ni','USB0::0x0699::0x0346::C036493::INSTR');
gf = gpib('ni',0,7);
%%
%abre la sesión con lockin
fopen(li);
%abre la sesión Visa de comunicación con el generador de funciones
... |
function [minVar] = VarBins(V1, V2, WIN)
% Outputs the vector with maximum number of greater variance bins as
% compared to the other vector.
ROW = size(V1,1);
COL = size(V1,2);
R_LEN = floor(ROW/WIN);
% TEMP1 = zeros(R_LEN,COL);
mV1 = 0;
mV2 = 0;
for i = 1:R_LEN
if (i*WIN < ROW)
x = V1(1 + (i-1)*WIN:WIN + ... |
train_imaging_spk = [];
test_imaging_spk = [];
for locs = 1:8
loc_inds{locs} = get_loc_inds(imaging_spk,locs);
trials = loc_inds{locs};
trials = shuffle(trials);
num_trials = length(loc_inds{locs});
num_train_trials = ceil(num_trials*.7);
num_test_trials = num_trials - num_train_trials;
trai... |
function [pctscore, reftable] = transform_percentile(d)
a = tabulate(d);
a(a(:,2)==0,:) = [];
pct = cumsum(a(:,3));
score = a(:,1);
[i,j] = ismember(d,score);
pctscore = pct(j);
reftable = [score pct];
end
|
function writeOutputResultToVtk( obj )
%WRITEOUTPUTRESULTTOVTK Summary of this function goes here
% Detailed explanation goes here
time = ncread(obj.filename{1},'time');
obj.OutputTime = time;
fprintf('Time of the output is:\n');
disp( obj.OutputTime );
fprintf('===============================\n');
for step = 1:numel... |
function E = rz( theta )
% rz 3x3 coordinate rotation (Z-axis)
% rz(theta) calculates the 3x3 rotational coordinate transform matrix from
% A to B coordinates, where coordinate frame B is rotated by an angle theta
% (radians) relative to frame A about their common Z axis.
c = cos(theta);
s = sin(theta);
... |
function [ processedData ] = dataProcessor_normRotAcc(processorInfo)
%Reed Gurchiek, 2018
%
%
%----------------------------------INPUTS----------------------------------
%
% processorInfo:
% struct. Fields:
% (1) data.(dataName(x)): 3xn, accelerometer data during static trial
% -fieldnam... |
function px=bldpx(px0,prnlist)
%
% Function bldpx
% ==============
%
% Build the constraint matrix for a list of PRN's. It actually starts
% with px=px0 and then keep destroying the matrix, eliminationg prns
% that are not in the prn list until the elements match with the prn
% list. The... |
%% Opdracht 8
% Maak een functie aan met de naam 'opdracht_8'.
%
% De input van deze functie bestaat uit twee vectoren.
% De eerste vector geef je de naam 'bovenbeen' en de tweede vector
% de naam 'onderbeen'.
%
% De output van de functie is de waarde van het laatste element
% van 'bovenbeen' gedeeld door het twee... |
function [ ] = ParseQSF( fname )
%ParseQSF Parse a qsf file and look for places to add names in loop fields
% Also spits out in legible, nested form
fid = fopen( fname, 'r' );
str = fscanf(fid, '%s');
inQuote = false;
curlyBracketDepth = 1;
for k = 1:length(str)
bDoCR = false;
if str(k) == '{'
cur... |
% Calulates the Average Mean Squared Error, MSE of an output dataset
% This function uses the first image of the set as reference and then
% runs the immse() function to compare each of the following images
%
% The final score can be used as an evaluation metric for the alignment
function [metrics, avg, total] = accur... |
function d = test()
n = 2^2;
x = [0:4*pi/n:4*pi];
x = x(1:end-1);
y = 0;
w = e^(-2*pi*i/n);
for j = 1:50
y = y + sin(j*x);
end
keyboard;
d = fft(y);
end
|
function [A,V,E1,E2]=zzsp_rs(A,V,n,l);
x=A(l+1,l+1);y=A(l,l);w=A(l,l+1)*A(l+1,l);p=(y-x)/2.;q=p^2+w;
if q<0.,E1=p+x;E2=sqrt(-q);
else z=sqrt(q);if p<0.,z=p-z;else z=p+z;end;if z==0.,r=0.;else r=-w/z;end;
if abs(x+z)>=abs(x+r),z=r;end;y=y-x-z;x=-z;t=A(l,l+1);u=A(l+1,l);
if (abs(y)+abs(u))<=(abs(t)+abs(x)),q=x;p=t;... |
function[loss,gradient]=logisticloss(y,p)
gradient= -1./(1+exp(-y'.*p)).*exp(-y'.*p).*(-y');
loss=sum(log(1+exp(-y'.*p)));
end
|
function [Sigma,bo] = integral_gaussian_product(gamma,sigma)
n = length(gamma);
A = zeros(n-1);
for i=2:n
for j=2:n
A(i-1,j-1) = (sigma(i)*sigma(j))^-2;
end
end
Sigma = diag(sigma(2:end).^-2) - A/sum(sigma.^-2);
bo = prod(gamma)/sqrt( ((2*pi)^(n-1)) * sum(sigma.^-2) * prod(sigma.^2) );
|
% пытаемся повторить опыт из л/р 6
fs = 1024;
f = 100;
% N = 10240;
T = 10;
t = 0:1/fs:T;
N = length(t);
s = sin(2*pi*f * t);
subplot(2,1,1); plot(t, s);
Nfft = 1024;
spf = abs( fft(s, Nfft) );
% for i = 1:length(sp)
% re = real( spf(i) );
% im = imag( spf(i) );
% sp(i) = sqrt( re*re + im*im )... |
classdef (ConstructOnLoad) Event < event.EventData
properties
EventData
end
methods
function event = Event(data)
event.EventData = data;
end
end
end
|
function arr = ensure_cell( arr )
% ENSURE_CELL -- Ensure an input is a cell array.
if ( ~iscell(arr) ), arr = { arr }; end;
end |
close all; clear all;
im1='demo.jpg'
OutputMap = analyze(im1);
for ii=1:length(OutputMap)
imagesc(OutputMap{ii});
pause;
end |
function D = apply_cluster_permutation(perm, D)
for i=1:numel(D)
D(i).data = D(i).data(:,perm);
D(i).fields = D(i).fields(perm);
end |
clear
load F:\地震数据\日本地震\处理结果\频散曲线\HKPS-QIZ\双台\earthquake1.25.txt
load F:\地震数据\日本地震\处理结果\频散曲线\HKPS-QIZ\双台\earthquake1.50.txt
load F:\地震数据\日本地震\处理结果\频散曲线\HKPS-QIZ\双台\earthquake2.25.txt
load F:\地震数据\日本地震\处理结果\频散曲线\HKPS-QIZ\双台\earthquake2.50.txt
load F:\地震数据\日本地震\处理结果\频散曲线\HKPS-QIZ\双台\earthquake3.25.txt
load F:\地震数据\日本地震\处... |
clc
clear all
load('database.dat','-mat');
ham = hamming(256);
mel = melfb_v2(20, 256, 8000);
word = (data_save(:,3));
% enum = unique(word_id, 'stable');
%% FILE .H
fid = fopen('dsp_coeffs.h','wt+');
fprintf(fid, '#ifndef __DSP_COEFFS_H\n');
fprintf(fid, '#define __DSP_COEFFS_H\n\n');
fprintf(fid, '#define WORD_NUM ... |
function testSystem = TPflashTest()
testSystem = neqsim.thermo.system.SystemSrkEos(290,10);
testSystem.addComponent('methane',1);
testSystem.createDatabase(1);
if nargin==1
display=1
end
testFlash = neqsim.thermodynamicOperations.ThermodynamicOperations(testSystem);
testFlash.TP... |
clearvars
close all
clc
res = napis_f5("napis",'a','s');
disp(res);
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Course: Understanding Deep Neural Networks
% Teacher: Zhang Yi
% Student:
% ID:
%
% Lab 7 - Sequence auto-complete
%
% Task:
% Design a multi-target outputs neural network to learn to complete sequence.
% The first two items of a sequence uniquely determine the rem... |
% Tao Du
% taodu@stanford.edu
% Mar 21, 2015
% Test readObjFromPascal.
% Clear.
clear all; clc;
PASCAL_ROOT = '/home/taodu/research/pascal/';
% Test the 3rd aeroplane model.
load([PASCAL_ROOT, 'CAD/aeroplane.mat']);
V = aeroplane(3).vertices;
F = aeroplane(3).faces;
% Now test readObjFromPascal.
[V2, F2] = readObjF... |
clc;
fprintf('============================[ Rayleightransientcirc.m ]============================\n\n');
fprintf('This example calculates the transient pressure field of a circular piston using a\n');
fprintf('transient version of the Rayleigh-Sommerfeld Integral. It outputs an animation of\n');
fprintf('the pressu... |
%% demo of indicator
% all numbers in functions are default value and optional.
clear;
clc;
close;
% doc ind;
load('Y:\24.pub-Strat\技术指标\ta_selector\indicator\sample_ind.mat');
%% accelerator oscillator
[ acVal ] = ind.aco( HighPrice , LowPrice, 5, 34 );
figure('name','aco');
subplot(2,1,1);
plot(Dates,ClosePrice)... |
% INGRESE EL MODELO EN MATLAB
clc
clear all
% Ingrese parametros
R=1;L=1;C=1;
% Ingrese matrices:
A=[0 1/L;-1/C -1/(R*C)];
B=[0; 1/(R*C)];C=[0 1];D=[0];
Cc=1;
cir1=ss(A,B,C,D) % State space (spacio de estado)
% RESPUESTA DEL SIST. CUANDO LA ENTRADA ES ESCALÓN UNITARIO
figure(1),step(cir1)
% RESPUESTA DEL SI... |
% This script fits a Linear Mixed Effect model to show the
% correlation between hit rate of RNN and rule encoding score predicted by linear
% regression classifier.
%% Load data table
clear;
load('../mats/SGD_table_RNN.mat')
SGD_table = array2table(SGD_table,...
'VariableNames',{'RNNid','pro','right','switches','h... |
function populatePPandRPT3d1(rptfile,betafile,smecfrfile)
nx=151;ox=649992;dx=100;
ny=151;oy=-19996;dy=100;
x=transpose(linspace(ox,ox+(nx-1)*dx,nx));
y=transpose(linspace(oy,oy+(ny-1)*dy,ny));
plio=textread('../surfaces/E-Dragon_Top_Pliocene_pts');
plio=plio*0.3048;
mio=textread('../surfaces/E-Dragon... |
function [word_list] = splitting_lines(input_line)
% splits a line into active words
% outputs the word list
% setting up some sets for the regular expressions
not_words = '[\s-+\*\/\(\)\[\]\{\}\;\:,\\\=]';
% must start with a letter
are_words = '[a-zA-Z][\w\.]*';
% duplicating up as the regexp command does not find... |
function new_population = genetic_mutation( population, fitness )
%Mutate the population
mut_select = zeros(1,2);
[mr,mc] = size(mut_select); %Get row and column value
[pr,pc] = size(population);
new_population = population;
for m = 1:mc
random_index_population = randi([1 pr],1,1);
number_of_mutts =... |
function [o1,o2] = plux( i1, i2 )
% plux compose/decompose Plucker coordinate transform.
% X=plux(E,r) and [E,r]=plux(X) compose a Plucker coordinate transform X
% from its component parts E and r, and decompose it into those parts,
% respectively. E is a 3x3 rotational coordinate transform and r is a 3D
% v... |
function [pos_err, ang_err] = errors(points, final_rot, target)
pos_err = points(:, end) - target(1:3)';
delta_quat = product(inverse(quaternion(target(4:end))), quaternion.rotationmatrix(final_rot));
[ang_err, axis] = AngleAxis(delta_quat);
if ang_err > pi
ang_err = ang_err - 2 * pi;
end
end
|
%% Clean-up Workspace
clc;
clear all;
%% Load Model Parameter
%ETHZ = 1
%Twente = 2
%Group = 3
Parameter_flag = 3;
syms m_s m_w m_b I_s I_b I_w r_s r_b r_w phi phi_dot phi_dotdot theta theta_dot theta_dotdot F t
if Parameter_flag == 1
Parameters_ETHZ
elseif Parameter_flag == 2
Parameters_Twente
elseif Param... |
% function [output] = AnalyzeVernier(SubjectDir, Conditions)
%========================= AnalyzeVernier.m ===============================
% Loads and analyses behavioural performance on the vernier accuity task
% from data stored in the matrix VernierData, which has the columnar
% organization:
% 1: Condition
... |
%Show execution of startup file
disp(' Executing startup.m in ./aux')
%adding paths
addpath(genpath('../plotting'))
%Plotting defaults
set(groot,'defaultLineLineWidth',1)%default line width
screen=get(0,'ScreenSize');
%default figure position
set(groot, 'defaultFigurePosition',[10 screen(4) - 10 720 540])
clear scr... |
function grad = Sobel(image,threshold)
im = imread(image);
im = rgb2gray(im);
mask=1/4.*fspecial('sobel'); %Sobel kerner
im2=conv2(double(im),mask,'same'); %convolution of the image and the sobel kerner for horizontal edges
im3=conv2(double(im),mask','same'); %convolution of the image and the sobel kerner for vertical ... |
function [rho,pval] = circ_corrcc2(alpha1, alpha2, w)
%
% [rho pval ts] = circ_corrcc(alpha1, alpha2)
% Circular correlation coefficient for two circular random variables.
%
% Input:
% alpha1 sample of angles in radians
% alpha2 sample of angles in radians
%
% Output:
% rho correlation coefficient... |
function chromaDiff = colorSimilarityEstimation(Cb,Cr)
[row,column] = size(Cb);
chromaDiff = zeros(row,column);
for i = 1:row
for j=1:column
chromaDiff(i,j) = abs(double(Cb(i,j)) - double(Cr(i,j)));
end
end
end
|
function [pic]=movie_maker_png(g,framenum1,framenum2,ff, pix1, pix2, pix3, pix4)
% framenum1,2 are the frames you want to start and stop the movie at
close all;
frame=framenum1:ff:framenum2;
for i=1:length(frame)
hold on
subplot(1,12,1);
plot(1,frame(i),'g.','MarkerSize',20);
xlim([0 2]); ylim([f... |
function [X, W] = incdD(l)
% incdD Return the points and weights of the increment delta_k.
%
% Author: Terrence Alsup
% Get the dimension.
d = length(l);
if d <= 1
if l == 1
[X, W] = cheb1D(l);
else
% Quadrature points will be the ones of the higher level.
[X, W] = cheb1D(l);
[... |
%% dos vs x
function re=dosdis(a,mu,Delta,Vz,alpha_R,dim,vimp,omega,delta)
% a=1;
ham=hdis(a,mu,Delta,Vz,alpha_R,dim,vimp);
% G=inv(full((omega+1i*delta)*speye(4*dim)-ham));
% re=-imag(trace(G))/pi;
K=(omega+1i*delta)*speye(4*dim)-ham;
Kv=eigs(K,40,0,'Tolerance',1e-5,'MaxIterations',20000);
re=-sum(imag(1./Kv))/pi;
en... |
close all
mu = 398600;
RE = 6378;
rLEO = RE+400;
rGEO = RE+35786;
aLUN = 384400;
rLUN1 = 362600;
rLUN2 = 405400;
bLUN = sqrt(rLUN1*rLUN2);
vLEO = sqrt(mu/rLEO);
vESC = sqrt(2*mu/rLEO);
vGEO = sqrt(mu/rGEO);
tGEO = 2*pi*sqrt(rGEO^3/mu); % 1 sidereal day
rVABi1 = (1+1)*RE; % inner Van Allen Belt starts at ~1,000 km alt... |
% Script M-File: LUfactNoPivot.m
% Written By: Christian Gruss
% Creation Date: 11/1/2016
%--------------------------------------------------------------------------------------------------------------------------------
% DISCLAIMER: All content of this file is the intellectual
% property of Christian Gruss. Any reprod... |
clear all;
N = 4; %order
Fp = 1000;
Wp = 2*pi*Fp; %passband edge angular frequency
[num,den] = butter(N,Wp,'s');
G = tf(num,den);
bode(G,'g'); |
%% Problem 3 : Program to solve ODE
%% d2m/dx2 + m =0
clc
clear all
close all
[X,M] = ode15s(@diff3,[0 3.142],[2 3]) % x values range from 0 to 3.1412
% M(1) : m , M(2) : dm/dx
% m(0)=2 , dm/dx(0)= 3
plot(X,M(:,1)) % plotting x vs m
xlabel('x');
ylabel('m(x)');
|
% RES = AICC(ACTUAL, EXPECTED, NPARAMETERS)
%
% Akaike Information Criteria with Correction
%
% ACTUAL - acctual value
% PREDICTED - predicted value
% NPARAMETERS - number of parameters in the model
% RES - AIC with correction, if error occurrs it's set to NaN
function res = aicc(actual, expected, nparameters)
... |
function [power_cost] = obj2(ChargingTimeMid, ChargingTimeNight, power_price)
power_cost = sum(ChargingTimeMid(:))*max(power_price)+ sum(ChargingTimeNight(:))*min(power_price);
end |
%% Loading an plotting of figures for paper on SKAB algorithm.
clear
%% Paths for loading
cdir = cd;
Figures_path1 = 'H:\MATLAB\DSTL\MASNET_Project\WINNER2';
Figures_path2 = 'C:\Users\pc202\Desktop\PatChambers\Autocorr\Results';
%% Load data
cd(Figures_path1);
AutoFigs = load('AutoFigs.mat');
R_auto_sim ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.