text stringlengths 8 6.12M |
|---|
function DAQmain
%DAQMAIN Data Acquisition GUI
dataAcqTool_export;
end
|
% Filter to sharpen the training images
h = fspecial('unsharp');
allImages = dir('*.jpg');
%% Histogram matching
% Take a reference image and filter it
imageRef = imread('image_1.jpg');
imageRef = imfilter(imageRef,h);
histRef = imhist(imageRef); % Compute histogram
%figure; imhist(imageRef);
cdfRef = cumsum(histRef) ... |
%__________________________________________________________________________
%
% REEFMOD-GBR MAIN SCRIPT FOR CALIBRATION OF CYCLONE MORTALITY
% requires uploading the model in the workspace:
% /data
% /functions
% /outputs
% /settings
%
% Parameters tuned in the script f_single_reef_for_calibration_cyclones
% Yves-Marie... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2012 Analog Devices, Inc.
%
% 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:/... |
x = 1:10;
y = x.^2;
figure(1)
plot(x,y)
title('y = x^{2}')
xlim([0 15])
ylim([0 120]) |
function cms_applyscale
hwin=gcf;
hs=get(hwin,'userdata');
hfig=hs(4);
cmsplot_prop=get(hfig,'userd');
if hs(3)<0,
typ='min';
else
typ='max';
end
switch typ
case 'min'
cmsplot_prop.scale_min=get(hs(2),'value');
case 'max'
cmsplot_prop.scale_max=get(hs(2),'value');
end
set(hfig,'userdat... |
function [edges, classes] = getEdgesFromDense(param, nmlFile)
% [edges, classes] = getEdgesFromDense(param, nmlFile)
% This function extracts a list of all edges and their
% classification (+1 for connected, -1 for disconnected)
% from an NML file.
%
% Written by
% Alessandro Motta <... |
L=10;
N=100;
dx=L/N;
dt=0.001;
rho=50;
lambda=100;
c=10;
T_0= 20;
T_L=0;
T_R=50;
T=T_0*sin(linspace(0,3*pi,N))+T_0; %linespase равномерный массив по левому числу и правому числу сс равноудаленными эедлементами
%T=T_0*ones(1,N); %динейно
T(1)=T_L;%краайняя левая
T(N)=T_R;%краайняя правоая
T(N/2)=60;
T_dr... |
image = rgb2gray(imread('intersectie.jpg'));
figure('name', 'Original image');
imshow(image);
template = rgb2gray(imread('template_intersectie_2.png'));
template = imresize(template, 0.1);
figure('name', 'Template image');
imshow(template);
figure('name', 'Finding template');
find_template = normxcorr2(template, imag... |
function [] = Dibujomecanismo( q, params )
%Definimos valores limite de x e y de la gráfica
%Definimos las coordenadas generalizadas
x1=q(1);
y1=q(2);
x2=q(3);
theta=q(4);
%Definimos las coordenadas que no varían(fijas)
xA=0;
yA=0;
y2=params.y2;
%Dibujamos nuestro mecanismo, en este caso, 2 barras, ya que tenemos un
%... |
clear, close all
%input
[srcimg, map] = imread('girl.bmp');
srcimg = double(srcimg);
[hs, ws] = size(srcimg);
%make tone curve
p = 0:255;
m = zeros(1, 256);
h = zeros(1, 256);
for i = 1:256
m(i) = -(i-1)/2;
end
%change
outimg = zeros(hs, ws);
for j = 1:hs
for i = 1:hs
out... |
% LOWER BOUNDS
% set all lower bounds to zero
lb = zeros(1,anzahlVar);
% UPPER BOUNDS
%initialize upper bounds as non-bound
ub = Inf * ones(1,anzahlVar);
ub(xSTART + 1 : xSTART + xLENGTH) = 1;
ub(hSTART + 1 : hSTART + hLENGTH) = Inf; |
function x = findMax(POPULATION_SIZE, P_Cr, P_M, ITER_NUM, DRAW_PLOT)
if nargin == 4
DRAW_PLOT = false;
end
PLOT_RATE = 60;
CHROMOSOME_LENGTH = 15;
S = (-10:(20/32767):10)'; % множество решений
Populations{1} = floor(rand(POPULATION_SIZE, 1)*32767); % начальная популяция
i = 1;
while i <= ITER_NUM
P... |
% Calculates the pheromone levels for the next generation
function newPheromoneLevels = UpdatePheromoneLevels(pheromoneLevel, deltaPheromoneLevel, rho);
size = length(pheromoneLevel);
evaporationMatrix = zeros(size,size);
for i = 1:size
for j = 1:size
evaporationMatrix(i,j) = (1 - rho) * pheromoneLeve... |
function [TP_rate_F_fold, FP_rate_F_fold, std_TP_rate_F_fold, std_FP_rate_F_fold] = cross_validation(X, y, F_fold, tt_ratio, k_range)
%CROSS_VALIDATION Implementation of F-fold cross-validation for kNN algorithm.
%
% input -----------------------------------------------------------------
%
% o X ... |
function mclbtdng
% Called by mclcalc following mclroot1
% Re-plots reflected root and calcs new bb poly
% Declare globals
global mclbbc hmatzt ;
global cmatrd camtrr qpoly ;
% Define local variables
bb = (mclbbc) ;
% Obtain current point
bmatcp = get(gca,'CurrentPoint') ; % 3x2 matrix
% Identify data point ****... |
%% Master 1D Single Molecule Tracking Script
% Claudia Carcamo
% 03 - 14 - 2020
%% save the directory information here for the rest
% REQUIREMENTS
% FUNCTION: my_directory_function('color',)
% Must Start In Directory Of Interest
% Directory must be made in jupyter notebook script
my_directory = 'C:\U... |
function R = Range(tsa, tsflag)
% ctsd/Range
%
% R = Range(tsa, 'sec')
% R = Range(tsa, 'ts')
% R = Range(tsa. 'all_ts')
%
% returns range covered by tsa
%
% INPUTS
% tsa
% tsflag: if 'ts' returns time in timestamps,
% if 'sec' returns time in sec
% if 'sec0' returns time in se... |
function [ setInfo ] = old_interface_fill_commonDataInfo( commonData, aqiIndex, periodIndex)
stringToRun='';
stringToRun=strcat(stringToRun, refInfo.fill_CommonDataInfoFunction);
stringToRun=strcat(stringToRun, '(');
%stringToRun=strcat(stringToRun,'refInfo,');
stringToRun=strcat(stringToRun,'commonData');
stringToRu... |
function plot_elec_density(subj_list, thresh, avgsubj, cfg)
% PLOT_ELEC_DENSITY Plots electrode density on brain average.
% Outputs four figures:
% 1. For each voxel, how many electrodes are within thresh (mm).
% 2. For each voxel, how many subjects have at least 1 electrode within
% thresh (mm).
% 3... |
% SHIFT Shifts a Diffration object by a scalar value
%
% Usage:
% >> object=shift(object,coordinate,value)
% The "coordinate" input may be 'Grid1' or 'Grid2'.
%
% See also Xray, Diffraction, map, scale
%
% created August 27, 2015 by Tommy Ao (Sandia National Laboratories)
% modified January 21, 2016 by Tommy Ao
%
fu... |
function [MSDF,sdf] = pa_spk_sdf(spike,varargin)
% [MSDF,SDF] = PA_SPK_SDF(SPIKE)
%
% Obtain (mean) spike-density function (M)SDF by convolving trains of action
% potentials in SPIKE with a Gaussian, Possion of growth-decay function
% kernel.
%
% SPIKE should be a (sparse) MxN matrix of M trials and N samples,
... |
function [T,N,B,I] = per_vertex_frames(V,F,varargin)
% PER_VERTEX_NORMALS Compute local frames for each vertex of a triangle
% mesh. This method works by first computing the normal nj at each vertex vi
% in the mesh (V,F), then finds the neighbor vi of vj such that the
% undirected line e_ij is most perpendicul... |
function [specific, basedir, homedir] = set_dirs(dirtype,parms)
%
% function [specific, basedir, homedir] = set_dirs(dirtype,inparm)
%
% Inputs:
% dirtype - 'home','runs','chemitms'
% inparm - a structure with parameters
%
% Outputs
% specific
% basedir - on linux, this is: '~/Projects/Embon/Qylur/'
% ... |
function [ varargout ] = plotf( varargin )
% PLOTF macro for plot, type 'help plot' for more information
figure;
if(nargout == 0)
plot(varargin{:});
else
varargout{:} = plot(varargin{:});
end
end |
function prepare_dataset(train_info, test_info, vars)
% prepare_dataset(train_info, test_info, vars)
% train_info/test_info : { img_path, img_label }
assert(false, 'Not write yet.');
% crop frames
% train PCA
% extract features
|
%% Remove the input units in index_cut from the NN while keep the other weights fixed
function [reduced_nn] = cut_nn(nn,index_keep)
%nn.size(1) = nn.size(1)-length(index_cut);
index_cut = 1:86;
index_cut(index_keep) = [];
% notice the bias in the vision layer
nn.W{1}(:,index_cut+1) = zeros([nn.size(2),le... |
function decv = bayescls(samples, pdfunc, pdparams, apriori)
% Bayes classifier
% samples - matrix of samples to be classified (sample is a row of the matrix; there's no labels column)
% pdfunc - handle to probability density function
% pdparams - a structure containing parameters for pdfunc
% apriori (optional) -... |
%Author: Mateusz Grossman
%Date: 07/01/2018
function [Xtest,Ytest,Xtrain,Ytrain] = setProportionsOfData(X,Y,perc)
%SETPROPORTIONSOFDATA Summary of this function goes here
% Detailed explanation goes here
% sets proportion of training data and test data
% perc is percentage of training data, so if perc is 8... |
function [tiempo] = cargaDato(nombreArch,i)
warning off;
%disp('Cargando Datos...');
% abrir un txt y cargar los datos en una variable
T = [];
tiempo=[];
%eje Norte-Sur
try
[tiempo,T(:,1)]=textread(strcat('E:\U\Memoria\Datos\Seismo\WOR\',strcat(nombreArch,'N')),'%s %f');
catch
disp('Com... |
% MK class definition
% Modified by Xikang Zhang, 04/18/2013
% constructor modified to accept variant inputs
% function init() created
% function disp() modified
classdef MK
properties
currFrame;
previousFrame;
nRows;
nCols;
currBlob;
currFG;
bg_img;
... |
function [infostr] = rem_subsections(functionname, infostr) %<<<1
% remove all other sections in infostr
% used to prevent finding key or matrix inside of some section
%
% functionname - name of the main function for proper error generation after concatenating
% infostr - info st... |
zi=-5;
xi=-5;
zf=5;
xf=5;
zstepfrac=0.1;
xstepfrac=0.1;
size=int8(((zf-zi)/(zstepfrac)+1));
eta = 1;
eps2=10;
angle=[0.0:(pi/12.0):pi/2.0];
for x=1:7
angle(x) = round(angle(x)*10^1)/(10^1);
end
sizesquare=int32(double(size)*double(size));
data=zeros(sizesquare, 4, 7);
for x=1:7
num2str(angle(x), '%3.1f');
data(:,... |
function [img] = laplacerec (arrlap,inp)
img = zeros(512,512,3);
for i=1:inp
img = img + imresize(arrlap(i).img,power(2,i-1));
end
end
|
function [stats, raw_by_type] = indiv_analysis_fcn(raw, bins, varargin)
% model data doesn't work right now with the way theory_plots generates
% fake data.
% make this parfor-ated? the bins loop is really slow
% define defaults
conf_levels = 4; % used for discrete variance
% data_type = 'subject';
flipsig = 1; % impl... |
function [ img ] = Atb( projections,geo,angles,varargin )
%ATB CUDA backprojection operator
%--------------------------------------------------------------------------
% This file is part of the TIGRE Toolbox
%
% Copyright (c) 2015, University of Bath and
% CERN-European Organization for Nucle... |
clear
clc
format
% input rotated 3.6 micrometer fits data of n4321
data=flipud(fitsread('C:\Users\Nick\Documents\MATLAB\h_alpha\n4321\fits_data\n4321_rotated_3_6.fits'));
[row, col]=size(data);
% intital values given in parameters.txt
xo=721.851;
yo=1205.553;
ia=31.7;
pa=150;
% pa=153;
r25=222.4;
% for n4321_rot... |
function [east_trunc,west_trunc, ...
east_flux, west_flux, ...
Jac_east_cell,Jac_west_cell, ...
Jac_east_othr,Jac_west_othr, ...
Jac_east_trunc,Jac_west_trunc, ...
nort_trunc,sout_trunc, ...
nort_flux, sout_flux, ...
Jac_nort_cell,Jac_sout_cell, ...
... |
function vnew = embeddingR6(p, v)
%EMBEDDINGR6 embeds v in TpM onto R6.
%
% p is a base point. v is a tangent vector.
% step 1
try
invp = inv(p);
catch
invp = pinv(p);
disp('pinv');
end
sqrtinvp= sqrtm(invp);
% step 2
S = sqrtinvp*v*sqrtinvp;
% step 3
% ... |
function tiffChangeTileSizeProd(input,output_dir,tile_size)
%TIFFTILEPROD change the size of the tiles in a high resolution tiled Tiff
%image tiles
%
% Function: open a tiff file and change tiles. Tiles are predefined by the
% width and height of the original images. Information of the tiles is
% found in the met... |
function wire3D_filotypes (state)
%like wire3d, but colors branches in gray with darkness proportional to
%z-position
if isfield(state, 'state')
state = state.state{1};
end
figure('Name', state.info.filename, 'color', 'w')
hold on;
colors = {'m', 'c', 'r', 'b', 'k'};
drawing.state = {state};
opts.noplot = true;
op... |
function [output1] = AMBody_LeftPelvisRotation(var1,var2)
if coder.target('MATLAB')
[output1] = AMBody_LeftPelvisRotation_mex(var1,var2);
else
coder.cinclude('AMBody_LeftPelvisRotation_src.h');
output1 = zeros(3, 1);
coder.ceval('AMBody_LeftPelvisRotation_src' ... |
function database = extractLBP(img,r,b)
if r == 3
x=zeros(28,1);
y=zeros(1,30);
%On entoure la matrice img d'une ligne et d'une colonne de 0
%->Matrice 30x30
imglecture=[x,img,x];
imglecture=[y;imglecture;y];
puiss=[1 2 4 8 16 32 64 128];
for i= 2:1:29
for j=2:1... |
function [ bins, prob ] = p4b_dicretize( data, label )
uniqdata = unique(data);
bins = zeros(min(length(uniqdata),10),1);
prob = zeros(min(length(uniqdata),10),1);
for i = 1:min(length(uniqdata),10)
if length(uniqdata) > 10
size = (max(uniqdata) - min(uniqdata)+1)/10;
low = min(uniqdata) + (i-1) * ... |
function tempEnv = newRadioMaze()
rC = 400;
rG = 600;
rE_1 = 860;
rE_2 = 880;
laneEdge = pi/20;
%% make train env
bg = 4*ones(1800,1800);
% first, draw lanes
for xx = 1:1800
for yy = 1:1800
x_c = xx-900;
y_c = yy-900;
theta = atan2(y_c, x_c);
if (theta < pi/... |
function [dataset_filtered_id]=DatasetFilter(dataset)
%% 过滤掉数据库中无效数据的项目
% 无效数据被填补为-99
% 输出有效的数据条目的id
[rdata,cdata]=size(dataset);
idcount=0;
for i=1:rdata
i
flag=0;%标志是否检索到-99
for j=1:cdata
if dataset(i,j)==-99
flag=1;
break;
end
end
if flag==0
idcount... |
function D = dbs_LFP_stim_prepare_TW(initials, drug)
druglbl = {'off', 'on'};
keep = 0;
tsss = 1;
try
[files, seq, root, details] = dbs_subjects(initials, drug);
catch
D = [];
return
end
%%
if ~exist(root, 'dir')
if ismember(root(end), {'/', '\'})
root(end) = [];
end
[p, p1] = filepar... |
% Author: Tanalp Şengün
% Course: Linear System Theory / Prof.Alper Erdoğan
% to clear the variables, and close all the past figures
clc;
close all;
clearvars;
% these are the a and b in the question
a = [ 1 1 ];
b = [ 2 1 ];
%this will be the name of the functions
% a and b will be the input and as an output the ... |
%____________________________________
% Author - Vitamin-C
% Status - Functional
% Description - Examines the names of files in a directory cd in
% comparison to the expected list of names (at expected_files_list) and
% saves the list of differences between the lis... |
function M1 = generate_approx_M_derivative_m2(Mp, rho_0, beta_0, sigma_0, rho_1, beta_1, sigma_1, xu_0, yu_0, zu_0, xu_1, yu_1, zu_1)
% SECOND METHOD (29/05/2020)
% M is the physical (6x6) mass matrix!
% Speed with cardan angles
cw = [rho_1; beta_1; sigma_1];
% Jacobian matric
Lc0 = generate_jacobian(rho_0, beta_0, s... |
function data = RidgeRrgression(data, params)
% Get multi-resolution image
for scale_ind = 1:params.number_of_scales
data.multires_pixel_template(:,:,:,scale_ind) = ...
get_pixels(data.im, data.pos, round(data.sz*data.currentScaleFactor*data.scaleFactors(scale_ind)), data.sz);
end
xt = bsxfun(@times,get_f... |
function [FGS] = Compute_FGS(I_MAX,J_MAX,FG,S)
FGS = zeros(Imax-1,Jmax-1,4,2,4);
for ii = I_MAX-1
for jj = J_MAX-1
FGS(ii,jj,1,1,:) = FG(ii,jj,1,:)*S(ii,jj,1,1)/norm(S(ii,jj,1,:));
FGS(ii,jj,1,2,:) = FG(ii,jj,2,:)*S(ii,jj,1,2)/norm(S(ii,jj,1,:));
FGS(ii,jj,2,1,:) = FG(ii,jj,1,:)*S(ii... |
function [output_data1 output_data2 LV_par] = CVS(parameters)
% Input parameters
failure = parameters(1);
flow_type = parameters(2);
asynch_setting = parameters(3);
SV = parameters(4);
Tvad(1) = parameters(5);
Tvad(2) = parameters(6);
Tvad(3) = parameters(7);
Tvad(4... |
clear all;
close all;
data = load('Areafunktio.mat');
% mesh
p = data.ts;
%p = 0:0.005:0.2;
N = size(p,2);
% material parameters
rho = 1.0;
c = 2;
% initialize solution vector
W = poisson_hermite(data.As/max(data.As), p);
M = mass_hermite(1+0*p, p);
N = length(p);
delta = 1e-5;
plotevery = 1e-3;
eps = 1e-8;
% bou... |
function y = SignalConstruction(Nd, num_regresor, control_signal)
%SIGNALCONSTRUCTION Summary of this function goes here
%------Construccion de la seņal
u = control_signal;
e = zeros(Nd,1);
y = zeros(Nd,1);
r_b = wgn (Nd, 1, -10); %ruido blanco
%Serie de Chen
for k = num_regresor + 1:Nd
... |
% Object to analyse a pout file
% Input:
% a) either the location of a single pout file, or,
% b) for runs which have been stopped and restarted, a cell array
% containing the locations of multiple Pout files in the order in which
% they were run
classdef Pout
properties
file_loc
times
time... |
function s = emptystruct
s = struct(); |
function main()
clc
clear all
close all
x0 = [0 100];
y0 = [0 (-4/25)];
[T,Y] = ode45(@eval,x0,y0);
plot(T,Y(:,1));
xlabel('X')
ylabel('Y')
title('Q3')
grid on
end
function D = eval(x,u)
D = zeros(2,1);
D = [u(2); ((1-((10/3)*u(2))) - u(1))/25];
end
|
%{
# Processed tracking data for one rigid body
-> tracking.Tracking
-> tracking.Tracking
-> tracking.TrackingProcessingMethod
-> tracking.TrackingProcessingMethod
-> reference.SyncMethod
-> reference.SyncMethod
---
synced_tracking_start : decimal(6,2) # (s) timestamp of tracking onset with respe... |
clear all; close all;
Img=imread('flowers.tif');
subplot(411);
imshow(Img);
imgR=Img;
imgB=Img;
imgV=Img;
subplot(412);
imgR(:,:,2:3)=0;
imshow(imgR);
subplot(413);
imgV(:,:,1)=0;
imgV(:,:,3)=0;
imshow(imgV);
subplot(414);
imgB(:,:,1:2)=0;
imshow(imgB); |
function [diag_Omega,non_diag_Omega] = Omega_init(xtr, ytr)
% Omega_init -- Produce the initial matrix Oemga in a specific method.
%
% Syntax:
% [diag_Omega,non_diag_Omega] = Omega(d_output)
%
% In:
% xtr - training inputs
% ytr - training outputs
%
% Out;
% diag_Omega - diagonal element ... |
function sample = randsampleWithRep(data,k)
len = length(data);
if isempty(k)
k = length(data);
end
for c = 1:k
idx = randi([1 len]);
sample(c) = data(idx);
end
end |
function atpath(varargin)
%ATPATH Adds the AT directories to the MATLAB search path
ATROOT = fileparts(mfilename('fullpath'));
ATINTEGRATORS = fullfile(fileparts(ATROOT),'atintegrators');
MACHINEDATA = fullfile(fileparts(ATROOT),'machine_data');
disp(ATROOT)
addpath(genpath(ATROOT));
disp(ATINTEGRATORS)
a... |
function [boxes] = detector_singleImg(inputImg, w, b, feature_params, thres)
% coords(i) is [x_min, y_min, x_max, y_max] for test img i.
run('C:\Users\123\Documents\MATLAB\download\vlfeat-0.9.21\toolbox\vl_setup')
boxes = zeros(0,4);
% thres=0.5;
if(size(inputImg,3) > 1)
inputImg = rgb2gray(inputImg);
end
img =... |
% dj.internal.TableAccessor allows access to tables without requiring the
% creation of classes.
%
% Initialization:
% v = dj.internal.TableAccessor(schema);
%
% MATLAB does not allow the creation of classes without creating
% corresponding classes.
%
% TableAccessor provides a way to access all tables in a schema ... |
function [] = test_calc_b_LTX_OH()
% function [] = test_calc_b_LTX_OH()
%
% Make a grid
x_min = 0.1;
x_max = 0.7;
y_min = 0;
y_max = 0;
z_min = -0.45;
z_max = 0.45;
% z_min = -0.2;
% z_max = 0.2;
quiver_scale = 5;
% % Make a grid
% x_min = 0.1;
% x_max = 0.7;
% y_min = 0;
% y_max = 0;
% z_min = -0.1;
% z_max = 0.1;
... |
function TablicaKomorkowa
% Tworzenie przez indeksowanie
A(1,1) = {[1 4 3; 0 5 8; 7 2 9]};
A(1,2) = {'Imie Nazwisko'};
A(2,1) = {3+7i};
A(2,2) = {-1:0.2:1};
A(3,3)={5};
celldisp(A); % wyswietlenie zawartosci tablicy A
B={A;
A};
celldisp(B); % wyswietlenie zawartosci tablicy B
cellplot(B); % prezentacja grafic... |
fo=150e3;
wo=2*pi*150e3;
Ls=17e-6; %% adityadan farkl? olarak asl?nda Quality 4 den 1e indirdim
Cs= 1/(wo^2*Ls);
RLx= 16;
M=12e-6; %% bu yüzden mutual? indirdim primer ak?m gereksinimi artt?
a1=0.2;
M1=M*(1+a1);
M2=M*(1-a1);
f=1e5:1e2:2e5;
w=2*pi*f;
figure();
c=[0 0 1];
RL=23;
Za=(RL./(... |
function [fdcomm, radar_temp] =...
tsp_WMMSE_algorithm_multimode_wc(fdcomm, radar, radar_comm,cov, dmode)
%------------------Algorithm 3 (WMMMSE minimization)-------------------------------------------
K = radar.codelength;
I = fdcomm.UL_num;
J = fdcomm.DL_num;
% Xi_min = sum(fdcomm.Xi_UL) + sum(fdcomm.Xi_D... |
function []=SavePitSamples(varargin)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
narginchk(0,2);
Names=evalin('base','whos(''Set_*'')'); % 'Set_*' to add a filter
Classes={Names.class}; I=strcmp(Classes,'PitsSample');
Names=Names(I); Names={Names.name};
if isempty(Names)
warni... |
% Dimensions of the region inside the mixing radius
% in helical coordinates (r,omega)
% For the equation of psi* over time
% we need r to be between 0 and 1
PRECISE_MESH=4.0
size_r=xMixing_radius+8;
NR=size_r*PRECISE_MESH;
% Dr=mean(mean(dist_surf_PR_map(:,1:size_r)));
% Dr=1/(xPsih_zero-1);
% scale_r=Dr*[0:size_... |
function [ afValues, afTimes ] = GetOccupancyFromMatFile( tRequestedSignal , tSignal )
% starting from the current data a randomic pattern for the Occupancy
% for the next requested hours
%
afValues = [];
afTimes = [];
%
try %
%
iNumberOfHourlyNeededSamples = mod( tRequestedSignal.iSignalID , 1... |
cd c:/shared/save_paper ; ls
moviecorrs = load('mean_moviecorrs.mat') ; moviecorrs = moviecorrs.meancorrs ;
restcorrs = load('mean_restcorrs.mat') ; restcorrs = restcorrs.meancorrs ;
moviebold = load('movie_sb.mat') ; moviebold = moviebold.allsb ;
restbold = load('rest_sb.mat') ; restbold = restbold.allsb ;
... |
% Turn off printing of figures
writeText({'0'}, which('printPmtk'));
|
function g_spectrum
global goose
if length(find(goose.analysis.framedone)) < goose.video.nFrames
warndlg('Spectrum will only be calculated after all frames have been analyzed','Warning')
return;
end
n = goose.video.nFrames;
fps = goose.video.fps;
x = goose.analysis.amp;
hw = hannwin(n);
hw =... |
%%case 9 PRO+RO+PRO two-stage PRO to produce eletricity
clear;
sa=[.4 1.56 32];
%sa=[0.37 .39 .39 .4 .4 .4 .41 .44 .61 1.06 1.56 6.21 11.13 18.52 32];
for i=1:3
raw=water;
raw.Concentration=sa(i);
low_water=water;
low_water.Concentration=0.1;
low_water.Flow=1;
fo=PRO;
fo.C_F0=low_water.Concentration*17.1429;
fo.C_D... |
function func_selected = my_create_simple_organ_shape(heart_center,heart_radius, spine_center)
% heart_radius = 0.15;%0.35; % Radius of the heart (modeled by a circle)
lung_limit_x = 0.10; % Value of x where the lung stops (the lung is modelled by a cropped circle), the lungs only spans for values of x>lung_limit_x... |
% --------------------------------------------------------------------
function create_tsne_Callback(hObject, eventdata, handles)
% hObject handle to create_tsne (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Creates ... |
l = 0.1; % [m]
ml = 1; % [kg]
Il = 8.33*10^(-4); % [kg*m^2]
w = 0.2; % [m]
mo = 12; % [kg]
Io = 800*10^(-4); % [kg*m^2]
g = 9.8; % [kg/m^2]
q1 = 0;
q2 = pi/2;
ox = 0.1;
oy = 0.3;
theta = 0;
M = eye(5);
M(1,1) = 3/2*ml*l^2+ml*l^2*cos(q2)+2*Il;
M(1,2) = 1/4*ml*l^2+1/2*ml*l^2*cos(q2)+Il;
M(2,1) = M(1,2);
M(2,2) = 1/4*ml*... |
function [res24, res24Shift] = oneBySqrt(num)
% Compute 1/sqrt(num) in newton-raphson method. We start with an initial guess
% from the look-up table. Each iteration should double the number of bits of
% accuracy (=> 2 iterations are enough). However we are using 3 iterations
% to reduce inacuracies due to fixed... |
classdef SUFF3 < 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:
% - time = steptime
% - tuni = unitary... |
classdef BetadcvCatheterResponse < mlaif.AbstractAifProblem & mlarbelaez.AbstractCatheterAnalysis
%% CATHETERRESPONSE estimates parameters of the betadcv kernel (ak1, e) by fitting
% crv data with a Heaviside input and betadcv model for the catheter impulse response.
% $Revision$
% was created $Date$
... |
clear;
[X, Y] = dataSample(@f21, 1, 120);
[X, Xfw, Xbw] = minmaxNorm(X);
[Y, Yfw, Ybw] = minmaxNorm(Y);
%% 30
%model = gpSim(X, Y, {1.00E-03});
%model = forestsSim(X, Y, {100 1}};%150, 5});
%model = nnSim(X, Y, {1 1.00E-05 25});
% {1.2, 0.0001, 1000});
%% 120
model = gpSim(X, Y, {10});
%model = forestsSim(X, Y... |
% autor: E.Pastucha
% skrypt wczytuje wyniki przetwarzania sieci neuronowej na obrazach o
% zmniejszonej rozdzielczości, przeszukuje obrazy w trzech petlach zmiany
% progu znajdując obszary zainteresowania do dalszego przetwarzania w
% oryginalnej rozdzielczości. Ustala ostateczną wielkość BoundingBox
tic
dysk = s... |
function [OutFiles,Surfa,models] = Atlas_Surf(SurfF,SVol,SMask,StrL,Out_dir,sa,ua,ma);
%
% Syntax :
% [OutFiles,Surfa] = Atlas_Surf(SurfF,SVol,SMask,StrL,Out_dir,sa,ua);
%
% This function says which points of the surface belongs to each anatomical
% structures taking into an account a given reference atlas. The ... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Matlab model for Energy Storage System Group 21%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc;
clear;
close all;
%%
%Settings
vacuumPercentage = 0; %Percentage of vacuum percentage [%]
numDays = 1; ... |
function curve = cal_sphericalrobot_motionplan_unified(Friction,R,r,m_wheel,m_global,m_platform,l,beta,J_wheel,Ja,Jb)
g= 9.8;
gap =20;
times = 3;
symmetric =0;
T =2;
T1 =T;%total time (s)
T2 =T;
T3 =T;
C1 = (R^2 - R*r)*2*J_wheel/r/r;
C2 = (R - r)^2*2*J_wheel/r/r + 2*m_wheel*(R - r)^2 + Jb + m_platform*l*l;
... |
function varargout = BuildNsineGamma(varargin)
%AllS = BuildRPExpt(... Makes stimulus description file for binoc
%For interleaving gratings, RLS, drifinting/dynamic steppein
stimno= 1;
nf = 200;
j = 1;
stimvals{2} = [0 1 2]; %foreground alone, background dynamic, foreground dynamic
lables = {'ForeAlone' 'BackDyn' 'For... |
function r=ind_tnr(ekvnr,maxnr)
%ind_tnr
%
%r=ind_tnr(varnr,maxnr)
%Hämtar index till raderna i systemmatrisen
%för termohydrauliken för ekvation
%nr ekvnr. maxnr är antalet ekvationer
%för noderna i termohydrauliken
%@(#) ind_tnr.m 2.2 02/02/27 12:10:32
global geom
r = geom.ind_rows + ekvnr - 1;
|
%Script for estimating camera calibration matrix using least square method and their intrinsic and
%extrinsic parameters as well as reconstruction and plotting.
clc;
clear all;
close all;
format long g
%Read world coordinates of 12 points from file.
world_points = dlmread('world_coordinates_12.txt');
%Convert to ho... |
function [r,k]=ind_thneig(eqnr,varnr,maxnr)
% ind_thnneig
%
% [r,k]=ind_thneig(eqnr,varnr,maxnr)
% Gets the index for the thermo hydraulic neighbours in the A-matrix
% eqnr: equation number for the node
% varnr: column number (variable number) for the node
% maxnr: number fo variables
global geom
nin=geom.nin;
kk = ... |
pclear;
tt = 0:(2*pi*0.01):(2*pi);
%Left circle
xL = -cos(tt)-1;
yL = sin(tt);
%Right circle
xR = -cos(tt)+1;
yR = sin(tt);
%plot(xR,yR);
%Attach
leftTopX = xL(1:floor(0.5*length(xL)));
rightTopX = xR(1:floor(0.5*length(xR)));
rightBottomX = xR(ceil(0.5*length(xR)):length(xR));
leftBottomX = xL(ceil(0.5*length(x... |
function offset = SquareNeighborhood (radius)
halfsize = ceil(radius);
fullsize = 2*halfsize + 1;
offset_x = ones(fullsize,1)*(-halfsize:halfsize);
offset_y = (-halfsize:halfsize)'*ones(1,fullsize);
offset_x = offset_x(:)';
offset_y = offset_y(:)';
offset = [offset_x; offset_y];
|
function [mt,ss] = mtable(n,m)
for i = 1:n
for j = 1:m
mt(i,j) = i.*j;
end
end
ss = sum(sum(mt)); |
function [B] = PLS( X,Y )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
r=size(X,2);%记录X有多少列
q=size(Y,2);%记录Y有多少列
%用于计算BPLS的四个参数矩阵
W=zeros(r,q);%由w1一列列堆叠而成
P=zeros(r,q);
Q=zeros(q,q);
b=zeros(q);
time=0;%循环次数
yuzhi=norm(Y);
while(time<q*0.9&&norm(Y)<=yuzhi),%循环次数过多或者残差矩阵很小时结束循环
time=... |
function hlep(s)
% HLEP Call the help function for the common typo hlep
%
% Gunnar Voet, APL - UW - Seattle
% voet@apl.washington.edu
%
% Last modification: 11/16/2013
help(s) |
load data/threefaceInfo.mat
for i=1:20
subplot(4,5,i);
img=reshape(FaceContainer(i*40,:),112,92);
imshow(img);
end |
%{
Examples for dimensionality reduction based on KPCA
%}
clc
clear all
close all
addpath(genpath(pwd))
% load the training data
load('.\data\helix.mat')
traindata = helix;
% create a parameter structure for the KPCA application
application = struct('type','dimensionalityreduction',...
'di... |
clear
%load morvan's data
blackSpruce=importdata('black_spruce.csv',',',1);
blackSpruce=blackSpruce.data;
oak1=importdata('oak1.csv',',',1);
oak1=oak1.data;
oak2=importdata('oak2.csv',',',1);
oak2=oak2.data;
needles=importdata('needles.csv',',',1);
needles=needles.data;
%morvan's model
%pyrolysis part
T=393:500;
%1.6... |
% Communicate with a Philips Hue bridge to talk to the Hue personal wireless LED lights.
% - Finds the Hue Bridge using https://www.meethue.com/api/nupnp
% - Checks if user previously paired with bridge, if not a pairing procedure is started.
% - Upon completed connection with the Hue-Bridge, user will get an appID,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.