text stringlengths 8 6.12M |
|---|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ONE DRUM NODE for testing
% VARY rho from 0.4 to 0.01
% note that:
% rho=0.25 gives square wave
% rho=0.01 gives sin wave
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Finite difference drum/chime
% Bruce Land, Cornell University, Feb 2018
% second order scheme from
% h... |
function almanac = read_gps_almanac(filename)
%read GPS YUMA almanac file (.txt)
fileID = fopen(filename);
if(fileID == -1)
almanac = [];
disp('Can''t open the file!')
return
end
temp = zeros(32,11);
almanac = zeros(32,12);
line = 1;
while ~feof(fileID)
tline = fgetl(fileID);
column = mod(line,15)... |
%脚本文件F2T.m定义了函数F2T,计算信号的反傅立叶变换。
function [t,st]=F2T(f,sf)
%This function calculate the time signal using ifft function for the input
%signal's spectrum
df = f(2)-f(1);
Fmx = ( f(end)-f(1) +df);
dt = 1/Fmx;
N = length(sf);
T = dt*N;
%t=-T/2:dt:T/2-dt;
t = 0:dt:T-dt;
sff = fftshift(sf);
st = Fmx*ifft(sff);
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Apply Naive Bayes to the data set and generate prediction.
% we will use three split criterions and choose the one with
% min cross validation error as the final predictor tree
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function varargout = covMatern(mode, par, d, varargin)
% Matern covariance function with nu = d/2 and isotropic distance measure. For
% d=1 the function is also known as the exponential covariance function or the
% Ornstein-Uhlenbeck covariance in 1d. The covariance function is:
%
% k(x,z) = f( sqrt(d)*r ) * exp(-s... |
function [ab_solved,df_solved,phi_solved] = XuNonUniformPhaseStep_ver2(I0_k,eps_k,phi_cos_k,phi_sin_k,I_k)
matrix_A = [ XuTallVector(I0_k), XuTallVector(I0_k.*eps_k.*phi_cos_k), -XuTallVector(I0_k.*eps_k.*phi_sin_k) ];
X = XuLeastSquareSolution(matrix_A,I_k);
ab_solved = -log(X(1));
df_solved = -log(sqrt(X(3)^2+X(2)^2)... |
clear all ; close all ;
subs = {'alex','dina','genevieve','jeremie','russell','sukhman','tegan','valerie'};
eeg_set_names = {'retino_gamma_01','retino_gamma_02','retino_movie','retino_rest'};
fmri_names = {'bp_clean_retino_gamma_01','bp_clean_retino_gamma_02','bp_clean_retino_movie','bp_clean_retino_rest'};
mask... |
% Copyright Claudio Menghi, University of Luxembourg, 2018-2019, claudio.menghi@uni.lu
% defining a variable that contains the name of the model
model='simppend';
% As we aim to consider the initial conditions of the model, we set init_cond to an empty set
init_cond = [];
% input_range we assume that the user can ... |
function [x,y,h,V,gamma,chi,alpha,mu] = varToState(var)
global N
% Note that var = [x;y;h;V;gamma;chi;alpha;mu]
x = var(1:N+1);
y = var(N+2:2*N+2);
h = var(2*N+3:3*N+3);
V = var(3*N+4:4*N+4);
gamma = var(4*N+5:5*N+5);
chi = var(5*N+6:6*N+6);
alpha = var(6*N+7:7*N+7);
mu = var(7*N+8:8*N+8);
end |
function [commErr, BERVec] = Generator_BERVec(SNR, N)
len = length(SNR);
BERVec = cell(N, 1);
commErr = cell(N, 1);
for i = 1:N
commErr{i} = comm.ErrorRate;
BERVec{i} = zeros(3, len);
end
end |
classdef InMemoryMotorMappingResult < mm.MotorMappingResult
properties(Access=protected)
FileName
Map_
MotionTubes_
PathLengths_
ROIs_
Trajectories_
end
methods(Access=protected)
function map = getMap(self)
map = self.Map_;
end... |
function status = XuOneStopRecon(s_config_fbp, s_config_preprocessing)
%status = XuOneStopRecon(s_config_fbp, s_config_preprocsssing)
fprintf('****Running one stop recon function ... ****\n');
%%
status = 0;
config_fbp_file_name = s_config_fbp;
config_preprocessing_file_name = s_config_preprocessing;
recon_para=XuR... |
function r = bisect(f,int,tol)
%
% BISECT(f,a,b,tol)
% bisection method to find a root of f
%
% input:
% f string giving function (e.g., 'sin(x^3)+3*x-5')
% int vector of length two specifying a bracketing interval
% tol desired size of final bracketing interval
% If tol is too small (e.g... |
function scatterPlotI(X,y,z,i)
color = ['r','g','b','y','k','c'];
rows = find(y == i);
X = X(rows,:);
z = z(rows,:);
for l = 1:6
r = X(z==l,:);
scatter(log(r(:,1)),log(r(:,2)),10,color(l))
hold on
end
axis equal
axis tight
end
|
filename = '/u/cliffk/bill/data/juemo/raw/epocheddata.mat';
d = load(filename);
for i = 1:size(d.data,1)
for j = 1:size(d.data,2)
fields = fieldnames(d.data{i,j});
for f = 1:length(fields)
filename = sprintf('../data/%i_%i_%s.mat', i, j, fields{f});
disp(filename)
... |
%% Plots and the solutions to the monodomain problem
N = 512;
alpha = [2, 1.7, 1.5, 2, 2];
Kalpha = [1e-4, 1e-4, 1e-4, 3e-5, 1e-5];
names = cell(length(alpha),1);
for i = 1: length(alpha)
names{i} = ['problemsol220000', num2str(alpha(i)*10), num2str(Kalpha(i)*1e5),'monodomain3', num2str(N),'.mat'];
end
count = [1,2... |
clear
clc
close all
%% Parameters
ncvariablename = 'tbot';
%% Loading data
% Gets the directory of the script
scriptloc = fileparts(mfilename('fullpath'));
% Opens the matrix of data
loadedmat = load([scriptloc,'/MatFiles/',ncvariablename,'.mat']);
% How do i refer to this variable without knowing the name of it?
... |
clear all; close all; clc;
%%
N = 1000;
nd = 3;
xg = ones(nd, 1); %45 degtree angle
xr = zeros(nd,1); %robot is always at origin.
mu = xg -xr;
kappa = 2; %concentration parameters
vonmises_samples = randvonMisesFisherm(nd, N, kappa, mu);
pdf = zeros(N, 1);
for i=1:N
x = vonmises_samples(:, i);
pdf(i) = vonMi... |
function [CCD_O_1_0,CCD_O_2_1,CCD_O_3_2,CCD_O_4_3,CCD_O_5_4,CCD_O_6_5,CCD_O_7_6,CCD_O_8_7]=CCD_O(n_e,T_i);
global n_e_data_CCD_O;
global T_e_data_CCD_O;
global Table_CCD_O_1_0;
global Table_CCD_O_2_1;
global Table_CCD_O_3_2;
global Table_CCD_O_4_3;
global Table_CCD_O_5_4;
global Table_CCD... |
%%%% This function is used to generate the instance for %
% min_{x \in X} \lambda_{max} (A_0 + \sum_{i=1}^{n} x_i A_i) %
% where X is a standard simplex in \Re^n and %
% A_0, A_1, \ldots, A_n are symmetric matrices in \Re^{m\times m} %
%%%%%%%%%%%%%%%%... |
function varargout = stackshow(fitarray,stackid,cntarray,sd)
if ischar(stackid)
% file name
load(stackid)
config = get(stack,'config'); %#ok<NODEF>
elseif isstruct(stackid)
% config struct
config = stackid;
st = imagesequence([],struct,stackid);
[ stackn... |
%% Q1
img = phantom(128);
%% Q1 Part a
%%
% * The required myIntegration() function is in the 'Code' folder.
%
% *Step size $\Delta s$* - Inter-pixel distance along any line in the image
% lies in the range [1,$\sqrt{2}$] pixel-width units. Hence, the step size should be chosen such that it is
% between 1 an... |
function vector=get_featureVector(image)
% this function returns a column vector of 64 features.
% First convert the colour input image into a greayscale image
image= rgb2gray(image);
[m,n]=size(image);
min_dimension=min([m n]);
Z = zigzag4(min_dimension); % the DCT-trandformed image is converted into one-dimensional ... |
function SerialFuc()
global s dialect;
global RcMsgRaw SerevoMsgRaw;
delete(instrfindall)
s = serial('com5');
set(s,'BaudRate',115200);
set(s,'InputBufferSize',20000);%%%设置输入缓冲区大小为200byte
set(s,'BytesAvailableFcnMode','byte'); %设置中断触发方式
set(s,'BytesAvailableFcnCount',1000); %设置中断触发方... |
function [nodes, edges, faces] = boundedVoronoi2d(box, germs)
%BOUNDEDVORONOI2D Computes a bounded voronoi diagram as a graph structure.
%
% [NODES, EDGES, FACES] = boundedVoronoi2d(BOX, GERMS)
% GERMS an array of points with dimension 2
% NODES, EDGES, FACES: usual graph representation, FACES as cell array
%
... |
function well_per_comp = simulateScreen
%Probability that fish will DIE (index = number of compound/well)
p = [0.014,0.021 0.032, 0.047, 0.071,0.106,0.159,.239,.357,.536];
num_rep = 10000;
well_per_comp = [0,0,0,0,0,0];
x_axis = [1,2,3,4,5,6,7,8,9,10];
well_per_comp(1) = 1;
arr_10 = zeros(1,num_rep);
for i = 1:num_rep... |
function [y,isterm,dir ] = option_fun_mean_on(t,x)
% event function to start treatment on mean field model when mean is high
% enough. event occurs when y changes from 1 to -1.
%set global variables
global beta mu_M D_M psi1 MT T_start
dx_m=@(t,x)mean_field(t,x);
% if treatment has not just ended
if t>T_sta... |
Infile= './Dataset_v1/Gaurav_3';
load(strcat(Infile,'_outptcloud'));
A = bodylabel;
for i=14:100
PT = A{i}{1};
Co = A{i}{2};
figure(1),showPointCloud(PT,Co,'VerticalAxis','y','VerticalAxisDir','down');
xlabel('X (m)');
ylabel('Y (m)');
zlabel('Z (m)');
pause(5);
disp(i);
end
... |
% add the all views' images feature into the matrix X
function []=add_data_to_matrix(lines_Path,kernel_Path,txt_Path,views,models,pslf_Path)
fprintf('start add_data_to_matrix\n');
if ~exist(pslf_Path,'dir')
mkdir(pslf_Path);
end
%% add data into X
X=cell(1,views);
kk=0;
for v=1:views... |
% prompt user to enter image file path
HDRImage = input('Please enter the file path for an HDR image, surrounded by single quotes with a file extension: ');
I = hdrread(HDRImage);
% calculate and print average minimum and average maximum intensity values
redHDR = I(:,:,1);
greenHDR = I(:,:,2);
blueHDR = I(:,:,3);
av... |
function name = rez_name(data_file,bragg,direction,varargin)
% function defines the filename used to store intermediate cuts
%
if nargin>3
prefix = varargin{1};
else
prefix = 'TF_';
end
[~,fname] = fileparts(data_file);
caption =@(vector)['[' num2str(vector(1)) num2str(vector(2)) num2str(vector(3)) ']'];
... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
% z-Transform properties
% Time reversal
syms z
x=[1 2 3 4];
n=[0 1 2 3];
X=sum(x.*(z.^-n));
Right=subs(X,z,z^-1)
nrev=[-3,-2,-1,0];
xrev=[4,3,2,1];
Left=sum(xrev.*(z.^-nrev))
|
classdef FourCompartmentsSimulator
%% FOURCOMPARTMENTSSIMULATOR is insensitive to FB, k32; default simulation is for p5661
% $Revision$
% was created $Date$
% by $Author$,
% last modified $LastChangedDate$
% and checked into repository $URL$,
% developed on Matlab 8.4.0.150421 (R2014b)
% ... |
% Semi-analytic calculation of the nonlinear constraints
% Yan Wang, May 29, 2013
function [LLR,a]=nonlinearConstFzero(N1,M2)
B=diag([1,-1,0,0,1,-1,0,0]);
% C is the constraint matrix
C=[1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0; ...
0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0; ...
0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0... |
%calcul energie signal
function [comparer] = energie_fun(x, fe)
nbSec = floor(length(x)/fe);
M = 256;
M_rec = M-1;
for i=1:nbSec-1
a=pow_fun(x(i:i+1));
frame_mat = frame_func(x(i:i+1), M, M_rec)
for j=1:length(frame_mat(1,:))
b=pow_fun(frame_mat(j));
if (b<0.5*a)
comparer(i) =... |
function d = minkowski_distance_cvip( vector1, vector2,r)
% MINKOWSKI_DISTANCE_CVIP - calculates the Minkowski distance between two feature vectors
%
% Syntax :
% ------
% d = minkowski_distance_cvip( vector1, vector2,n)
%
% Input Parameters include :
% ------------------------
% 'vector1' Feature v... |
function [Z] = Zernike(n,m,rho,theta)
% Computes the zernike polynomial Z_n^m
% n>=0 and n>=|m|
rho = rho./max(max(rho));
R = zeros(size(rho));
m1 = abs(m);
if mod(n-m1,2) == 1
R = zeros(size(rho));
else
for k = 0:((n-m1)/2)
R = R + (-1)^k*factorial(n-k)/(factorial(k)*factorial((n+m1)/2-k... |
%% Data
[row, col, dims] = size(indian_pines_corrected);
x = double(reshape(indian_pines_corrected, row*col, dims));
%% linkage with single method
z = linkage(x, 'single');
c = cluster(z,'maxclust',16);
% Agglomerative clustering for classes 1 and 2
figure(1)
scatter3(x(c==1,1),x(c==1,2),x(c==1,3))
hold on
scatter3(x... |
function [dx, y] = parrot_bebop_veltilt_m(t, x, tilt_rad, Cx, Cy, g, varargin)
% x [vx;vy]
% y [vx;vy]
% tilt_rad [pitch_rad roll_rad]
% d_vx = -Cx * vx + g * tan(pitch_rad)
% d_vy = -Cy * vy - g * tan(roll_rad)
% Output equation.
y = x;
% State equations.
dx = -diag([Cx Cy]) * x + diag([... |
function randpoints = generateSpherePoints(ctr, radius, n, maxoff)
%generate an array of zeros to hold the points around the sphere
randpoints = zeros(3,n);
%generate an array of zeros to hold the distances from the points to
%the sphere
errors = zeros(1,n);
%create a while loop wh... |
classdef RHD_Analyzer < SimulationAnalyzer
properties(SetAccess = public, GetAccess = public)
lastLinearFrame;
end
properties(SetAccess = public, GetAccess = public)
nModes; % number of transverse modes in [Y Z] direction
nFrames;
is2d; % True if run was of z extent 1, ot... |
function [meas_est, Jacobian] = obsEstMeasurementDS(...
x_est, y_est, z_est, spr)
% EKF estimated measurement
% Estimated LOS angles
azimuth_est = atan2(y_est , x_est);
elevation_est = atan2(-z_est , sqrt(x_est^2 + y_est^2 + z_est^2));
meas_est = [
azimuth_est
... |
function [a1,b1,c1,d1]=trf2ss(a,b,k);
%Return a state space description (type=2) of a transfer function
%
% Usage: [a,b,c,d]=trf2ss(a,b);
% [a,b,c,d]=trf2ss(a,b,k);
%
%See syscan for a canonical form
%See sysdr for a direct realization
% Programmed by Niels K. Poulsen
% Departmen... |
function chordae = build_3d_trees_arbitrary_coords(params, filter_params, tree_frac, k_0, k_multiplier)
%
% Creates and returns two binary trees of chordae
% The binary trees are fully balanced by definition
% N, the number of internal nodes, must be a power of two
%
% Input
% chorda... |
initialize_folder_names;
close all;
filename=strcat(DATA_FOLDER,'physics_constants.mat');
load(filename);
filename=strcat(DATA_FOLDER,'pressure_profile.mat');
load(filename);
filename=strcat(DATA_FOLDER,'flux_geometry.mat');
load(filename);
filename=strcat('../METIS_profiles.mat');
load(filename);
filename=strcat(DATA... |
function [ res] = w_dot_del_u_v_integral( params, paramsP, grid, tria_index, qdeg)
%W_DOT_DEL_U_V_INTEGRAL Summary of this function goes here
% Detailed explanation goes here
f = @(lcoord) w_dot_del_u_v_local( lcoord, params, paramsP, grid, tria_index);
res = -triaquadrature(qdeg,f)*2*grid.A(tria_index);
end |
function [ h ] = add_button( button_to_left,string )
%ADD_BUTTON Given the handle to a button to the left, create another next
%to it
% Duplicate button will have same dimensions. Attributes should be set
% with returned handle.
d = 10; % points spacing
sz = button_to_left.Position;
parent = button_to_left.Parent;... |
function [N,dN_du] = evaluateBasis(qPts)
% Element parameters.
n = 3;
nen = 10;
nQPts = size(qPts,1);
N = zeros(nen,nQPts);
dN_du = zeros(nen,3,nQPts);
for qq = 1:nQPts
xi = qPts(qq,1);
eta = qPts(qq,2);
% Find the barycentric coordinates of xi and eta
vert = [0,0;1,0;0,1];
x1 = vert(1,1);
... |
function V = vertices(I)
% compute the vertices of an interval matrix
%
% Syntax:
% v = vertices(I)
%
% Inputs:
% I - interval matrix
%
% Outputs:
% v - vertices
%
% Author: Weiming Xiang
% Written: 02/25/2019
% Last update: 02/25/2019
%------------- BEGIN CODE --------------
V = combvec(I(1,... |
% 2020.06.09
% Dianxin at UoE
% Ignore the Received_Signal_when_h_is_known
function [Unrecovered_Signal, Received_Signal_when_h_is_known] = OFDM_Receiver(Received_Signal, FFT_Size, Length_of_CP, Length_of_symbol, Received_Signal_when_h_is_known)
% S2P
Received_Signal = reshape(Received_Signal, Length_of_symbol... |
function [negativeB, y] = getNegativeData(bData, x)
% select only the Negative field sweep from the full low-B data
numOfPoints = length(bData);
numOfNegatives = 0;
for i = 1:numOfPoints
if bData(i) < 0
numOfNegatives = numOfNegatives + 1;
end
end
negativeB = zeros(numOfNegatives, 1);
y ... |
function h = draw(G, options, FaceField)
F=G.F;
V=G.V;
if isempty(F) | isempty(V)
disp('Empty vertices or faces!');
return;
end
if ~iscell(F) %convert to cell array
F=mat2cell(F',ones(1,size(F,2)),3);
end
face_size = cellfun(@numel, F); % get face size per face
minmax_face_size = [min( face_siz... |
function CircCollision
% Have fun with just click
% For anr explanation or Feedback contact
% Nikesh Bajaj
% bajaj.nikkey@gmail.com @9041150067
% Aligarh Muslim University
global vel vel2 size color1 color2 pos pos2 width hight
width=400;
hight =400;
x=(width)/2;
y=(hight)/2;
pos =[x y];
pos2=[x/2 y/... |
function [V,pe] = FLD(X,Y,color,a)
[d,N]=size(X);
mu_x = mean(X,2);
mu_y = mean(Y,2);
MX = X - repmat(mu_x,1,N);
MY = Y - repmat(mu_y,1,N);
SW = MX*MX' + MY*MY';
V = SW^(-1)*(mu_x - mu_y);
Px = V'*X;
Py = V'*Y;
if mean(Px)>mean(Py)
Px = -Px;
Py = -Py;
end
%plot ROC
P = [Px Py];
I = [zeros(N,1); ... |
% 'src' and 'evt' are arguments passed automatically by the 'timer' objects,
% thus they need to be handled even if not used
%
function OnExit( src, evt, atController, tTCPConnection )
%
try %
%
for iController = 1:numel(atController)
%
atController{iController}.OnExit(tTCPConnection);
%
en... |
function init_knowledge_base()
%% initializing the rule base and creating a folder for archiving them
% Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com)
global FISFILENAME ARCHIVEFOLDER FIS
globalfql % global parameters initialized
% create archive folder
if exist(ARCHIVEFOLDER,'dir')~=7
mkdir(ARCHIVEFOLDER);... |
clear
close all
%% Parameter Initializition
paramInit % Init mission parameters
targ.sma = 42164000; % m
scenarioDuration = 36*3600; % sec Scenario duration
n = sqrt(earth.mu/targ.sma^3); % mean motion
stepSize = 0.1; % sec State transition step interval
burnAccel = fgc.thrust/fgc.mass*fgc.pulseWidth; % m/s^2 Min acce... |
function [w,b,x] = svm_param_calc(meas,grp)
SVMModel = svmtrain(meas,grp);
%Now before we calculate anything we need to rescale all the data
shift = SVMModel.ScaleData.shift; scale = SVMModel.ScaleData.scaleFactor;
shift = repmat(shift,size(meas,1),1);
scale = repmat(scale,size(meas,1),1);
x = (meas + shift) .* scale... |
function a = get_steering_vectors_single_bank(Ron, Roff, good_idx, xid, bad_freqs, save_dir, tmp_stmp, pol, overwrite)
filename = sprintf('%s/%s_steering_vectors_%s.mat', save_dir, tmp_stmp, pol);
if ~exist(filename, 'file') || overwrite == 1
Nele = length(good_idx);
Npoints = size(Ro... |
classdef SUCFF < SUFF
%
% \author M.Moriche
% \date 01-05-2015 by M.Moriche \n
% Created
%
% \brief Structured Uniform Fluid Field
%
% \details
%
% Class to simplify the postprocessing of simulation frames.
% Scripts that use this class result much more clear
%
% METHODS:
% - C2R
%
properties
ux_re; ux_im;
u... |
width=400; height=400;
DataSet = cell([], 1);
for i=1:length(dir(fullfile(Dataset2,'*.png')))
% Training set process
k = dir(fullfile(Dataset2,'*.jpeg'))
for j=1:length(k)
tempImage = imread(horzcat(Dataset2,filesep,k{j}))
imgInfo = imfinfo(horzcat(Dataset2,filesep,k{j}))
if strcmp(imgInfo.ColorType,'grayscale')
Dat... |
function varargout = panelGUI(varargin)
T_SKIN_MIN = 0.1;
T_SKIN_DEFAULT = 1;
T_SKIN_MAX = 3;
PITCH_STIFF_MIN = 1;
PITCH_STIFF_DEFAULT = 20;
PITCH_STIFF_MAX = 100;
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gu... |
disp("----- Problem 19 -----")
disp("Problem 1")
syms f(x)
syms g(x)
f(x) = x^3 - 2*x + 1;
g(x) = x^2;
h(x) = f(x) - g(x);
a = 0;
b = 1;
intersect = false_position(h, a, b);
disp("x=")
disp(vpa(intersect))
disp("Problem 2")
syms f(x)
f(x) = 9 * x^4 + 18*x^3 + 38 * x^2 - 57*x + 14;
a = 0;
b = 0.5;
intersect = ... |
function f = stagetwo(x,pars)
% return fit of Izi MSN D1 or D2 type neuron (intrinsic) to corresponding Moyer et al data
% Moyer data - injection current and corresponding output
inj = [0.22 0.225 0.23 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000];
injScaled = roun... |
function [mi boundary binneddata] = opt2bin (rawdata, class, steps,...
typesearch, minint, maxint)
% Karl Kuschner, College of William and Mary, Dept. of Physics, 2009.
%
% opt2bin finds the best single boundary for each variable to maximize MI
%
% DESCRIPTION
% This function takes an array of continuous da... |
close all; clear; clc;
%%
%
% Joćo Araśjo 2018/2019
%
% Tour visualization Script for the Traveling Santa 2018 contest
%
%
%%
%% Tour drawing
Data = csvread('cities.csv',1);
prime_vector = primes(size(Data,1)-1);
prime_idx = prime_vector +1;
nonprime_vector = Data(~ismember(Data(:,1),prime_vecto... |
function h = plot_fcvdata(data,ts,lines,clim)
% plot_fcvdata creates a colour plot of fcv data from tarheel fcv
%
% function h = plot_fcvdata(data,ts,clim,lines)
%
% Take a matrix of fcv data and plots using traditional colour map
%
% Inputs:
% data - fcv data (m×n matrix, points in scan×scan number)... |
function populate_ac_db_from_folder(main_figure,path_f,varargin)
%% input parser
p = inputParser;
addRequired(p,'main_figure',@ishandle);
addRequired(p,'path_f',@ischar);
addParameter(p,'ac_db_filename','',@ischar);
addParameter(p,'platform_type','Hull',@ischar);
addParameter(p,'transducer_location_type','Hull, keel... |
%@(#) sortcost.m 1.2 94/08/12 12:15:43
%
function [antal,restsek,meanburn,uttag]=sortcost(irad,select,restSEK,burnup,Uttag,imax)
if nargin<6, imax=max(irad);end
antal=zeros(1,imax);meanburn=antal;uttag=antal;restsek=antal;
for i=1:max(irad)
ibun=find(irad==i&select);
antal(i)=length(ibun);
if antal(i)>0,
... |
function make_data_sets(N_test, N_train, N_genes, Data, Labels, file_name)
if N_test + N_train < size(Data,1) && N_genes < size(Data,2) && size(Labels,1) == size(Data,1)
sample_data(N_test, N_genes, Data, Labels, [file_name '.test']);
sample_data(N_train, N_genes, Data, Labels, [file_name '.train']... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Author: Hamza Bourbouh <hamza.bourbouh@nasa.gov>
% Notices:
%
% Copyright @ 2020 United States Government as represented by the
% Administrator of the National Aeronautics and Space Administration. All
% Rights Reserved.
%
% Disclaimers
%
% No Warranty:... |
clear all
% Generarea matricei A
A=[11,12,13,14;21,22,23,24;31,32,33,34;41,42,43,44]
% Manipulari cu matricea A
B=A(2,2:4)
C=A(2,:)
D=A(1:2:3,:)
E(:,[3,5,7])=A(:,2:4)
F=A(:,[1 3 2 4])
% Utilizarea filtrelor logice
Filt=zeros(size(A));
Filt(1,3)=1; Filt(2,4)=1; Filt(4,4)=1;
% Transforarea mat... |
function [out] = plot_spheres(vertices, scale_factor, varargin)
[x, y, z] = sphere(10);
n = size(vertices, 1);
for ind = 1:n
out = surf(scale_factor * x + vertices(ind,1), scale_factor * y + vertices(ind,2), scale_factor * z + vertices(ind,3), ...
'FaceColor', 'r', 'EdgeColor', 'n... |
% Copyright (c) 2020, The MathWorks, Inc.
function autoFitCellWidth(filename)
% Excel ファイルへの絶対パスを取得
filepath = which(filename);
% Excel に対して ActiveX を開く
h = actxserver('excel.application');
wb = h.WorkBooks.Open(filepath);
% UsedRange: データが入っている範囲の
% EntireColumn: 列全体を
... |
function meascentralfrequency
%MEASCENTRALFREQUENCY - Measures central frequency using sextupole (chromaticites)
%
% Written by Laurent S. Nadolski
DisplayFlag = 1;
t0 = clock;
stepxi = 1;
stepfreq = 100e-6;
kn = 3;
tune1 = zeros(2,2*kn+1);
tune2 = zeros(2,2*kn+1);
tune3 = zeros(2,2*kn+1);
tune4 = zeros(2,2*kn+1);
... |
function stan_cadata_roi_vis(IMAGE,ROIS,IDX)
%
%
%
%
%
%
IMAGE=double(IMAGE);
imagesc(IMAGE);
caxis([0 256]);
colormap(gray);
hold on;
for i=1:length(ROIS)
% use the sorting idx
center=ROIS(IDX(i)).Centroid;
% label with i, which corresponds to the appropriate idx in other plots
text(center(1)+10,cente... |
clc
clear all
simulation_step=50e-6;
fs=1/simulation_step;
step_one_cycle=round(0.02/simulation_step); %%400 一个周期四百个数
fft_fre=0:50:250;
[~,fre_l]=size(fft_fre);
fit_T=4; %%拟合周期数 选取4
for ii=1.08+simulation_step:simulation_step:1.5
step=round(ii/simulation_step);
seq=rem(step,step_one_cycle);
... |
function ZAna = rdDpxAvgBar(disps,D)
% Main analysis function for binding data
%
% AnalysisOutput = rdDpxAvgBar(disps
% average and t-test for 2 value's: near and far.
% makes a barplot with error bars (std) and a nice asterix if significant
% :)
% only for stereo
% D input is optional data. If not given will be asked ... |
function [chi, Res_term, TV_term, Tik_term] = tikhonov_qsm(tfs, Res_wt, sus_mask, TV_mask, Tik_mask, air_mask, TV_reg, Tik_reg, TV_reg2, vox, P, z_prjs, Itnlim)
% argmin ||Res_wt * (F_{-1} * D * F * sus_mask * chi - tfs)|| + TV_reg * TV|TV_mask * chi| + Tik_reg * ||Tik_mask * chi|| + TV_reg2 * TV|air_mask * chi|
%
% tf... |
close all;
clc;
clear;
% register the generator
setpaths;
m = gbs_Matrix('m', 2, 4); % three 2D measurements
n = gbs_Vector('n', 7);
d = gbs_Vector('d', 3); % three known 3D distances
syms a1 a2 a3; % three unknown lambda factors
eq(2) = a1^2+a2^2-m(1,1)*a1*a2-m(1,2)*a1+m(1,3)*a2+m(1,4)-d(1); % three polynomial equat... |
function [X_rec,flag] = GD(uvw,pmat,X_init)
flag = 0;
X(:,1) = X_init;
reso1 = 1;
reso2 = 1;
for step = 1:100
dLdX = call_grad(uvw,pmat,X(:,step));
dLdX2 = call_grad2(uvw,pmat,X(:,step));
Loss = call_loss(uvw,pmat,X(:,step));
% Loss = call_loss(X-rate*dLdX')
%... |
% function success = finaliseHWActivityDataset(filepath,savepath, verbose)
clear;
clc;
% filepath = '/home/yossi/Dropbox/visualRFNN/Datasets/Dataset_4_new/activitiesPredictionsResiduals/no_suboutput_1000_passes_10-Jan_nw_400_regtype_abs_lambda_-3_/';
filepath = '/home/yossi/Dropbox/visualRFNN/Datasets/Dataset_4_new/ac... |
function [ edge_verts ] = get_parc_edges(vert_weights,nbrs)
% find some edges yo
%
% INPUTS
%
% vert_weights: vector (length == number of verticies) of label
% weights
% nbrs: matrix (size1 == number of verticies) of neighbors
% per vertex
%
% OUTPUTS
... |
# Ejercicio Evaluable 1
# Reactor Monod
h = 'hola'
# Variables
# X (concentracion de biomasa)
# S (concentracion de sustrato)
# y Sout ?
# El sustrato
# Tiene inputs de 1.5 mmol/h
# Tiene outputs que dependen de X (y de rs) y de S (canal de salida)
mux = 0.3;
Km = 0.2;
# La biomasa
# Tiene inputs que dependen d... |
function neighbors = roiNeighborsIndex(imMask, winSize)
% generates neighbor cell array as an input for robust fuzzy c-means
% function rfcm
% SYNTAX:
% neighbors = roiNeighborsIndex(imMask, winSize) generates neighbors
% (cell array containing the neighboring pixel indices) with input roi
% and window size. T... |
function [ A ] = neu_tseries( input_dz,output_dz )
%UNTITLED5 此处显示有关此函数的摘要
% 此处显示详细说明
fid=fopen(input_dz,'r');
tline=fgetl(fid);
k=0;
fid_w=fopen(output_dz,'w');
header=['# time_unit: years',10,'# unit: mm',10,'# scale: 1',...
10,'# column_names: east north up east_sigma north_sigma up_sigma year month day hour',... |
function [ result ] = isCollideFood( field, headPos )
result = field(headPos(1),headPos(2))==5;
end
|
function [gs_top,post,betas_hist] = kyu_BN_trainMCMC_L1_BS(data,args_graph,args_MCMC)
% a main MCMC routine with parallelization
MCMCresults = struct('Label',0,'Prior',0,'EdgePosterior',0,'TopGraph',0,'DAGhistogram',0,'L1track',0,'Beta_track',0,'Beta_hist',0,'Agree_caus',0,'Agree_ipa',0);
NoFolds = numel(data);
num_n... |
function PolyMshr_PlotMsh(type, coord,ele, eleMat)
% type = 0: elements whitout color
% type = 1: fill color in elements
hold on;
ne = length(ele);
elePoint = NaN(ne,17);
for ii = 1:ne
nodes = ele{ii};
elePoint(ii,1:length(nodes)) = nodes;
end
if type == 1
a = eleMat == 1; b = eleMat == 2;
... |
function DELTAM = calculate_GKM_continuous_ASL_signal(t, f, lambda, M0b, alpha, T1, T1b, t_labeling, deltat, tau)
% calculate_GKM_continuous_ASL_signal -- Calculate the continuous labeling ASL signal
% Usage
% DELTAM = calculate_GKM_continuous_ASL_signal(t, f, lambda, M0b, alpha, T1, T1b, t_labeling, deltat, tau... |
% This script compares hand drawn V1-V3 ROIs from multiple raters
% KGS 2/20
%% set path
subDir='/Users/kalanit/Courses/psych224/data/TestSubject/TestSubject_190725';
cd(subDir);
%% Open a mrVista 3D view
vw = mrVista('3');
%% Load HK's V1-V3 ROIs
HK_ROIs={
'toonRet_CSS_lh_V1_hk.mat',
'toonRet_CSS_lh_V2d_hk.mat',
'... |
%FNNLS Fast non-negative least-squares algorithm.
%
% Adapted from NNLS by Mathworks, Inc. and fnnls by R. Bro 5-7-96
%
% x = fnnls(AtA,Atb) solves the problem min ||b - Ax|| if
% AtA = A'*A and Atb = A'*b.
%
% A default tolerance of TOL = MAX(SIZE(AtA)) * NORM(AtA,1) * EPS
% is used for deciding when elements of ... |
source "../tools/utilities/geometry_helpers_2d.m"
source "./total_least_squares_indices.m"
# error and jacobian of a measured pose, all poses are in world frame
# input:
# Xi: the observing robot pose (3x3 homogeneous matrix)
# Xj: the observed robot pose (3x3 homogeneous matrix)
# Z: the relative transform me... |
function Symmetry_Correspondence_Loss_Folder(input,output)
x=dir([input '\*.csv']);
N=length(x(:,1));
for i=1:N
y=CSV_0_0_To_Matrix([input '\' x(i,1).name]);
z=[];
for j=1:length(y(:,1))
z(j,1)=j;
end
symmetry_correspondence_loss=Symmetry_Correspondence_Loss(y);
Symmetries_... |
clc
close all
clear all
load PU
img=pavia_corrected;
gt=groundtruth;
classnum=9;
window_size=15;
patch_size=floor(window_size/2);
RandSampled_Num = 250*ones(1,9);
img_extend=padarray(img,[patch_size patch_size],'symmetric');
scale_level=[0.1,0.2,0.3,0.4,0.5,0.7,1];
% scale_level=[0.1];
leve... |
%/**
% Скрипт отрисовки графики для межсистемных помех
%*/
clear
close all
clc
path_to_ro = [pwd '/ro'];
path_to_results = [pwd '/results/back_intersystem_L2'];
path_to_pics = [pwd '/k_intersys/L2/BackGPS'];
load([path_to_results '/BackInterSysJam_BoCsin_L2_BoC_10_5.mat']);
load([path_to_results '/BackInterSysJam_B... |
function ptable = param_tables(params, heterogeneity)
param_names = {};
param_names(1,:) = {'numeraire_in_dollars', 'Mean annual income ($)'};
param_names(2,:) = {'nx', 'Num points, cash-on-hand grid'};
param_names(3,:) = {'xmax', 'Max, cash-on-hand grid'};
param_names(4,:) = {'xgrid_par', 'Curv, cash-on-hand g... |
function totalError = knn(distance, labelsTest, labelsTrain, k)
[m,n] = size(distance);
nn = zeros(m,k);
dist = zeros(n,2);
% loop to calculate the k-nearest neighbor of each point in data set
for i = 1:m
for j = 1:n
dist(j,2) = j;
end
dist(:,1) = distance(i,:);
% sort distance of all tr... |
uniqueUsers=load('../SUsig/uniqueUsers');
uniqueUsers=getfield(uniqueUsers,'uniqueUsers');
for i=1:length(uniqueUsers)
user=uniqueUsers(i);
userdata=load(['../SUsig/userdata/' char(user) '_dataset.mat']);
userdata=getfield(userdata,'dataset');
dataLabels=load(['../SUsig/userdata/' char(user) '_labels.m... |
function [pnts] = getpoint (I)
figure('name','Doubleclick to set location');
imshow(I);
[c r] = getpts(1);
pnts = uint32([c r]);
if size(pnts)>1
pnts = [pnts(1,1) pnts(1,2)];
end
close all;
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.