text stringlengths 8 6.12M |
|---|
clc;clear;close all;
% ------------------Signatures:--------------------------
% We're looking for 2D peak that is 4x amplitude of G peak.
%
% ----------------- IMPORT DATA-------------------------
% Assumes that col 1 is freq shifts, and col 2 is amplitude
delimeter = '\t';
% A = importdata('GraphenePicture/T2_2 gr... |
function xdot=flnnnew1(t,x,ths,spec,Kpid)
xdot=zeros(8,1);
ths1=ths(1);
ths2=ths(2);
qd=[ths(1) ths(2)]';
a1=1;a2=1;
M1=spec(3); M2=spec(4); L1=spec(1); L2=spec(2);
g=9.8;
b11=(M1+M2)*L1^2+M2*L2^2+2*M2*L1*L2*cos(x(4));
b12=M2*L2^2+M2*L1*L2*cos(x(4));
b21=M2*L2^2+M2*L1*L2*cos(x(4));
b22=M2*L2^2;
Bq=... |
function [activations] = getActivations(nn, x)
%GETACTIVATIONS return the activations of the output neurons from the network.
% Detailed explanation goes here
n = nn.n;
m = size(x, 1);
x = [ones(m,1) x]; %adding of the bias
%nn.a{1} = x;
val = n-1;
activations = sigm(x * nn.W{val - 1}');
... |
function [] = plotchain(chain)
% Function to create plots of the mcmc chains generated during my thesis
%
% INPUT:
% chain = The markov chain for one parameter
iterations = (1:1:length(chain))';
plot(iterations,chain,'k') |
function output = attinuate(input,N)
output = input / N ;
end |
% Stock Mining Program.
% Auther : C.Cui, D.Wang, M.Li
% Time : 7/05/2015
% ------------------------------------------------------------------------
% version : 1.0 Beta
% Copyright (C) 2015 Caihao Cui - All Rights Reserved
% You may use, distribute and modify this code under the
% terms of the MIT license.
% -... |
function plotMultipleHotspots(pointscanCellArray,aligned,shader)
% This function is designed to plot peak G/R values over distance of
% multiple pointscans in pointscanCellArray.
% Optional arguments:
% aligned - 0 is no alignment, 1 set the peak of all the pointscans to be aligned. Default is 0
%
% shader - 0 no er... |
[tree1] = treeFarm(5, '!');
[tree1_soln] = treeFarm_soln(5, '!');
% tree1 =>
% !
% ! !
% ! ! !
% ! ! ! !
% ! ! ! ! !
[tree2_soln] = treeFarm_soln(10, '%');
[tree2] = treeFarm(10, '%');
[tree3_soln] = treeFarm_soln(35, 'w');
[tree3] = treeFarm(35, 'w');
match1 = isequal(tree1,tree1_soln);
mat... |
function trl = trialfun_temprod_OLD_uniquetrial(cfg)
% cfg.dataset = '/neurospin/meg_tmp/temprod_Baptiste_2010/DATA/NEW/Trans_sss_s04/s04_run6_raw_sss.fif';
events = ft_read_header(cfg.dataset);
trl(1,1) = 1 ;
trl(1,2) = events.orig.raw.last_samp - events.orig.raw.first_samp -10;
trl(1,3) = 0;
|
function f = plottraj(fname, type)
%type 1:RJET, 2:MPPT, 3:VACCO
res = 5;
D = load(fname, 'ascii')';
ts = D(1,1:res:end-1)
vs = D(2:7,1:res:end-1);
qs = D(8:13,1:res:end-1);
us = D(14:end,1:res:end-1);
W = 0;
for i=1:length(ts)-1;
dt = ts(i+1)-ts(i);
W = W + dt*norm(vs(4:6,i))*us(4,i);
% W = W + dt*vs(1:3,i)'... |
function [Flag,vehPos,indCUE,indDUE,indDUE2] = genCUEandDUE(d0, laneWidth, numLane, disBstoHwy, d_avg, numCUE,numDUE)
%首先,根据泊松分布(泊松分布的参数是车辆之间的平均距离)在高速公路上生成汽车。
%然后,生成DUE和CUE的用户位置
%输入:d0:高速公路的长度
% d_avg:车辆间的平均距离,d_avg = 2.5*v
% 其他的参数可以从命名中推出
%输出:Flag,0/1,如果生成的汽车数量不够,flag=1
% vehPos,N*2的矩阵,存储汽车坐标
%... |
function [S]=rrtt2S(r1,r2,t1,t2)
S=0.5*(t2-t1)*(r2^2-r1^2);
endfunction
|
function clas_error=compute_error(y,y_est)
[~,N]=size(y); % N=no.ofvectors
clas_error=0; % Counting the misclassified vectors
for i=1:N
if y(i) ~= y_est(i)
clas_error=clas_error+1;
end
end
% Computing the classification error
clas_error=clas_error/N; |
function pitch = PitchExtraction(filename) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Pitch Extraction from monophonic signals %%%%%%%%%%%%%%%
Fs = 16000; % Resampling frequency
load('convModel.mat'); % The convolution network model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function [mean2] = computeMean(residual, weight)
mean2 = zeros([1,3]);
mean2(1) = sum(residual(:,1).*weight) / sum(weight);
mean2(2) = sum(residual(:,2).*weight) / sum(weight);
mean2(3) = sum(residual(:,3).*weight) / sum(weight);
end |
addpath('../../bierman.git/src/');
|
function G = ditheringMatrix(matrix, row, col, N)
mul = log2(N);
I = [1 2; 3 0];
if mul > 1
for i = 1 : mul - 1
I = [(4*I+1) (4*I+2); (4*I+3) 4*I];
end
end
T = (I + 0.5) * (255/(N ^ 2));
for i = 1 : row
for j = 1 : col
if matrix(i, j) > T(mod(i, ... |
clear;
load("corrupt");
load("handel");
Y=fft(y);
Z=fft(z);
H=Z./Y;
h=ifft(H);
stem(1:10,h(1:10)); |
function Y = sphericalHarmonic(azi, elev, ambiOrder, sphIdx, norm)
%function Y = sphericalHarmonic(N, P, azi, elev, order, degree)
%
%uses Normalization formulas as well as legendre() to get spherical harmonic.
%
%Y = N * P(sin(azi))*cos(abs(m)*elev) if m >= 0
%Y = N * P(sin(azi))*sin(abs(m)*elev) if m < 0
%
%n = ... |
function [u_next,v_next,w_next] = newton(u,v,w,p,q,r,fap,mat_T)
%NEWTON この関数の概要をここに記述
% 詳細説明をここに記述
%%共通パラメタ
cp.delta_t=0.1;
%音速
cp.vs=340.0;
%重力加速度
cp.g=9.8;
%基準断面積
cp.S=0.1;
%飛行機効率
cp.kappa=0.3;
%モーメント基準
cp.xcm=1.0;
%質量
cp.m=1000;
%重心
cp.xcg=1.0;
%慣性モーメント
cp.Ixx=10.0;
cp.Iyy=5.0;
cp.Izz=11.0;
cp.mat_I=[cp.Ixx 0 0;0... |
function [] = plot_grid(Grid,labels,M)
ptsymb = {'bv','b*','b+','bo','bs' 'bd' 'rv','r*','r+','ro','rs','rd','mv','m*','m+','mo','ms' 'md',...
'gv','g*','g+','go','gs' 'gd' 'cv','c*','c+','co','cs','cd' 'yv','y*','y+','yo','ys' 'yd',...
'kv','k*','k+','ko','ks' 'kd'};
%ptsymb = {'bv','r*','m+... |
function [valid_out, count_out, ddr_read_done, rd_addr, rd_len, rd_avalid] = ...
hdlcoder_external_memory_read_ctrl(burst_len, start, rd_aready, rd_dvalid)
%
% Copyright 2017 The MathWorks, Inc.
% create persistent variables (registers)
persistent rstate burst_stop burst_count
if isempty(rstate)
rstate ... |
%-------------------------------------------------------------------------------------
%
% M-file: hg_H2O.m [kJ/kg]
% saturated vapour
% Data from L. Wester, 1998
% valid VI: 273.16<=Tsat<647.3 K
%
% Created: 000810 by Kristina Johansson
% Revision history: 000830
%-----------------------------------------------------... |
%
% regraining post-process to match colour of IR and gradient of I0
%
% IRR = degrain(I_original, I_graded, [smoothness]);
%
% the smoothness (default=1, smoothness>=0) sets the fidelity of the
% original gradient field. e.g. smoothness = 0 implies IRR = I_graded.
%
% (c) F. Pitie 2007
%
% see reference:
% ... |
function result=GetRSSI(csi_entry)
% Get RSSI
%
% csi_entry: input csi file
%
% Author: LBJ
temp_result(1)=csi_entry.rssi_a;
temp_result(2)=csi_entry.rssi_b;
temp_result(3)=csi_entry.rssi_c;
result=mean(temp_result);
end |
%
% ISEL - Instituto Superior de Engenharia de Lisboa.
%
% LEIC - Licenciatura em Engenharia Informatica e de Computadores.
%
% Com - Comunicações.
%
% bit2file.m
%
%
% Recebe: bitstream, vetor no qual cada posição é um bit.
% filename, nome do ficheiro destino.
% Retorna: x, ficheiro na forma de veto... |
j = sqrt(-1);
seed = 200;
comparison = false;
nS = 4;
nR = 4;
nT = 4;
dataSize = 1;
%LTE-A codebook
u=[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
-1, -j, 1, j, (-1-j)/sqrt(2), (1-j)/sqrt(2), (1+j)/sqrt(2), (-1+j)/sqrt(2), -1, -j, 1, j, -1, -1, 1... |
clear;
close all;
Template = imread('mask_template.jpg');
T = rgb2gray(Template);
% figure(3);
% imshow(T);
% Arthoscope_File = 'KneeGap100L1Clip'
Arthoscope_File = 'KneeGap10L11Clip'
vr_arthroscope_file = strcat(Arthoscope_File,'.mp4')
%Opens the video of the knee athroscopy
vr = VideoReader(vr_arthroscope_file);
%... |
close all;
clc; clear;
addpath('./lib');
%% DEFINE
R2D = 180/pi;
D2R = pi/180;
forces = [0;0;0;0];
%% INIT. PARAMS.
drone1_params = containers.Map({'mass','armLength','Ixx','Iyy','Izz'},...
{1.25, 0.265, 0.0232, 0.0232, 0.0468});
drone1_initStates = [0, 0, -4, ... % x... |
function S = get_2dsteering_matrix(theta_vals,d_vals,n_sub,f,df,ant_sep,n_ant,c)
%% SpotFi 2D Steering Matrix for the given theta_vals and d_vals
% Inputs:
% theta_vals: the search space for Angle of Arrival
% d_vals: the search space for Time of Flight
% n_sub: number of subcarriers
% f: Center Frequency of the trans... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright (C) 2016 N. Eamon Gaffney
%%
%% This program is free software; you can resdistribute and/or modify it under
%% the terms of the MIT license, a copy of which should have been included with
%% this program at https://github.com/... |
function [ NeuralNet, trainData ] = train_neural_net(trainPred, trainResp, nHiddenNodes, validationFrac, maxEpochs)
%UNTITLED8 Summary of this function goes here
% Detailed explanation goes here
% Set up the parameters of network
NeuralNet = patternnet(nHiddenNodes);
NeuralNet.divideFcn = 'dividerand';
NeuralNet.div... |
clear all
close all
%We need patient info, markers,and which patients have pots
T=readtable('../Summary_Data_800_Gals/PatientInfo07212021.csv');
load('../AStract/potspats.mat')
load('../Cluster/Markers/markers.mat')
counter = 1;
%Table names
T2{1,1} = 'File Names';
T2{1,2} = 'Estimated Tau_p';
T2{1,3} = 'Estimated Ta... |
clc;
close all;
clear all;
h=[1 1 1 0 0 0 0 0 0; 0 0 0 1 1 1 0 0 0 ; 1 0 0 1 0 0 1 0 0; 0 1 0 0 1 0 0 1 0; 0 0 1 0 0 1 0 0 1];%here h is key which is provided to us;
c1=[1 1 1 0 1 1 1 1 0];%is the signal comming from BEC(Binary Erase channel) here 3 indicates the bit which is erased here you can enter any number e... |
clear
image = imread('forged2_gj90.png'); %resim okundu
grayimage = rgb2gray(image); %resim gri seviyeye getirildi
doubleimage = double(grayimage); %resim double hale dönüştürüldü
%Boyut degiskenleri
image_size = size(doubleimage);
row_size = image_size(1);
col_size = image_size(2);
VECTORS_SIZE = (row_... |
% PARAM
%
% Identifikacia prenosu prveho radu
%
% Spusta - ID_PARAM
% Copyright is with the following author(s):
%
% (c) 2012 Juraj Oravec, Slovak University of Technology in Bratislava,
% juraj.oravec@stuba.sk
% (c) 2012 Monika Bakosova, Slovak University of Technology in Bratislava,
% monika.bakosova@stuba.sk
% ... |
function [ sparse_us, sparse_ue ] = energyLineU( img, C1, C2, lines_us, lines_ue, init_H )
% for given target image, C1*C2 mesh grid and lines in target image,
% generate sparse matrix for line-preserving
% for lines_u, preserve slope-invariant
num_V = (C1+1)*(C2+1); % number of control vertices
X_col = linspace(1,s... |
MU1 = [3];
SIGMA1 = [1];
MU2 = [10];
SIGMA2 = [2];
X = [mvnrnd(MU1,SIGMA1,100);
mvnrnd(MU2,SIGMA2,100)];
% scatter(X(:,1),X(:,2),10,'.')
hist(X);
% title('histogram');
% pause;
% close;
options = statset('Display','final');
obj = gmdistribution.fit(X,2,'Options',options);
ComponentMeans = obj.mu
ComponentCovariances = ... |
% this function marks the names of EEG files that has values > 100 or < -100
function [] = mark_artefacts()
% initializations
folder_content = dir("datasets\filtered_data\*.txt");
filt_data_no = numel(folder_content);
artefact_counter = 0;
% generate a folder to record artefact EEG files
if not(isfolder('artefact_pr... |
function [f2_align, gam] = pairwise_align(f1,f2,time)
% aligns f2 to f1
q1 = f_to_srvf(f1,time);
q2 = f_to_srvf(f2,time);
gam = optimum_reparam(q1,q2,time,0,'DP',0.0,0.0,0.0);
f2_align = warp_f_gamma(f2,gam,time);
|
%% hw2
%
clc; clear; close all;
Image_A = imread(".\pic\Image A.jpg");
Image_B = imread(".\pic\Image B.jpg");
%% hw2-1a
%
cpselect(Image_A,Image_B);
%% hw2-1b
%
% figure(3)
% imshow(Image_A);
% points_A = zeros(7,2);
% for i = 1:7
% [x,y] = ginput(1);
% hold on;
% plot(x,y,"or");
% points_A(i,... |
function y = iftn(x)
% Performs ifftshift(ifftn(fftshift(input)))
% 2D inverse FT
y = ifftshift(ifftn(fftshift(x)));
|
function [forces, distance_output] = do_seperation_sim(h1Length, h2Length, distanceLimit)
% Two Unfolding Simple Helix Models: rotation at helix base
distance_output = 0:0.5:distanceLimit;
% Helix Models
force_constant = 10;
distance_interval = 1;
distance_limit = distanceLimit;
h1len... |
function d = point_to_line(pt, v1, v2)
% Calcualtes the distance from a given point to the line defined by two
% vertices.
%
% the vertices/points are defined as [x y z]
a = v1 - v2;
b = pt - v2;
d = norm(cross(a,b)) / norm(a);
end |
function [f,g] = primalProblemUnc(w,X1,X2,X3,XX1,XX2,XX3,A,b1,AA,Ab1,p,b2,ref1,ref2,ref3,exv,alpha,ro1,ro2,numSamples,numEigs)
w1 = w(1:numEigs);
w2 = w(numEigs+1:numEigs*2);
w3 = w(numEigs*2+1:numEigs*3);
u1 = X1' * w1; u_1=u1.^2; ex1=exp(-u_1/2); gauss1 = u1.*ex1;
u2 = X2' * w2; u_2=u2.^2; ... |
clear all; clc;
wavelength=xlsread('New_SWIR_wavelength.xlsx'); % FTNIR wave
% range='130:1866';
aa= xlsread('non_viable_seed.xlsx');
bb= xlsread('viable_seed.xlsx');
Total = [aa;bb];
% total = Total(:,str2num(range));
TT= Mean_normalize(Total);
% TT= Total(1:end,1:195);
% figure
% plot(ww,TT);
% xlabel('Wavelength(n... |
function C=eul2dcm(eul)
%----------------------------------------------------------------
% function C=eul2dcm(eul)
%
% This functions determines the direction cosine matrix C
% that transforms a vector in a reference axis system at time k
% to one the same axis sytem at time k+1. The ... |
% 非主函数: 判断当前函数是否为imf —— 零点个数与极值点个数对比
function u = isimf(x)
N = length(x);
u1 = sum( x(1:N-1).*x(2:N) < 0 ); % 零点个数
u2 = peaks(x) + peaks(-x); % 极大值 + 极小值总点数
if abs(u2-u1) > 1
u = 0; % 不是imf函数
else
u = 1; % 是imf函数
end
|
function vol = renderClosedCurveOutlines(neuron, varargin)
% RENDERCLOSEDCURVEOUTLINES
%
% Description:
% Renders neuron annotated with closed curves.
%
% Syntax:
% vol = renderClosedCurveOutlines(neuron, varargin);
%
% Note:
% Replaces RENDERCLOSEDCURVE
%
% See als... |
function results2 = RBES_change_results_struct2(results)
if ~iscell(results) && length(results) == 1
fields = fieldnames(results);
narc = length(results.(fields{1}));
results2 = cell(narc,1);
for i = 1:narc
for j = 1:length(fields)
if isnumeric(result... |
clear
clc
%计算模糊综合评价模型的W,R,B,结果放在'result.xlsx'
w1 = [0.4773,0.2880,0.1538,0.0809];
w2 = [0.149,0.420,0.099,0.264,0.068];
w3 = [0.238,0.626,0.136];
w4 = [0.4549,0.1606,0.0619,0.3226 ];
w5 = [0.538,0.087,0.258,0.117];
R1 = [0.2 0.2 0.5 0.1;
0.1 0.4 0.3 0.2;
0.6 0.2 0.2 0;
0.5 0.2 0.2 0.1];
R2 = [0.3 0.4 0.2 0.1;
0.3 0.3... |
function [x, P] = kf_update(x, z, P, H, R)
% measurement residuals (innovation)
y = z - H*x;
% residual (innovation) covariance
S = H*P*H' + R;
% Kalman gain
K = P*H' / S;
% update state prediction
x = x + K*y;
% update covariance matrix
P = (eye(size(P)) - K... |
function [ version, major, minor, maintenance ] = getVersion()
%GETVERSION Return the current version of the toolbox
major = 1;
minor = 0;
maintenance = 1;
version = [num2str(major), '.' num2str(minor). num2str(maintenance)];
end
|
function proceImg = PreProcess(img, transformation, varargin )
% ===============================================================================
% Reference:
%
% Misalignment-robust Face Recognition via Efficient Locality-constrained Representation,
% Yandong Wen, Weiyang Liu, Meng Yang, Yuli Fu, Zhifeng Li
% ... |
function num_fields = fieldcount(psf_obj)
%
% Determines the number of fields in a psf object.
% Used by psf child class methods.
%
% J. Nagy 2/11/01
num_fields = length(fieldnames(psf_obj)); |
clear; close all; clc;
d_pca = 20;
d = 16;
data = load('Yale_64x64.mat');
X = data.fea';
label = data.gnd;
[label, index] = sort(label);
X = X(:, index);
L = [];
pre = [];
for i = 1 : length(label)
if isempty(pre)
pre = i;
end
if label(pre) ~= label(i)
L = [L; [pre, i - 1]];
pre = i;... |
function hom_mat = Homo_Matrix(DH,n)
hom_mat = eye(4);
for i = 1:n
hom_mat = hom_mat * Transf(DH(i,:));
end
end |
classdef CTF < handle
%CTFProcess Summary of this class goes here
% Detailed explanation goes here
% Private constant properties
properties (Constant, GetAccess = private)
xmlVersion = '<?xml version="1.0" encoding="UTF-8"?>';
end
% Private properties
properties (SetAcces... |
% xCompareErrors.m
% Load some error surfaces and compare them
clear;
% close all;
setFigureDefaults;
% Load the first error
load('Grid_Results/ErrOEF_72_Uncorrected.mat');
err_1 = abs(errs);
est_1 = ests;
rel_1 = abs(rel_err);
% Load the second error
load('Grid_Results/ErrOEF_72_fB_funcSR_2.mat');
err_2 = abs(err... |
function [forward, feedback]=make1_ERBfilt(cf,Fs,p)
% [forward, feedback]= make1_ERBfilt(cf,Fs,p)
% computes the filter coefficients for a single Gammatone filter.
% These filters were defined by Patterson and Holdworth for simulating
% the cochlea. The result is returned as a set of filter
% coefficients (for... |
sampleEigs = [];
frechetMeanEigs = [];
for i = 1:N
sampleEigs = [sampleEigs, eig(sampleAdjSet{i})];
end
avgEig = mean(sampleEigs');
avgEig = sort(avgEig,'descend');
T = 5;
for i = 1:T
frechetMeanEigs = [frechetMeanEigs, eig(rand_adj(p_i,q_i,n))];
end
distMatrix = zeros(T,T);
for i = 1:T
f... |
function [pop,x,x1] = Pop_InISimple(PopSize, SL)
% Input Variables: PopSize, SL
% PopSize: The size of the population
% SL: The string length of each individual in the population
% GenNo: The total number of the generation
% Create a list of binary strings
pop = round(rand(PopSize,SL)); %generating a random popul... |
clear;clc;
%Periyodu belirleme
duty_cycle=50;
t=0:1:800;
input = 1;
if(input == 1)%input kare dalga
u=square(2*pi*0.01.*t,duty_cycle);
else %input t=50'de impulse
u=1*(t==50);
end
%sistemdeki katsayilar
a=-0.8;
b=0.5;
c=-0.5;
lambda = 0.95;
%parametreleri initialize ve preallocation ediyo... |
function omparvar(modelname,parameter,values,varargin)
% Parametervariation and plotting...
% SYNTAX: omparvar(modelname,parameter_to_be_changed,values,toplotx1,toploty1,toplotx2,toploty2,...)
% Example:
% omparvar('HelloWorld.test','Hello1.a',[2:1.5:10],'time','Hello1.x','Hello1
% .a','Hello1.x')
% ingenieurbuero@ch... |
function [cost grad] = costFunc(x)
cost = sum(x.^4);
grad = 4*x.^3;
end |
function [ hdr, ldr ] = tmo2_mod( img, ldrtohdr, f, range, maxi )
%将img映射到hdr和ldr
%
[ m, ml ] = GetMapping( ldrtohdr, range, maxi, f );
[ imgtohdr ] = Linearization3_mod( m, range );
maxm=max(m);
%-------------------恢复hdr图像------------------------
[h,w,d]=size(img);
hdr=zeros(h,w,d);
for ii=1:h
for jj=1:w
... |
function demo_cells(folder)
%%
%% DEMO for LGN, V1 and MT cells
%%
%% ILLUSTRATIVE STIMULUS 75 pix, 64 frames, fsx=37.5, fst = 20 ------------
% folder = 'C:\disco_portable\mundo_irreal\rutinas\Software_Katedra\Vistalab\sample_data'
load real_seq_Nx_75_Nf_64.mat % sequence Y
FTY = fft3( Y , 1);
show_ff... |
function [ model, mins, rngs ] = train_1class(file_path, filename, electrode)
%% Setup Constants and Load Data
decimator = 5;
f_sampling = 50000/decimator;
d = load([file_path filename]);
data = d.data;
%% Extract Features and Annotate
% If features don't exist
save_feat... |
% Perturbaciones
J2 = 1.083e-3; % Tierra
% Variacion RAAN
% Heliosincrona
Omegap_Sol = 2*pi/( 365.2411984 * 24 * 3600 ); % rad/s
|
% CreateScene2
%
close all
% INITIALISATION
lig = input('*** Donner le nombre de lignes de la scene :','s');
lig= str2double(lig);
nlig=int16(lig);
col= input('*** Donner le nombre de colonnes de la scene :','s');
col= str2double(col);
ncol=int16(col);
%
im= ones(nlig,ncol,'int16'); % initialisation de im a ... |
%% validate Numeric XfrFunc
frequency = linspace(-0.6,0.6,100);
ampRe = exp(-frequency.^2/0.2);
figure();plot(frequency,ampRe,'-+');
xfrFunc = com.qos.waveform.XfrFuncNumeric(frequency,ampRe,0*ampRe);
freq1 = linspace(-0.5,0.5,200);
ampE = xfrFunc.eval(freq1);
hold on;
plot(freq1,ampE(1:2:end),'-+');
|
% Arnold Lab, University of Michigan
% Melissa Lemke, PhD Candidate
% Last edit: March 11th, 2020
function [YOutput, filettl] = Sensitivity_2D_1v3(params, dParams_p1, dParams_p2,...
paramnames,ycol,p1,p2)
% If not inside a PBS job, use 4 processors
if isempty(getenv('PBS_NP'))
NP = 4; % May want to change this... |
%A basic gui that user sees at a very first look into the application
classdef Segmentation_tool < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
SelectImageForSegmentationLabel matlab.ui.control.Label
... |
clc
close all
clear all
%% Bakalářská práce
% Název: Segmentace ultrazvukových sekvencí
% autor: Jana Schwarzerová, učo: 186686
% Verze Matlab R2015b
%% Segmentace Narůstání oblastí v čase
%Předdefinování pomocných proměnných:
Vystup_data_narust_oblast = {};
Vstup_data_narust_oblast = {};
pocitadlo ... |
% Lee los parametros de entrada
p = params();
archivo_imagen = p.archivo_imagen;
K = p.K;
% Lee la imagen y construye una matriz que representa la imagen
I = im2double(imread(archivo_imagen));
% La matriz tiene dimension igual a (# pixeles de la imagen) por 3
% Cada pixel es representado por un vector de 3 dimensione... |
function [datadir, basedir, hostname] = GammaDataDir()
% determine hostname
[status, hostname] = system('hostname');
if status ~= 0
fprintf(2, 'cannot determine hostname, fall back to ''default''.\n');
hostname = 'default';
else
hostname = strtrim(hostname);
if ~isempty(regexp(hostname, '\.local$', 'once'))... |
%% to construct the accumulation matrix D
function [accumulation] = accumulation_construct(P_n_1, P_n, rock, fluid, grid, simulation)
% oil pressure and gas saturation at time step n
delta_t = simulation.time_step;
po_n = P_n(1:2:size(P_n));
sg_n = P_n(2:2:size(P_n));
% oil pressure and gas saturation at time ste... |
close all;
[s fss]=audioread('radio3.wav');
s=reshape(s,1,length(s));
s=s/max(abs(s));
%sound(s,fss);
m=interp(s,80);
fs=fss*80; % Frecuencia de muestreo (Hz)
kf=25e3; % Constante de desviación de frecuencia (Hz/V)
fc=100e3; % Frecuencia de portadora (Hz)
N=length(m); % Número de muestras
nfft=N; % número de pun... |
function weights = pypoststickbreaking(m, alpha, sigma)
% Sample K first size-biased weights of a posterior
% Pitman-Yor process using stick-breaking
K = length(m);
b = betarnd(1-sigma + m, alpha + (1:K)*sigma + sum(m)-cumsum(m));
logb = log(b);
log1mb = [0, cumsum(log(1.0-b(1:end-1)))];
logweights = logb + log1mb;
w... |
baseDir = '/Users/ZhipingJiang/base/results';
testsDir = dir(baseDir);
testsDir(1:3) = [];
testsData = {};
for k = 1:length(testsDir)
disp(['extracting tests: ' testsDir(k).name]);
currentDir = [baseDir filesep testsDir(k).name];
userDirs = dir([currentDir filesep] );
userDirs(1:3) = [];
resu... |
%% Takes the images of the best individuals from each run and creates a panel of images
%
%
% GAS 01-08-18
%%
clear all
% Configuration options
experiment_name = '6_sonar_symmetric_placement_without_failure';
bool_save = 1;
save_file_name = strcat(experiment_name, '_winners_panel_2x5.png');
% Navigate to the analy... |
%#############
%# Bootstrap #
%#############
% author: Zihan Zhang (zihan0203@gmail.com)
% https://landbuland.github.io
clc; clear
data = table2array(readtable('Portfolio.csv'));
B = 1000;
A = zeros(B,1);
for i = 1:B
index = randi(length(data),[1 length(data)]);
x = data(index,1);
y = data(index,2);
c... |
classdef Line < handle
properties (SetAccess = private)
m = 0 % slope
c = 0 % y-intercept
x_min = NaN % x of left-bottom point
x_max = NaN % x of right top point
alpha = 0 % angle from x-axis
d = 0 % x-inter... |
% PatientAverages.m
%
% Loads the results of FABBER inference on patient data and displays the ROI
% mean OEF, etc.
%
% Based on FabberAverages.m
%
% Created 12 July 2019
% MT Cherukara
%
% CHANGELOG:
clear;
%% User Selections
% choose patient (as a string)
p_id = '099';
% choose session (as an integer)
ses = 1;... |
function d=pcompress(p,c)
n=length(c);
q=((1-p)*norm(c))^2;
d=c;
max=norm(c,inf);
s=0;
r=0;
while (s<q)
min=max;
jmin=1;
for j=1:1:n
if (abs(d(j))>0 & abs(d(j))<min)
min=abs(d(j));
jmin=j;
end
end
s=s+(d(jmin))^2;
if (s<q)
r=r+1;
d(j... |
function cycles = find_perfect_5cycles(g)
% Find all groups of 5 dual-types that have a
% rock-paper-scissors-lizard-Spock relationship. Input a directed graph
% containing all the matchups.
beats_fn = @neutrally_beats;
cycles = []; % All perfect 5-cycles, 1 per row
all_nodes = string(g.Nodes... |
%shockTube.m
%main program for Assignment 2 shock tube simulation
function shockTube
clc
%Retrieve the shock tube parameters from the setup function.
par = setup();
%Use the functions exactSolution.m and roeSolution.m to find, respectively,
%the exact and simulated results for the state of the shock tube at the
%spec... |
function [inputMovie] = addDroppedFramesToMovie(inputMovie,droppedFrames,varargin)
% Fixes movie by adding dropped frames with the mean of the movie (to reduce impact on cell extraction algorithms).
% Biafra Ahanonu
% started: 2016.10.04 [20:31:15]
% inputs
% inputMovie - matrix dims are [X Y t] - where t = numbe... |
load 4brian.mat #contains M2d and M3d
load RCE_M3d2km.mat #contains M3d2km from 2km run
# pressure coordinates
pT = [998.712, 984.929, 968.826, 950.489, 930.031, ...
907.586, 883.295, 848.726, 796.539, 729.685, ...
651.747, 567.679, 487.197, 416.461, ...
354.365, 299.894, 252.163, 210.436];
pq = pT(1:17);
# dp
d... |
%K = [0.1,0.3,0.4,0.5,0.6,0.7];
K = [0.15];
FolderName = '.\validate_\furnace301\';
dataFile = 'furnace301.mat';
%dataFile = 'DTLZ2_2000_12_3.mat';
out_index = 17:19;
%set 1 for min and -1 for max in PPopt_tripathi
for k = K
PPopt(FolderName,dataFile,k,out_index);
end
|
% Calculate a single, average liquid contact angle
% E. Weiand - 01/2022
clear
clc
%% parameters
% file name to be read (.mat from readTraj.m)
fileName = 'tabTraj_nvt_pt1to2.mat';
% binning range and bin size
dAmin = 95; % [A^2], cylinder surface area increase
Nbins = 500; % number of radial bins
Nz = 310; ... |
%% homework 1 solution
%% 1a
im = 60*ones(500,500);
imshow(im, [0 255])
%% 1b
A = [255* ones(500,2), zeros(500,2)];
im = repmat(A, 1, 125);
imshow(im, [0 255])
%% 1c
im = [32*ones(500,255), 200*ones(500,255)];
imshow(im, [0 255])
%% 1d
im = ([0:499]/2)'*ones(1,500);
imshow(im, [0 255])
%% 1e using function meshgrid
[y,... |
function [ dmb, terminate ] = getDmbs(path)
%getDmbs Opens a window to select the .dmb's then converts that information into a structure
terminate = false;
defPath = path;
%% USER
[dmb_names, dmb_path] = uigetfile('*.dmb','Select .dmb''s',...
'MultiSelect','on',defPath);
if numel(dmb_names) == 1 && ~dmb_na... |
clear; close all; clc;
pkg load io;
cd ('C:\Users\Korisnik\Desktop\Faks 3. semestar\Praktikum\Grafovi');
G = [4.9033;
9.8066;
19.6133;
29.4200];
l = [0.071450;
0.143200;
0.289700;
0.438700];
Plot(G,l, 'zasto', 'zato', 'mozda');
print -dpng "G(1,1)"; |
t0=75.8;
tf=80.8;
th=2004.5;
d=2.1;
t= 2000:0.1:2013 ;
y = tf + (t0-tf)./(1+exp((t-th)/d));
plot(t,y)
%%
mu0=2;
muf=0.8;
muh=20;
d=1;
t=1:0.1:50 ;
y=mu0 + (mu0-muf)./(1+exp((t-muh)/d));
plot(t,y)
%%
136159 |
actualtest = load('actual_test.csv');
for i=1:size(actualtest,2)
actualtest(:,i) = actualtest(:,i) - mu(1, i);
actualtest(:,i) = actualtest(:,i) / sigma(1, i);
end
actualtest = [ones(size(actualtest, 1), 1) actualtest];
final_hypo = actualtest * theta;
final_hypo = sigmoid(final_hypo);
final_hypo = round(final_hypo... |
function out = FRONT_skin_segmentation(frame)
%FRONT_skin_segmentation removes useless details from frame returning an
%image where only skin is enlightened.
%Computation is done by checking at RGB and HVS frame values.
%
%
% OUTPUTS:
% * out - RGB containing only segmented hands. Useless details are make
% BLACK... |
function [forceList, obj] = fullGroundStructure(groundStructure, loadcases, supports, solverOptions, totalPenaltyList)
trussProblem3D = OptProblem3D();
trussProblem3D.createProblem(groundStructure, loadcases, supports, solverOptions, 0, totalPenaltyList);
[conNum, varNum, objVarNum] = trussProblem3D.getConA... |
function A = Inverse(A, method)
% Inverse Matrix inverse.
%
% B = Inverse(A) is the inverse of the square matrix A.
%
% B = Inverse(A, method) specifies the algorithm for matrix inversion.
% The available method are:
%
% 'GaussJordan' - (default) Gauss-Jordan elimiation
% 'LU' - LU decomposit... |
if isunix==0
data_folder='D:\Raw\AlzheimerEEG\Multivariate AFAVA artefact free';
save_folder='D:\Extracted\Alzheimer\Multivariate AFAVA artefact free\AFAVA_1sectrials\';
else
data_folder='/home/engbiome/INECO/INECO_fieldtrip/';
save_folder='/home/lspyrou/Documents/results/INECO/';
end
%%
fidx_patient... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.