plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | endsley/ml_examples-master | generate_distribution.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/generate_distribution.m | 903 | utf_8 | e26f8302bdbd1554db22be1edbeddd7b |
function [y_total, y_normalized] = generate_distribution(N, sigma, sigma_2, x1,y1)
epsilon = 0.000001;
% Create original y
A = [ones(length(x1),1) x1 x1.^2 x1.^3 x1.^4 x1.^5 x1.^6];
[q r] = qr(A);
coef = r\(q'*y1);
x_lower = min(x1);
x_upper = max(x1);
x = [0:99]';
A = [ones(length(x),1) x x.^2 x.^3 x.^4 x... |
github | endsley/ml_examples-master | plot_cluster_results.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/plot_cluster_results.m | 1,476 | utf_8 | 774fc7a277f2c7777aba45dee48e78ee |
%function plot_cluster_results(x, assignment, data, N, figure_id)
% dot_type = '';
%
% figure(figure_id);
% hold on;
% for m = 1:N
% if(assignment(m) == 1)
% %printf('plot 1\n')
% plot(x, data(:, m),['r' dot_type]);
% elseif(assignment(m) == 2)
% %printf('plot 2\n')
% plot(x, data(:, m),['g' dot_type]);
% e... |
github | endsley/ml_examples-master | proximity_reduction.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/proximity_reduction.m | 141 | utf_8 | 99b9e614045a80ec8e073989d2a106d1 |
% find points that are within epsilon
function proximity_reduction(A, epsilon)
[row,col] = find(A == 1);
points = [row,col];
points
end
|
github | endsley/ml_examples-master | conv_to_freq.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/conv_to_freq.m | 233 | utf_8 | c29f3919650b52547290a03e9081b762 |
function fft_out = conv_to_freq(data, start_freq, end_freq)
fft_dat = abs(fft(data));
start_bin = floor(start_freq*size(fft_dat,1)) + 1;
end_bin = floor(end_freq*size(fft_dat,1)/2);
fft_out = fft_dat(start_bin:end_bin, :);
end
|
github | endsley/ml_examples-master | get_KL_in_Time.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/get_KL_in_Time.m | 474 | utf_8 | 797b7eb3a2727e9e0c0470613cb27a67 |
% Each column in A is a single data point
function out_matrix = get_KL_in_Time(A)
N = size(A,2);
divergence_matrix = [];
for m = 1:N
v = repmat(A(:,m), 1, N);
single_row = sum(A.*log(A./v));
divergence_matrix = [divergence_matrix;single_row];
end
divergence_matrix = (divergence_matrix + divergence_matrix')... |
github | endsley/ml_examples-master | spectral_fit.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/spectral_fit.m | 905 | utf_8 | f94d507abd06db78f0ac8d8aac17dc50 |
function [centroid, pointsInCluster, assignment] = spectral_fit(distance_matrix, cluster_N, sigma)
sigma = std(distance_matrix(:));
sss = sigma^2*2
% % Using information
% distance_matrix = distance_matrix + 0.01*eye(size(distance_matrix));
% Adjacency_matrix = log(distance_matrix./sum(sum(distance_matrix)));
% U... |
github | endsley/ml_examples-master | sample_data_generation.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/sample_data_generation.m | 7,818 | utf_8 | c307c2caec6438cf3a8cd688c9e57145 |
function [y_normalized, y_total, N] = sample_data_generation(data_set_id, plot_data)
original_view = 1;
number_of_data_per_type = 20;
time_series_data = 1;
if(plot_data == 1)
figure(1, "position", get(0,"screensize")([3,4,3,4]).*[0 0 0.4 0.4]);
end
if(data_set_id == 1)
sigma1 = 0.5;
sigma2 = 0.5;
% ... |
github | endsley/ml_examples-master | get_Distance_in_Time.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/get_Distance_in_Time.m | 1,060 | utf_8 | 2c9b36d36dbfdee526156509861e72f7 |
% Each column in A is a single data point
function out_matrix = get_Distance_in_Time(A, weight, remove_percentage, tight_bound )
if weight == 0
out_matrix = [1];
return
end
A = cell2mat(A(:));
A = variance_map_filter(A, remove_percentage);
N = size(A,2);
Euclid_matrix = [];
for m = 1:N
D = abs(A - repmat... |
github | endsley/ml_examples-master | RW_spectral_fit.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/RW_spectral_fit.m | 455 | utf_8 | fe29207b88f9cae39592ad14c4a6eaf5 |
function [centroid, pointsInCluster, assignment] = RW_spectral_fit(distance_matrix, cluster_N)
% Using Gaussian distance
Adjacency_matrix = exp(-distance_matrix);
Degree_matrix = diag(sum(Adjacency_matrix));
Laplacian = inv(Degree_matrix)*Adjacency_matrix;
[V,D] = eig(Laplacian);
% figure(7);plot(diag(D));
% %... |
github | endsley/ml_examples-master | get_KL_in_Freq.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/get_KL_in_Freq.m | 619 | utf_8 | cee66184c3fec2d10056640cc9b3eec0 |
% Each column in A is a single data point
function out_matrix = get_KL_in_Freq(A)
A = abs(fft(A));
N = size(A,2);
divergence_matrix = [];
for m = 1:N
v = repmat(A(:,m), 1, N);
single_row = sum(A.*log(A./v));
divergence_matrix = [divergence_matrix;single_row];
end
divergence_matrix = (divergence_matrix + ... |
github | endsley/ml_examples-master | kl_divergence.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/kl_divergence.m | 235 | utf_8 | 17694ed0111036ff0de7679f464561cf |
% kl( v1 || v2 ) = sum v1 ln(v1/v2)
function divergence = kl_divergence(v1,v2,normalizeV)
if(normalizeV == 1)
v1 = v1/sum(v1);
v2 = v2/sum(v2);
end
divergence = sum(v1.*log(v1./v2));
%divergence = sum(v1.*log(v1./v2));
end
|
github | endsley/ml_examples-master | calc_Eucli_Distance_matrix.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/calc_Eucli_Distance_matrix.m | 425 | utf_8 | 8f98e9dbe4fe94391eca55d5e689e846 |
% Each column in A is a single data point
function Euclid_matrix = calc_Eucli_Distance_matrix(A, use_L1)
N = size(A,2);
Euclid_matrix = [];
for m = 1:N
if(use_L1 == 1)
single_row = sum(abs(A - repmat(A(:,m), 1, N)));
else
D = abs(A - repmat(A(:,m), 1, N));
if(l == 1)
single_row = sqrt(D.^2);
els... |
github | endsley/ml_examples-master | adjust_width.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/adjust_width.m | 522 | utf_8 | 3dc4afcfd3b8ea64939a4b1535582ae7 |
function out_dat = adjust_width(dat, max_len)
out_dat = zeros(max_len,1);
n = length(dat);
dat
for m = 1:max_len
ratio1 = n*m/max_len;
ratio2 = n*m/max_len - floor(n*m/max_len);
upIdx = ceil(ratio1);
downIdx = floor(ratio1);
if downIdx == 0
downIdx = 1;
end
%[dat(downIdx) + ratio2*(dat(upIdx)... |
github | endsley/ml_examples-master | evecs.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/evecs.m | 1,056 | utf_8 | 56eae66ead9c6febdf8b7aeb1f8388fb |
function [V,ss,L] = evecs(A,nEvecs)
%% calculate eigenvectors, eigenvalues of the laplaican of A
%%
%% [V,ss,L] = evecs(A,nEvecs)
%%
%% Input:
%% A = Affinity matrix
%% nEvecs = number of eigenvectors to compute
%%
%% Output:
%% V = eigenvectors
%% ss = eigenvalues
%% ... |
github | endsley/ml_examples-master | variance_map_filter.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/variance_map_filter.m | 462 | utf_8 | 934cee094c0301a37c2901a4b6e4d266 |
% each column of y is a single dataset, this function will remove
% the least import parts of the data
function filter_out = variance_map_filter(y, remove_percentage)
if(remove_percentage == 0)
filter_out = y;
return;
end
vMap = std(y');
vMap = vMap/sum(vMap);
[s,id] = sort(vMap,'descend');
cdf = cumsum(s)... |
github | endsley/ml_examples-master | calc_Jensen_shannon_divergence.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/calc_Jensen_shannon_divergence.m | 349 | utf_8 | ed9e43e0edca8c470ba62b69dbcd0da6 |
% Each column in A is a single data point
function divergence_matrix = calc_Jensen_shannon_divergence(A)
N = size(A,2);
divergence_matrix = [];
for m = 1:N
v = repmat(A(:,m), 1, N);
single_row = sum(A.*log(A./v));
divergence_matrix = [divergence_matrix;single_row];
end
divergence_matrix = (divergence_matri... |
github | endsley/ml_examples-master | plot_noisy.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/plot_noisy.m | 320 | utf_8 | 1dc07aab23d59b68ad5f01f694c4405a |
function plot_noisy(y,color, original_view)
l = size(y,2);
x = [1:size(y,1)]';
hold on;
for m = 2:l
y_column = y(:,m);
if(original_view == 1)
plot(x,y_column,'k');
else
plot(x,y_column,color);
end
end
if(original_view == 1)
plot(x,y(:,1) ,'k')
else
plot(x,y(:,1) ,'k', 'LineWidth',2)
end
end
|
github | endsley/ml_examples-master | fft_filter.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/fft_filter.m | 383 | utf_8 | 5150bd5585cdaac27b5e16428f3b023c |
function out_matrix = fft_filter(A, reduction_percentage)
if reduction_percentage == 0
out_matrix = A;
return;
end
dat_size = size(A,1);
increments = floor(reduction_percentage*( dat_size - 1 )/2);
first = ceil((dat_size - 1)/2) + 1 - increments
second = ceil((dat_size - 1)/2 + 0.5) + 1 + increments
f = f... |
github | endsley/ml_examples-master | spectral_path_clustering.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/spectral_path_clustering.m | 1,969 | utf_8 | 683e078e1c9fafc67fe1ea331274c26c | % Input argument
% A : is the data, where each sample is a single column
% EV_percentage : this controls what percentage of emphasis 1.00 is completely time domain and 0 is completely Freq domain
% remove_percentage : percentage of data we remove for variance map, 1 is 100%
% plot_it : 1 to display plot and 0, not to
%... |
github | endsley/ml_examples-master | cluster_rotate.m | .m | ml_examples-master/spectral_clustering/spectral_trajectory/path_cluster_lib/cluster_rotate.m | 1,802 | utf_8 | 6503848de67e091d1fee109e4a32dbd8 |
function [clusts,best_group_index,Quality,Vr] = cluster_rotate(A,group_num,fig,method)
%% cluster by rotating eigenvectors to align with the canonical coordinate
%% system
%%
%% [clusts,best_group_index,Quality,Vr] = cluster_rotate(A,group_num,method,fig)
%%
%% Input:
%% A = Affinity matrix
%% grou... |
github | endsley/ml_examples-master | compute_J.m | .m | ml_examples-master/verify_derivative_hessian/compute_J.m | 232 | utf_8 | 3eeb65417e3ac65a1199ccd5b1bedfa0 | %
function F = compute_J(w,A1, A2)
%F = -exp(-w'*A1*w) - 2*exp(-w'*A2*w);
%F = -exp(-w'*A1*w);
F = - 2*exp(-w'*A2*w);
%F = 2*exp(-w.T.dot(A1).dot(w))*(A1 - 2*A1*w*w'*A1) + 4*exp(-w.T.dot(A2).dot(w))*(A2 - 2*A2*w*w'*A2);
end
|
github | endsley/ml_examples-master | hessdiag.m | .m | ml_examples-master/verify_derivative_hessian/DERIVESTsuite/hessdiag.m | 2,034 | utf_8 | ff31ada116a5b893f0b1b7ad4ef6336f | function [HD,err,finaldelta] = hessdiag(fun,x0)
% HESSDIAG: diagonal elements of the Hessian matrix (vector of second partials)
% usage: [HD,err,finaldelta] = hessdiag(fun,x0)
%
% When all that you want are the diagonal elements of the hessian
% matrix, it will be more efficient to call HESSDIAG than HESSIAN.
% HESSDIA... |
github | endsley/ml_examples-master | hessian.m | .m | ml_examples-master/verify_derivative_hessian/DERIVESTsuite/hessian.m | 5,157 | utf_8 | 8e0bddd9a2df4151adbee6e016f767cf | function [hess,err] = hessian(fun,x0)
% hessian: estimate elements of the Hessian matrix (array of 2nd partials)
% usage: [hess,err] = hessian(fun,x0)
%
% Hessian is NOT a tool for frequent use on an expensive
% to evaluate objective function, especially in a large
% number of dimensions. Its computation will use rough... |
github | endsley/ml_examples-master | jacobianest.m | .m | ml_examples-master/verify_derivative_hessian/DERIVESTsuite/jacobianest.m | 5,850 | utf_8 | eb3dd9ff0c56b1eb7316f8237dbee253 | function [jac,err] = jacobianest(fun,x0)
% gradest: estimate of the Jacobian matrix of a vector valued function of n variables
% usage: [jac,err] = jacobianest(fun,x0)
%
%
% arguments: (input)
% fun - (vector valued) analytical function to differentiate.
% fun must be a function of the vector or array x0.
%
%... |
github | endsley/ml_examples-master | gradest.m | .m | ml_examples-master/verify_derivative_hessian/DERIVESTsuite/gradest.m | 2,374 | utf_8 | 8164711b2f9bdaae657fae039afd34f0 | function [grad,err,finaldelta] = gradest(fun,x0)
% gradest: estimate of the gradient vector of an analytical function of n variables
% usage: [grad,err,finaldelta] = gradest(fun,x0)
%
% Uses derivest to provide both derivative estimates
% and error estimates. fun needs not be vectorized.
%
% arguments: (input)
% fun ... |
github | endsley/ml_examples-master | derivest.m | .m | ml_examples-master/verify_derivative_hessian/DERIVESTsuite/derivest.m | 23,018 | utf_8 | 3198e9636b2275d707eec59dbb9b8a2f | function [der,errest,finaldelta] = derivest(fun,x0,varargin)
% DERIVEST: estimate the n'th derivative of fun at x0, provide an error estimate
% usage: [der,errest] = DERIVEST(fun,x0) % first derivative
% usage: [der,errest] = DERIVEST(fun,x0,prop1,val1,prop2,val2,...)
%
% Derivest will perform numerical differentiatio... |
github | endsley/ml_examples-master | pack_kmeans.m | .m | ml_examples-master/orthogonal_clustering/src/pack_kmeans.m | 373 | utf_8 | 853aac4832eb0aa838101e33c64b2f80 |
function [opt_idx , opt_C] = pack_kmeans(X,k, repeat_time)
opt_error_d = -1;
opt_idx = 0;
opt_C = 0;
for m = 1:repeat_time
[idx,C,sumd] = kmeans(X,k);
error_d =norm(sumd);
if(opt_error_d == -1)
opt_error_d = error_d;
opt_idx = idx;
opt_C = C;
end
if(error_d < opt_error_d)
opt_idx = idx;
... |
github | endsley/ml_examples-master | orthogonal_cluster.m | .m | ml_examples-master/orthogonal_clustering/src/orthogonal_cluster.m | 755 | utf_8 | 3e261f971c2a5542436b444afcf46d4d |
function [assignment_1, assignment_2, center_1, center_2] = orthogonal_cluster(k, k2, X)
kmeans_repeat = 10;
addpath('cbrewer');
X = X - repmat(mean(X),size(X,1),1);
[colormap]=cbrewer('qual', 'Accent', k, 'cubic');
% Run initial K means 10 times and keeps the best result
[assignment_1 , center_1] = pack_kmea... |
github | endsley/ml_examples-master | plot_kmeans.m | .m | ml_examples-master/orthogonal_clustering/src/plot_kmeans.m | 164 | utf_8 | 42fc8f0ca1497cb809015b937d809431 |
function plot_kmeans(X, opt_idx, colormap)
hold on;
for m = 1:length(X)
c = colormap(opt_idx(m),:);
plot(X(m,1),X(m,2),'x', 'Color', c);
end
hold off;
end
|
github | endsley/ml_examples-master | fD.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/fD.m | 1,161 | utf_8 | 3724e9f52f11d6c9fd4bd5126596b9db | function fd = fD(X, D, A, N, d)
% ---------------------------------------------------------------------------
% the value of dissimilarity constraint function
% f = f(\sum_{ij \in D} distance(x_i, x_j))
% i.e. distance can be L1: \sqrt{(x_i-x_j)A(x_i-x_j)'}) ...
% f(x) = x ...
% -------------------------... |
github | endsley/ml_examples-master | D_objective.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/D_objective.m | 942 | utf_8 | 23f87f641f58a75b6b8b6756afadf2d2 | function fD = D_objective(X, D, a, N, d)
sum_dist = 0;
for i = 1:N
for j= i+1:N
if D(i,j) == 1
d_ij = X(i,:) - X(j,:); % difference between 'i' and 'j'
dist_ij = distance1(a, d_ij);
sum_dist = sum_dist + dist_ij;
end
end
end
fD = gF2(sum_dist);
... |
github | endsley/ml_examples-master | unroll.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/unroll.m | 229 | utf_8 | 134f66a989ef4b2c88e0acfeb58c9d64 | % av = unroll(A)
% column concatenation of matrix 'A' into vactor 'av'
function av = unroll(A)
s = size(A);
n = s(1); % # of rows
m = s(2); % # of columns
for i = 1:m
av( ((i-1)*n+1) : (i*n) ) = A(:,i);
end
av=av';
|
github | endsley/ml_examples-master | plot_kmeans.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/plot_kmeans.m | 176 | utf_8 | 165a4ae746a824181a119df0d261e436 |
function plot_kmeans(X, opt_idx)
figure(1);hold on;
for m = 1:length(X)
if opt_idx(m) == 1
plot(X(m,1),X(m,2),'ro');
else
plot(X(m,1),X(m,2),'bo');
end
end
end
|
github | endsley/ml_examples-master | D_constraint.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/D_constraint.m | 2,360 | utf_8 | f496a7fa7c618d1ff72a29a3958c30e6 | function [fD, fD_1st_d, fD_2nd_d] = D_constraint(X, D, a, N, d)
% Compute the value, 1st derivative, second derivative (Hessian) of
% a dissimilarity constrant function gF(sum_ij distance(d_ij A d_ij))
% where A is a diagnal matrix (in the form of a column vector 'a').
sum_dist = 0;
sum_deri1 = zeros(1,d);
s... |
github | endsley/ml_examples-master | iter_projection_new2.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/iter_projection_new2.m | 4,681 | utf_8 | f8b6bb83e8b9b3de90ef9d64b73844bc | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% solving constraint optimization problem using iterative projection
%
% Eric Xing
% UC Berkeley
% Jan 15, 2002
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [A, converged] = ...
iter_projection_... |
github | endsley/ml_examples-master | packcolume.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/packcolume.m | 187 | utf_8 | 91293f047816375bfd5e8565a8ec720b | % A = pack(av, n, m)
% pack vactor 'av' into a nxm matrix 'A' using acolumn concatenation
function A = packcolume(av, n, m)
for i = 1:m
A(:,i) = av( ((i-1)*n+1) : (i*n) ) ;
end
|
github | endsley/ml_examples-master | fD1.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/fD1.m | 2,410 | utf_8 | f846a84950894fba0f17649508e49b26 | function fd_1st_d = fD1(X, D, A, N, d)
% ---------------------------------------------------------------------------
% the gradient of the dissimilarity constraint function w.r.t. A
%
% for example, let distance by L1 norm:
% f = f(\sum_{ij \in D} \sqrt{(x_i-x_j)A(x_i-x_j)'})
% df/dA_{kl} = f'* d(\sum_{ij \in D... |
github | endsley/ml_examples-master | Newton.m | .m | ml_examples-master/constrained_alternative_clustering/code_Metric_online/Newton.m | 2,112 | utf_8 | ee766f5264b5983ad238cef8ed5467ca | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% solving constraint optimization problem using Newton-Raphson method
%
% Eric Xing
% UC Berkeley
% Jan 15, 2002
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function A = Newton(data, S, D, C)
size_data... |
github | endsley/ml_examples-master | pack_kmeans.m | .m | ml_examples-master/constrained_alternative_clustering/src/pack_kmeans.m | 379 | utf_8 | b676be6285edccd6421da710cd30c4e9 |
function [opt_idx , opt_C, sumd] = pack_kmeans(X,k, repeat_time)
opt_error_d = -1;
opt_idx = 0;
opt_C = 0;
for m = 1:repeat_time
[idx,C,sumd] = kmeans(X,k);
error_d =norm(sumd);
if(opt_error_d == -1)
opt_error_d = error_d;
opt_idx = idx;
opt_C = C;
end
if(error_d < opt_error_d)
opt_idx = i... |
github | endsley/ml_examples-master | plot_kmeans.m | .m | ml_examples-master/constrained_alternative_clustering/src/plot_kmeans.m | 164 | utf_8 | 42fc8f0ca1497cb809015b937d809431 |
function plot_kmeans(X, opt_idx, colormap)
hold on;
for m = 1:length(X)
c = colormap(opt_idx(m),:);
plot(X(m,1),X(m,2),'x', 'Color', c);
end
hold off;
end
|
github | endsley/ml_examples-master | constrained_alternative_clustering.m | .m | ml_examples-master/constrained_alternative_clustering/src/constrained_alternative_clustering.m | 2,262 | utf_8 | 03f8eec5cb3ab88b6747f62ce216aee3 |
function [assignment_1, assignment_2, center_1, center_2] = constrained_alternative_clustering(k, k2, X)
kmeans_repeat = 10;
addpath('cbrewer');
X = X - repmat(mean(X),size(X,1),1);
[colormap]=cbrewer('qual', 'Accent', k, 'cubic');
% Run initial K means 10 times and keeps the best result
[assignment_1 , cente... |
github | endsley/ml_examples-master | nLDA.m | .m | ml_examples-master/LDA/nLDA.m | 1,550 | utf_8 | 8feccbad7742ad8d8a0d9f813a9ce149 | #!/usr/bin/octave
function metrics = nLDA()
x = -8:8;
n0 = 50;
n1 = 50;
Dat0 = randn(n0,2);
Dat1 = randn(n1,2) + 2;
%set_0 = [Dat0, Dat0.^2]
%set_1 = [Dat1, Dat1.^2]
total_data = [Dat0; Dat1];
center_bias = mean(total_data);
Dat0 = Dat0 - repmat(center_bias,n0,1); % + [0 10];
Dat1 = Dat1 - repmat(ce... |
github | endsley/ml_examples-master | chieh_kmean.m | .m | ml_examples-master/k_means/chieh_kmean.m | 1,573 | utf_8 | 2b65dad0ca6eb33dc8dd56040c106982 | % Input
% r : the number of kmean iteration, to avoid bad seed
% x : the observed data, each column is each observation
% k : the number of clusters
% Output
% cluster :
function clusters = chieh_kmean(r, x, k)
clib = cluster_lib(x,k);
criteria_met = 0;
clusters = containers.Map();
clusters('square_sum... |
github | endsley/ml_examples-master | fD.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/fD.m | 1,161 | utf_8 | 3724e9f52f11d6c9fd4bd5126596b9db | function fd = fD(X, D, A, N, d)
% ---------------------------------------------------------------------------
% the value of dissimilarity constraint function
% f = f(\sum_{ij \in D} distance(x_i, x_j))
% i.e. distance can be L1: \sqrt{(x_i-x_j)A(x_i-x_j)'}) ...
% f(x) = x ...
% -------------------------... |
github | endsley/ml_examples-master | D_objective.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/D_objective.m | 942 | utf_8 | 23f87f641f58a75b6b8b6756afadf2d2 | function fD = D_objective(X, D, a, N, d)
sum_dist = 0;
for i = 1:N
for j= i+1:N
if D(i,j) == 1
d_ij = X(i,:) - X(j,:); % difference between 'i' and 'j'
dist_ij = distance1(a, d_ij);
sum_dist = sum_dist + dist_ij;
end
end
end
fD = gF2(sum_dist);
... |
github | endsley/ml_examples-master | unroll.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/unroll.m | 229 | utf_8 | 134f66a989ef4b2c88e0acfeb58c9d64 | % av = unroll(A)
% column concatenation of matrix 'A' into vactor 'av'
function av = unroll(A)
s = size(A);
n = s(1); % # of rows
m = s(2); % # of columns
for i = 1:m
av( ((i-1)*n+1) : (i*n) ) = A(:,i);
end
av=av';
|
github | endsley/ml_examples-master | plot_kmeans.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/plot_kmeans.m | 176 | utf_8 | 165a4ae746a824181a119df0d261e436 |
function plot_kmeans(X, opt_idx)
figure(1);hold on;
for m = 1:length(X)
if opt_idx(m) == 1
plot(X(m,1),X(m,2),'ro');
else
plot(X(m,1),X(m,2),'bo');
end
end
end
|
github | endsley/ml_examples-master | D_constraint.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/D_constraint.m | 2,360 | utf_8 | f496a7fa7c618d1ff72a29a3958c30e6 | function [fD, fD_1st_d, fD_2nd_d] = D_constraint(X, D, a, N, d)
% Compute the value, 1st derivative, second derivative (Hessian) of
% a dissimilarity constrant function gF(sum_ij distance(d_ij A d_ij))
% where A is a diagnal matrix (in the form of a column vector 'a').
sum_dist = 0;
sum_deri1 = zeros(1,d);
s... |
github | endsley/ml_examples-master | iter_projection_new2.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/iter_projection_new2.m | 4,681 | utf_8 | f8b6bb83e8b9b3de90ef9d64b73844bc | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% solving constraint optimization problem using iterative projection
%
% Eric Xing
% UC Berkeley
% Jan 15, 2002
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [A, converged] = ...
iter_projection_... |
github | endsley/ml_examples-master | packcolume.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/packcolume.m | 187 | utf_8 | 91293f047816375bfd5e8565a8ec720b | % A = pack(av, n, m)
% pack vactor 'av' into a nxm matrix 'A' using acolumn concatenation
function A = packcolume(av, n, m)
for i = 1:m
A(:,i) = av( ((i-1)*n+1) : (i*n) ) ;
end
|
github | endsley/ml_examples-master | fD1.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/fD1.m | 2,410 | utf_8 | f846a84950894fba0f17649508e49b26 | function fd_1st_d = fD1(X, D, A, N, d)
% ---------------------------------------------------------------------------
% the gradient of the dissimilarity constraint function w.r.t. A
%
% for example, let distance by L1 norm:
% f = f(\sum_{ij \in D} \sqrt{(x_i-x_j)A(x_i-x_j)'})
% df/dA_{kl} = f'* d(\sum_{ij \in D... |
github | endsley/ml_examples-master | Newton.m | .m | ml_examples-master/alternative_clustering/code_Metric_online/Newton.m | 2,112 | utf_8 | ee766f5264b5983ad238cef8ed5467ca | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% solving constraint optimization problem using Newton-Raphson method
%
% Eric Xing
% UC Berkeley
% Jan 15, 2002
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function A = Newton(data, S, D, C)
size_data... |
github | endsley/ml_examples-master | calc_mutual_information.m | .m | ml_examples-master/mutual_information/octave_enable/calc_mutual_information.m | 1,026 | utf_8 | 663f0a596e081cefb529357c0343c3b4 |
% mutual information = sum p(x,y) log2[ p(x,y) / (p(x)*p(y) ]
% Note : this is base 2
function [mInfo, xkey, ykey, x_prob, y_prob, x_y_prob] = calc_mutual_information(x,y)
if length(x) ~= length(y)
error('The length of two vectors must be equal to calculate the mutual information')
end
xkey = unique(x, 'rows')... |
github | endsley/ml_examples-master | l1_ls_nonneg.m | .m | ml_examples-master/lasso/l1_ls_nonneg.m | 7,985 | utf_8 | a65d1f604b6bb3e700f967b4eed0ba79 | function [x,status,history] = l1_ls_nonneg(A,varargin)
%
% l1-Regularized Least Squares Problem Solver
%
% l1_ls solves problems of the following form:
%
% minimize ||A*x-y||^2 + lambda*sum(x_i),
% subject to x_i >= 0, i=1,...,n
%
% where A and y are problem data and x is variable (described below).
%... |
github | endsley/ml_examples-master | l1_ls.m | .m | ml_examples-master/lasso/l1_ls.m | 8,414 | utf_8 | 592cd5d633c7f3e474bcad9309e4ea07 | function [x,status,history] = l1_ls(A,varargin)
%
% l1-Regularized Least Squares Problem Solver
%
% l1_ls solves problems of the following form:
%
% minimize ||A*x-y||^2 + lambda*sum|x_i|,
%
% where A and y are problem data and x is variable (described below).
%
% CALLING SEQUENCES
% [x,status,history] = l1... |
github | endsley/ml_examples-master | sorted_eig.m | .m | ml_examples-master/dimension_reduction_clustering/old_code/sorted_eig.m | 180 | utf_8 | f35a0ccc52665dba4ff6c2e3e43f6141 |
% ordering = 'ascend' or 'descend'
function [eig_Vector, eig_Value] = sorted_eig(X, ordering)
[V,D] = eig(X);
[eig_Value,o] = sort(diag(D), ordering);
eig_Vector = V(:,o);
end
|
github | rqiao/zsl_noise_suppression-master | formulation_l21.m | .m | zsl_noise_suppression-master/formulation_l21.m | 5,401 | utf_8 | 1314b2a4985c241f7ff36b56b10e2d4e | function formulation_l21(lx, lw, dataset_name)
cvsplit = 0;
if dataset_name =='AwA'
datapath = [ './dataset/AwA'];
matrix_path = [datapath, '/predicate-matrix-binary-1855-all.mat']; %path of candidate words
if cvsplit==0
% get original split
tmp = load([datapath,'... |
github | urbste/mdBRIEF-master | CreateRandomTests.m | .m | mdBRIEF-master/Training/CreateRandomTests.m | 222 | utf_8 | 13a0a037c29e06fade20a5c588c6fdd4 | % create a fixed number of random tests and save to file
function [tests] = create_tests(patch_size, nr_tests, seed)
rng(seed,'twister')
S = 1;
tests = floor(S+(patch_size-2*S)*rand(4,nr_tests))+ones(4, nr_tests);
end
|
github | ericguerrero/IntersectingFieldsStereo2015-master | vertices3.m | .m | IntersectingFieldsStereo2015-master/Functions/vertices3.m | 430 | utf_8 | a68730f4a03433fa18552d99562e15a8 | % [u v w]' = P * [X Y Z 1]'
% x = u / w
% y = v / w
function [V] = vertices3 (cam, tr, dmax)
cam.K=cam.P(1:3,1:3);
LU =transl(tr * transl(inv(cam.K) * [0 0 1]'*dmax)); % point
LD =transl(tr * transl(inv(cam.K) * [cam.w 0 1]'*dmax));
C =transl(tr);
RD =transl(tr * transl(inv(cam.K) * [ca... |
github | ericguerrero/IntersectingFieldsStereo2015-master | roi.m | .m | IntersectingFieldsStereo2015-master/Functions/roi.m | 410 | utf_8 | 82e92daae5c0d04140a81003e85c2c69 | % [u v w]' = P * [X Y Z 1]'
% x = u / w
% y = v / w
function [roipoints, roiK] = roi(cam, ht, dmax, Points)
K=cam.P(1:3,1:3);
roipoints=zeros(2,length(Points));
for j=1:length(Points)
p_world = transl(Points(j,:));
p_camera = transl(inv(ht)*p_world)/dmax;
M = K*p_camera;
... |
github | ericguerrero/IntersectingFieldsStereo2015-master | q2tr.m | .m | IntersectingFieldsStereo2015-master/Functions/q2tr.m | 1,174 | utf_8 | fd1cefa9333edcfd5ce5bcfd9b82f8a9 | % Ryan Steindl based on Robotics Toolbox for MATLAB (v6 and v9)
%
% Copyright (C) 1993-2011, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published... |
github | ericguerrero/IntersectingFieldsStereo2015-master | pHRIWARE.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/pHRIWARE.m | 4,270 | utf_8 | fc08385f3b36e55b73c842cbd8a04273 | %pHRIWARE physical HRI worspace analysis, research and evaluation
%
% pHRIWARE (pron. 'freeware') provides tools to analyse, research and
% evaluate physical human-robot interactions. Many of these tools also
% requires the Robotics Toolbox for MATLAB(R) (RTB), developed by Peter
% Corke. This may be downloaded a... |
github | ericguerrero/IntersectingFieldsStereo2015-master | h2fsu.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Functions/h2fsu.m | 9,855 | utf_8 | a6c040ef31722999567bc37552aa9719 | %H2FSU Convert hand data to forearm, swivel, and upper arm frames
%
% Returns the corresponding forearm, swivel and upper arm frame(s) for
% given hand frame(s) or point(s). If hand data is be given in a N-D
% array, the outputs will be of same shape. The swivel angle can be
% resolved using a number of methods (... |
github | ericguerrero/IntersectingFieldsStereo2015-master | gikine.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Functions/gikine.m | 2,577 | utf_8 | df5ace1e6770c2b64357462428940772 | %GIKINE Shoulder inverse kinematics of HAL-like right shoulder
%
% Computes the inverse kinematics of the right shoulder which is the
% same kinematically as a HAL object. This function is mainly useful
% for procedures which require many, many calls, so time can be saved
% by not referencing a HAL object.
%
... |
github | ericguerrero/IntersectingFieldsStereo2015-master | wikine.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Functions/wikine.m | 2,788 | utf_8 | 94c656a629c653bdd74bcaa2aa5f6979 | %WIKINE Wrist inverse kinematics of HAL-like right wrist
%
% Computes the inverse kinematics of the right wrist which is the
% same kinematically as a HAL object. Either the hand and wrist frames
% can be entered separately, or a relative rotation used.
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licensed unde... |
github | ericguerrero/IntersectingFieldsStereo2015-master | d2r.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Functions/util/d2r.m | 1,194 | utf_8 | 26809dac2965c20b2acbe1d78b361128 | %D2R Convert degrees into radians
%
% Convert an angle which is expressed in degrees into radians
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licensed under the GNU Lesser General Public License
% see full file for full statement
%
% Syntax:
% (1) rad = d2r(deg)
% (2) rad = d2r()
%
% (2) is as per (1) w... |
github | ericguerrero/IntersectingFieldsStereo2015-master | r2d.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Functions/util/r2d.m | 1,196 | utf_8 | 6893cc2ff7db4cf1f4fcf1a2a958f23d | %R2D Convert radians into degrees
%
% Convert an angle which is expressed in radians into degrees
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licensed under the GNU Lesser General Public License
% see full file for full statement
%
% Syntax:
% (1) deg = r2d(rad)
% (2) deg = r2d()
%
% (2) is as per (1) w... |
github | ericguerrero/IntersectingFieldsStereo2015-master | sym2func.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Functions/util/sym2func.m | 1,540 | utf_8 | 33c0b33e119d40cea1d5ad7d3da24dd0 | %SYM2FUNC Convert a sym object to an anonymous functions
%
% While the function matlabFunction can be used for the same purpose,
% AND and OR operators when using this function cannot be made bitwise.
% This function converts AND and OR operators to be bitwise.
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licens... |
github | ericguerrero/IntersectingFieldsStereo2015-master | anthroData.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Data/anthroData.m | 4,405 | utf_8 | b8417a60793af1c1526caeded4f4fa4b | %ANTHRODATA Load anthropometric data
%
% Retrieve anthropometric data for a 50th percentile male. Data is
% taken from two sources, surveyed on US Army personnel and matched to
% US Marine Corps personnel.
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licensed under the GNU Lesser General Public License
% see fu... |
github | ericguerrero/IntersectingFieldsStereo2015-master | cmdl_arm.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Data/collision models/cmdl_arm.m | 2,216 | utf_8 | 34efe359e7de5fc59d803454f8603b4d | %CMDL_ARM Create a CollisionModel object of the human arm
%
% Returns a CollisionModel object of the human upper arm and forearm.
% Link lengths may be specified or anthropometric data can be used. The
% Upper arm is a cylinder, and the forearm is a cylindrical frustum
% (Curvilinear), to accomodate for the change... |
github | ericguerrero/IntersectingFieldsStereo2015-master | cmdl_hat.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Data/collision models/cmdl_hat.m | 2,385 | utf_8 | 28600f0b3f060877231b36b659847c6e | %CMDL_HAT Create a CollisionModel object of the human HAT
%
% Returns a CollisionModel object of the human head and torso segment
% (also includes neck). The model may be given for any shoulder frame
% transformation (synonymous with the base transform of a HAL object).
% The head is a sphere, the neck a cylinder,... |
github | ericguerrero/IntersectingFieldsStereo2015-master | cmdl_trophy.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Data/collision models/cmdl_trophy.m | 2,125 | utf_8 | a6ea5c6c7982f286656d168c5501517b | %CMDL_TROPHY Create a CollisionModel object of a grand trophy
%
% Used for demos.
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licensed under the GNU Lesser General Public License
% see full file for full statement
%
% Syntax:
% (1) trophy = cmdl_trophy
%
% See also CollisionModel demo_collisionmodel demo_c... |
github | ericguerrero/IntersectingFieldsStereo2015-master | ikunc.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/ikunc.m | 3,431 | utf_8 | 739de7f32bb0036e19b7459b7d4f4393 | %IKUNC Compute inverse kinematics without considering joint limits
%
% Computes the inverse kinematics for an arbitrary SerialLink
% manipulator. Requires fminunc from the optimization toolbox. ikunc
% works by minimizing the error between the forward kinematics of the
% joint angle solution and the end-effector f... |
github | ericguerrero/IntersectingFieldsStereo2015-master | qmincon.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/qmincon.m | 2,746 | utf_8 | ea1943d30daacb0fd3e780e15c6c397a | %QMINCON Resolve redundancy in robots by avoiding joint limits
%
% A popular way to resolve redundant robots is to keep joints away from
% their mechanical limits to allow freer motion. This function will do
% that process. Requires fmincon from the optimization toolbox.
%
% Copyright (C) Bryan Moutrie, 2013-2014... |
github | ericguerrero/IntersectingFieldsStereo2015-master | grav.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/grav.m | 4,268 | utf_8 | e81e98de74c45742efee9dc30d7bd956 | % GRAV Quick non-mex gravload and jacob0 for SerialLink objects
%
% Calculates the joint loads due to gravity for SerialLink objects. The
% world frame Jacobian can also be returned. The gravity vector is
% defined by the SerialLink property if not explicitly given.
%
% Copyright (C) Bryan Moutrie, 2013-2014
%... |
github | ericguerrero/IntersectingFieldsStereo2015-master | gravload.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/gravload.m | 2,208 | utf_8 | 18697bf0774691a7eac9eb3a2bc8eab6 | % GRAVLOAD Joint loads due to gravity
%
% Uses either the rne MEX file, from RTB, or the grav function, from
% pHRIWARE, depending on being able to use the MEX file and if the
% Jacobian is requested to be returned
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licensed under the GNU Lesser General Public Licens... |
github | ericguerrero/IntersectingFieldsStereo2015-master | collisions.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/collisions.m | 5,154 | utf_8 | ebec8e8bcba304a53bcc348a120cc99b | %COLLISIONS Conduct collision checking for SerialLink objects
%
% Uses the point data stored in the points property of SerialLink
% objects to conduct point-primitive collision checking with objects of
% the CollisionModel class. The function does not currently check the
% base of the SerialLink object!
%
% Copy... |
github | ericguerrero/IntersectingFieldsStereo2015-master | pay.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/pay.m | 2,706 | utf_8 | a5bd4992a510f89e6c80c8f10391ea44 | %PAY Joint forces from payload for SerialLink objects
%
% Calculates the joint loads due to a payload for SerialLink objects,
% It uses the formula Q = J'w, where w is a wrench vector applied at
% the end effector, w = [Fx Fy Fz Mxx Myy Mzz]'. The Jacobian can be
% supplied or computed by RTB
%
% Copyright (C) B... |
github | ericguerrero/IntersectingFieldsStereo2015-master | ikcon.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/ikcon.m | 3,739 | utf_8 | 371877cd126fc34bf002e31dcc8bce25 | %IKCON Compute inverse kinematics considering joint limits
%
% Computes the inverse kinematics for an arbitrary SerialLink
% manipulator. Requires fmincon from the optimization toolbox. ikcon
% works by minimizing the error between the forward kinematics of the
% joint angle solution and the end-effector frame as ... |
github | ericguerrero/IntersectingFieldsStereo2015-master | paycap.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/@SerialLinked/paycap.m | 2,793 | utf_8 | b449dafadf42d5b2fd7ac21560a01320 | %PAYCAP Compute the static payload capacity of a SerialLink object
%
% Find the maximum magnitude of a wrench applied at the end-effector
% for a given pose. The wrench may be referenced in the world frame or
% end-effector frame. How loads are calculated vary to minimise time.
%
% Copyright (C) Bryan Moutrie, 20... |
github | ericguerrero/IntersectingFieldsStereo2015-master | islimit.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Classes/@HAL/islimit.m | 2,551 | utf_8 | 8ea83cd8d0e2cdc81924ae6653d3ca76 | %ISLIMIT Test if HAL joint angles are within their limits
%
% Returns a matrix the same size as the matrix of joint angles input
% (where each row is a joint angle set), whose elements are false if
% within joint limits or true if not. The formulae by Lenarcic & Umek
% (1994) are used to calculate the shoulder ran... |
github | ericguerrero/IntersectingFieldsStereo2015-master | ikine.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Classes/@HAL/ikine.m | 3,044 | utf_8 | b7eee1876cf4f6ff26d64c6d252fb495 | %IKINE Inverse kinematics of HAL objects
%
% Executes the inverse kinematics of a HAL (human arm-like) object.
% It returns the two sets of possible solutions for the shoulder and
% wrist in two of the four possible permutations - the other two may be
% created from the others.
%
% Copyright (C) Bryan Moutrie, ... |
github | ericguerrero/IntersectingFieldsStereo2015-master | reachable.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Classes/@HAL/reachable.m | 3,209 | utf_8 | 16b01bf2de71f84590158ebe852b1e6b | %REACHABLE Find if a pose is reachable
%
% Tests if a pose, described by two sets of joint angles (such as that
% from ikine), is reachable or not. Will output the permutation of the
% two sets, which is reachable.
%
% Copyright (C) Bryan Moutrie, 2013-2014
% Licensed under the GNU Lesser General Public License
... |
github | ericguerrero/IntersectingFieldsStereo2015-master | runscript.m | .m | IntersectingFieldsStereo2015-master/rvctools/contrib/pHRIWARE/Help/Demos/runscript.m | 7,187 | utf_8 | 5e6cbdf3a3da19124b626a132f58e8b3 | %RUNSCRIPT Run an M-file in interactive fashion
%
% RUNSCRIPT(FNAME, OPTIONS) runs the M-file FNAME and pauses after every
% executable line in the file until a key is pressed. Comment lines are shown
% without any delay between lines.
%
% Options::
% 'delay',D Don't wait for keypress, just delay of D seconds (defa... |
github | ericguerrero/IntersectingFieldsStereo2015-master | e2h.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/e2h.m | 1,006 | utf_8 | 2cb9b356b913bc4034f8ff954a3af7cb | %E2H Euclidean to homogeneous
%
% H = E2H(E) is the homogeneous version (K+1xN) of the Euclidean
% points E (KxN) where each column represents one point in R^K.
%
% See also H2E.
% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you... |
github | ericguerrero/IntersectingFieldsStereo2015-master | distributeblocks.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/distributeblocks.m | 2,689 | utf_8 | 02d506ec479136e1e31aa0bc8d7e55e2 | %DISTRIBUTEBLOCKS Distribute blocks in Simulink block library
%
% distributeBlocks(MODEL) equidistantly distributes blocks in a Simulink
% block library named MODEL.
%
% Notes::
% - The MATLAB functions to create Simulink blocks from symbolic
% expresssions actually place all blocks on top of each other. This... |
github | ericguerrero/IntersectingFieldsStereo2015-master | ccodefunctionstring.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/ccodefunctionstring.m | 7,881 | utf_8 | 4cf90fce5f0aa80ef2f46c0078982003 | %CCODEFUNCTIONSTRING Converts a symbolic expression into a C-code function
%
% [FUNSTR, HDRSTR] = ccodefunctionstring(SYMEXPR, ARGLIST) returns a string
% representing a C-code implementation of a symbolic expression SYMEXPR.
% The C-code implementation has a signature of the form:
%
% void funname(double... |
github | ericguerrero/IntersectingFieldsStereo2015-master | Polygon.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/Polygon.m | 43,679 | utf_8 | f9aecaaeb67549736f9e5a897382c8f4 | %POLYGON Polygon class
%
% A general class for manipulating polygons and vectors of polygons.
%
% Methods::
% plot Plot polygon
% area Area of polygon
% moments Moments of polygon
% centroid Centroid of polygon
% perimeter Perimter of polygon
% transform Transform polygo... |
github | ericguerrero/IntersectingFieldsStereo2015-master | plot_ellipse.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/plot_ellipse.m | 5,075 | utf_8 | dc3a048c3ebbe615580730aee7e0e297 | %PLOT_ELLIPSE Draw an ellipse or ellipsoid
%
% PLOT_ELLIPSE(A, OPTIONS) draws an ellipse defined by X'AX = 0 on the
% current plot, centred at the origin.
%
% PLOT_ELLIPSE(A, C, OPTIONS) as above but centred at C=[X,Y]. If
% C=[X,Y,Z] the ellipse is parallel to the XY plane but at height Z.
%
% H = PLOT_ELLIPSE(A, C, ... |
github | ericguerrero/IntersectingFieldsStereo2015-master | edgelist.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/edgelist.m | 4,519 | utf_8 | 9dbcf362180f27696a907d35e54a9736 | %EDGELIST Return list of edge pixels for region
%
% EG = EDGELIST(IM, SEED) is a list of edge pixels (Nx2) of a region in the
% image IM starting at edge coordinate SEED=[X,Y]. The edgelist has one row per
% edge point coordinate (x,y).
%
% EG = EDGELIST(IM, SEED, DIRECTION) as above, but the direction of edge
% fol... |
github | ericguerrero/IntersectingFieldsStereo2015-master | plot2.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/plot2.m | 1,511 | utf_8 | bfd954f5beb6f7fc4fb81eb31a3787c3 | %PLOT2 Plot trajectories
%
% PLOT2(P) plots a line with coordinates taken from successive rows of P. P
% can be Nx2 or Nx3.
%
% If P has three dimensions, ie. Nx2xM or Nx3xM then the M trajectories are
% overlaid in the one plot.
%
% PLOT2(P, LS) as above but the line style arguments LS are passed to plot.
%
% See als... |
github | ericguerrero/IntersectingFieldsStereo2015-master | diff2.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/diff2.m | 1,284 | utf_8 | f6e6e63ad2f2932ff0c0f6cc8d30e137 | %DIFF2 First-order difference
%
% D = DIFF2(V) is the first-order difference (1xN) of the series data in
% vector V (1xN) and the first element is zero.
%
% D = DIFF2(A) is the first-order difference (MxN) of the series data in
% each row of the matrix A (MxN) and the first element in each row is zero.
%
% Notes::
% ... |
github | ericguerrero/IntersectingFieldsStereo2015-master | colnorm.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/colnorm.m | 949 | utf_8 | 4debc9bb5d072db097080daf3f4a0e0d | %COLNORM Column-wise norm of a matrix
%
% CN = COLNORM(A) is vector (1xM) of the normals of each column of the
% matrix A (NxM).
% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the ... |
github | ericguerrero/IntersectingFieldsStereo2015-master | plot_arrow.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/plot_arrow.m | 1,200 | utf_8 | b0e028d67838f7797ea962dbf227f836 | %PLOT_ARROW Draw an arrow
%
% PLOT_ARROW(P, OPTIONS) draws an arrow from P1 to P2 where P=[P1; P2].
%
% Options::
% All options are passed through to arrow3. Pass in a single character
% MATLAB colorspec (eg. 'r') to set the color.
%
% See also ARROW3.
% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is par... |
github | ericguerrero/IntersectingFieldsStereo2015-master | yaxis.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/yaxis.m | 1,309 | utf_8 | 5f4320f0c98172efe34b97d002fc128e | %YAYIS set Y-axis scaling
%
% YAXIS(MAX) set y-axis scaling from 0 to MAX.
%
% YAXIS(MIN, MAX) set y-axis scaling from MIN to MAX.
%
% YAXIS([MIN MAX]) as above.
%
% YAXIS restore automatic scaling for y-axis.
%
% See also YAXIS.
% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbo... |
github | ericguerrero/IntersectingFieldsStereo2015-master | plot_poly.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/plot_poly.m | 2,318 | utf_8 | 297b18bbd3140b314fc2a5221f378aea | %PLOT_POLY Draw a polygon
%
% PLOT_POLY(P, OPTIONS) draws a polygon defined by columns of P (2xN), in the current plot.
%
% OPTIONS::
% 'fill',F the color of the circle's interior, MATLAB color spec
% 'alpha',A transparency of the filled circle: 0=transparent, 1=solid.
%
% Notes::
% - If P (3xN) the polygon is d... |
github | ericguerrero/IntersectingFieldsStereo2015-master | doesblockexist.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/doesblockexist.m | 1,690 | utf_8 | 8c3d04d595b2f2e7d26bdb692a63c7b6 | %DOESBLOCKEXIST Check existence of block in Simulink model
%
% RES = doesblockexist(MDLNAME, BLOCKADDRESS) is a logical result that
% indicates whether or not the block BLOCKADDRESS exists within the
% Simulink model MDLNAME.
%
% Author::
% Joern Malzahn, (joern.malzahn@tu-dortmund.de)
%
% See also symexpr2... |
github | ericguerrero/IntersectingFieldsStereo2015-master | gauss2d.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/gauss2d.m | 1,287 | utf_8 | c9329a3cf21df2eb02cc83da94f1b08b | %GAUSS2D Gaussian kernel
%
% OUT = GAUSS2D(IM, SIGMA, C) is a unit volume Gaussian kernel rendered into
% matrix OUT (WxH) the same size as IM (WxH). The Gaussian has a standard
% deviation of SIGMA. The Gaussian is centered at C=[U,V].
% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Rob... |
github | ericguerrero/IntersectingFieldsStereo2015-master | ishomog.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/ishomog.m | 1,399 | utf_8 | 7a7028bf8f013a80ff13d3f65d302bc4 | %ISHOMOG Test if SE(3) homogeneous transformation
%
% ISHOMOG(T) is true (1) if the argument T is of dimension 4x4 or 4x4xN, else
% false (0).
%
% ISHOMOG(T, 'valid') as above, but also checks the validity of the rotation
% sub-matrix.
%
% Notes::
% - The first form is a fast, but incomplete, test for a transform is S... |
github | ericguerrero/IntersectingFieldsStereo2015-master | homtrans.m | .m | IntersectingFieldsStereo2015-master/rvctools/common/homtrans.m | 2,020 | utf_8 | 269013d453832d4d270e61b718aeaa65 | %HOMTRANS Apply a homogeneous transformation
%
% P2 = HOMTRANS(T, P) applies homogeneous transformation T to the points
% stored columnwise in P.
%
% - If T is in SE(2) (3x3) and
% - P is 2xN (2D points) they are considered Euclidean (R^2)
% - P is 3xN (2D points) they are considered projective (P^2)
% - If T is i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.