text
stringlengths
8
6.12M
% book : Signals and Systems Laboratory with MATLAB % authors : Alex Palamides & Anastasia Veloni % Discrete Fourier Transform properties % periodicity n=0:4; x=n.^2; X=dft(x) N=length(x); for k=0:N-1+N for n=0:N-1 X(n+1)=x(n+1)*exp(-j*2*pi*k*n/N); end XkN(k+1)=sum(X); end XkN m...
i1=imread('1.jpg'); i2=imread('2.jpg'); i3=imread('3.jpg'); i4=imread('4.jpg'); i5=imread('5.jpg'); c1=corner(i1); c2=corner(i2); c3=corner(i3); c4=corner(i4); c5=corner(i5); figure; imshow(i1); hold on; plot(c1(:,1), c1(:,1), '*', 'Color', 'c') figure; imshow(i2); hold on; plot(c2(:,1), c2(:,2), '*', 'Color', 'c') ...
% proton_lung_injury_20160218() % % originally named: GEMS_overlay_H_C_20140409_gems % % The file reads reconstructed fdf proton and all carbon images. It also % averages images indexed from n1 to n2 and interpolates the averaged image % to match it to the size of the proton image. % % File Created by Mehrdad Pourfath...
% STEP_1_DOWNLOAD_GENBANK() % This will download all the sequences into a directory `dataset` as % individual `.mat` files. Re-running this script will only download % files that are not present in the `dataset` directory, so you can run % it again to keep your dataset up-to-date with the NCBI dataset. % % ...
function CodeSpeechwPlot % Sample file to code the active speech frames x = wavread('FI49wcar.wav'); FID = fopen('CodedData.cod', 'w'); CActive = 1; CSilence = 0; CSID = 2; Ns = length(x); NsFrame = 80; % Frame size (10ms) NsLA = 40; % Look-ahead size for VAD / DTX NsWin = 240; NFrame = floor(Ns/NsFra...
function hrf = pa_hrfunction(beta,X) % Y = PA_NIRS_HDRFUNCTION(BETA,X) % % f(t) = ((t-o)/d)^(p-1)(exp(-(t-0)/d)/d(p-1)!))^(p-1) % function gam = GammaFcn(k,t) close all N = 200; X = zeros(N,1); X(1) = 1; Fs = 10; gain = 1; shift = 2; % 2 sec response delay A = 4.30; % peak time 4.5 s after stim...
function [stressavg] = NodalAveraging(stress_N,type) %-------------------------------------------------------------------------- % Purpose: % Nodal averaging of elemental nodal stresses % Synopsis : % stressavg = NodalAveraging(stress_N,type) % Variable Description: % stress_N - element...
function getRaw % Script to download different raw data from the internet. % % File: getRaw.m % % Created: 13/12/2012 % % Last modified: 07/01/2015 % % Author: Sebastian Stoll (hydrosolutions ltd.) % % Purpose: Download different raw data and save them. % % Description: D...
clear all load('ocrfeaturestrain.mat'); %Transposing matrices for usage in pre-coded algorithms X = X.'; Y = Y.'; index = 1; part = cvpartition(45,'HoldOut',0.95); %Looking for only A's and B's, so sorts anything else out. for i = 1:size(Y,1) if Y(i,1) == 1 sortedX(index,:) = X(i,:); sortedY(in...
cd('~/Desktop/SST_DEV/input/ladderFiles/') numChunks = 16; sizeChunks = 8; startSub = 1; endSub = 119; numRuns = 5; % [H, U] numStops = [6, 26]; numGos = [58, 38]; % unhealthy: 64 trials % 26 stop, 38 go % 41% stop, 59% go % healthy: 64 trials % 6 stop, 58 go % 9% stop, 91% go for s = startSub:endSub for r = 1:...
function St= setim(Ac,Bc,K,F,R,delay,Ts,Sett)%,Sat_u) % Setim finds the settling time of a continous time system with delay. This % function uses a 2 step simulation to find the settling time: first step find the St with a long sample period and second with a small one. % % % St= setim(Ac,Bc,K,F,pipes,R,delay,...
function text = msg2text(msg) % Converts a bit-stream into an ASCII character string assert(~rem(length(msg), 8), ... 'The message doesn''t contain an integer number of bytes'); text = char(bin2dec(reshape(num2str(msg), 8, []).').'); end
function plot3DScene(X,Y,Z,image_RGB,downsample) rows_down = size(image_RGB,1)/downsample; cols_down = size(image_RGB,2)/downsample; %Downsample x_down = X(1:downsample:end, 1:downsample:end); y_down = Y(1:downsample:end, 1:downsample:end); z_down = Z(1:downsample:end, 1:downsample:end); r_down = image_RGB(1...
function q = LuminanceDiscriminationTask(varargin) % PSychophysics expeirment for UFlicker. The oberserver is presented with a % fixation point. Then the background moves and at some variable time % defined by objDelays the two patches appear on either side of the % fixation point. THe task is to identify the highest ...
%% TABFUN arr = randi(10,[2,3]); report.addTabular(arr); %% TABFUN2 row_labels = 'row1,row2'; col_labels = 'col1,col2,col3'; report.set('dataFormat','%i'); report.set('tableRowLabels', row_labels); report.set('tableColLabels', col_labels); report.set('tableColumnAlignment','lccc'); report.addTabular(arr); %% TABF...
function GetRect(vote,scale,ImgIndex,para,mode,average,all_compute) SuperPixelStructurePath = para.SuperPixelStructurePath; Files = para.Files; ImageName = Files(ImgIndex).name; %% load SP=load([SuperPixelStructurePath ImageName(1:end-4) '.mat']); SP = SP.SP; % curGT_pict...
function [aloc, alocf, alocH] = findminv(x, n) addpath('../'); load('frequency.mat'); % Find the local minimum points of the input % Save the values in a structure array % Convinent when there are several transfer functions % INPUT % n : number of load % f : frequncy points (containe...
function poses = compute_poses_juggling(X,inter) % compute joint centres and joint angles for the upper body model with % juggling balls % % © Copyright Phil Tresadern, University of Oxford, 2006 nframes = size(X,3); locations = zeros(21,nframes); % 1..3 : root % 4..9 : left/right shoulders % 10..12 : head % 13.....
%czas=Lev.time; y1_uciety=y1(400:size(y1),1); czas_zbior_1=Lev.time(1:size(y1)); czas_zbior_2=Lev.time(1:size(y1_uciety)); %y1=Lev.signals(1).values; %y2=Lev.signals(2).values; %y3=Lev.signals(3).values; % k=1; % [p q]=size(y1_uciety); % for i=1:p % if czas_zbior_2(i,1)==round(czas_zbior_2(i,1)) % ...
function rdDpxExpOccluders() if IsWin DisableKeysForKbCheck([233]); end E=dpxCoreExperiment; E.txtStart='textstart'; E.paradigm='rdDpxExpOccluders'; E.nRepeats=10; E.txtPauseNrTrials=5; E.nRepeats=1; E.outputFolder=''; E.window.set('rectPx',[],'widHeiMm',[394 295],'distMm',1000,'scrNr',1); E.window.set('interEye...
function Example3_5 % Example 3.5, p.133 Text % Uses the function fsolve from the Optimization Toolbox % and the M-function example3_5 supplied by the user % X(1) refers to xA (liquid composition) % X(2) refers to yA (gas composition) % X(3) refers to gammaA (the activity coefficient) [X]=fsolve(@example3_5,[0.2...
function [gmi] = mvn_mutual_information(X, Y) %Calculate the gaussian mutual information of X and Y. % % Arugments: % X - a MxD_1 matrix (M - observations, D_1 - dimension of X) % Y - a MxD_2 matrix (M - observations, D_2 - dimension of Y) % % Return: % The mutual information of X and Y assuming their joint is % ga...
function pa_checkfartspeakers_calibration_tone % PA_BOSE_QC2_CALIBRATION2 % % Determine calibration parameters of the Bose Quiet Comfort 2 headphones. % % See also AUDIOGRAM, PA_PLOT_BOSE_QC2_CALIBRATION % 2013 Marc van Wanrooij % Calibration performed by Michiel Dirkx, Maarten van de Kraan close all % grp...
function [out] = random(msg,BSID,DIUC,Frame); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % %% Name: random.m % %% ...
% Written by Ali A. Eftekhari % Last checked: June 2021 clc c=@(x)(x.^2); dc=@(x)(2*x); Lx=1.0; Nx=200; dx=Lx/Nx; m=createMesh1D(Nx, Lx); x_face=m.facecenters.x; x_cell=m.cellcenters.x; BC=createBC(m); BC.left.periodic=true; BC.right.periodic=true; u0=abs(sin(x_cell/Lx*10*pi)); u_old=createCellVariable(m, u0); u_val=u_...
function Wd = discretize(W, return_sparse) if ~exist('return_sparse', 'var') || isempty(return_sparse) return_sparse = false; end [~,ind] = max(W,[],2); n = size(ind,1); Wd = full(sparse((1:n)', ind, ones(n,1), n, size(W,2))); if ~return_sparse Wd = full(Wd); end
function [ eigenVect, eigenVal, mat_mean ] = PCA( mat ) %PCA sz = size( mat, 2); % calculate mean mat_mean = sum( mat, 2 )/sz; % Substract the mean mat_normalized = (mat-repmat(mat_mean,1,sz))/ sqrt(sz-1); % pca [eigenVect, eigenVal] = svds( mat_normalized, sz ); eigenVal = diag(e...
function [trainData,trainLabels,testData,testLabels]=loader(train_file_path,test_file_path) fprintf('Loading training data...\n'); data=load(train_file_path); test=load(test_file_path); trainData=data(:,2:end-1); trainLabels=data(:,end)+1; testData=test(:,2:end-1); testLabels=test(:,end)+1; % [trainData, mu, sigma] ...
function [objout] = convm2java(objin) if iscell(objin), objin = cell2mat(objin); end if isnumeric(objin) objout = m2j(objin); elseif isstruct(objin) fields = fieldnames(objin); vals = struct2cell(objin); [x, y, k] = size(objin); objout = matlab.jmstruct.JMStruct; objout.setFie...
% Strong isospin test example % % mikael.mieskolainen@cern.ch, 2017 clear; close all; addpath ./src % SU(2) isospin states proton = [1/2 1/2]; neutron = [1/2 -1/2]; piplus = [1 1]; pizero = [1 0]; piminus = [1 -1]; % Calculate Glesbch-Gordan ratios (based on Wigner-Eckart theorem) CGR = @(p1,p2,...
%% Baseflow Separation % loads catchments and performs baseflow separation by means of different % filters using (mainly) the parameter values from the model runs clc clear all % close all % load catchment(s) % Barden_Lane BELLEVER BROAD_GREEN Whitebridge Cappenham TREGONY stationname_vec = ["Barden_Lane","...
function FR = factorialratio(A,B) % FACTORIALRATIO - ratio of factorial numbers % % FR = FACTORIALRATIO (A,B) calculates the ratio between products of % factorials specified by A and B. A and B are lists of positive % integers, with N and M elements, respectively. The number of values in % each list may...
% Fibonacci.m by David Terr, Raytheon, 5-11-04 % Given an integers n, compute the nth Fibonacci number. function fib = Fibonacci(n) % Make sure input is an integer. if ( n ~= floor(n) ) error('Argument must be an integer.'); return; end if ~isreal(n) error('Argument must be an integer.');...
clear filename='../data/splice.data'; [class,gene,~]=importdata(filename); accuracy=zeros(10,4); % priors calculation nums_ei=0; nums_ie=0; nums_nn=0; C=zeros(3); for i=1:length(class) if class{i}=='EI' nums_ei=nums_ei+1; elseif class{i}=='IE' nums_ie=nums_ie+1; els...
% MicrophoneCal2_updateUI.m %------------------------------------------------------------------------ %------------------------------------------------------------------------ % Go Ashida & Sharad Shanbhag % ashida@umd.edu % sharad.shanbhag@einstein.yu.edu %----------------------------------------------------------...
clc; clearvars; % set this to 1 to enable docked window style in plots enable_docked = 1; if (enable_docked) set(0,'DefaultFigureWindowStyle','docked'); else set(0,'DefaultFigureWindowStyle','normal'); end set(0,'defaultAxesFontSize',14) set(0,'DefaultLegendFontSize',14) % Set LaTeX as default interpreter...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Function to calculate a comodulogram of Modulation Index (MI) values % from Fieldtrip data using the metric from (Ozkurt et al., 2011) % % Inputs: % - virtsens = MEG data (1 channel) % - toi = times of interest in seconds e.g. [0.3 1.5] % - p...
function [trunceast,truncwest,residual_cell, ... Jac_trunc_east,Jac_trunc_west,Jac_cell] = problem_exact_integrals_eastwest_M1(q,q_past,nuv1,nuf) u_1 = q(1); u_past_1 = q_past(1); trunceast(1,1) = 0; trunceast(1) = nuv1*(4.0*nuf*u_1); truncwest(1,1) = 0; truncwest(1) = nuv1*(-4.0*nuf*u_1); residual_cell(1,1...
function rgb = dark_slate_gray rgb = [0.18431, 0.3098, 0.3098]; end
function plot_graph %PLOT_GRAPH Plot the maximal invariant set in each direction Ts = 1/5; quad = Quad(Ts); [xs, us]= quad.trim(); sys = quad.linearize(xs, us); [sys_x, sys_y, sys_z, sys_yaw] = quad.decompose(sys, xs, us); %% --------- MPC Control x Invariant set for x --------- ...
function [] = plotSudokuTime(sudoku_table) sudoku; % put ordering to row names easy_time = sudoku_table{'Easy','Time'}; gentle_time = sudoku_table{'Gentle','Time'}; moderate_time = sudoku_table{'Moderate','Time'}; tough_time = sudoku_table{'Tough','Time'}; diabolical_time = sudoku_table{'Diabolical','Time'}; arto_ink...
function rgb = getcolors() rgb = rand(3,1); end
function centers = GetEveryOtherChecker(check1, check2) Add2StimLogList() checksN = ceil((check2-check1+1)^2/2); centers = ones(2, checksN); k=1; for i=check1:check2 for j=check1:check2 if mod(i+j-check1-check1,2)==0 centers(:, k)=[i j]; k=k+1; ...
function as_m_d % % Deletes the global data that has been generated by 'as_m_i'. % % Calling sequence: % % as_m_d % % % LYAPACK 1.0 (Thilo Penzl, May 1999) global LP_A clear global LP_A
function giveJuice(juiceX,juiceInterval,juiceTTLDuration,randomizeReward) % function giveJuice(juiceX,juiceInterval,juiceTTLDuration) % % provides a reward. uses juiceX and juiceTTLDuration to determine the % value of reward. If no arguments are provided for either one, uses the % global params values. % % juiceX - nu...
function [image] = vec_vol_img_2d_nii(raw_image,vol) [x,y,z,t] = size(raw_image.img(:,:,:,vol)); image = reshape(raw_image.img(:,:,:,vol),[x*y*z,t]); end
function [data] = lsim_get_tfdata(tf1hz,tf4hz,tfcon,loc,index) % [DATA] = LSIM_GET_TFDATA(TF1HZ,TF4HZ,TFCON) - pull data out of tf condition % structures in a format that can be plugged into the linear selectivity % increase model. % % INPUTS: % tf1hz - 1Hz training condition info % tf4hz - 4Hz training co...
function cannydete=cvcanny(imgName,k) img=imread(imgName); figure; % subplot(3,1,1); imshow(img); title('原图像') [m n]=size(img); img=double(img); %%canny边缘检测的前两步相对不复杂,所以我就直接调用系统函数了 %%1,高斯滤波 w=fspecial('gaussian',[5 5]); img=imfilter(img,w,'replicate'); % subplot(3,1,2); % imshow(uint8(img)) % title('高斯模糊后的图像') %%2,sob...
function path_planner(serPort) %read the obstacle file into column vector obstacle_file = 'map4.txt'; fid = fopen(obstacle_file); tline = fgetl(fid); tlines = cell(0,1); obstacles = zeros(200,4); counter = 1; %obstacles_raw = {' '}; while ischar(tline) disp(tline); ...
function CS4640_A1_driver % CS4640_A1_driver - driver for A1 functions % On input: % N/A % On output: % N/A % Call: % CS4640_A1_driver % Author: % Kyle Heaton % UU % Spring 2018 % % Create image im = CS4640_create_im("CS4640_hemisphere",10,10,100,-4,4,-4,4); %surf(im); % Image distance batman1 = imrea...
function analyse_eyedata_attention_task(date) %Written by Xing 30/7/18. %Load and analyse eye movement data, identifying time at which eye movement %was made, on each trial. localDisk=1; if localDisk==1 rootdir='D:\data\'; elseif localDisk==0 rootdir='X:\best\'; end switch(date) case '240718_B13' g...
function fig = configurePlot() fig = figure('units','normalized','outerposition',[0 0 1 1]); % fig = figure; hold on; end
%SKINBW_HSI Summary of this function goes here % Detailed explanation goes here a = imread('E:\Semester VII\Final Year Project\iCub_jpg\00001323.jpg'); HSV = rgb2hsv(a); H = HSV(:,:,1); S = HSV(:,:,2); V = HSV(:,:,3); %figure(1),imshow(H,'InitialMagnification',40),title('Hue'); %figure(2),imshow(S,'InitialM...
function SaveDicom(imageStruct, folderPath) % Save Dicom files using functions derived from imlook4d % Inputs: % imageStruct (where imageStruct.Cdata = matrix) % path to dicom folder where saving should be % % Example: % SaveDicom(imageStruct,'/Users/jan/Desktop/test') handles.image = imageStruct;...
if isw ~= 1 CGtoDGarrays nelLP = nelL; nelRP = nelR; inter = elem - (numel - numSI); nodeAR = -1;%SurfacesI(inter,1); nodeBR = -1;%SurfacesI(inter,2); nodeAL = -1;%SurfacesI(inter,3); nodeBL = -1;%SurfacesI(inter,4); end % Tim Truster % 10/15/13 % DG for elasticity problem in 3D with conforming interf...
%uses data from regressPrfSplit.m close all clear all isub=1; bandpass = 1; bandMin = 1; bandMax = 6; toZscore=0; nperms=100; prffolder = '~/NSD/prfsample/'; zscoreStr=''; if toZscore zscoreStr = '_zscore'; end absAvg = 0; bandpassStr = ''; if bandpass bandpassStr = ['_bandpass' num2str(bandMin) 'to' num...
dataset_format = '/media/arktheshadow/Windows/dataset_cannon/very_stable_img/IMG_%0.4d.CR2'; si = 931; ei = 1174; color = 1; % [u1_vals,u2_vals,I_vals] = parse_video_dataset(dataset_format,si,ei,color,956:1564,1148:1704,'select'); [mean_img,mean_diff_img,var,M,N] = parse_video_dataset2(dataset_format,si,ei,color); % ...
function mvfPEOF = getMotionVectorFeildPEOF(frames) shape = size(frames); refFrame = squeeze(mean(frames,3)); flows = zeros(shape(1), shape(2), shape(3)); opticFlow = opticalFlowFarneback; for f = 1:size(frames,3) flow = estimateFlow(opticFlow,refFrame); flow = estimateFlow(opticFlow,squeeze(frames(:,:...
%% Script para probar cruce uniforme % Para correr este script es necesario encender la bandera CROSSOVER_TEST % dentro del método uniformCrossover (recuerde apagarla después) % Se crea una población con 3 segmentos de 10 dígitos y bases 2, 3, y 4 p = population('i',[10 10 10],0,1,[2 3 4]); p = random(p,10); p = fill(...
function varargout = drawBezierCurve(varargin) %DRAWBEZIERCURVE Draw a cubic bezier curve defined by 4 control points. % % drawBezierCurve(POINTS) % Draw the Bezier curve defined by the 4 control points stored in POINTS. % POINTS is either a 4-by-2 array (vertical concatenation of control % points coordin...
trame = randi([0;1],239,8); nberreur = 0; convert = bi2de(trame)'; m = 8; % Number of bits per symbol n = (2^m)-1; k = 239; % Word lengths for code msg = gf(convert,m); % Two rows of m-bit symbols code = rsenc(msg,n,k); coders = code.x; final=de2bi(coders); %convertion en binaire for i = 1:239 if trame(i) ~= ...
ld = load('J_vs_E.mat'); x2 = ld.fj200.x; f2 = ld.fj200.signal; f2_err = ld.fj200.error; x4 = ld.fj400.x; f4 = ld.fj400.signal; f4_err = ld.fj400.error; e_min_s = 45; e_max_s = 125; % first subrange: take from ei200 ir2_min = find(x2==e_min_s); ir2_max = find(x2==e_max_s); x_tot1 = x2(1:ir2_min); s_tot1 = f...
function [acc] = my_accuracy(y_test, y_est) %My_accuracy Computes the accuracy of a given classification estimate. % input ----------------------------------------------------------------- % % o y_test : (1 x M_test), true labels from testing set % o y_est : (1 x M_test), estimated labes from tes...
% This function calculates numeric derivatives given sample data y in ROW % vector form. We assume a uniformly sampled space in x with diff(x) = dx % % INPUT: dependent sample data y % INPUT: sample space width dx % INPUT: differencing: forward (f), backward (b), central (c) [char] + % accuracy order: 2-pt schem...
function C = matern(d, range, nu) alpha = sqrt(2*nu) .* d ./ range; C = 2^(1-nu) .* alpha.^nu .* besselk(nu, alpha); end
function M = grayndcs(n) % M = grayndcs(n) is a column of 2^n integer indices % that reveal which bit changes among consecutive Gray % Codes in G = grays(n) , and in which direction. % Counting up from 1 for the least-significant bit % (the rightmost), bit number |M(1+k)| of G(1+k) % ch...
function [dist] = bmWeightedRecon(mMembership1, mMembership2, mAdj1, mAdj2, sMeasure) % % Compares the blockmodels using the weighted reconstruction error. % % INPUT: % mMembership1 - matrix of memberships of each vertex % mMembership2 - matrix of memberships of each vertex % mAdj1 - adjacency matrix of first...
function JND=JND_pixel(I,type) % JND=JND_pixel(I,type) %Initialize if nargin<1 close all;clc; I=imread('lena.bmp'); % I=imread('hats_JPEG.bmp'); Test=1; end if nargin<2 type='Yang'; end I=double(I); [H,W]=size(I); f = max(1,round(min(H,W)/256)) if(f>1) lpf = ones(f,f); lpf = lpf/su...
% This code is written by Claudia Clopath, Imperial College London % % Please cite: Clopath et al. Journal of Neuroscience 2014 % "A Cerebellar Learning Model of Vestibulo-Ocular Reflex %Adaptation in Wild-Type and Mutant Mice" % This code calls VOR.m clear all % Parameters N_inp = 100; ...
%this is a test of using an anonymous error function rather than a hardcoded square %error function. %it is only about 1% slower and saves having to write a new error function %for each new function definition. cd('/Users/skato/Desktop/Dropbox/ZimmerLab/BargmannProjects/Christine/AIAunc103/N2-nv'); load('lnmresults....
%MNPLibrary Class % %This class is a library of all the magnetic nanoparticles we have. % %The functions of this class are: % nameList A list of all particles in the library % compareLoop Plots all hysteresis loops % compareLoopShape Plots all hysteresis loops (normalized) %Long Chang, UH, F...
function replace_2(si) %% % using this function simiulating the case without soft isolation, only lru global num_set cl lru_stamp lru hit2 hit_app1 hit_app2; global num_app1; set_num = mod(si, num_set); % set_num = int32(set_num); base0 = set_num * 16 + 1; % base0 si the starting base of the set base = -1; % base is d...
%% Attractor Network Model % Firing rates of 12 units are simulated over time: % 1) 2 'intention nodes' representing voluntary colour choice (blue/green) % 2) 2 'sensory nodes' representing perceptual choice (left/right) % 3) 4 'action nodes' representing the movement output (target) % 4) 4 'cost nodes' represen...
[x,Fs] = audioread('singing44.wav'); output = phaseVocoder(x', Fs, 1024, 128, 17/18); resampled = resample(output, 17,18); soundsc(resampled, Fs); audiowrite('exercise4.wav', resampled, Fs);
function [m,suff,hist_best] = nn_projgrad5(classes,X0,params,fn,A0) %le_solve(samp,NX,NY) global D; global NX; global X; global c; global px0; force_marg = 1; % tr_wgt is the weight of the trace constraint NX = length(classes); N = NX; X = X0; D = size(X,2); px0 = ones(1,NX)/NX; %F={}; % The F ma...
% Exercise 3.2 % Simulation of the distribution of the mean of the exponential distribution M = 1000; nV = 2.^[2:10]'; tau = 10; tV = linspace(0,100,10000)'; figure(1) clf plot(tV,exppdf(tV,tau)) nn = length(nV); fprintf('\t n \t average of sample mean \n') for i=1:nn figure(i+1) clf n =...
function colors = solver(A,targetIndex) colors = []; end
% MATLAB Compiler % Version 4.7 (R2007b) 02-Aug-2007
function [ x y ] = findmax(u) [a,b] = max(u); [c, y] = max(a); [c,x] = max(u(:,y)); %UNTITLED4 Summary of this function goes here % Detailed explanation goes here end
function x = fovPixelSize(fovWidth, varargin) % FOVPIXELSIZE % % Description: % Get field of view pixel size in microns % % Syntax: % x = fovPixelSize(fovWidth, varargin) % % Input: % fovWidth field of view width (degrees) % Optional key-value inputs: % axi...
%% glm to test for associations between cognition and global measures of cortical thickness %% cogntion = age, gender, education, apoe, cortical thickness clear all path_csv = '/Users/AngelaTam/Desktop/adsf/model/model_preventad_20160813.csv'; path_out = '/Users/AngelaTam/Desktop/adsf/glm_mean_ct_cog_20160822/'; pso...
%% close all; clc; clear all; Ti = 21.2+273.15; % [C] Tf = 22.6+273.15; Pi = 102268; % [Pa] Pf = 102235; R = 8.314; % [J/molK] MMass = 28.97; % [g/m3] Di_air = (MMass*...
clear all; clc; %% FILL INFORMATION BELOW Vin=90; %V (rms) Vout=100; %V (rms) P_o=500; %W Qs=4; % unitless f=150e3; %Hz res_w=2*pi*f; %rad/sec k=0.2; % chosen coupling factor %% Calculation R_L=(10*8/pi^2)*2; Vout=sqrt(P_o*R_L); %load resistance % R_L=10.3; Ls=Qs*R_L/res_w; % secondary coil inducta...
clear paramsAll; clear params; params.Gridjob.runLocal = false; params.Gridjob.requiremf = 3000; params.Gridjob.jobname = 'layer1ActPhaseCombined'; params.Gridjob.wc_host = ''; params.ActPhaseCombine.inActFolder = '../../20130726_Paper/Autoencoder/layer1ActRectified'; params.ActPhaseCombine.inActFilenames = 'act1.mat'...
function [yEst] = execQ1(x, w1, w2, bias) for i=1:size(x)(2) %% Camada oculta %--Potencial de ativação uN = w1(:,1)*1 + w1(:,2)*x(i); %--Sinal de saída do neuronio [Função de ativação sigmóide] yN(:,1) = 2/(1 + exp(-2*uN(:,1))) - 1; %% Camada de saída ...
%MATLAB SCRIPT THAT READS THE TIFF MOVIE OF REGISTER FRAMES AND EXTRACTS THE %VESSEL REGIONS. clear %location of the tiff movies tiffDirec = './Alignednew'; %list of files to be processed. dirList = dir(fullfile(tiffDirec,'*.tif')); %Process the files one by one for j = 1:length(dirList) ProcessDir = dirList(j)...
function [] = write_c06(obj,fid) %% S T A T I C D I S P L A C E M E N T S if obj.CASE.SOL == 101 ct = 0; for i = 1:1:obj.nnodes if ct == 0 fprintf(fid,'\n\n S T A T I C D I S P L A C E M E N T S\n'); fprintf(fid,' GRID\n'); fprin...
function wsaq=weakly_sub_additiveQ(clv,tol) % WEAKLY_SUB_ADDITIVEQ returns 1 whenever the game v is weakly % sub-additive. % % wsaq=weakly_sub_additiveQ(clv) % % Define variables: % output: % wsaq -- Returns 1 (true) or 0 (false). % % input: % clv -- TuGame class object. % tol -- Tolerance value. B...
classdef statistics %STATISTICS Summary of this class goes here % Detailed explanation goes here properties centers leftRoom enteredRoom numFramesDesk = 0; numFramesCabinets = 0; numFramesOut = 0; lastCM = [-2 -2]; end methods ...
%prediction = 0.0; %for j = 1: n + 1, %In matlab % prediction = prediction + theta(j) * X(j); %end; % Vectorized implementation in Octave % prediction = theta' * x; % % % % % % % % % % % % % % %
%% FUNCTION Z1 % This matlab function returns value of Z1 for a given angle alpha. Z1 is % part of the equation of motion and is the coefficient in front of F1. % % input: % - [rad] alpha % - constants (module parameters) % output: % - [] Z1 % % Creator: Anders van Riesen (a.vanriesen@student.utwente.nl) ...
% clear close all fName = 'velocity_field_centerline.txt'; dataRead = dlmread(fName); dataSize = [94 94]; circLoc = [40 32]; xSurf = reshape(dataRead(:,4),dataSize); ySurf = reshape(dataRead(:,5),dataSize); zSurf = reshape(dataRead(:,6),dataSize); fig_w = 1024; fig_h = 360; figure('Units','points','Position',[0 0...
function [ vec_CA_bin ] = sample2bin(samples,A,B,C,D) mapped = round(((D+C) + (D-C) *samples ) / (B-(A))); %mapping [A,B] to [C,D] CA_bin=de2bi(mapped,8,'left-msb'); vec_CA_bin=zeros(1,numel(CA_bin)); msb=1; lsb=8; for i=1:length(CA_bin) vec_CA_bin(1,msb:lsb)=CA_bin(i,:); msb=msb+8; lsb=lsb+8; end end...
global c rho_W rho_O C min_delta_t nu Max_Trav Min_Trav lambda_glob size_p size_v W; c=3*10^11; rho_W=0.9; rho_O=0.9; C=[1000,-1000,1500]; min_delta_t=200*10^-12; nu=3*10^14; Max_Trav=[75,75,75]; Min_Trav=[40,40,40]; lambda_glob=0.25; size_p=[100,100]; size_v=[20,20,20]; W=[5,15,5,15];%W=[ymin=1,ymax,zmin=1...
%% 初始化 clc;clear close all A=imread('leaf.tif'); ABinary=logical(A); % 保证它是二值图 B=imread('wirebond.tif'); B=double(B); %% 二值图像 腐蚀膨胀 SE1=ones(3,3); [A_dilate,A_erode]=DilateErode_BinaryImg(ABinary,SE1); for k=1:2 % 对这张图 只操作一次的效果不明显,重复操作几次 [A_dilate,~]=DilateErode_BinaryImg(A_dilate,SE...
%give some initial coordinates. Track through sample lattices. %Store results for tracking tests. xextent = 0.003; yextent = 0.003; deltaextent = 0.02; n = 10; Z0=[]; for j=-n:n for k=-n:n for l=-n:n x0=j*xextent/n; y0=k*yextent/n; delta0=l*deltaextent/n; PS0=[x0;0;y0;0;delt...
function [ ihuman ] = upgrade_human( ihuman, changed_soul, changed_karma, last_influence_marker ) ihuman.soul = changed_soul; ihuman.karma = changed_karma; if (last_influence_marker > ihuman.specialized_marker) ihuman.specialized_marker = last_influence_marker; end
function rds = reduce(ds, parts) % Function reducing samples count of individual classes in ds % ds - data set to be reduced (sample = row; in the first column labels) % parts - row vector of reduction coefficients for individual classes % (1 means no reduction; 0 means no samples of given class to be left) % rds ...
clc; clear; A = [1 1 1; 2 3 7; 1 3 -2;]; b = [3; 0; 17]; n = 3; for i = 1 : n A(i, n + 1) = b(i); endfor for k = 1 : n - 1 # find max maxi = k; maxa=0; for p = k :1: n if abs(A(p,k))> maxa maxa = abs(A(p,k)); maxi = p; endif endfor # swap if maxa == 0 fprintf("System Does n...
function [s n] = mergeboundary(s,n,nx) % Purpose: used with continuousSet() to merge the two subsets containing boundary points for periodicity %%%%%% merge the two boundary systems into one due to the periodic domain %%%%%%%%%%%% if ( numel(s)>1 & any(s{1}==1) & any(s{end}==nx) ) % if 1 and 32 is in the set, th...