text stringlengths 8 6.12M |
|---|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Wenan Chen
%% September, 2007
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This function detection the lowest point of line stored in a 1*n vector
function x_coord_lowest=get_local_min(vec_line);
%% get the first oder derivative of the line.
%% for digital... |
clc;
% Read Image and prompt user for 4 points
imageOne = imread("inputs/h1.jpeg");
subplot(2, 2, 1), imshow(imageOne), ...
title("Select 4 Homography points from Image 1");
hold on;
imageTwo = imread("inputs/h2.jpeg");
subplot(2, 2, 2), imshow(imageTwo), ...
title("Select 4 Homography points from Image 2");
h... |
function vol = compute_cellvol(cells,nodes)
N = length(cells(:,1));
vol = zeros(N,1);
% Cell volume is summation of inner products of the face location
% and its face surface * normal
for iCell=1:N
n1 = nodes(cells(iCell,1),:); % corner 1
n2 = nodes(cells(iCell,2),:); % corner... |
%%spectrum for mass disorder
function [rev,re,randlist]=spec_massdis(a,mu,dim,sigma,randlist)
% a=1;
delta=0.2;
alpha=5;
vzlist=linspace(0,2.048,100);
nv=40;
en=zeros(nv,length(vzlist));
if randlist==0
randlist=(sigma*randn(dim,1)+1);
while (nnz(randlist<0)~=0)
randlist=(sigma*randn(dim,1)+1);
... |
function [errorValue, delta_V, delta_W] = trainNeuralNet(Input, Output, V, W, delta_V, delta_W)
% Train the Neural Network
% Calculating the Output of Input Layer
% No computation here.
% Output of Input Layer is same as the Input of Input Layer
Output_of_InputLayer = Input;
% Calculating Inpu... |
function [Rav rav t]=MW_proj_1
%% Dane projektowe
clc
global k1 Deff gamma em rm rpt R M
j=1;
jj=1;
dpm=0.5e-6; % [m]
rm=[10 20 40]*1e-9; % [m]
em=0.25; % [-]
tm=2.2; % [-]
rpt=[5 10 20]*1e-9; % [m]
fipt=0.05; % [uł. obj]
Ts=600; ... |
function [ price ] = dataNormalize( start_date,nDate,slice_seconds,path )
% dataNormalize 使股指期货隔夜时间序列连续
% start_date输入形式cell,默认为{'IF0Y00_20120104.mat'};
% nDate 自start_date开始,提取nDate天的数据
% path 默认路径为Y:\qdata\IF\intraday_bars_60s_daily\
%% 默认值和验参
if ~iscell(start_date)
error('start_date is not cell')
end
if ~exist... |
function [histequal] = myHistEq(I)
%% MYHISTEQ - This fuction performs Histogram Equalization of the given Image, I.
%
% Input : I - Input Image
%
% Output : histeq - Histogram Equalized Image
%% The Function starts here
[r,c]=size(I);% Read the size of Image
histequal=uint8(zeros(r,c)); % Intialize the Ou... |
function [RD_slbp_med,RD_slbp_std] = xu_SLBP_pairing(img_med,img_std,lbpRadius,lbpPoints,mapping,mode)
block_med = cirInterpSingleRadiusNew(img_med,lbpPoints,lbpRadius);
block_med = block_med';
block_std = cirInterpSingleRadiusNew(img_std,lbpPoints,lbpRadius);
block_std = block_std';
% blocks1=xu_prime_base(block_m... |
function [C] = getcosines_contigstatic( show, config )
%getcosines_contigstatic 200914
% re-hash of contigous cost matrix concept
% now the idea is we modify the cosine matrix in-place, and sum over
% we work on two conceptualizations, "past" and "future"
% past means we trace downwards from main diag, future acc... |
function w = OPdiffusion(u,R,S,Tsteps,tflag)
% OPdiffusion The forward computation and its adjoint for PRdiffusion
%
% w = OPdiffusion(u,R,S,Tfinal,Tsteps,tflag)
%
% Performs the forward computation or returns the problem dimensions.
%
% Input: u - the vector to be operated upon
% R,S - two matri... |
function d = start_std_greedy_over_GAMMA(m,d)
FN = '/Users/mladi/Desktop/GAMMA/';
FN_save = [FN 'Std_Err_Est_part/'];
K = blkdiag(d.LGG2,d.LGG2);
K1 = blkdiag(d.LGG2,0*d.LGG2);
K2 = blkdiag(0*d.LGG2,d.LGG2);
d.W = K;
data = load([FN 'PartSol/sol' num2str(1) '.mat']);
d.RB = [data.tru1;data.tru2];
d.RB_glob = [data.t... |
% visim_plot_kernel : plots VISIM simulations
%
% V=visim_plot_kernel(V,ivol)
%
function visim_plot_kernel(V,ivol,G,doPlot)
if nargin<4
doPlot=0;
end
if isstruct(V)~=1
V=read_visim(V);
end
if isfield(V,'fvolsum')
if (isfield(V.fvolsum,'data')==0)
V.fvolsum.data=read_eas(V.fvolsum.fname... |
function result = util_check_two_files_are_continuous_recording( filenames, timestamps )
%UTIL_CHECK_TWO_FILES_ARE_CONTINUOUS_RECORDING Check if the given two files
%are recorded continously (like ..., ...0001.mcd)
% Input:
% filenames: Cell array of filenames (used to compare their names)
% ... |
function matrix = get_matrix(inputArg2)
%GET_MATRIX 此处显示有关此函数的摘要
% 此处显示详细说明
matrix = [1,2,1,3,1,4,1,3,1,1,1,1,3,3,2,4,1,...
2,2,2,2,2,3,2,3,1,4,2,2,2,2,1,3,2,...
3,1,1,3,2,3,3,3,4,3,2,2,3,4,1,3,3,...
4,4,1,1,4,2,2,4,4,3,4,2,2,4,4,4,4];
end
|
function [lat, candidate] = makeCluster(lattice, coordinates, vacuumSize)
% $Rev: 584 $
% $Author: maxim $
% $Date: 2014-08-30 10:27:47 +0400 (Sat, 30 Aug 2014) $
% this function adds 'free space' to the cluster, evenly from all sides
lat = lattice;
coordinates = coordinates*lat;
lat(1,1) = lat(1,1) + vacuumSize;
l... |
function [fX, fnX] = rk4N(a, b, h, nfX0, dnfX)
if b <= a
error('b <= a!')
end
[fX, fnX] = rk4NWithoutPlot(a, b, h, nfX0, dnfX);
end
function [fX, fnX] = rk4NWithoutPlot(a, b, h, nfX0, dnfX)
x = a:h:b;
n = length(x);
order = length(nfX0);
fnX = NaN(order, n);
fnX(... |
remain = path;
diary('whichalloutput.txt');
while ~strcmp(remain,'')
[token, remain] = strtok(remain,':');
if isempty(strfind(token,'/Applications/MATLAB_R20'))
dircontents = dir([token '/*.m']);
disp(['FOLDER: ' token]);
disp('=======');
%First entry in MATLAB toolbox folde... |
function y = f_Bruss(t,x,param)
a = param(1) ; mu = param(2);
y(1,1) = a -(mu+1)*x(1)+x(1)^2*x(2) ;
y(2,1) = mu*x(1)-x(1)^2*x(2) ; |
%% Implementation of the Orthogonal Matching Pursuit Algorithm
function theta = myOMP(y,A,iter)
[~,n] = size(A);
r = y;
theta = zeros(n,1);
T = false(n,1);
A_norm = A ./ sqrt(sum(A.*A)); %This won't work in older versions of matlab. sigh
%A_norm = normc(A);
for i = 1:iter
[~,j] = max(abs(r' * A_norm));
T(j... |
function X_baseframe = mycircle()
% generate a circle
angles = linspace(0,2*pi,100);
radius = 50;
X_workspace = ones(3,100);
X_workspace(1,:) = 620 + radius * sin(angles);
X_workspace(2,:) = 0 + radius * cos(angles);
X_workspace(3,:) = X_workspace(3,:)*1.5;
% transform every co... |
classdef DynamixelType
enumeration
XH430_W210
XM540_W150
PRO_M54_60_S250
RH_P12_RN
PRO_H54P_200_S500
end
end |
function [ C_inf, I ] = metric_rectification4( C, l ,Iloc )
%{
performs metric rectification on an image at location "Iloc"
by calculating C_infinity_star' using the paper
"planar metric rectification by algebraically estimating
the image of the absolute conic" by Yisong Chen & Horace S Ip
Assumption: C is an already... |
%
% D_TS_METOFFICE: Driver script to create a 4D-Var T,S observations file.
%
% This a user modifiable script that can be used to prepare ROMS 4D-Var
% SST observations NetCDF file. The T,S data is extracted from the UK
% Met office Hadley Centre, quality controlled, EN3 observation datasets.
% It uses the script... |
function [f]=twodsin2(A,u,v,allocate)
if allocate
f=zeros(512,512);
end
[X,Y]=meshgrid(1:512,1:512);
f=A*sin(u*X+v*Y); |
function [Q_tab,policy,S,A,R,WCL_3,WCL,Irrigation,Irrigation_3,runoff,ET_simu] = TestCode(ET,Precipitation)
corn_price = 3.6;
water_price =2.2;
Q_tab = zeros(20,4);
Q_tab(21,:) = 0;
Q_tab_record = ones(21,4);
e_tab = zeros(20,4);
%policy = updatePolicy(Q_tab);
%policy_record = zeros(1,20);
alfa = 0.05;
gama = 0.9;
th... |
%% Exercise 6:
% The goal of this exercise is to implement a Classification And Regression
% Tree (CART). To reduce some of the disadvantages (like overfitting, low
% prediction accuracy, ...) ensemble methods (boosting, bagging) can be
% used. One common algorithm for a CART with bagging is the random forest.
%
% INF... |
function y_dist_map = y_dist_map_vector(bw, num_of_lines, length, width, start_column_idx, end_column_idx, start_row_idx, end_row_idx)
gap = floor(width / (num_of_lines + 1));
i = start_column_idx + gap;
y_dist_map = zeros(1,num_of_lines);
count = 1;
while count <= num_of_lines
target_row = bw(:,i);
%i
%l... |
[home_dir, lab_dir, current_dir, tmat_dir] = dirnames;
cd(current_dir)
clear home_dir lab_dir current_dir tmat_dir
|
% ejercicio 1.10: Operación de extensión
% EJERCICIOS RESUELTOS DE VISIÓN POR COMPUTADOR
% Autores: Gonzalo Pajares y Jesús Manuel de la Cruz
% Copyright RA-MA, 2007
% Ejercicio 1.10: Representación de imágenes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1.6.4 Operaciones sobre... |
function [subSets, getCodons, codonTbl, codonCtg ] = getCodonSubsets(varargin)
% [subSets, getCodons, codonTbl, codonCtg ] = getCodonSubsets('v1')
p = inputParser;
addOptional(p, 'Version', 'v1', @istext);
parse(p, varargin{:});
[~, codonTbl] = getCodonNames(p.Results.Version);
[~, codonCtg] =findgroups(string(c... |
clear all
close all
name_site={'AUSTRALIA1','BENIN','ITALY','NIGER','USA1','USA2','USA3','USA4'};
%P=[rain_insitu,rain_trmm_rt,rain_cmorph_rt,rain_cmorph_gc];
%SMOS=[SMOS;time_smos,smos_SM,smos_DQX,smos_RFI,smos_ORBIT];
for ll=1:length(name_site);
load([name_site{ll},'_data_v1'])
%% DQX
%The Data Qualit... |
% Assignment-3.2 Mass Spring Damper System
clear all;
clc;
% Constants
c = 1; % Damping Constants
m = 0; % Mass
k = 2; % Spring Constant
F = 1; % Force
% Inputs
h = 0.1; % Step Size
t_final = 100; % Final Time
N = t_final/h; % No. of Steps
% Initial Conditio... |
M = [0,1,0;0,0,2;0,0,0];
names = {'A','B','C'};
BG = biograph(M,names);
BG.Nodes(1).Position = [100,100];
BG.Nodes(2).Position = [200,100];
BG.Nodes(3).Position = [300,200];
BG.Nodes(3).Label = names{3};
BG.Edges(1)
BG.Edges(1)
|
function [algData, algNames, algColors] = loadCompAlg(path, funcSet, algs)
% [algData, algNames, algColors] = loadCompAlg(path, funcSet, algs) loads
% data names and colors of compared algorithms for functions and dimensions
% given.
%
% Input:
% path - path to file containing reference algorithms' data | string |... |
%Sistemas de ecuaciones no lineales 2x2
%metodo de broyden
%Luis Mario Urrea Murillo
%Codigo 4072011 Universidad Cooperativa de Coolombia
function y = Broyden2x2
syms x1 x2
x0=input('Digite un vector fila con los valores iniciales de x0= '); %ecuación x0
TOL=input('Tolerancia del sistema= ');
f(1)= input(... |
function [netout options] = sgd(net, options, x, t)
% The learning supports mini batches, momentum and weight decay.
% Jonathan Masci <jonathan.masci@gmail.com>
if isempty(options)
options.nepochs = 1;
options.lrate = 0.001;
options.lratedecay = 0.97;
options.momentum = 0.9;
options.minibatch = ... |
function plotModel(axes, selection, results)
%TODO: handle arrays of selections with multple plots
title(axes, selection)
disp("plotModel()");
disp(selection);
switch(selection)
case 'Output1'
disp("plotting Output1")
cla(axes);
% ... do whatever with the Resu... |
function [err,rcor] = mean_sq_error(y,z)
% Normalised mean squared error and correlation coefficient
% [err,rcor] = mean_sq_error(y,z)
%
% err = sum((y-z).^2)/sum((y - <y>).^2)
% rcor = sum((y - <y>).*(z - <z>))/sqrt(sum((y-<y>).^2)*sum((z-<z>).^2))
% GoF = 1 - err
[N,T,Ntr] = size(y);
y = reshape(y,[N,... |
function result = matchEllipses(f1, f2, varargin)
% EVALFRAMESTABILITY
%
% EVAL.NEIGH : for each F2 frame, the list of F1 neighbors
%
% If no rescaling is applied the function is symmetric.
%
% With rescaling, the frames of F2 are used to fix the scaling factors.
%
% Author:: Andrea Vedaldi
import affineDetectors.... |
A=[1 2 3; -8 5 7; -8 4 6];
B=[12 -5 4; 7 11 6; 1 8 13];
C=[7 13 4; -2 8 -5; 9 -6 11];
% (a) A+B = B+A
show(A+B, B+A);
% (b) A+(B+C)=(A+B)*C
show(A+(B+C), (A+B)*C);
% (c) 7*(A+C)=7*(A)+7*(C)
show(7*(A+C), 7*(A)+7*(C));
% (d) A*(B+C)=A*B+A*C
show(A*(B+C), A*B+A*C);
function show(A, B)
if all(A == B)
disp... |
% EJERCICIOS RESUELTOS DE VISIÓN POR COMPUTADOR
% Autores: Gonzalo Pajares y Jesús Manuel de la Cruz
% Copyright RA-MA, 2007
% Ejercicio 7.9: Extracción de bordes, regiones y puntos de interés
% Representación gráfica de la máscara LoG
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
... |
clear % clear variables
rand('seed', 1994); % seed random number generator
load('usps_modified.mat'); % load x and y data into variable called data
[x, y] = getfeatures(data); % extract symmetry and ... |
function [X]=updateX(X,Y,Ytn,T,Set)
dY=Y.DataOrdered-Ytn(1:Set.NumMainV,:);
nC=zeros(size(X,1),1);
dX=zeros(size(X));
for t=1:size(T.DataOrdered,1)
if T.NotEmpty(t)
for n=1:4
dX(T.DataRow(t,n),:)=dX(T.DataRow(t,n),:)+dY(t,:);
nC(T.DataRow(t,n))=nC(T.DataRow(t,n))+1;
end
... |
c=Circuit();
c.AddVSource(10,1,3);
c.AddResistor(1000,1,2);
c.AddResistor(1500,2,3);
c.AddResistor(1000,2,3);
c.SetGround(3);
c.MakeEquations();
|
%%%%%%%%%%%%%%%%%%%%
% 対象:ワイヤターゲット,境界厚さ:2mm~19mm
% 設定音速:1580[m/s]=正解音速
% 焦点水平位置固定:y=0
% 境界位置:既知
% IMCL割合を0 %に固定する.
% 波面遅延プロファイルにより音速推定
% 素子間受信波時間差は実信号の正規化相互相関を用いる
% 内挿処理は行わない.
%%%%%%%%%%%%%%%%%%%%
%% 初期設定(共通)
clear
dst_path = sprintf('H:/result/2018_12_06_IMCL_direct_estimation/2layer/2018_12_11_rawsignal_corr');
if ~... |
list = [14,30,36,31,20,9,22,1,62,10];
newton = [];
adam = [];
ori = [];
for id = 1:length(list)
img = concat(id-1, list(id),'newton');
newton = [newton; img];
img = concat(id-1, list(id),'adam');
adam = [adam; img];
if id ~= 1
img = imread(['res_adjust/adam/img' int2str(list(id)) '_target_... |
function [A_k S] = task4(image, k)
A = imread(image);
A = double(A);
[m n] = size(A);
mniu = zeros(m, 1);
Z = zeros(m, m);
for i = 1 : m
mniu(i, 1) = sum(A(i,:)) / n;
endfor
A = A - mniu;
Z = A * (A'/(n - 1));
[V S] = eig(Z);
for h = 1 : k
W(:, h) = (V(:, h));
endfor
Y ... |
data = load_data();
X = data(:,1:2);
y = data(:,3);
plot_lwlr(X, y, 0.01, 40);
plot_lwlr(X, y, 0.05, 40);
plot_lwlr(X, y, 0.1, 40);
plot_lwlr(X, y, 0.5, 40);
plot_lwlr(X, y, 1, 40);
plot_lwlr(X, y, 5, 40);
|
function CoGs = CoGPositions(s1,phi1,theta,s2,phi2,x2,y2,g,k1,k2,L_sp0,L_mB,mB,IB,m1)
%COGPOSITIONS
% COGS = COGPOSITIONS(S1,PHI1,THETA,S2,PHI2,X2,Y2,G,K1,K2,L_SP0,L_MB,MB,IB,M1)
% This function was generated by the Symbolic Math Toolbox version 7.1.
% 14-Jan-2017 12:59:25
t2 = sin(phi2);
t3 = phi1+phi2-thet... |
%% Intialization
clc
clear all
N=1000;
Alpha=2;
D=2;
Mu0=zeros(1,D); % Prior mean for cluster Mu
Sig0=1*eye(D); % Prior covariance matrix for cluster Mu
Sig=0.010*eye(D); % Prior covariance matrix for data point
Bet=[];
Pi=[];
Mu={};
X=[];
k=0;
%% Dirichlet Process Mixture Model
for n=1:N
... |
function [ inifil, finfil, inicol, fincol ] = getMaskLimits( mask )
[fils,cols]=find(mask);
inifil=min(fils);
finfil=max(fils);
inicol=min(cols);
fincol=max(cols);
end
|
function triggerTime = identifyTriggerTime_tattooPaw( video, BGimg_ud, rat_metadata, session_mp, cameraParams, varargin )
%
% INPUTS:
% video - a VideoReader object for the relevant video
% BGimg_ud - undistorted background image
% rat_metadata -
%
% VARARGs:
% pawgraylevels -
% pixelcountthreshold -
% f... |
% Methode zur Berechnung der Kapazitaet eines Plattenkondensators
%
% Eingabe
% mesh kartesisches Gitter, wie es von cartMesh erzeugt wird.
% ebow Ein Vektor nach dem kanonischen Indizierungsprinzip,
% gefllt mit den elektrischen Gitterspannungen.
% dbow Ein Vektor n... |
function imaget=mytry6(imaget)
I=imaget;
[row,col,dep]=size(I);
I3=zeros(row,col);
for i=1:row
for j=1:col
x=i; %水平镜像变换x的值不变
y=col-j+1; %镜像变换后y的值
I3(x,y)=I(i,j);
end
end
%figure,subplot(1,2,1)... |
function [ xs, mu, sig] = standardize( x, varargin)
% z-score transformation of x colum wise
centeronly = setParam(varargin, 'centeronly', false);
mu = setParam(varargin, 'mu', mean(x));
sig = setParam(varargin, 'std', std(x));
xs = bsxfun(@minus, x, mu);
if ~centeronly
xs = bsxfun(@rdivide, xs, sig);
end
end
|
lamata=0.5
trainnum=100
X=rand(1,trainnum);
Y=sin(X);
G=zeros(10,10);
b=zeros(10,1)
Gtemp=zeros(10,10);
for i=1:10
for j=1:10
for l=1:100
Gtemp(i,j)=Gtemp(i,j)+X(1,l)^(i+j-2);
end
end
end
for i=1:10
for j=1:10
G(i,j)=Gtemp(i,j)/2*trainnum
if i==j
G(i,j)=G(i,j)+lamata;
end
end
end
for i=1:10 %一次项系... |
function [pix_itn,mean_intensity]=sub_intensity(I,B)
for k = 1:length(B)
% B{k} The set of pixels in a boundary
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'w', 'LineWidth', 2);
b_r=boundary(:,1);
b_c=boundary(:,2);
% get the position of cell
% pos: The median v... |
function res = rats(t, y)
plot(t,y,'bo');
a = 0.01;
omega = 2 * pi / 365;
res = a * y * (1 + sin(omega * t));
%res = a * y * (0.5 + sin(omega * t)); zgx: original
end
|
function Colored(flag, corr)
% Kalman filter simulation with colored (time correlated) measurement noise.
% INPUTS:
% flag = 0 means ignore the time correlation of the measurement noise
% 1 means augment the system state
% 2 means use the Bryson/Henrikson approach
% corr = magnitude of... |
function [] = freesound()
% dataDir = './data/freesound/';
dataDir = '/Volumes/ALEX/data/freesound/';
%-The elements of the Freesound API call
base_url = 'http://www.freesound.org/api/sounds/search';
api_key = 'api_key=1395cec077e84d27b1f71d6e16410ffe';
query = 'q=';
and = '&';
quest = '?';
format = 'fo... |
%% Initialization
clear ; close all; clc
addpath('./libsvm-3.22/matlab');
%% ==================== Part 1: linear SVM ====================
%% 加载数据
[train_y, train_x] = libsvmread('ex8a.txt');
gamma = 0.21;
%% 获取大小
[m,n] = size(train_x);
model = svmtrain(train_y, train_x, sprintf('-s 0 -t 2 -g %g', gamma));
fprintf('... |
disp('Hmatrix.mat Start');
clear all;
load n.mat;
nx=nx/2;ny=ny/2;nz=nz/2;
load CubicSize.mat;
Eg = 3.5;
Delta1 = 0.022;
Delta2 = 0.005;
Delta3 = 0.005;
A1 = -7.24;
A2 = -0.51;
A3 = 6.73;
A4 = -3.36;
A5 = -3.35;
A6 = -4.72;
D1 = 0.7;
D2 = 2.1;
D3 = 1.4;
D4 = -0.7;
D5 = -0.7;
D6 = 1.4;
m0 = 9.1095e-... |
clc
clear
%% Dane
% %Wiktor
% t = [10 30 50 70 100];
% ca0 = 2.5;
% ca = [2.05 1.42 1.02 0.75 0.49];
% alfa = [0.178 0.430 0.592 0.701 0.804];
% n = [1.01:0.001:1.4];
%Antke
t = [10 30 50 70 100];
ca0 = 3;
ca = [2.04 1.21 0.84 0.64 0.46];
% alfa = [0.083 0.241 0.388 0.524 0.704];
n = 1.6:0.01:2.1;
... |
function [ AvalsX, AvalsY, AvalsZ ] = QuintPoly( )
for i = 2:2:4
QuinticMatrix = [1 (i-2) (i-2)^2 (i-2)^3 (i-2)^4 (i-2)^5;
0 1 2*(i-2) 3*(i-2)^2 4*(i-2)^3 5*(i-2)^4;
0 0 2 6*(i-2) 12*(i-2)^2 20*(i-2)^3;
1 i i^2 i^3 i^4 i^5;
0 1 2*i 3*i... |
% dat2info wrapper script (including saving files)
[filename, folder] = uigetfile('G:\', '', '', 'multiselect', 'on');
if ~iscell(filename)
filename = {filename};
end
nFiles = length(filename);
for iFile = 1:nFiles
allInfos = dat2info(fullfile(folder, filename{iFile}));
nInfos = length(allInfos);
for... |
function [Obj,V,Est,PEst] = oolik(LogDetF,PeFiPe,MtFiM,MtFiPe,NObs,Opt)
% oolik [Not a public function] Estimate out-of-lik parameters and sum up log-likelihood function components.
%
% Backend IRIS function.
% No help provided.
% -IRIS Macroeconomic Modeling Toolbox.
% -Copyright (c) 2007-2017 IRIS Solutions ... |
function [] = rplot2(Date1, nav1, Date2, nav2)
% 给出两列基金净值和数值格式的时间,做出净值对比图
% ----------------------------------------------
% 唐一鑫 08/01/2015
h = plot(Date1, nav1, Date2, nav2);
grid on
set(h(1),'color','r','linewidth',2);
set(h(2),'color','b','linewidth',2);
set(gca,'XTick',29)
datetick('x',29);
set(gca,'xlim',[min(D... |
function enc = matrix_diff(mat)
[LL ,LH, HL, HH] = dwt2(mat,'haar');
enc1 = LL(size(LL,1),size(LL,2));
enc2 = LL(1,1);
enc = ((enc1+enc2)/2);
end |
%% **************************************************
%
% Example 3D-FDTD code to simulate scattering
%
% v1.0 - July 2015
%
% Jonathan Sheaffer, Ben-Gurion University, Israel
% Trevor Cox, University of Salford, UK
%
clear
close
clc
%% **************************************************
% DEFINE SIMULATION PARAMETE... |
function [] = saveFig(fig, name)
size = [9 4] * 1.5;
fig.PaperUnits = 'inches';
set(fig,'PaperSize',size);
set(fig,'Position',[[10 10] size*100]);
% fig.PaperPosition = [[0 0] size];
% set(fig,'PaperOrientation','landscape');
% set(fig, 'PaperPositionMode','Au... |
function FiltSignal=gaussFilter(SD, inSignal)
flgRawSig=0;
if size(inSignal,1)< size(inSignal,2) % make sure it is column vector
inSignal=inSignal';
flgRawSig=1;
end
filtwidth=8*SD; % filter width
b=fspecial('gaussian',[1,filtwidth],SD); % generate filter coefficients
PadSignal=[repmat(mean(inSignal(1... |
classdef fitpanel < handle
% Line Profile Browser Class
properties
% Parent imagesobject
Parent
% Handles
figureHandle
% UI Controls
fitButton
fitParameterTable
fitEquationTable
variablesTable
end
% Figure file: fitpanelgui.m
%
methods
... |
classdef sliceMER < handle
%SLICEMER Slice for Mass Eruption Rate sim
properties
diameter = 30; % m
height = 0; % m
enu = 3000; % (1x3 m)
mass = 100; % g
velocity = [0,0,10]; % m/s
end
methods
... |
[x,y] = meshgrid(-2:.1:2);
z1 = g(x+y-1.5);
z2 = g(x+y-0.5);
z = g(z2-z1-0.5);
mesh(x,y,z) |
function [J, grad] = linearRegCostFunction(X, y, theta, lambda)
%LINEARREGCOSTFUNCTION Compute cost and gradient for regularized linear
%regression with multiple variables
% [J, grad] = LINEARREGCOSTFUNCTION(X, y, theta, lambda) computes the
% cost of using theta as the parameter for linear regression to fit the ... |
function [features, setLabels] = featureEx(imds, hogFeatureSize, cellSize)
% Extract HOG features from an imageDatastore.
setLabels = imds.Labels;
numImages = numel(imds.Files);
features = zeros(numImages, hogFeatureSize, 'single');
% Process each image and extract features
for j = 1:numImages
img = readimage(im... |
r = randi([1 500],1,10000);
data = r;
%insert bipolar montage here
%Step 1 - filtering bandpass-filtfilt
d1 = designfilt('bandpassfir','FilterOrder',64,'CutoffFrequency1',80,'CutoffFrequency2',500,'SampleRate',2048);
y = filtfilt(d1,data)
plot(r)
plot(y)
spectrogram(r)
spectrogram(y)
%%
%step 2 and 3
%standard de... |
% Code to generate 128X128 images from 256X256 images in the original data
% set. Run the code once and save the data.
clc;
clear;
dataDir= './data/wallpapers/';
checkpointDir = 'modelCheckpoints';
rng(1) % For reproducibility
Symmetry_Groups = {'P1', 'P2', 'PM' ,'PG', 'CM', 'PMM', 'PMG', 'PGG', 'CMM',...
... |
%%new approach: resample data and design onto 0.2s tr grid
r1 = single(hdf5read('/Volumes/Serena/MMClock/MR_Proc/10711_20140826/mni_5mm_wavelet/glmdenoise_test/r1.h5','run1'));
r2 = single(hdf5read('/Volumes/Serena/MMClock/MR_Proc/10711_20140826/mni_5mm_wavelet/glmdenoise_test/r2.h5','run2'));
r3 = single(hdf5read('/V... |
load('possi_table.mat');
load('mytable.mat');
load('mytable_num.mat');
load('final_table.mat');
final_table = final_table/sum(sum(sum(final_table)));
global a_label;
global range_label;
global range_rate_label;
global v_label;
a_label = -4:0.2:2;
range_label = 0:5:115;
range_rate_label = -10:1:8;
v_label = 20:1:40;
lo... |
dane = csvread('wig20.csv')
zamkniecie = dane(2:end,5);
zamkniecie = zamkniecie' #transpozycja żeby lenght działało poprawnie
data = [1:1:length(zamkniecie)]; #zamiast odczytywać daty tworzę tablicę od 1 do ilości pomiarów - do prezentacji wykresu
apro_1 = polyfit(data,zamkniecie,1); #wielomian pierwszego stopnia
apro... |
function fields = get(this, varargin)
for i = 1:length(varargin)
fieldName = varargin{i};
fields(i) = this.ref.(fieldName);
end |
function data = create_cost_table
global zeResult;
j = global_jess_engine();
c = j.getGlobalContext();
data = cell(100,10);
% Cost model
% [num,txt,raw] = xlsread(params.master_xls,'Output');
% headers = txt(:,1);
% Cost model
% Ground segment cost
data(1,2:4) = {'Total', ... |
%%
%experiment3
%edit by gzf 1219
%STEP3:Relation-based LDA
%%
% Content-based LDA
% 参数准备
load('../Record.mat');
load('STEP2DATA.mat');
[WS, DS] = importworddoccounts('step2_wordcount_ssRelationLeft.txt'); %利用importworddoccounts读入所需参数
%使用清洗过的数据
%WO为service列表
%选取存在引用关系的service作为词典
%这些service在总的service下的编号记录在leftS... |
function [output_rdata,output_data_sign,output_genes]= deletezero(rdata,data_sign,genes)
index = find(sum(rdata,2)~=0);
output_rdata = rdata(index,:);
output_data_sign = data_sign(index);
output_genes = genes(index);
end |
function [ markov ] = markovMatrix( codedData )
% This function calculates the Markov probability matrix for the coded data
% Get the number of data points
N = length(codedData);
% Get the number of unique elements (the alphabet length)
index = unique(codedData);
alpha = length(index);
... |
function [] = simulation_tpa_nondegenerate(l,pump1_l,pump2_l,pump1,pump2)
sig_gain1 = 0;
sig_gain2 = 0;
sig_gain3 = 0;
sig_gain4 = 0;
x_vec1 = zeros(1,101);
x_vec2 = zeros(1,101);
x_vec3 = zeros(1,101);
x_vec4 = zeros(1,101);
s_gain1 = zeros(1,101);
s_gain2 = zeros(1,101);
s_... |
%Program 12.1 Power Iteration
%Computes dominant egienvector of sqaure matrix
%Input: matrix A, intial (nonzero) vector x, number od steps k
%Output: dominant eigenvalue lam, eigenvector x
function [lam x k] = mypowerit(A, x, tol)
oldLam=1;
lam=-5;
k=1;
while abs(oldLam-lam)> tol && k <1000
k=k+1;
oldLam=lam;
... |
%% Build the Design Matrix
%% experiment date: 10.26.09
TR = 4;
duration = 1144;
% 150 * TR;
% add three seconds for instructions on each trial
%shifts = [1:5]*3;
one_on = [
13
66
303
380
681
1046 ] -8;
one_dur = [
48
96
72
48
72
96];
four_on = [
167
468
604
758
870
958 ] -8 ;
four_dur = [
96
... |
function I2 = circshift2(I, K)
% Shifts the contents of the image by K(1) rows down and K(2) columns left
% and replaces the shifted rows and columns with zeros.
%
% Parameters
% ----------
% I : Image to be shifted
% K : [K(1), K(2)]
%
% Returns
% -------
% I2 : The shifted ... |
% ADVISOR data file: ESS_NIMH28_OVONIC.m
%
% Data source:
% Dennis Corrigan, Vice President of EV Battery Systems, Ovonic
%
% Data confirmation:
% Data provided by manufacturer.
%
% Notes: These are designed to be a high power, intermediate energy battery.
% Cell type = M70
% Nominal Voltage = 6V
% Nominal Capacity (... |
function [M, G] = mean_from_harmonics(a_vec, j_0, s0, L)
% Evaluate the mean of the volume from volume expansion coefficients.
% See reconstruct_from_clean_autocorrs_script.m for example usage.
%
% Inputs:
% * a_vec: vecotrized volume expansion coefficients
% * j_0: cell array of zeroth-order spherical bessel func... |
function [theta, phi] = lonlat2thetaphi(lon, lat)
%lonlat2thetaphi(lon, lat)
%Transform longitude and latitude (deg) into co-latitude and longitude (rad)
%
%Inputs:
%lon: Longitude in degrees
%lat: Latitude in degrees
%
%Outputs:
%theta, phi: Co-latitude and longitude in radians
theta = pi/2 - (lat * pi/180);
phi =... |
function [AA,BB,CC,DD,Gs,Go,Gi,dim,m0]=scbraw(A,B,C,D,tol)
%SCBRAW Special Coordinate Basis in a Raw Form
%
% [As,Bt,Ct,Dt,Gms,Gmo,Gmi,dim] = scbraw(A,B,C,D)
%
% decomposes a proper system characterized by (A,B,C,D) into
% a raw SCB form without separating state subspace x_d into
% ... |
function [ ] = makePTdiagram( P,T,Status )
n = 500;
F = TriScatteredInterp(P,T,Status);
T0 = linspace(min(T),max(T) , n);
P0 = linspace(min(P),max(P), n);
[p, t] = meshgrid(P0, T0);
stat = F(p,t);
mesh(p,t,stat);
view([0 90]);
xlim ([min(P) max(P)])
ylim ([min(T) max(T)])
xlabel('Pressure','FontWeight', 'bo... |
function data_simple = make_simple_plot_data()
full_filename = fullfile(fileparts(which('data_anscombe.mat')),'data_simple.mat');
if exist(full_filename, 'file')
fprintf('Data already exists. Loading available data.\n');
load(full_filename);
fprintf('Done.\n');
else
... |
% ISNVP - Checks whether or not a cell array could consist of name/value pairs.
%
% ISNVP tries to determine if the inputted cell array could be a vector of name/value pairs (NVPs). NVPs are frequently
% employed as a convenience in functions that would otherwise have long lists of optional input arguments.
%
% NVP pr... |
function ExtractWordPartsFromFile( setPath, wordFileName, outputFolderPath)
%EXTRACTWORDPARTSFROMFILE Summary of this function goes here
% Detailed explanation goes here
%wordFileName = '1231874627010';
%setPath = 'C:\Users\kour\OCRData Old\Archieve\adab_database_v1.0\Data\set_1\';
inkmlPath = [setPath,'\inkml... |
function [ aoicoords ] = getaoicoords( mask ,pxva, stdva )
if nargin < 3, stdva=2; end
if nargin < 2, pxva=40; end
[y,x]=find(mask(:,:,1)>0);
pxstd=pxva*stdva;
xmin=(min(x)-pxstd)/size(mask,2);
xmax=(max(x)+pxstd)/size(mask,2);
% xdist=xmax-xmin;
% xmin=xmin-(xdist*0.5);
% xmax=xm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.