text stringlengths 8 6.12M |
|---|
function output = ATMIP_remaining2(opt,beta,samplestage,stage,num,covsmpl)
fprintf('inside the script ATMIP_remaining 2\n')
% initialisation : stage 0
rng('shuffle');
N = opt.N; % Number of markov chains
Neff = opt.Neff;
Neff = 40; % chain length
target = opt.targ... |
function value = gegenbauer_integral ( expon, alpha )
%*****************************************************************************80
%
%% GEGENBAUER_INTEGRAL evaluates the integral of a monomial with Gegenbauer weight.
%
% Discussion:
%
% VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x^2)^ALPHA dx
%
% Licensing... |
function [sig_symbol, sig_text] = get_sig_star(pval)
if pval > 0.05
sig_symbol = '';
sig_text = 'ns';
elseif pval > 0.01 && pval <= 0.05
sig_symbol = '*';
sig_text = '\leq0.05';
elseif pval > 0.001 && pval <= 0.01
sig_symbol = '**';
sig_text = '\leq0.01';
elseif pval > 0.0001 && pval <= 0.001
... |
function grSetTitle(arg1,arg2)
global figlist;
if (isstr(arg1)) fig = gcf; title = arg1;
else fig = arg1; title = arg2;
end;
% -- Set the title in the window
% -----------------------------------
set(fig,'Name',title);
% -- Set the title in the figlist
% -------------------------------... |
clear all;
clc;
KSUM=3;
disp('Start test')
disp(' ')
disp('TEST Malthusuv model')
x0=10;
r=2;
t=10;
mal=fceMalthus(x0,r,t);
if mal(t)==x0*exp(r*t)
disp('Malthus OK')
KSUM=KSUM-1;
else
disp('Maltus CHYBA')
end
disp(' ')
disp('TEST Logisticky model')
x0=10;
r=2;
t=10;
K=100;
logic=fceLogistic(x0,r,t,K);
if ... |
clear; clc;
fid = fopen('input.txt');
result = 0;
lights = zeros(1000,1000);
while 1
tline = fgetl(fid);
if ~ischar(tline)
break
end
indexs = find(tline == ' ');
command = tline(1:indexs(1)-1);
if strcmp(command, 'turn')
command2 = tline(indexs(1)+1:indexs(2)-1);
... |
%%
clear all;
close all;
clc;
%% Set constants
fs_LOS = 2.0;
fs_VAD = 2.5;
%% Load data
disp('Load data');
load('Data/FINO1.mat');
LOS_files = dir('Data/LOS');
VAD_files = dir('Data/VAD');
ts_VAD = [];
rs_VAD = [];
cnr_VAD = [];
az_VAD = [];
for i = 1:5 %length(VAD_files)
disp(strcat('Loading VAD file ', num2st... |
function a = analyze_paths(ps,new_tign)
%looks at the paths in a path struct and figures out some basic statistics
% input ps - struct, from ps = cluster_paths(w,1);
% new_tign - analysis from squish4(ps)
%vector for speeds between points in the paths new_tign
p_speeds = [];
%vector for speeds between pts in... |
DAQ.Connect(); % need to connect and disconnect before/after fifo
DAQ.Reset(); % always good to start with a clean slate...
%% ---------------------------------------------------------------------------
DAQ.FiFo = FiFoSettings();
DAQ.FiFo.nShots = 1000; % number of shots to be acquired in total
DAQ.FiFo.shotSize = 204... |
%for 1-D cell array concatenation. Horizontal cell array.
function [newCell] = cellCat (C,c)
s = size(C);
s = s(2);
newCell = cell(1,s+1);
%set value and end function if empty
if ( isempty(C) )
newCell = C;
newCell{1} = c;
return; %end function
e... |
%EE569 Homework Assignment #2
%Date: 02/15/2020
%Name: Wenbo Ye
%Email: wenboye@usc.edu
%uscid: 3963437994
col = 481;
row = 321;
oriRGB = readraw('./EE569_Spring_2020_HW2_Materials/Problem1/Gallery.raw', row, col, 3);
gray = rgbToGray(oriRGB, row, col);
fixedBound = edgeFix(gray, row, col);
sobelX = sobelGx(fixedBou... |
function [morphed_im] = morph_tps(im_source, ...
a1_x, ...
ax_x, ...
ay_x, ...
w_x, ...
a1_y, ...
ax_y, ...
... |
function existList = getExistBeamStructure(structure, areaAndForceList, plotLimit)
existList = zeros(size(structure, 1), 1);
memberVectors = structure(:, 5:6) - structure(:, 3:4);
memberLengths = zeros(size(memberVectors, 1), 1);
for i = 1:size(memberVectors, 1)
memberLengths(i) = norm(memberVec... |
% Mendefinisikan parameter dari permasalahan yang akan diselesaikan
function Fitness=objectFunctionGA(MatVariables)
NVariant = min(size(MatVariables));
NIndividu = max(size(MatVariables));
Fitness = zeros(NIndividu,1);
switch(NVariant)
case 2
x = MatVariables(:,1);
y = MatVariab... |
clear all
close all
data_dir='C:\DEM_5m';
cd(data_dir)
dir
%%
tic
data = imread('don_5m.tif');
data = double(data);
min = min(min(data));
data(data == min) = NaN;
toc
%%
tic
%Setup the desired specifications.
elevation_max = 100 %This is in meters and will chop off anything above this height.
window_size = 5 %Thi... |
% Here foreground pixel is denoted by 1 and background pixel is denoted by 0
function [nospaceRefinedStorFearureMat,nospaceLukUpTableForRealIndex] = GetFeatureOfComponentUpdated_3ExpNoSpaces(componentImg,fullImg)
[nRows,nCols] = size(componentImg);
storFeatureMat = zeros(nCols,8);
storTopIndex = zeros(nCols,3);
storBo... |
% Problem 3
% (a)
D = [
0 569 667 530 141;
569 0 1212 1043 617;
667 1212 0 201 596;
530 1043 201 0 431;
141 617 596 431 0
];
size_D = size(D, 1);
J = eye(size_D) - 1/size_D * (ones(size_D, 1)*ones(1, size_D));
B = -0.5 * (J*D*J);
[B_eigvec,B_eigval] = eigs(B, size_D, 'SM')
coordinates = B_eigvec(:, 1:2) * s... |
% dataRead_energy_1res.m
% Project csgA adsorption
% YJL 12/8/2015
% Description: Function reads in energy files output by vmd and saves a MAT
% file with the energy for each residue over time. The energy files are
% organized by residue and give the energy for the surface-residue
% interaction during adsorption.
% ... |
function CI = stoye_CI(lower_estim, upper_estim, varcov, signif_level, optimopts)
% Stoye (2009) confidence interval for partially identified parameter
% Inputs to routine
Delta = upper_estim-lower_estim; % Point estimate of length of identif. set
sigma_lower = sqrt(varcov(1,1)); % Std. dev. of lower ... |
function play_frames(figno, fps, frames, start, finish)
figure(figno);
tic;
for i=start:finish
frame = frames{i};
frame = frame(:,:, 1);
imshow(color_code(double(frame)));
drawnow;
time_elapsed = toc;
time_needed = (i-start+1) * 1 / fps;
time_remaining = time_needed - time_elapsed;
if (... |
function [scriptdata, namelist,frequency]=scriptprocess(scrFile)
fid=fopen(scrFile,'rt');
data=fscanf(fid,'%c',inf);
a=regexp(data,'\n','split');%split the file row by row
a=a';
[splitpoint,container]=regexp(a,'\:','start','split');%split every row with the position of ":"
%initialize
... |
function [paths,flags,configs,parcs,params]=f_fMRI_plots(paths,flags,configs,parcs,params)
% F_FMRI_PLOTS
% Plots data from fMRI processing and analysis
%
% Contributors:
% Matt Tharp, IU School of Medicine
close all
cd(paths.EPI.dir)
currDir = pwd;
if ~exist(strcat(curr... |
num_labels = 10; % 10 labels, from 1 to 10
% (note that we have mapped "0" to label 10)
%% =========== Part 1: Loading and Visualizing Data =============
% We start the exercise by first loading and visualizing the dataset.
% You will be working with a dataset that contains handw... |
function [ params_optimized ] = trans_duration(curr_dur, obj_dur, prms)
% Esta función se encargará de transformar una sácada en otra con una
% duración especificada.
global x;
global obje_dur;
x = 1:150;
obje_dur = obj_dur;
param_dur = int8(obje_dur / 10);
param_dur = double(param_dur);
if curr_dur < obje_dur
... |
classdef RABBIT < RobotLinks
% Author: Ross Hartley
% Email: rosshart@umich.edu
% Date: 06/02/2017
%
% Robot parameter values taken from:
% Westervelt, Eric R., et al. Feedback control of dynamic bipedal robot locomotion. Vol. 28. CRC press, 2007.
properties
ContactPoints
OtherPoi... |
function [rls] = rls_landweberdual(X,y, opt)
% rls_landweberdual(X, y, opt)
% computes the regression function for landweber regularization in the dual space.
% The regularization parameter (i.e. the number of iterations) is set to the one found in opt.paramsel.
%
% INPUTS:
% -OPT: struct of options with the following... |
load('20190412T152714.mat');
if params.NatVPhs == 1
cond = 'natural';
else
cond = 'phaseScram';
end
c = 1;
numIm = size(original_stimulus.images{1,1},3);
for i = 2:10:numIm
saveDir = '/mnt/storage_2/projects/Nat_PhScr/MS/finalFig/stimuli';
curIm = original_stimulus.images{1,1}(:,:,i);
fig... |
function [data,header] = loadmc(filename,time)
% [data,header] = loadmc(filename,timerange)
% Like load64, except doesn't account for gain of amplifier
[fid,message] = fopen(filename,'r');
if (fid < 1)
error(message)
end
header = ReadAIHeader(fid);
% End of header
ShowAIHeader(header)
if (nargin == 2)
data = ReadBina... |
function [movieType, supported, movieType2] = getMovieFileType(thisMoviePath,varargin)
% [movieType, supported, movieType2] = getMovieFileType(thisMoviePath,varargin)
%
% Determine whether movie is a type supported by CIAtah, don't assume every movie in list is of the same type.
%
% Biafra Ahanonu
% started: 2020... |
function [u, X_, Y_] = solver_4_2_7( dx, dy, dt, slices )
f_ = @(X, Y)(sin(pi * X) .* sin(2 * pi * Y));
nu = 1;
g_ = @(y, t)( -pi * exp(-5 * nu * pi * pi * t) .* sin(2 * pi * y) );
slices_id = round(slices / dt);
X = round(1 / dx);
Y = round(1 / dy);
x = 1; y = 1;
Mx = x * X; My = ... |
% Assignment 8 ; problem 3
function fval = fun4Spring(t,Y)
% Get variables
x = Y(1);
v = Y(2);
% Constants
W = 0.5;
% Describing dY/dt
fval = zeros(2,1);
fval(1) = v;
fval(2) = -(3*v+2*x+3*sin(W*t));
end |
function [a_out, alpha_out, difference_out] = GradientDescentLoop(y,H,X,lambda,a,alpha_initial,tolerance)
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
m=0; x=X;
iterations=0; iterations_out=0;
a_out=zeros(size(a)); alpha_out=alpha_initial;
error=0; mse_old=0; mse_new=0; difference=0;... |
close all
clear all
clc
% ------------------------------------------------
% datos
% largo de la barra
L=1;
% paso de la malla
dx=0.1;
% paso al cuadrado
dx2=dx.^2;
% nodos de la malla
x=0:dx:L;
% cantidad de nodos de la malla
n=length(x);
% define la matriz K y el vector f
K=zeros(n,n);
f=ze... |
function Data = DiscardTransientData(Data)
% Discard trainsient data
if any( strcmp(fieldnames(Data), 'ExplVar') ) && ...
~isempty(Data.ExplVar) && ...
any( strcmp(fieldnames(Data.ExplVar), 'discard_transient') ) && ...
Data.ExplVar.discard_transient > 0 % input check
... |
function angle = angl(vec1,vec2)
cosTheta = dot(vec1,vec2)/(norm(vec1)*norm(vec2));
angle_ = real(acos(cosTheta)); % in radian
angle = angle_ * 10;
end
|
%Take the original colored image (image 1) and start adding Gaussian noise to the pixels in the green channel.
#Increase sigma until the noise is somewhat visible.
img = imread('input/4.1.05.png');
[row column channel] = size(img);
noise_sigma = 30;
noise = randn([row,column]) .* noise_sigma;
img(:,:,2) = img(:,:,2)... |
%compare_single_stimuli_for_single_electrode_electrode_between_patterns_for_single_cell
neuron.expr_file = 'IFNR_0004_sc.mat'; neuron.file_str = 'IFNR0004'; neuron.signal_str = 'patch';
signal = sc_load_signal([get_search_dir neuron.expr_file], neuron.file_str, neuron.signal_str);
amplitudes = sc_get_amplitudes_... |
% ==== (SNS matlab code)======
% The Code (Version 1) is created by ZHANG Yabin,
% Nanyang Technological University, 2015-12-30
% which is based on the method described in the following paper
% [1] Wang, Yu-Shuen, et al. "Optimized scale-and-stretch for image resizing."
% ACM Transactions on Graphics (TOG) 27.5 ... |
classdef ProgConstraintType
enumeration
constraint,objectiveFunction
end
end
|
% % %
% % % FIS for flight test
% % %
clc;clear all; close all;;
trndata = xlsread('dg_autopilot_success.xls');
numMFs = 5;
mfType = 'gbellmf';
in_fis = genfis1(trndata,numMFs,mfType);
epoch_n = 20;
dispOpt = zeros(1,4);
out_fis = anfis(trndata,in_fis,20,dispOpt);
% saving the fis file
writefis(out_fis);
% writing t... |
%% CARGA DE DATOS
clear;
%% Variables para modficiar
name= "Prueba_1610_1.csv";
%name= "Prueba_05.csv";
of=1; %offset de toma de datos
%% Programa
[ALL]=table2array(readtable(name));
largo=length(ALL)-of+1; %length(ALL)-of+1;
% G=zeros(largo,1);
% k=1;
% con=0;
[AA]=ALL(of:end,1);%muestras
[A]=ALL(of:end,2); %tiemp... |
classdef DefaultBox
properties
feature_maps
min_sizes
max_sizes
image_size
has_six_default_boxes
end
methods
function obj = DefaultBox()
obj.image_size = 300;
% Size of the feature maps
obj.feature_maps... |
function [inputDim,outputDim,coeffs] = DeserializeMap(filename)
[inputDim,outputDim,coeffs] = MParT_('ParameterizedFunction_DeserializeMap', filename);
end |
function [traj, length] = turn(baseSize, resolution, speed)
% initial straight part
initTraj = init(baseSize, resolution);
% curved turn trajectory path
turnRadius = [35 62.5 90];
radius = turnRadius(speed);
len = (2*pi*radius)/4;
numSteps = ceil(len/resolution);
angleStep = (pi/... |
function [pp] = natcsi (x,y)
% Compute cubic spline interpolation with natural end conditions
% x ---> x_i vector
% y ---> y_i vector
% pp <--- p_i(x) values vector
% input error management
x = errman(x,y);
% ensure nondecreasing site sequence
if any(diff(x)<0)
[x,y] = insort(x,y);
end
% get the cubic spline
... |
% a function to show the features of the nodes
% im : the image
% l : the level of the nodes to be displayed
% f : which feature
% nodes : the structure that holds the nodes
% nodesFeature : array that holds the nodes features featuresxnodes
function showNodesFeatures(M,N,l,f,nodes,nodesFeature)
% choose the nodes at... |
function [ToStop, Message] = StopRun(fitness, generation, numGenerations, stopCrit, stopFitness)
Message = '';
ToStop = 0;
if generation >= numGenerations
ToStop = 1;
Message = ['Maximum Generation number achieved: ' num2str(numGenerations)];
elseif ~isempty(stopFitness)
if min(fitness) <= stopFitness
... |
function [distToLineSeg] = distanceToLineSegment(startPt,endPt, pt )
L = sqrt((endPt(1) - startPt(1))^2 + (endPt(2) - startPt(2))^2);
global MMA_DEBUG;
global MMA_ABS_TOL;
global MMA_REL_TOL;
if (L < MMA_ABS_TOL)
distToLineSeg = sqrt((startPt(1) - pt(1))^2 + (startPt(2) - pt(2))^2);
return;
end
% else
... |
function A = filterA(f, plotFilter)
if nargin < 2
plotFilter = 0;
end
% FILTERA Generates an A-weighting filter.
% FILTERA Uses a closed-form expression to generate
% an A-weighting filter for arbitary frequencies in Hz.
%
% Author: Douglas R. Lanman, 11/21/05
% Define filter coefficients.
% See... |
classdef ATMOptions < TrainOptions & MapOptions
properties (Access = public)
maxPatience = 10;
maxSize = 10;
maxDegrees = MultiIndex(0);
end
methods
function obj = set.maxPatience(obj,value)
obj.maxPatience = value;
end
function obj = set.maxSize(o... |
classdef KSPCATransform < ATransform
properties(SetAccess=private)
%kernel functions
y_kernel = [];
x_kernel = [];
sigma = 0.5;
downsampleUpperBound = 1000;
mean_x = [];
mean_y = [];
U = [];
training_points;
... |
function z= Function2(x)
z=-cosd(x(1))*cosd(x(2)) * exp(-((x(1)-pi).^2) - ((x(2)-pi).^2));
end |
%------------------newCase.m--------------------------------------------
clear all; close all;
syms mB mF l Jb g
syms k kt
Parameters
Mlin = [mB + mF,(l*mB)/2; (l*mB)/2,...
(mB*l^2)/4 + Jb];
% Special Case when kt = (g*l*mB)/2;
Klin = [2*k, 0; 0, 0];
A = double(subs(-Mlin\Klin));
[eVec, eVal] = eig(A);
omg = sqrt... |
I = imread('clock1.jpg');
K = medfilt2(I(:,:,1),[5 5]);
% figure, imshow(K)
imwrite(K,'c1.jpg');
I = imread('clock2.jpg');
K = medfilt2(I(:,:,1),[5 5]);
% figure, imshow(K)
imwrite(K,'c2.jpg');
I = imread('clock3.jpg');
K = medfilt2(I(:,:,1),[5 5]);
% figure, imshow(K)
imwrite(K,'c3.jpg');
I = imread('clock4.jpg');
... |
function Temp=Cel2Far(cel, exact)
% Cel2Far is a simple calculator to get a given temperature in Celsius
% converted to Farenheit.
% Function: Cel2Far(cel, exact)
% Input:
% cel Temperature in degree Celsius (float)
% exact if seti, the function returns float numbers, else integers
% Output: Temperature in degree Fa... |
function [A m t] = linsc(A, from, to)
% Scales data linearly. Examples:
% linsc(data, [0 1], [0 100]) % scale from [0 1] to [0 100] (equivalent to data*100)
% linsc(data, [0 1], [-1 1]) % scale from [0 1] to [-1 1]
% linsc(data, [-1 1]) % scale from [min(data(:)) max(data(:))] to [-1 1]
% linsc(data) %... |
clear; clc; close all
dat = xlsread('Lab8Data.xlsx');
datu = dat(1:floor(end/2), 1);
daty = dat(1:floor(end/2), 2);
figure(), subplot(211), title 'Y Data', hold on
plot([0:size(daty, 1)-1].*0.001, daty)
xlabel 'Time (s)', ylabel('$\theta$ (rad)', 'interpreter', 'latex')
subplot(212), title 'U data', hold on... |
% Statistics Toolbox
% Version 7.6 (R2011b) 15-Jul-2011
|
function[imf] = DCTcIFlp(im1,im2,k)
% inputs: im1 & im2 are images to be fused
% output: imf is the fused image
%By Dr. VPS Naidu
% transform RGB image into PCA space
[pcaim1,V1] = rgb2pca(im1);
[pcaim2,V2] = rgb2pca(im2);
im1pca1 = pcaim1(:,:,1);
im1pca2 = pcaim1(:,:,2);
im1pca3 = pcaim1(:,:,3);
im2pca1 = pc... |
classdef AdvRotationShockUniformMesh2d < AdvRotationUniformMesh2d
methods
function obj = AdvRotationShockUniformMesh2d(N, M, cellType)
obj = obj@AdvRotationUniformMesh2d(N, M, cellType);
end
end
methods(Access = protected)
function fphys = setInitialField( obj )... |
clear
x1 = [ 1.5 3.5 5 6.9 8.4 10 11.2 1 2.1 3.1 4 5.9 7.9 9 10.5];
x2 = [ 7 6.5 5 3.7 3 5 1.3 4.5 3.5 5.5 4.2 2.7 2.2 1.6 0.8];
xx = [x1;x2;1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
y = [1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1];
x = [x1;x2];
ws = inv(xx*transpose(xx))*xx*y'
x_bound = linspace(-5,15,200);
yy = -(ws(1)/ws(... |
function params = CBIG_EM_InitATParams_vol(corpus, paradigm_by_exp, params, brain_mask)
% params = CBIG_EM_InitATParams_vol(corpus, paradigm_by_exp, params, brain_mask)
%
% Initialize parameters for the EM algorithm of the Author-Topic model
% Note that compared to CBIG_EM_InitATParams.m, this function initializes
% b... |
function [FFmaps,errormaps,sdmaps,residuals] = Simulate_Values(SNR, sigmaError, reps)
% function [FFmaps,errormaps,sdmaps,residuals] = Simulate_Values(SNR)
% Description:
% Enables visualisation of FF accuracy and precision over a range of simulated FF and
% R2* values
% Input:
% SNR is the true SNR; sigma is calcu... |
%% Plot Randon data
close all;
clc;
if exist('randondata', 'var') == 1
disp('The required data is alrady loaded')
else
randondata = readmatrix('.\CustomerData\Randon\dutycicle.xlsx');
end
time = randondata(:,1);
speed = randondata(:,2)*60/2/pi;
torque = randondata(:,3)/12.25;
%
yyaxis left
plot(time, speed, 'C... |
function [xg,wg] = gauss_c(npg)
if npg > 1
u = (1:npg-1)./sqrt((2*(1:npg-1)).^2-1);
[vc,xg] = eig(diag(u,-1)+diag(u,1));
[xg,k] = sort(diag(xg));
wg = 2*vc(1,k)'.^2;
else
xg(1)=0;
xg(2)=0;
wg = 2;
end
|
function experiment = closeTivaroVstmExperiment(experiment)
%writes data and closes screen
disp('Saving Experiment...');
locationSaved = writeTivaroVstmExperiment(experiment);
disp([' >Experiment saved to ' locationSaved]);
% The same command which closes onscreen and offscreen windows also
% closes tex... |
function y=overload(X,a,b,G)
y=arrayfun(@(x) overload_element(x,a,b,G),X);
end
function y=overload_element(x,a,b,G)
if(abs(x)>=a)
y=G*(b*x+sign(x)*(1-b)*a);
else
y=G*x;
end
end |
function [OutputName,Recognized_index] = Recognition(TestImage, m, A, Eigenfaces)
% Extracting the PCA features from test image
ProjectedImages = [];
Train_Number = size(Eigenfaces,2);
for i = 1 : Train_Number
% Projection of centered images into facespace
temp = Eigenfaces'*A(:,i);
ProjectedImages = [Pro... |
function [ output_image ] = static_threshold( image, threshold )
%STATIC_THRESHOLD Summary of this function goes here
% Detailed explanation goes here
%Apply Threshold
output_image = image > threshold;
end
|
ecco20 = HighPowerPerms2('coax','eccosorb',0.001,'50mm_coax_air_20dbm_1-24-17.dat','50mm_coax_eccosorb_20dbm_1-24-17.dat','50mm_coax_eccosorb_20dbm_180_1-24-17.dat',' ');
ecco30 = HighPowerPerms2('coax','eccosorb',0.001,'50mm_coax_air_30dbm_1-24-17.dat','50mm_coax_eccosorb_30dbm_1-24-17.dat','50mm_coax_eccosorb_30dbm_1... |
edit MecheLab_3
%% 1a) Find the regression coefficients for the points (0,.23), (1,.925), (2,2.35), (3,3.5)
x = [0, 1, 2, 3]
y = [.23, .925, 2.35, 3.5]
%%I need to take the transpose of y, so i can multiply x*y
y = y'
% I will calculate a0 and a1 using the same formula that we used in class.
% In short hand, the fo... |
function [fxeval] = derivadaEvaluada(fx,x0)
delta=10^(-10)
fxeval=(fx(x0+delta)-fx(x0))/delta
|
clear all;
close all;
clc;
baseDir='C:/Users/Deltawi/Documents/MATLAB/Computer_Vision/TP1/Scene/';
baseDirDes='C:/Users/Deltawi/Documents/MATLAB/Computer_Vision/TP1/Sifts_base/';
[ I , nomim , sifts] = randomImageDes( baseDir , baseDirDes);
sifts = double(sifts);
load('centres.mat')
temp = [arrayfun(@(idx) norm(ce... |
%% function [x_out,y_out,theta_x_out,theta_y_out,color] = img2rays(img,width,numRays,maxRayAngle)
% generates a series of rays from an image
%
% inputs:
% img: An H x W x 3 matrix representing an image to be converted into rays. The third dimension represents the colors red, green, and blue respectively.
% width: ... |
function y = leasqrdfdp(x,f,p,dp,func)
%y = [0*x+1 x];
y=[exp(-p(2)*x) -p(1)*x.*exp(-p(2)*x)];
|
% calculate rate of OH + n-Heptane -> products
% Updated 6/10/15
% Based on MCM v. 3.3
% rate = kOHnheptane(T,M)
% n-Heptane, Heptane
function j = kOHnheptane(T,M)
j = 1.59e-17.*T.^2.*exp(478../T); |
function [Y, info] = hsl_ma97_multiply(handle, transpose, inverse, X, varargin)
% HSL_MA97_MULTIPLY Multiply by factor of Sparse Symmetric Matrix
% Y = hsl_ma97_multiply(handle, transpose, inverse, X) forms a product
% of X with the lower triangular factor L depending on the values of
% transpose and inver... |
function Concatenated = PaddedHorizontalConcatenate(ConcatCell,Padder)
% Argument count check
narginchk(1,2);
% Make sure ConcatCell is a cell array
if not(iscell(ConcatCell))
error('MatlabExtensions:PaddedHorizontalConcatenation:InputNotCell',...
'The first input must be a... |
# Author: Valentin Andrei
# E-Mail: am_valentin@yahoo.com
function [m_feat_normalized] = do_feature_scaling(m_feat_unnormalized, s_mmm)
m_mmm = load(s_mmm);
v_max = m_mmm(1, :);
v_min = m_mmm(2, :);
v_mean = m_mmm(3, :);
m_feat_normalized = (m_feat_unnormalized - v_mean) ./ (v_max - v_min);
endfun... |
classdef Dict2dTo3d < handle
% Dict2dTo3d
%
% This class contains logic that builds a high-res 3d dictionary from
% 2d patches at a lower resolution.
%
% John Bogovic
% HHMI
% September 2014
properties ( SetAccess = protected )
obj_fn; % the file where t... |
function [x,U,D] = thornton(xin,Phi,Uin,Din,Gin,Q)
%
% function [x,U,D] = thornton(xin,Phi,Uin,Din,Gin,Q)
%
%
% M. S. Grewal & A. P. Andrews
% Kalman Filtering Theory and Practice Using MATLAB
% Third Edition, Wiley & Sons, 2008
%
%
% Catherine Thornton's modified weighted Gram-Schmidt
% orthogonalizatio... |
function varargout = tsmirrms(x,varargin)
% e = mirrms(x) calculates the root mean square energy.
% Optional arguments:
% mirrms(...,'Frame') computes the temporal evolution of the energy.
notchunking.type = 'Boolean';
notchunking.when = 'After';
notchunking.default = 1;
option.no... |
function [datosEstructura,varargout] = organizarDatos(datosSap2000, varargin)
% function [datosEstructura,datosOpt] = organizarDatos(datosSap2000, datosExcel, datosOpt)
%funcion para organizar todos los datos que seran necesarios
%Nro de parametros de entrada
nin = nargin - 1;
%Empezamos a organizar todos los dato... |
function evalfunc4(States,B,Bus,Cp,Cq,Dp,Dq,E,F,K,S,Shunt)
global h cons
clear c V;
nbranch=length(B(:,1));
nbus=length(Bus(:,1));
nstate=length(States);
nvolp=length(F(:,1));
nang=length(F(:,1));
nI=length(K(:,1));
nflowsp=length(Cp(:,1));
nflowsq=length(Cq(:,1));
npinj=length(Dp(:,1));
nqinj=length... |
% 2.1: Contour plot and stationary points
% Make a contour plot of f(x) and locate all local minimizers, all local
% maximizers, and all saddle points.
sol_2_0;
%% Script parameters:
boundary_for_first_parameter.start = -5;
boundary_for_first_parameter.end = max(boundary_for_first_parameter.star... |
function totalAttenuations = fillTotalAttenuation( truncatedView, totalAttenuations )
% function totalAttenuations = fillTotalAttenuation( truncatedView, totalAttenuations )
% Detecting truncation projection in sinogram
%
% Meng Wu at Stanford University
% 2014
noViews = length( truncatedView );
for iv = 1 : noView... |
% Name: Zheng Wen
% USC ID: 7112807212
% USC Email: zwen1423@usc.edu
% Submission Date 2/11/2020
img = imread('E:\Chrome Download\EE569\Week2\HW2\Problem1\Gallery.jpg');
img = rgb2gray(img);
% for Dogs.jpg
% low_th = 0.1:0.01:0.5;
% high_th = 0.4:0.01:0.7;
% for Gallery.jpg
low_th = 0.1:0.01:0.3;
high_... |
function [hhg] = EvalsAndPlots(AFC, N, Nf, Title, varargin)
if(ismember('ss',varargin))
ss = AFC;
SS = fft(ss);
ssbp1 = N;
ssbp2 = Nf;
SSbp1 = fft(ssbp1);
figure( 'Name', Title, 'NumberTitle', 'off' )
CreateSimplePlot(ss, 'subplot', [4 2 1], ... |
function p = struct2arr(parms)
%
% function p = struct2arr(parms)
% p = zeros(9,1);
%
% p(1) = parms.mtis0 ;
% p(2) = parms.f ;
% p(3) = parms.cbva;
% p(4) = parms.bat;
% p(5) = parms.bat2;
% p(6) = parms.kfor;
% p(7) = parms.r1tis;
% p(8) = parms.flip;
% p(9) =parms.Disp;
%
%
p = zer... |
function [p0,pStar,p1,dp0,dpStar,dp1] = autoGen_kinematics_contact(x,y,q0,q1,dx,dy,dq1,dq0,r,a,b)
%AUTOGEN_KINEMATICS_CONTACT
% [P0,PSTAR,P1,DP0,DPSTAR,DP1] = AUTOGEN_KINEMATICS_CONTACT(X,Y,Q0,Q1,DX,DY,DQ1,DQ0,R,A,B)
% This function was generated by the Symbolic Math Toolbox version 6.2.
% 13-Aug-2015 16:00:1... |
close all; clear; clc;
A = imread('Kasus10.jpg');
B = rgb2gray(A);
B = ~im2bw(B,graythresh(B));
B = imfill(B,'holes');
D = -bwdist(~B);
mask = imextendedmin(D,2);
D2 = imimposemin(D,mask);
Ld2 = watershed(D2);
bw = B;
bw(Ld2 == 0) = 0;
%imwrite(bw, 'bwzShedKasus10.jpg');
imshow(bw); |
% Calculates the max speed of the vehicle in m/s
% Returns -1's is vehicle cannot sustain lift
% Returns current value for inputs that don't not converge after 1000
% iterations
% weight is the weight of the vehicle in N
% topArea and frontArea are the lateral areas of the vehicle from the top
% and front respe... |
%将数据集划分为训练集与测试集
function[X_train,Y_train,X_test,Y_test]=Q3_step2(X,Y,T) %T=280
% X=[1,2;3,4;5,6;7,8];Y=[60;70;80;90];T=0.8;
%训练数据
len = size(X,1);
randidx = randsample(len,T,false) ; %随机取样,不可重复
X_train = X(randidx,:);
Y_train = Y(randidx,:);
%测试数据
randidx2=[];
for i=1:len
... |
function [theta] = logReg(xtrain, ytrain)
n = size(xtrain, 2) - 1;
% Initialize fitting parameters
initial_theta = zeros(n + 1, 1);
% Set options for fminunc
options = optimset('GradObj', 'on', 'MaxIter', 400);
% Run fminunc to obtain the optimal theta
% This function will return theta and the cost
... |
function predicted = trueDistance723S2(data)
% Distances from AP to RP's in July 10th S1 walk
values = [ 8.544003745
9.433981132
10.63014581
9.433981132
8.544003745];
time = [20, 90];
predicted = zeros(size(data.Sign... |
% Copyright 2014
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writin... |
% QN 1
function [ output_args ] = eval( input_args )
output_args = ((input_args.^4) .* ((3.*input_args) + 5).^0.5)./((input_args.^2 + 1).^2);
end
eval(6)
eval([1 3 5 7 9 11])
% QN 2
function [ output_args ] = average( input_args )
output_args = sum(input_args)/numel(input_args);
end
function [ output_args ] = st... |
function assignOutputs(callerNargout, varargin)
%ASSIGNOUTPUTS Assigns desired output variables of a caller function to the
% caller's workspace as the variable VARARGOUT. Inputs include the caller
% function's NARGOUT and then an all-inclusive list of possible output
% variables in the order that they are to app... |
% NB7, NB6, NB5, AND NB4.
% Juan Carlos Martinez
% February 8th, 2015
% Last Update: February 11th, 2015
nb7='NB7.csv';
nb6='NB6.csv';
nb5='NB5.csv';
nb4='NB4.csv';
nb7table=readtable(nb7);
nb6table=readtable(nb6);
nb5table=readtable(nb5);
nb4table=readtable(nb4);
speednb7=table2array(nb7table(:,2));
speednb6=table2... |
% hidden_layers = number of neurons per hidden layer
% trainAlg = one of the algorithms from set:
% ['traingd','trainlm','traingda','trainrp','traingdm']
% x = inputs, y = targets
% returns predictions = prediction of labels (6x1004)
function [predictions] = createNN(hidden_layers, x, y, trainAlg, numEpoches, withP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.