text
stringlengths
8
6.12M
% pressure in Pa (not hPa nor mbar) % temperature in K (not in degree Celsius) % humidity: % - partial pressure of water vapor in Pa (not hPa nor mbar) % - specific humidity in kg/kg (not g/kg) % - mixing ratio in kg/kg (not g/kg) % - relative humidity in percent % - dew point temperature in K (not degree Celsiu...
function q = plotRandViaPointTask() axis([-10 10 -10 10]) hold on q = []; sx_max = 3; sx_min = -3; sy_max = 9; sy_min = -9; x = (sx_max - sx_min) * rand(1) + sx_min; y = (sy_max - sy_min) * rand(1) + sy_min; th = pi * rand(1) - pi/2; quiver(x, y, 1*cos(th),1*sin(th), 'o'); q = [q, x, y, th]; sx_max = -4; sx_min = ...
depth=[0; 1;]; DATASET='MNIST'; ALPHA=0.5; LR_LAMBDA=1; Wd=load('MNIST Data/Simplified_MNIST_Dic.mat'); Wd=Wd.WDict; data=load('MNIST Data/MNIST_Data.mat'); label=data.trls(1:5000); test=data.tt_dat(:,1:1000); test_lb=data.ttls(1:1000); data=data.tr_dat(:,1:5000); num_label=numel(unique(label)); S_cod=eye(size(Wd'*Wd))...
function varargout = findspikes(varargin) % function [ind,thresh] = findspikes(y, opts...) % or findspikes(t,y, opts...) % % Locates spikes in a time series, based on a threshold. Optionally asks % for the threshold opt.nspike = 2; opt.window = false; opt.method = 'threshold'; opt.threshold = [];...
function [disp_az, disp_el, disp_data] = plotsurf(xaxis, yaxis, data); % PLOTSURF plots 2-d data using pcolor and corrects axes % [disp_az, disp_el, disp_data] = plotsurf(xaxis, yaxis, spacedata); % NOTE: THIS VERSION HAS BEEN UPDATED TO SHIFT NUMERICAL VALUES OF AXES % RATHER THAN JUST THE LOCATION OF THE ...
function [x, y] = mth_circle_tangent_line(v, t, r, dx, dy) % MTH_CIRCLE_TANGENT_LINE generates the tangent line to a circle given % as a function of an independent variable. % %----------------------------------------------------------------------- % Copyright 2018 Kurt Motekew % % This Source Code Form is subject to t...
function gettweets_nopost % Set up paths to twitty and json parser addpath(genpath('~/Desktop/twitter/creds')); % Credentials addpath(genpath('~/Desktop/twitter/data')); % Data addpath(genpath('~/Desktop/twitter/out')); % Output folder addpath(genpath('~/Desktop/twitter/json/parse_json')); % Twitty's default json...
% Part1.m % Author: Charles Yang % Signal&System 4.3(b)(c)(d)(e)(f) %% (b) load splat; y=y(1:8192); fs=8192; Y=fftshift(fft(y)); Y1=conj(Y); y1=ifft(fftshift(Y1)); subplot(211);plot(y);sound(y,fs); pause(2); subplot(212);plot(real(y1));sound(y1,fs); %% (d) load splat; y=y(1:8192); fs=8192; Y=fftshift(fft(y)); Y2=abs(Y)...
function ksurf(record,cm) % function ksurf(record) % makes a 3D surface plot of a LTSTM record % Same as ltsurf but modified to my pleasure. if ~isstruct(record) t=record; record=struct; record.Data = t; end % Normalize to [0,1]; record = ltnorm(record); surf(record.Data,'LineStyle','no...
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % Noss is Mean Squared Eigenvalue Error method used for obtaining optimum % Number of Source Signals (NoSS): https://ieeexplore.ieee.org/document/8466044 % Reference Authors: % Soosan Beheshti (soosan@ee.ryerson.ca) and Saba Sedghizadeh % CITE...
function y = sigFun(init_coeffs,x) y = init_coeffs(1)./(1+exp((init_coeffs(2)-x)/init_coeffs(3)));
% load('d:\hina\marathon\clusters\cluster2'); % load('d:\hina\marathon\embedding parameters\xparameters2'); % load('d:\hina\marathon\embedding parameters\yparameters2'); % load('d:\hina\marathon\timeseries\ts2'); % for j=1:67 %interpolation % xm_=cell2mat(xm(1,j)); % ym_=cell2mat(ym(1,j)); % for i=1:size(x...
clear all; close all; clc; im = imread('http://i.imgur.com/TwDQZKO.jpg'); r = im(:,:, 1); g = im(:,:, 2); b = im(:,:, 3); % green % bwr = abs(double(r) - 80) <= 80; bwg = abs(double(g) - 240) <= 80; bwb = abs(double(b) - 60) <= 80; bw = bwr .* bwg .* bwb; bw = imfill(bw,'holes'); bw = bwareaopen(bw,80); green ...
% title_alt : Alternate title positioning % % Call : % title_alt(string,isub,location,dw,w_out) % % title [str] : title string % isub [int] : Number of subplot. 1-->'a)' is prepended to the title % 2-->'b)' is prepended to the title.. % ...
function [point_candidate, track_out, x1,y1] = search_candidate_point_1(dis_range, angle_range,x1,y1,x2,y2,x3,y3,track_out) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% step 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% point_candidate = []; for i = 1:length(x1) x = x1(i); y = y1(i); dis = sqrt((x2 - x).^2 + (y2 - y).^2); [a,b]...
%calling function : logVriable; function [avg_currency_rnd, currency1, currency2, currency3, currency4, currency5]=logCurrency(node,Id1,Id2,Id3,Id4,Id5) % Collect currency of various nodes % Retrieving network constants. CONST=networkConstants(); n=CONST.n; % Total nodes in the network % Total currency ...
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % En este script se seleccionara entre los 6 modos de trabajo que se desee % para obtener el modelo del robot. En concreto se puede dar que: % -> Robot ideal con Reductoras % -> Robot ideal sin Reductoras % -> Robot real solo encoder con Reductora...
function [globalMap, cumulativeM] = constructGlobalMap(globalFrame, frame, M, globalM) % TODO: Add explicit explanations here [h, w] = size(frame); t = M; M(:,3) = t(3,:)'; M(3,:) = t(:,3)'; tform = affine2d(M); Tinv = invert(tform); cumulativeM= Tinv.T*globalM.T; ble...
mex ./persistence/comp_graph_persistence.cpp
%%% Función para recorrer los clusters buscando clusters multielectrodo de p-valores %%% Álvaro Cabana Junio 2017 - CIBPsi %%% ------------------------------------------------------------------- % % Función recursiva: algunos inputs deben ser fijados vacíos. % % % entradas: ptable: salida de estadístico punto...
function [] = plot_piano(maxFFT,low,high,A) % plots the piano backdrop in the active figure % maxFFT: the maximum amplitude, sets the y-limit of the piano plot % low, high: the lowest and highest octave to be displayed % A: the tuning of the piano, e.g. 442 Hz NOTE_ABOVE_RATIO = 2^(1/12); % ...
function [distortion]=CalDistortion_LUT_Compare(x0)%newton([0.8 0.8 0.8],0.00001,20) global N dist bitlens imp y2fit z2fit a b c d syms ri% 1/2 root of the 'inverse of rate' per=eval(2^(-1.1^(d*ri^6+c*ri^4+b*ri^2+a)));%ri^4 for the sake of using newton method y2_lot=min(y2fit):0.05:6;%max(y2fit); for i=1:length(y2...
function [R_s, R ,M,N] = GetHArrisMatrix( Sxx,Syy,Sxy,k,threshold) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here [x,y] = size(Sxx); R = zeros(x,y); R_s = zeros(x,y); for i = 2 : x - 1 for j = 2 : y - 1 xx = 0; yy = 0; xy = 0; for wi = 1 : 3 for wj = 1 :...
%% Q1 beta = 0.95; delta = 0.5; theta = 0.8; alpha = 0.5; A = 1; k_star_old = ((1/beta+delta-1)/(alpha*A))^(1/(alpha-1)); c_star_old = A*k_star_old^alpha - delta*k_star_old; k_star_old; c_star_old; %% capital before the shock disp(k_star_old); %% consumption before the shock disp(c_star_old); A = 1.1; k_star_new = (...
function [R] = get_CC_network(R) fprintf('\t Getting correlation coefficient distribution (network-wide sampling)...\n'); corrcoef_sample_num = 10^3; %10^4; % number of sampling pairs CC_kernel_width = 40; % ms, kernel length % Dumpe fields N = R.N; spike_hist = R.reduced.spike_hist; dt = R.reduced.dt; Num_po...
% This function is used to align the electrical pulse that is detected by % the detector algorithm. Alignment can minimize the errors caused by % variation of timing and voltage baseline function stim_align() end
%Q3 (a) clc; clear all; img = imread('image path''circular_stroke.tif'); imshow(img); title('Input image'); [row col] = size(img); w = (1/81)*(ones(9)); % 9x9 averaging filter g = imfilter(img, w, 'conv'); % smooth image figure(); imshow(g); title('Smooth image'); % displ...
clear all; S1 = imread('car-plate (5).jpg'); S2 = rgb2gray(S1); S3 = medfilt2(S2, [3 3]); E1 = edge(S3, 'sobel'); [sx, sy] = size(E1); E2 = imdilate(E1, ones(3)); L = bwlabel(E2, 8); N = 4; [yN, xN] = find(L == N); G = zeros(sx, sy); for i = 1:length(yN) G(yN...
function [im_out PSNR SSIM ] = Centralized_SR_Denoising_IDR2( par ) time0 = clock; nim = par.nim; [h w] = size(nim); par.step = 1; par.h = h; par.w = w; ori_im = zeros(h,w); n_im = nim; if isfield(par, 'I') ori_im = par.I...
close all clear clc fs=1000; n=0:1/fs:2 x=sin(2*pi*20*n); subplot(211); plot(n,x) N=2^nextpow2(length(x)); m=-N/2:(N/2)-1; w=2*pi*fs*m/N; X=x*exp(-1i*2*pi*n'*m*fs/N); subplot(212); plot(w/(2*pi),abs(X)) xlim([-70 70])
function [ signal ] = highPass( signal, Fs, sigma ) %HIGHPASS Summary of this function goes here % sigma: standard deviation of gaussian high pass filter % l = length(signal); % [f, femg, nfft] = fourier(signal, Fs); % %plot(f(:), abs(femg(1:nfft/2+1))); % % % Gaussian filter in Fourier domain % % standard deviatio...
m = 100; % dimension of hidden state eta = 0.1; % learning rate seq_length = 25; % length of input sequence sig = 0.01; %Parameters in a model RNN.b = zeros(m,1); %Changed dimension (K,1) -> (m,1) think its wrong in assignement RNN.c = zeros(K,1); RNN.U = randn(m, K) * sig; RNN.W = randn(m, m) * sig; RNN.V = randn(K,...
function [measures, best] = distilate(Z, param1_name, skinny, ref_fsimc) [~, N] = size(Z); if nargin < 3 skinny = true; end measures.param1 = zeros(1, N); measures.psnr = zeros(1, N); measures.fsim = zeros(1,N); measures.ssim = zeros(1,N); measures.msam = zeros(1,N); measures.rel_norm = zeros(1, N); if nargin <...
function [strSPL, strSpec1, strSpec2] = stimdispMBL(Stim) % stimdispMBL - strings describing specific parameters of MBL stimulus % [strSPL, strSpec1, strSpec2] = stimdispMBL(Stim) returns strings % strSPL, strSpec1, strSpec2 describing the stimulus parameters of the % MBL stimulus. Stim is the struct containin...
% Revolute joint in the X axis % % Author : Darwin LAU % Created : 2012 % Description : classdef RevoluteX < JointBase properties (Constant = true) numDofs = 1; numVars = 1; q_default = [0]; q_dot_default = [0]; q_ddot_default = [0]; q_lb = [-pi...
%dynamics A=[1 0 .1 0; 0 1 0 .1; 0 0 .5 0; 0 0 0 .5;]; B=[0 0; 0 0; 1 0; 0 1]; H = [1 0 0 0; 0 1 0 0]; %starting x0=zeros(4,1); %way points w=[1 5 10 12 6 2 3; 2 3 4 5 8 7 10]; k=[4 10 19 30 40 45 50]; % H = [0 0 1 0; % 0 0 0 1]; numIter = size(w,2); Ap = [] zeroBuffer = zeros(2, 2)...
function y = odd_finder(a) s = size(a); row = s(1,1); column=s(1,2); for i = 1: row for j = 1:column if rem(a(i,j),2) ~= 0 b(i,j) = a(i,j); end end end y = b; end
function pts = getPoints3D(I, pointsPerSlice, viewX, viewY, viewZ, interpScale) % lets you select points from a 3D image, slice by slice % only the part of the image defined by I(viewX, viewY, viewZ) is shown. pts = zeros(0, pointsPerSlice, 3); [~,~,numImages] = size(I); scrsz = get(0,'ScreenSize'); figure('Position',...
img = imread('lena512.bmp'); [row,col] = size(img); for i=1:row for j=1:col if(img(i,j)>128) img(i,j)=1; else img(i,j)=0; end if((i>=1 && i<=10) || (j>=1 && j<=10) || (i>=row-10 && i<=row) || (j>=col-10 && j<=col)) img(i,j)=0; end end e...
function onset=odByVol(wObj, odPrm, plotOpt) % tpByVol: Onset detection of tapping by volume % Usage: onset=odByVol(y, fs, odPrm, plotOpt) % % For example: % waveFile='tapping.wav'; % [y, fs, nbits, opts, cueLabel]=wavReadInt(waveFile); % plotOpt=1; % odPrm=odPrmSet; % onset=odByVol(y, fs, odPrm, plotOpt); % subp...
clear; % Remove all workspace variables T = 32; L = 64; t = 0:L-1; Ts = t(2)-t(1); % Sampling period fs = 1/Ts; % Sampling frequency y = cos(2*pi/T*t); fy = fft(y,128); yz= [y zeros(1,L)]; fyz= fft(yz); freqs = FftShiftedFreqs(numel(fy), fs); figure(5); clf; subplot(2...
function fid = open(obj,permission) %OPEN Open a FILE object for reading/writing/appending. % This method opens a file and returns the FID. The FID is also stored in % the file object. Note only one instance of the file can be open by this % method. % % PERMISSION is optional and should be 'r', 'w', or 'a' for...
% функция для определения мгновенного угла тангажа аппарата каждой ступени function [Theta_t] = Tangagh_corner (t, Stage_Time_Interval, ... Theta_Stage_Bound, PP_1, PP_2, t_0) % - веменные интервалы закона изменения тангажа % t_0 - время начала работы ступени % t = t - t_0; % Stage_Time_Interval представ...
%Lotanna Ezenwa, Problem Set 2, #2 %PS2_2.m %% Due Wednesday, April 6th, 2016 clear me = LotaEzenwa(); code = me.id; PS_2_1 %To get Initial Values PS2_1 %To obtain Eigenvalues for Part B syms ir1 ir2 V1 V2 ic1 ic2 syms B D E F G R C B = 5; D = 6; E = 6; F = 7; G = 2; R = 1; %Ohm C = 1; %Farads V1_0 = .5; %Volts V...
close all, clear all [sim_vars,bot,target] = init_vars(); t_end = sim_vars.t_end; t_step = sim_vars.t_step; t = [0:t_step:t_end]; for i = 1:3 traj = gen_trajectories(sim_vars,target.speed,i); subplot(3,1,i); hold on; plot(traj(1,:),traj(2,:),'r'); plot(traj(1,end),traj(2,end),'r','marker','x'); ...
function [trainMatrix, speciesVec] = buildTrainMatrix(train, im2gray) % Argument: % train: a cell array containing FishImage objects for the training % set % im2gray: a function handle that converts the image from RGB to % grayscale % % Return: % trainMatrix: ...
function [individual_best,fval_best] = de(problem) %DE 此处显示有关此函数的摘要 % input: problem % problem.dimension: 变量维度 % problem.objective: 目标函数句柄 % problem.lb: 下界,如[-1,-1] % problem.ub: 上界,如[1,1] m = problem.dimension; f = problem.objective; lb = problem.lb; ub = problem.ub; % init size_population = 20; genera...
%% Example Title % Summary of example objective % 退出行情服务器连接 clear all; rehash; delete(timerfindall); mdlogout pause(2); %% 初始化:counter, book % counter, 多初始化几个 c_opt = CounterCTP.huaxi_opt3; c_opt2 = CounterCTP.huaxi_opt4; % c_etf = CounterCTP.HuaXiETFTest; c_opt.login; c_opt2.login; %% 初始化:quote, volsurf: 手工 %% ...
function I = preprocess(I, pipeline, methods, colorMode) numSteps = numel(pipeline); assert(any(ismember(colorMode,{'RGB','HSV'})),'Wrong colorMode.'); for s=1:numSteps step = pipeline{s}; if strcmpi(step,'cc') I = preprocessColorConstancy(I, methods.cc, colorMode); elseif strcmpi(step,'heq') ...
clear all %%% settings %%% N = 20; % oscillators placed along one dimension of the grid Nn = N^2; % total number of oscillators levels = 20; total_sims = levels^2; dt = 1e-2; % integration time step t_sim = 1; ...
function v = VAR(this, select, range, varargin) % VAR Population VAR for selected model variables. % % Syntax % ======= % % V = VAR(M,List,Range,...) % % Input arguments % ================ % % * `M` [ model ] - Solved model object. % % * `List` [ cellstr | char ] - List of variables selected for the V...
# Venturi tube calculator # calculates area ratio depending on flow constants # Damon Printz # 8/11/2020 clc; clear; P1 = 20 * 6894.76; % incoming pressure (Pa) P2 = 10 * 6894.76; % pressure in the neck (Pa) V2 = 343; % speed through the venturi neck (m/s) rho = 1.225; % air density (kg/m^3) if( P2/rho-P1/rho+V...
function [distance] = euclidean_distance(u,v) %EUCLIDEAN_DISTANCE Return the euclidean distance between two points % points are vectors squared_distance = sum((u-v).^2); distance = squared_distance^0.5; end
var_mat = NaN(3,3); corr_mat = NaN(3,3); prod_l_mat = NaN(3,6); prod_m_mat = NaN(3,6); prod_s_mat = NaN(3,6); wl_mat = NaN(3,6); wm_mat = NaN(3,6); ws_mat = NaN(3,6); emp_l_mat = NaN(3,6); emp_m_mat = NaN(3,6); emp_s_mat = NaN(3,6); rel_wage_l_mat = NaN(3,6); rel_wage_s_mat = NaN(3,6); nl_mat = NaN(3,6); nm_mat = NaN(3...
function M = logmap(r, x1) X(1) = x1; for i=1:19 X(i+1) = r * X(i) * (1 - X(i)); end M = X; end
%% Vassilis Palassopoulos % Helper function for running Python (mymod.py) within MATLAB function mymod() mymod = py.importlib.import_module('mymod'); py.importlib.reload(mymod); end %clear classes %if count(py.sys.path,'') == 0 % insert(py.sys.path,int32(0),''); %end
% this script states and solves the floor dual for function g. The Ordering % of the indicies in the Matrix is given by the functions getIndex5Vars and % getSets5Vars. The coefficiants are in the variable c except for % c_emptySet_emptySet which is given in floorDualVal! n = 5; % number of variables binCoeff = nchoosek...
clc; clear; close all; choice = input('<< Welcome to MNA-MAT - A SPICE netlist simulation tool >> \n 1. Standard Analysis \n 2. Monte Carlo Analysis \n 3. View the results of previous simulation \n'); switch(choice) case{1} run('Standard_Analysis.m'); case{2} run('MonteCarlo.m'); case{3} ...
function llk_trial=Exp1_TrialLikelihood(llk_responses) %% Collapse llk by trial llk_trial=squeeze(nansum(log(llk_responses+eps),2));
clear all; clc; syms y; fx=42*(5-y)*2*sqrt(25-(y-5)^2); n=5; a=0; b=5; R=zeros(n,n); fa=subs(fx,a); fb=subs(fx,b); for j=1:n h(j)=(b-a)/(2^(j-1)); end h R(1,1)=(h(1)/2)*(fa+fb); for j=2:n Sum=0; for i=1:(2^(j-2)) c=(a+((2*i-1)*h(j))); fc=subs(fx,c); Sum=Sum+fc; end R(j,1)=(1/...
clear; clc; r = 1024; c = 1024; padX = 3; padY = 3; blockX = 16; blockY = 16; totalFrame = 100; NBx = ceil( ( c - padX ) / (blockX + padX) ); NBy = ceil( ( r - padY ) / (blockY + padY) ); GW = NBx * blockX + (NBx+1) * padX; GH = NBy * blockY + (NBy+1) * padY; diffH = GH - r; diffW = GW - c; H = GH; W = GW; dataSet ...
%%%%%%%%%%%%%%%%%%%%%%% pMelts equil. batch melting %%%%%%%%%%%%%%%%%%%%%%% H2O=0.15; % Initial Water Pi=33000; % Initial Pressure % Starting composition sc=[44.8030; 0.1991; 4.4305; 0.9778; 0.3823; 7.1350; 0.1344; 37.6345; 0.2489; 0.0129; 3.5345; 0.3584; 0.0289; 0.0209; H2O;]; %mcdbse (McDonough Pyrolite) % Elements t...
dat=[10,2,4,5,20,34,5,10,23,88,4,2,5,1,19,30] % Example short time series. in=dat; bin_len=round(length(in)/2)-1; % This is for the 'default' binning. User can comment this out % if they prefer assigning specific bins to % the MSCV analysis. If user wants ...
function [dZ] = backward_activation(Z, Sigma) %BACKWARD_ACTIVATION Compute the derivative of the activation function %evaluated in Z % inputs: % o Z (NxM) Z value, input of the activation function. The size N % depends of the number of neurons at the considered layer but is % irrelevant here. % ...
clear all; close all; clc; m=input('Enter the basis matrix dimension: '); n=m; alpha2=ones(1,n)*sqrt(2/n); alpha2(1)=sqrt(1/n); alpha1=ones(1,m)*sqrt(2/m); alpha(1)=sqrt(1/m); for u=0:m-1 for v=0:n-1 for x=0:m-1 for y=0:n-1 a{u+1,v+1}(x+1,y+1)=alpha1(u+1)*alpha2(v+1)...
% Use the Open File Dialog [filename, pathname] = uigetfile('*.out', 'Pick the image file: '); % Check For Selected Files if isequal(pathname,0) disp('No Data Files Were Selected !!') else % Read Image File imageRaw = dlmread(filename,'\t'); [imgX imgY] = size(imageRaw); % Plot Orig...
%temp = %csvread('../data/control_group/2018-04-30T12-54-31/virus-over-time.csv'); % SETUP virusMin = 50; virusMax = 500; % Get config group names cd ../data/ files = dir; configGroups = {files([files.isdir]).name}; configGroups = configGroups(~ismember(configGroups,{'.','..'})); % Enter each group. Take the average...
%target side plot(tc_dva(1),tc_dva(2),'-or') hold on; axis([-5,5,-5,5]); plot(dc_dva(1,1),dc_dva(1,2),'-ob') plot(dc_dva(2,1),dc_dva(2,2),'-ob') %unrotated target stuff plot(targ_coor_struct.point_3(1),targ_coor_struct.point_3(2),'*r') plot(targ_coor_struct.point_2(1),targ_coor_struct.point_2(2),'*g') plot(targ_coor_st...
% Final Project - Interest Points Detection and Image Matching % Author: CÚline Bensoussan & Jill Perreault % Course: Computer Vision % Date: April 15, 2013 function [r, c, harris] = harrisCornerDetector(im, sigma, n, disp) % HARRIS CORNER DETECTOR: detects n interest points of an image % % [fig, r, c, harr...
function cir_plot(c,r) cir_x=[]; cir_y=[]; for j=0:pi/500:2*pi % ²ÎÊý·½³Ì»­Ô² aa_x= r*cos(j)+c(1); aa_y= r*sin(j)+c(2); cir_x=[cir_x,aa_x]; cir_y=[cir_y,aa_y]; end plot(cir_x,cir_y,'k--','LineWidth',1.5);
function [left_, right_] = calc_dynamicBEP(self, tau_) % 计算动态的BEP函数 %输出 % 左BEP和右BEP left_ = nan; right_ = nan; call = self.call; put = self.put; if isempty(call) || isempty(put) else if ~exist('tau_', 'var') tau_ = call.tau; end [left_init_, right_init_] = self.calc_payoffBEP; % 计算的函数句柄 ...
function pspm_contrasts(modelname, modelfile) % function for batch running contrasts in PsPM %% %========================================================================== % User Defined Contrasts %========================================================================== % User Defined Contrasts %...
function [Light_Dark_Box] = createLDBstruc_Godfrey(T_Food_Complete,T_Light_Complete,T_Difference_Complete,T_Weight_Complete) %{ Removing mice that were exclded for various reasons. Total of 10 mice in Fasted groups and 11 mice in Control groups. Used in the function CreateStrucLDB_Godfrey.m Uses the following function...
clear all; theta = [0,0]; thetax = zeros(1000,2); Jthetax = zeros(1000,2); for i=1:1000 Jtheta = 0.5*[5*theta(1) + 3*theta(2) - 7, 3*theta(1) + 2*theta(2) - 4]; theta = theta - 0.1*Jtheta; thetax(i,:) = theta; Jthetax(i,:) = Jtheta; end
clear, clc syms u1 u2 u3 s u = [u1; u2; u3]; R = (2 * s * s - 1) * eye(3) + 2 * (u * transpose(u) - s * skew(u)); q = transpose(sym('q%d%d', [4, 3])); qq = transpose(sym('qq%d%d', [4, 3])); % gc_zp_data(4, false, [symvar([q, qq]), sym('s')]); % q = eval(q); % qq = eval(qq); % R = eval(R); eqs = sym(zeros(5, 1)); e...
clear all close all %this will be used to flag how you want to be assessed fname = 'EGB339_prac_exam_group_16.json'; flags = jsondecode(fileread(fname)); %change this for different input sheets init_image = imread('TestSheet1.jpg'); dest_image = imread('TestSheet8.jpg'); %this will not be made available b...
function [F,labels] = featureExtractor(my_dir,name) fprintf('\n\n\n\t\t%s\n\n',upper(name)); Bt = 20; Nc = 9; folderInfo =dir(my_dir); folderInfo(1:2) = []; num_images = length(folderInfo); labels = repmat(name, num_images, 1); labels = mat2cell(labels, ones(size(labels, 1), 1), size(labels, 2)); disp(['Total:...
function [wijt xijt] = get_i_j_cooccurrences(output,Xframes,i,j,sign_test_flag) if j<i [i j] = swap_values(i,j); end if ~exist('sign_test_flag','var') sign_test_flag = false; end T = length(output); wijt = zeros(T,1); xijt = zeros(T,1); for t=1:T xi = Xframes(i,t); xj = Xframes(j,t); xijt(t) = m...
function bestVal = findBestThreshVal(vmin, vmax, dv, nExp, windowSize) if nargin < 4 nExp = 1; end if nargin < 5 windowSize = 50; end vals = vmin:dv:vmax; [~,Tshape] = plotResults(nExp, vmin, windowSize, false); bestVal = [vmin mean(Tshape) std(Tshape) length(Tshape)]; values = [bestVal; zeros(length(vals)-1...
%変数リスト B=1.2; delta_K=0.1; delta_H=0.05; theta=2; low=0.05; alpha=0.33; a11 = (B + delta_K - delta_H)/alpha; a21 = 1/theta*(delta_K*(1-theta)+low); a31 = (1-alpha)/alpha*(delta_H - B - delta_K); A = [a11 a21 a31]' ; Slope_SS = [1 0 0; (alpha-theta)/theta 1 0; 0 -1 B]; %x= -10; %y= 10; % if (x>0) & (y>0) % disp('x ...
function []=plot_possibilistic(number_of_clusters, centers, data, plottitle) figure() scatter(data(:,1),data(:,2),1, '.c'); hold on for i=1:number_of_clusters plot(centers(i,1),centers(i,2),'xk','MarkerSize',7,'LineWidth',1) hold on end title(plottitle) hold off end
syms y(x) c DY = diff(y); % (a) cond = y(2) == 0.5; ode = DY == 8*x^2 + 5; getY(ode,cond,x, '(a)'); % (b) cond = y(0) == pi/5; ode = DY == 5*x*sin(y)^2; getY(ode,cond,x,'(b)'); % (c) disp('(c)') cond = y(0) == c; ode = DY == 7*x*(cos(y)^2); ySol(x) = dsolve(ode,cond); disp(ySol(x)); % (d) cond = y(0) == 3; ode = DY...
% Simon's code nCuts_no = length(unique(nCuts)); nTrees_no = length(unique(nTrees)); nCutsRS = reshape(nCuts,length(unique(nTrees)),length(unique(nCuts))) nTreesRS = reshape(nTrees,length(unique(nTrees)),length(unique(nCuts))) ROCintRS = reshape(ROCint,length(unique(nTrees)),length(unique(nCuts))) surf(nCutsRS,nTre...
function [e] = test14(cleanup, level) %TEST14 Unicode tests, You need your machine set up and the level needs to %be higher than 1. For windows, install the Asian fonts and switch to %Japanese mode. % Thomas Ruark, 5/10/2006 % Copyright 2006 Adobe Systems, Inc. if level > 1 % J characters j = [2...
function W=initLayer(m,n) W=zeros(m,n); end
%% HW 4 %% 1. ...Produce a short Matlab script to test your answer. sol=inv([7,2,1;0,3,-1;-3,4,-2]); %% 2.a. Implement the bisection scheme to solve for E. for i=1:1 w=.017; %set up values e=.07; t=50; f=@(E) (w.*t)+(e.*sin(E))-E; a=1.5.*10.^8; b=-1.*10.^8; error=10.^-3; E_bi_a=bisectionMethod(f,a,b,error); disp('The...
function [k,f] = LBFGS_k(k0,ffo,fmo,rho,Dissimilarity,Spacing,delta,ZU_diff,M_lbgfs ) maxFunEvals = M_lbgfs; fprintf('Result after %d evaluations of limited-memory solvers on 2D rosenbrock:\n',maxFunEvals); % fprintf('---------------------------------------\n'); options = [];% 元素为空 options.display = 'none'; optio...
%1 %traversal file pathroot='G:\GranduationProject\sport\dFC\pingpong_dfc\FCM'; list=dir(fullfile(pathroot));%得到20个运动员被试文件夹名 index=1; A=zeros(20,104,116*116);%得到20个104*(116*116)的矩阵 for i=3:size(list,1) traversalFileName=list(i).name;%得到20个运动员文件夹子文件名 sublist=dir(fullfile([pathroot,'\',list(i).name])); for j=...
%P3 subplot(2,2,1); t=0:0.002:15; %de la 0 la 15; 0.002=2 ms rezolutia temporala; mai poate fi 0.02=20ms si 0.2=200ms; amplit=[-1 1]; hold on grid title('Graficul 1') xlabel('timp (s) ') ylabel('amplit(V)') for n=0:0.25:15 y=datasample(amplit,1) %genereaza un numar aleator intre -1 si 1(am specificat ...
function val = get(c, astr_propName) % % NAME % % function val = get(c, astr_propName) % % ARGUMENTS % INPUT % c class cortical parellation class % astr_propName string One of: % rows % cols % slices % % OPTIONAL % % DESCRIPTION % % 'get' accesses the internals of the class to stdout. % % NOTE: % % ...
function thetatrig_FR(thisdir) disp('Start thetatrigFR') load(thisdir,'times_armon_thetaof_headingarm_lap_thetahalf_all','PFCthetaspikes_binned'); Th = times_armon_thetaof_headingarm_lap_thetahalf_all; clear times_armon_thetaof_headingarm_lap_thetahalf_all binsize = .02; window = [-2 2]; ind = [window(1):binsi...
pwd() pkg load image rgb = imread("animal.jpg"); figure('Name', 'RGB'); imshow(rgb); %% [X,map] = rgb2ind(rgb); figure('Name', 'Indexed'); imshow(X, map); %% figure('Name', 'Gray from rgb') gray = rgb2gray(rgb); imshow(gray); %% figure('Name', 'Gray from indexed'); ga = ind2gray(X, map); imshow(ga...
%% Runs The Experiment (Block 2) function player_struct = rtanx_experiment_block2(player_struct, w, debug, rootFolder, quitmarker, par) %% Input data for experiment_data % 1 = Trial % 2 = Time % 3 = Block id % 4 = Stim 1 p(win)- BLOCK ORDERING FROM INTIALISE % 5 = Stim 2 p(lose,- BLOCK ORDERING FR...
function [ z ] = fitfunction( a,b,c,x ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here z=atan(a*x^2 + b*x + c)/pi + 0.5; end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %-% ------------------------------------------------------------------- %-% %-% Approximates the solution to the small dispersion CH equation,given %-% %-% u_t +2*Ku_x+ 3uu_x - ep^2(u_{xxt}+2u_xu_{xx}+uu_{xxx})= 0. The %-% %-% spatial doma...
% figure('Name','Scatter Plot of Sigma and T'); % scatter(sigma5,T5,64,'b','o'); % hold on % scatter(sigma28,T28,64,'b','o'); % a = [0.3927 0.3927]; % b = [0 50]; % %p = plot(a,b,'r'); % %p.LineWidth = 1.5; % xlim([0,1.6]) % ylim([0,50]) % xlabel('Drifting Tendency \sigma_d','FontSize',18); % ylabel('Optimal...
function [ticks,lims] = getDecentTicks(xx,minNumTicks) % xx contains the values to be shown on the axis, e.g., the data points % themselves, the most extremal points, or preselected axis limits. % % See also getTicks % % @ Matt Golub, 2018. if nargin==1 minNumTicks = 5; % Guaranteed to have at least this many tick...
% Slow Potassium channel % % modeled after Mahon2000 % Note: in tau_h, mahon2000 has 2930 instead of 293.0 % % using n and alpha, beta formulation % returns also steady-state value % % $Revision:$ % function [I_KAs, dm, dh, m_inf, h_inf] = ikas(V_m, m, h) E_As = -85; % mV g_As = 0.32; % mS/cm^2 I_KAs = g_As*m*h*...
%% 颜色空间的对比图 clc; close all; clear; imgdata = imread('data\\10.jpg'); rgbdata = 255 * im2double(imgdata); labdata = stpRgb2Lab(imgdata); figure; imshow(imgdata); title('彩色图像'); [m, n, ~] = size(rgbdata); N = 1000; rgbd = reshape(rgbdata, m*n, 3); labd = reshape(labdata, m*n, 3); labd(:, 1) = labd(:, 1) - 50; rgbdat...
function [numOfDeleted] = deleteTemporaryFiles(alsoDelete) %DELETETEMPORARYFILES A simple function that deletes temporarily created %files with certain postfixes in current folder. % % ------------------------------------------------------------------------ % Copyright (C) 2017 M. Schrauwen (markschrauwen@gmail.com...