text
stringlengths
8
6.12M
function [rCleanUp] = rebuildDSSSsig(x_end3,beta, span, sps, pn, Ns, N, To) x_end4 = x_end3.*pn; y = 1/N*sum(reshape(x_end4 , Ns, N)); rClean = (y >0); tmp = repmat(rClean', 1,Ns); tmp2= reshape(tmp',1,Ns*N); temp_bits = tmp2.*pn; timing_offset = To; % should be positive shape = 'sqrt'; p = rcosdesign(beta,span,sps,sh...
%ini_robot q0=[0 0 0 0 0 0 0]; % q1b=[3*pi .1745 pi/3 pi/2 .5236 pi/1.5 0]; % q1=[.0873 .1745 .3491 .1745 .5236 .8727 0]; % q2=[.0873 0 -.3491 .2618 .8727 1.2217 0]; % q3=[-.1745 -.3491 .5236 .0873 -.1222 .3491 0]; % q4=[.1745 .1745 0 -.1396 .3191 -.5236 0]; % q5=[-.3491 -.3491 -.3491 0 -.0873 0 0]; %Iniciar Rbt L1=...
%% nh3_v4.mat TEST SCRIPT (T,rho) INDEPENDENT VARIABLES % % Franco N. Ferrucci % ferruccifranco@gmail.com % Oct 2018 %% Cleanup clearvars -except nh3_v4 c clc %% f(T,rho), independent variables set T_K = 300.5; rho = 150; %% Load parameters/variables load nh3_v4.mat c = conversion_factors(); fluid =...
function Sim19 %% Reset close all clear %% Load data load('GroupsWOAisles.mat'); %% Set names simName = '19 Groups without aisles, 5 min delay'; folderName = 'Sim19'; %% Set conditions [Sim.Luminaires.View] = deal('narrow'); [Sim.Zones.DimAfter] = deal(duration(0,5,0)); [Sim.Zones.OffAfter] = deal(duration(0,5,0));...
function [u_P, u_N, z_tilde] = ReducedControlAction_TrimerController(~, z_p, ~, z_0, Parameters) %% Extract Parameters kappa_1 = Parameters.kappa(1); kappa_2 = Parameters.kappa(2); kappa_3 = Parameters.kappa(3); k = Parameters.Parameters_Actuation.k; %% Polynomial Coefficients: c_6*y_2^6 + c_5*y_2^5 + c_4*y_2^4 + ...
%for log part of 2... and also bx^a part m = 10; % size of data n = 2; % size of a; n-1 is the degree x = [4, 4.2, 4.5, 4.7, 5.1, 5.5, 5.9, 6.3, 6.8, 7.1]'; y = [102.56, 113.18, 130.11, 142.05, 167.53, 195.14, 224.87, 256.73, 299.5, 326.72]'; z = log(y); f = log(x); d = solve_normal_eq(m, 2, x, z); lnb = d(1); a = d(2...
%% Creates a Graph for a baseball's flight without drag clear; clc; velnaught = input("Enter the ball's initial velocity: "); angle = input("Enter the angle of ascent: "); Xdistance = linspace(1,75,150); vynaught = velnaught * sin((angle*(3.14/180))); vxnaught = velnaught * cos((angle*(3.14/180))); g = 9.8...
function [grid] = grid_exp1( xmin, xmax, num_grid ) % Function grid_exp1 % [grid] = grid_exp1( xmink, xmax, num_grid ) % % Purpose: % Generate exponentially-spaced grids. % % Record of revisions: % Date Programmer Description of change % ========== ========== ===================== % 02/20/2013...
modelOptions.useShift = 0; modelOptions.predictionType = 'poi'; modelOptions.trainAlgorithm = 'fmincon'; modelOptions.normalizeY = 1; modelOptions.meanFcn = 'meanConst'; modelOptions.hyp.lik = log(0.01); modelOptions.hyp.cov = log([0.5; 2]); modelOptions.covBounds = [ [-2;-2], [25;25] ]; modelOptions.likBou...
function varargout = is_valid_first_saturation_derivative(varargin) [varargout{1:max(1,nargout)}] = CoolProp_wrap(151,varargin{:}); end
function mosaic_build(FeatureVector, eigenVectors_multihist, eigenVectors_lbp, eigenVectors_hsv, MosaicResolution) DATABASE_PATH = 'C:\image_database'; %PATH = 'H:\TNM025- Bilddatabaser\projekt\mosaic'; PATH = 'H:\MATLAB\mosaic'; FILE = 'obama.jpg'; Original_Image = imread(fullfile(PATH, FILE...
clear all [fname,fpath] = uigetfile('bruce.txt') ; fid = fopen ([fpath,fname]); count = 1 ; while feof(fid) == 0 %are we done reading the file yet? txtline = fgetl(fid); token = strtok(txtline); romline{count} = token; count = count + 1 ; end %=========================...
function [M, RHS] = transientTerm(phi_old, dt, varargin) % function [M, RHS] = transientTerm(MeshStructure, h, dt, phi) % Matrix of coefficients and the RHS vector for a transient term % alfa \partial_t \phi % % % SYNOPSIS: % [M, RHS] = transientTerm(phi_old, dt) % [M, RHS] = transientTerm(phi_old, dt, alfa) % % PA...
%% clear close all clc Colors %% domain x = -100:.5:100; %% true parameters vSAF = 25; DSAF = 16; vCF = 13; DCF = 10; thetat = [vSAF;DSAF;vCF;DCF]; vt = RunModel(thetat,x); %% observations nobs = 200; xobs = x(1) + (x(end)-x(1))*rand(nobs,1); s = ones(nobs,1); d = RunModel(thetat,xobs)+s.*randn(nobs,1); data = [xobs...
function Prop = PropensityFunction_GeneExp(x, Parameters) % Propensity Function for Gene Expression % Species: X = [X_1; X_2] % Reactions: R1: X_1 --> 0 [gamma_1*X_1] % R2: X_2 --> 0 [gamma_2*X_2] % ...
function output = GetFolder(input) %Necessary input field:Path WhichLevel %output field = FolderName FolderPath ValidNecessaryField(input,'Path','WhichLevel'); FileSepIndex = strfind(input.Path,filesep); if input.WhichLevel == fix(input.WhichLevel) %将层数转换成正整数 if input.WhichLevel < 0 ...
classdef copse_force_B < copse_force % Forcing, calcerous plankton evolution methods function D = force(obj, tyr_after_present, D) % tyr_after_present - (negative) years after present day % ' to convert to column vector to allow use of fast interpolation ...
clear all; close all; H_poziom = 5:5:30; load('poziom_5.mat'); zbiornik_1(1) = mean(RawVoltage.signals.values(:,1)); clear RawVoltage; load('poziom_10.mat'); zbiornik_1(2) = mean(RawVoltage.signals.values(:,1)); clear RawVoltage; load('poziom_15.mat'); zbiornik_1(3) = mean(RawVoltage.signals.values(:,1)); clear Raw...
function [ output_args ] = rkmatrix_struct( table ) [r,c] = size(table); if issparse(table) [a s v] = svd(full(table)); else [a s v] = svd(table); end k = nnz(diag(s)); if r > k || c > k a = a(:, 1:k); b = v(:, 1:k) * s(1:k, 1:k)'; else ...
function sig = sbxpullsignalspacked(varargin) fname = varargin{1}; dash = find(fname=='_'); mouse = fname(1:(dash(1)-1)); day = fname((dash(1)+1):(dash(2)-1)); expNum = fname((dash(2)+1):end); curdir = cd; experiment = [mouse,'_',day,'_',expNum]; % dataDir = ['C:\Data\dms\',mouse,'\',mouse,'_',day]; % dataDir = ['C:\...
% File: P5_84.m for Problem 5-84 clear; clf global c; BTb = 0.3; Tb = 1; N = 20; dt = 2*Tb/N; t = -2*Tb:dt:2*Tb; A = BTb*sqrt(2*pi/log(2)); c = -2*(pi^2)*(BTb^2)/log(2); p = zeros(length(t),1); for (i = 1:1:length(t)) a = (t(i)/Tb)-0.5; b = (t(i)/Tb)+0.5; p(i) = A*quad(@P5_84I,a,b); end; plot(t,p); xlabel...
%{ # Document document_id : int --- document_name : varchar(30) document_data1 : attach document_data2 : attach@main document_data3 : filepath@main %} classdef Document < dj.Lookup end
function printInfo(obj) % PRINTINFO(OBJ) is a quick method to print some of the most useful % information from a Satellite object. The information required should be % generated from the updateFromTLE() and updateOrbit() methods. % % In Class: Satellite % Title fprintf('----------------------------------------...
function [y, J] = chaosfn(Theta, X, L, m, q, ActiveFN) %CHAOSFN is the objective neural net function used to run % test for chaos and to compute the Lyapunov exponent. % Y = CHAOSFN(THETA, X, L, m, q, ActiveFN) where X is a % time series and THETA is a vector of parameters. A = reshape(Theta(1:q*m), m,...
function [Bcum, Mcum, r] = findthickmpoleraddifm(rin, PolynomA, PolynomB,L, irho, E0, max_order,num_steps) %FINDTHICKMPOLERADDIFFM % Fourth order-symplectic integrator constants persistent DRIFT1 DRIFT2 KICK1 KICK2 if isempty(DRIFT1) DRIFT1 = 0.6756035959798286638; DRIFT2 = -0.1756035959798286639; ...
function [S_o] = bandpassfilter(S_i,Fs,F_low,F_high,BWrel_transband,Atten_stopband) %Bandpass filters data and returns it % Bandpass filters data and returns it using F_low/high as lower/upper %passband. %Transition band is BWrel_transband, for example 0.15 is 15% relative of %F_low/high respcetivly %test of ...
function stan_fig_cadata_driftanalysis_all() % % % % [options,dirs]=stan_preflight; ext='lib'; [fig,fig_stats]=stan_mu_ca_timecourse(ext); names=fieldnames(fig); for i=1:length(names) if length(strfind(names{i},'frac'))>0 set(fig.(names{i}),'units','centimeters','position',[10 10 4.5 2],'paperpositionmode','auto')...
% Anti-symmetric matrix for the meet operation dual Plücker coordinates function Lx = pluecker_matrix(L) Lx = [ 0 , - L(1), - L(2), - L(3); + L(1), 0 , - L(4), - L(5); + L(2), + L(4), 0 , - L(6); + L(3), + L(5), + L(6), 0 ]; end % function
img = mat2gray(imread('colordifferencemap.bmp')); figure, imshow(img), title('original'); img = Inhibit(img); figure, imshow(img), title('inhibited');
function intNumber = twosComp2dec(binaryNumber) % 转化二进制补码字符串为十进制数字 %--- Convert from binary form to a decimal number ------------------------- intNumber = bin2dec(binaryNumber); %--- If the number was negative, then correct the result ------------------ if binaryNumber(1) == '1' intNumber = intNumber - 2^length(b...
%{ ---------- Info ---------- %} % @date 29-Jan-2017 % @title PREPARATION clear; close all; clc; basename = '/'; datasetdir = [basename 'datasets/']; matdir = 'mats/'; addpath('codes/'); %% Colorcharts to LAB disp('START: convert colorcharts rgb to l*a*b*'); dirname = [datasetdir 'colorcharts/']; l_a_b_colorcharts...
function dZ=relu_backward(dA, activation_cache) Z=activation_cache; dZ=dA; if Z <= 0 dZ = 0; end end
clear all close all x = linspace(-1, 1, 1000); mu = 0; sigma = 0.01; h_prep1 = normpdf(x, mu, sigma)/normpdf(0, mu, sigma); delta_num = 5; h_prep2 = zeros(1, 1000); h_prep2(1+length(h_prep2)/delta_num/2:length(h_prep2)/delta_num:end) = 1; h = conv(h_prep1, h_prep2, "same"); delta_num = 3; f = zeros(1, 1000); f(1+len...
clc; clear; close all; Size = 100; sSize = sqrt(Size); [x, y] = meshgrid([1:sSize], [1:sSize]); xpos = reshape(x, 1, Size); ypos = reshape(y, 1, Size); createVotes; epoch = 40; eta = 0.2; [nbrVotes, nbrAttrib] = size(votes); outputSize = Size; inputSize = nbrAttrib; weights = rand(outputSize, inputSize); for i = 1:...
addpath E:\BMS\ECM\Matlabfiles\work\readonly load E:\BMS\ECM\Matlabfiles\work\readonly\E2model.mat % simSCM: Simulate series-connected-module packs (cells are connected in % series to make modules; these modules are connected in parallel to make % packs). % The parameters for each cell may be different % Initialize s...
% just testing, a short cut for running the model function testing(epoch) if nargin == 0 epoch = 5000; end record = trainAgent(epoch); save('record','record'); % eval the performance quiz() checkLearning() beep % notice me that the program was ended end
%% create object clear all; clear java; rng(0); % seed random number generator for testing %clc; mode='fast'; %mode='standard'; switch mode case 'fast' object=CloudDistanceFast; label='(fast mode)'; otherwise object=CloudDistance; label='(standard mode)'; end total=tic; %% defi...
%% Colour Filter %% This function can be used for separating or filter out Red components, %% Green components and Blue Components of colors from the color images. %% Function C = colorfilter(img,color) %% input img = Color image (The input image should be a color image) %% color = which color want to...
%% % Dobson Semi-imperical model %% clc; clear all; %% S=0.75; %It must me calculated from field data. C=0.10;%It must me calculated from field data. alpha=0.65; b_d=1.2748-0.519*S-0.152*C; b_dd=1.33797-0.603*S-0.166*C; rho_s=2.66; % in [g/m^3] rho_b=2; % in [g/m^3] %It must me calculated from field data....
function y = phiprimeover2x(x,phi,s) if (phi==0), % Quadratique % pour phi = x^2, % phi_prime = 2*x % phi_prime_over_2x = 1; y = ones(size(x)); end if (phi==1), % Strictement convexe % pour phi = sqrt( s^2 + x^2), % phi_prime = x/sqrt( s^2 + x^2), % phi_prime_over_2x = 1/sqrt( s^2 + x^2)/2 y = 1/2./sqrt(...
% Question 5 % % Part b % % Construction of the Vandermonde matrix % clc; M_data; n = 10; A_van = zeros(m,n+1); for j = 1:n+1 A_van(:,j) = M_t.^(j-1); end best_fit(M_t, M_ft, n)
function [tof,v_transf_1,v_transf_2] = pork_chopLEG2(X1,X2,tdep,tarr,misun) l=length(tdep); m=length(tarr); v_transf_1 = zeros(l,m,3); v_transf_2 = zeros(l,m,3); tof = zeros(l,m); for i = 1:l for j = 1:m tof(i,j) = tarr(j)-tdep(i); if tof(i,j) <= 0 tof(i,j) = NaN; for k=1:3 ...
% help from Matlab close all disp('Example 2 of Matlab'); % The following example shows how to use these functions to detect lines in an image. % Read an image into the MATLAB? workspace. I = imread('circuit.tif'); % For this example, rotate and crop the image using the imrotate function. rotI = imrotate(I,33,'cro...
function [im] = dctcompr (infile,coeff,outfile) % DCTCOMPR (infile,coeff,outfile) % Image compression based on Discrete Cosine Transform. % infile is input file name present in the current directory % coeff is the number of coefficients with the most energy % outfile is output file name which will be created %...
function target=Filter_for_temperatures(data,col,upper_limit,lower_limit) target=data; % disp('2') filter_matrix= target(:,col)<lower_limit; % disp('4') target(filter_matrix,:) = [] ; % disp('6') filter_matrix= target(:,col)>upper_limit; % disp('8') target(filter_matrix,:) = [] ;
function time = getTime() time = sprintf('[%d-%02d-%02d %02d:%02d:%02d] ', floor(clock)); end
%% load data and define constants clc; clear all; load AlternansData.mat; % ecg_h , ecg_p1, ecg_p2, t_h, t_p1, t_p2 F_s = 1000; T = 1 / F_s; %% Decimate signal df = 2; ecg_h = decimate(ecg_h,df); t_h = round(t_h / df); F_s = F_s / df; T = 1 / F_s; %% Filter signal(s) % cutFreq = 50; %Hz % B = fir1(10000,cutFreq/(F_s/...
settings_default; % data_path = '_data/htrack_model/collision_finger/'; data_path = '_data/htrack_model/collision_palm/'; mode = 'hand'; %% Weights w1 = 10; w2 = 1; damping = 0.1; num_iters = 8; %% Load data load([data_path, 'radii.mat']); load([data_path, 'blocks.mat']); [blocks] = reindex(radii, blocks); load([da...
function [Tsys_etaX, Tsys_etaY, freq, wX, wY, maxSens_idx] = get_onoff_7pt_tsys(session, on_scan, off_scan, source, LO_freq) % On/Off Tsys addpath ../kernel/ scan_table; % Found in kernel directory source_table; % Found in kernel directory quick_map = 0; overwrite = 0; overwrite = overwrite | quick_map; tic; for p_...
%{ # litter information -> animal.Animal -> animal.Animal --- litter : varchar(64) # animal litter %} classdef AnimalLitter < dj.Manual end
function [ToBeRm,Mtooclose]=as_axonlist_distance_closerthandiameter(axonlist,criteria,PixelSize) % distance matrix Mdist=as_axonlist_distancematrix(cat(1,axonlist.Centroid)); % minimal distance is mean diameter: diams=cat(1,axonlist.axonEquivDiameter)./PixelSize; diams=repmat(diams,[1,length(diams)]); diams=mean(cat(3,...
function [pc,W,data_mean,xr,evals,percentVar]=ppca(data,k) % PCA applicable to % - extreme high-dimensional data (e.g., gene expression data) and % - incomplete data (missing data) % % probabilistic PCA (PPCA) [Verbeek 2002] % based on sensible principal components analysis [S. Roweis 1997] % code slightly adapte...
% MBLMEXC.M % For expanded, magnetization profile plot (Bloch Equa) % Called by mblbm mblmexv = get(mbluimex,'Value') ; if mblmexv == 1 ; set(mbluimex, 'BackGroundColor', 'white') ; if mblslpv == 1 ; % Semilog plots set(mbluislp, 'BackGroundColor', 'white') ; end ; else ; set(mbluimex, 'BackgroundColor', ...
function g_h1 = gh1(x, lambda1) g_h1 = x; g_h1(x>=0) = 1; g_h1(x<0) = -1; g_h1 = lambda1*g_h1; end
% ChangeLog file for the MatTuGames Toolbox % % % Author: Holger I. Meinhardt % E-Mail: Holger.Meinhardt@wiwi.uni-karlsruhe.de % Institution: University of Karlsruhe (KIT) % % % % Requirements % ------------ % This release of *MatTuGames* was developed and tested using *Matlab % R2019b* and earlier ...
% Coherent Noise Word Lock close all; clearvars; % Add kernel codes to path addpath ../kernel/ % setup file info dir = '/lustre/projects/flag/'; sub_dir1 = '/TMP/BF/'; sub_dir2 = '/word_lock_cov/'; % scan time tstamp = '2017_07_25_22:29:55'; % system parameters Nele = 40; % Antenna Eleme...
function s = aga_dls( x, t) %AGA_DLS - Dimensionless Agarwal solution in the aquifer % % Syntax: s = aga_dls(x,t) % % x(1) = Cd % x(2) = rd % x(3) = sigma % t = time % % Description: % Computes drawdon in the aquifer for a constant rate pumping test in a % large diameter well with skin effect. The aquif...
%% close all clc %% labelFontSize = 20; ticksFontSize = 20; lineWidth = 4; % feature('locale') %% % Variables' names: var_name_list = {'Q prod (W)',... % 1 'Q heater to reactor (W)',... % 2 'Q heater to exterior (W)',... % 3 ...
function varargout = GUI_endMeasure(varargin) % GUI_ENDMEASURE M-file for GUI_endMeasure.fig % GUI_ENDMEASURE, by itself, creates a new GUI_ENDMEASURE or raises the existing % singleton*. % % H = GUI_ENDMEASURE returns the handle to a new GUI_ENDMEASURE or the handle to % the existing singleton*. % ...
function [z, zx1, zx2] = ckr2_regular(y, h, r, ksize) % [CKR2_REGULAR] % The second order classic kernel regression function for regularly sampled % data. % % [USAGE] % [z, zx1, zx2] = ckr2_regular(y, h, r, ksize) % % [RETURNS] % z : the estimated image % zx1 : the estimated gradient image along the x1 ...
classdef optimizationObject < handle % Structural Topology Optimization class. Constructor requires % femObject and optimization setting struct. Default optimization % settings are found in 'defaultOptimSettings()' properties fem % FEM Object ss % BESO Optimizati...
[X Y] = meshgrid(-2:1:2); nodes = [X(:), Y(:)];% + rand(25, 2) - 0.5; n_nodes = length(X); z = func_to_test_2D(nodes); Z = zeros(n_nodes, n_nodes); for n = 1 : n_nodes Z(n,:) = z((n - 1)*n_nodes+1 : n*n_nodes); end figure surface(X, Y, Z); hold on; n_samples = 81; [X Y] = meshgrid(-2:(2 - (-2))/(n_samples-1):2); p...
function a = mcf(RING,dp0) %MCF momentum compaction factor % MCF(RING) calculates momentum compaction factor of RING % % MCF(RING,DPP) computes the momentum compaction for off-momentum DPP if nargin < 2, dp0=0; end ddp = 0.000001; fp0 = findorbit4(RING,dp0); fp = findorbit4(RING,dp0+ddp); % Build initial condition vec...
function [beam_code_book_from_matlab] = generate_beam_codebook_32_angulars() %GENERATE_BEAM_CODEBOOK 此处显示有关此函数的摘要 % 此处显示详细说明 rx_beam_num = 32; tx_beam_num = 32; beam_codebook = zeros(32*32,32*32) + zeros(32*32,32*32)*1i; angular_set = linspace(-pi,pi,32); for i= 1:rx_beam_num for...
function [model,latnVar,varPar] = trainAHDStochBlockModel(N,M,Y,K) % function [model,latnVar] = trainHDStochBlockModel(Y,K) % training a Scale-free blockmodel by variational EM % input: N, M, node and link numbers % Y, M by 2 matrix, each row stores a link (head, end) % K, cluster number % ouput: mo...
% Calculate the Shaw forward problem for a model m % for data points in s and equidistant model points in th % from Parameter Estimation and Inverse Problems, 3rd edition, 2013 % by R. Aster, B. Borchers, C. Thurber % function g = shawforward(s,mbasis,th,dth) m=length(s); g=zeros(m,1); for i=1:m ...
%% isss_multiband.m % Script to run for pilot scans comparing ISSS, multiband, and the new % hybrid scanning protocol. Ported from my previous ISSS_test script. % Author - Matt Heard %% Startup sca; DisableKeysForKbCheck([]); Screen('Preference','VisualDebugLevel', 0); try PsychPortAudio('Close'); catch d...
%% HW 4 %% Q2 clear clc miu = 0.5; fm = 2; fc = 1000; fs = 4*fc; L = 2; t = linspace(0,L,L*fs); %since ammod() gives suppressed carrier signal we define x of t as follow x =1 + miu*sin(2*pi*fm*t); u = ammod(x,fc,fs); SNR1 = 10; SNR2 = 14; noise = randn(1,L*fs); %define noise coefficients...
function [matrix] = hat(vector) % map from a vector to a skew symmetry matrix matrix = [ 0, -vector(3), vector(2) vector(3), 0, -vector(1) -vector(2), vector(1), 0]; end
function mic_data=analyze(dataset) mic_data = []; windowSize = 1000; sampleRate = 1250; points = size(dataset, 3); fAxis = (0:windowSize-1)*sampleRate/windowSize; for i=1:points trial_data = dataset(:,:,i); trial_results = []; for channel=1:3 data = ...
function yes_no = is_table_variable(tbl, varname) % return true/1 if the variable is in the table yes_no = false; if sum(strcmp(tbl.Properties.VariableNames, varname)) yes_no = true; end
% Project 2 if ~exist('output', 'dir') mkdir('output') mkdir(['output' filesep 'part2i']) mkdir(['output' filesep 'part2ii']) mkdir(['output' filesep 'part2iii']) mkdir(['output' filesep 'report']) mkdir(['output' filesep 'code']) end % Test points x = cell(5,1); y = cell(5,1); x{1} = [3.6942;1...
% pAlignGroupToModel tells what each column in a motif group, and what each % location for possible insertions between models, corresponds to in the model % load 'MotifLibrary\IL_018.mat' % JAR3D_path % [filePaths,Node] = pWriteSingleJAR3DModel(Search,'IL_018',1) % T = pAlignMotifGroupToModel(Search,Node,'IL_018','IL_...
function [calcMode,err,modeSpecified] = options2Mode(net,nameValuePairs) % Copyright 2013-2015 The MathWorks, Inc. calcMode = []; modeSpecified = false; %=================== Override Default Options options = nnet.options.calc.defaults; options.reduction = net.efficiency.memoryReduction; [options,err] = nnet.option...
mat = load('J_02.mat') matPlot(mat.mat) function matPlot(mat) for i = 1:size(mat,1) Xs = mat(i,1:3:size(mat,2)); Ys = mat(i,2:3:size(mat,2)); refreshdata scatter(Xs,1000-Ys); xlim([0 2000]); ylim([0 1000]); drawnow pause(0.04); end end
function [dat, pos]= nanread(filename) % res=regexp(a,'----------- (?<day>\d{1,2})\s+(?<month>\w+)\s+(?<year>\d+)\s+(?<hour>\d+):(?<minute>\d+):(?<second>\d+)\s-----------\s', 'names') % % % res=regexp(a,'----------- (?<day>\d{1,2})\s+(?<month>\w+)\s+(?<year>\d+)\s+(?<hour>\d+):(?<minute>\d+):(?<second>\d+)\s--------...
function y = vl_nnl2norm(x, varargin) %VL_NNL2NORM - apply L2 normalisation to features % Y = VL_NNL2NORM(X) - applies L2 normalisation to each channel of the input % tensor X (which has shape H x W x C x N). % % DZDX = VL_NNL2NORM(X, DZDY) computes the derivatives of the block % projected onto DZDY. % % VL_NNL...
clear all;clc global c m k f w c = 3; m = 1; k = 10; f = 10; w = 0.5; tspan=[0:.001:30]; y0=[1;0]; [t,y]=ode45('forced',tspan,y0); j = diff(y(:,2))./(diff(t)); plot(t,y,t(1:length(t)-1),j); grid on xlabel('time') ylabel('Displacement') title('Displacement,Velocity, and Position Vs Time') legend('Displac...
classdef TimeRegion < handle properties state time allaxes; patches patch_listeners label_text popup all_labels end properties (SetObservable) label end properties (Constant) states =...
function [pupil,tip,tilt,piston] = rmTTP( pupil, mask ) %rmTTP Removes TTP from a pupil mask % Calculates overlap integral with tip and tilt masks, then subtracts % them. Seemed faster to rewrite than to find the previous % implementation. % divide tip and tilt by the optic radius to get the angle in radia...
function Loc=tDhashsearchvar(x,y,m,n,a,b,img) %m为搜索的区域宽,n为搜索区域长;(x,y=1)为搜索区域的起点位置;a为搜索块宽度,b为搜索块长度,x1为搜索的阙值,img为被搜索的图片 %FASTSEARCHMEANVAR 此处显示有关此函数的摘要 % 此处显示详细说明 % Test sub-functions [m,n]=size(img); img=double(img); res=zeros(m-a+1,n-b+1); vars=zeros(m-a+1,n-b+1); for i=1:m-a+1 for j=1:n-b+1 if i==1 && j=...
function Mb=clearMouse; [Mx My Mb]=GetMouse; while ~all(Mb==0) [Mx My Mb]=GetMouse; end
function I = flip_image(I) %Flips the image in the LR direction for i = 1:size(I,3) I(:,:,i) = fliplr(I(:,:,i)); end
%DEFLECTION EVALUATION for fast transmission along y: %DIAMETERS OF THE SHAFT(BEARING-GEAR-SHOULDER): d_b=15; d_g=20; d_s=25; %PARAMETERS OF THE SHAFT SECTIONS: Ib=(pi*d_b^4)/64; Ig=(pi*d_g^4)/64; Is=(pi*d_s^4)/64; Jb=(pi*d_b^4)/32; Jg=(pi*d_g^4)/32; Js=(pi*d_s^4)/32; E_rig=205*1000; G_rig=79000; %BEARINGS REACTIONS:...
clear; close all; index_actuation=0; % underactuated=1 num_thruster = 6; dim_control = 3; path = './'; tcontroller = csvread(strcat(path, 'controller.csv'),1,0); testimator = csvread(strcat(path, 'estimator.csv'),1,0); % GPS = csvread(strcat(path, 'GPS.csv'),1,0); tplanner = csvread(strcat(path, 'planner.csv'),1,0); ...
function varargout = Ejercicio5(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @Ejercicio5_OpeningFcn, ... 'gui_OutputFcn', @Ejercicio5_OutputFcn, ... 'gu...
function [RepSol RepBMat]=p_replicate_prk(clv,x,scl,smc) % P_REPLICATE_PRK replicates the pre-kernel solution x as a pre-kernel of % the game space v_sp. % % Usage: RepSol=clv.p_replicate_prk(x,scl,smc) % or % Usage: [RepSol RepBMat]=clv.p_replicate_prk(x,scl,smc) % % This call needs for a 14-person game more than 6 G...
function [ signal_error_params, signal_orig_params, signal_recon_params ] = analyze_test_vector(test_vector, verbose = 0, do_plot = 0) curr_dir = pwd(); addpath(curr_dir); [ vector_dir vector_name vector_ext ] = fileparts(test_vector); [ parameters, sig_lvls, samples, signal_original, signal_recons...
function [tracks,tracks_lost_1,nextId,FlagPred] = trackletsPolyBbox_V2(... PolyBboxes_0,tracks,VisiThre,nextId,frame_i,Level ) % modified from Motion-Based Multiple Object Tracking % input ------------------------ % bbox detection results % tracks tracklets % VisiThre threshold for...
% wm_complex01.m % Animation of a travelling wave % Visualization of complex numbers using colors to show the phase % Ian Cooper % email: ian.cooper@sydney.edu.au % School of Physics, University of Sydney % DOING PHYSICS WITH MATLAB % https://d-arora.github.io/Doing-Physics-With-Matlab/ clear all close all clc ...
function out_bits = tx_make_int_num_ofdm_syms(tx_bits, sim_options) global sim_consts; n_tx_bits = length(tx_bits); n_syms = sim_consts.NumDataSubc; n_bits_per_sym = get_bits_per_symbol(sim_options.Modulation); n_ofdm_syms = ceil(n_tx_bits/(n_syms*n_bits_per_sym)); % if Radon Hurwitz transform is used we need an ev...
function [history,exitflag,lambda] = runfmincon % ========================================================================= % This function calls the optimization function fmincon % % Credits: % Ricardo Fontes Portal % IDMEC - Instituto Superior Tecnico - Universidade Técnica de Lisboa % ricardo.portal(at)dem(.)...
clear all ; close all ; currs = {'AUDCAD','AUDCHF','AUDJPY','AUDNZD','AUDSGD','AUDUSD','CADCHF','CADHKD','CADJPY','CHFJPY','CHFSGD','EURAUD','EURCAD','EURCHF','EURDKK','EURGBP','EURHKD','EURJPY','EURNZD','EURPLN','EURSEK','EURSGD','EURTRY','EURUSD','GBPAUD','GBPCAD','GBPCHF','GBPJPY','GBPNZD','GBPUSD','HKDJPY','NZD...
% since FlowNet can not run detection on raw image of 2880*1440 resulution % we downsample the input images first clear file_path = 'flownet2-pytorch/video2/';% Path to original images img_path_list = dir(strcat(file_path,'*.png')); img_num = length(img_path_list);%the total number of images if img_num > 0 ...
function cor2zero %set horizontal and vertical correctors to zero COR=getappdata(0,'COR'); status=COR(1).status; z=zeros(length(status),1); setsp('HCM',z,status); status=COR(2).status; z=zeros(length(status),1); setsp('VCM',z,status);
function W = lr2W(l,r,varargin) % Takes two views of N points over T frames in the format: % % l = [ x1(1) y1(1) x2(1) y2(1) ... xN(1) yN(1) ] % [ x1(2) y1(2) x2(2) y2(2) ... xN(2) yN(2) ] % [ ... ] % [ x1(T) y1(T) x2(T) y2(T) ... xN(T) yN(T) ] % % r = [ u1(1) v1(1...
function ay_paper_simulator() T= linspace(0.1,1.5,2); Xs = -4:0.2:4; fid = fopen('normal.txt','wt'); fclose(fid); fid = fopen('normal_count.txt','wt'); fclose(fid); fid = fopen('normal_binary.txt','wt'); fclose(fid); fid = fopen('normal_binary_count.txt','wt'); fclose(fid); for rpt = 1:10 ...
function Y = Pej_Transform_logistic(X) Y = 1./(1+exp(-X)); end
% Calculates the STEERED focus location in HASgui. % Base workspace script. % % This version moves the lines (hs1, hs2, hs3, hs4, hs5, hs6) on the box model. % Changes: % 1/26/11 - Changed name to calcfocus5 and call to displa5. % If not phased array, lines are not moved since the lines don't ...
% This test consist to check the correct behavour of the % generatePathUsingGBM function, we sill check: %% Test Class Definition classdef Test_2_optionValuation < matlab.unittest.TestCase methods(TestMethodSetup) function setup(testCase) % Install all project functions to get access to it: ...