text
stringlengths
8
6.12M
% Derivatives of the [Ca++] in microdomain and cytosol. Calls the % SquareSource function to get the membrane potential (V) at time t. function [dCmd dCi]=ChenModelCalcium(t,Cmd,Ci) % Global parameters ts=60; % Conversion to minutes % These names mirror the original XPP model fmd=0.01; fi=0.01; B...
% Objective function, constrants, and derivatives for optimization % function [objective,con] = grd(X,FEM) [~,FEM_prime] = CoFE_design(FEM,X,@X_2_FEM); % von Mises stress at all recover points for all elements svmAll = [FEM_prime(1).CQUAD4.vonMisesStress; FEM_prime(2).CQUAD4.vonMisesStress; ...
disp('%'); disp(['% User: ', daisyUnixCmd('echo $USER', 'unknown') ]); disp(['% Project name: ', daisyUnixCmd('echo $PROJNAME', 'unknown') ]); disp(['% Project area: ', daisyUnixCmd('echo $PROJAREA', 'unknown') ]); disp('%'); disp('% Department of Electrical Engineering'); disp('% Linkoping University '); disp('%'); [...
function xb = blockAudio(x, blockSize, hopSize) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here len_x = length(x); N = ceil((length(x) - blockSize)/hopSize)+1; pad_size = N * blockSize - len_x; x = [x;zeros(pad_size, 1)]; xb = zeros(N, blockSize); for i = 1:N-1 xb(i,:) = x((i-1)*ho...
%%% kekka matome gurahuka clear all; % SR+deno load ('P021.mat'); %PSNR1 = PSNR.'; PSNR1 = PSNR; load ('P022.mat'); PSNR2 = PSNR; load ('P023.mat'); PSNR3 = PSNR; load ('P024.mat'); PSNR4 = PSNR; load ('P025.mat'); PSNR5 = PSNR; %deno-SR load ('P046.mat'); PSNR6 = PSNR; load ('P047.mat'); PSNR7 = PSNR; load ('...
clc; clear all; t=0:0.001:0.8; x=sin(2*pi*50*t)+sin(2*pi*120*t); y=x+0.5*randn(1,length(t)); N = 256; Y=fft(y,N); P=Y.*conj(Y)/N; %求功率谱 k=[0:1:N/2];w=2*pi/N*k; subplot(2,1,1); plot(w/pi,P(1:N/2+1));title('FFT N=256'); xlabel('频率(单位:pi)');ylabel('P');grid; subplot(2,1,2); plot(t, x) title('时域')
clear;clc; ima=imread('lena.tiff'); %ima=imread('butterfly.jpg'); %ima=imread('xinxiaohui.jpg'); ima=rgb2gray(ima); p1=imnoise(ima,'gaussian',0.05); p2=imnoise(ima,'salt & pepper',0.05); gausFilter = fspecial('gaussian',3, 1); %高斯模板 gaus1= imfilter(p1, gausFilter, 'replicate'); averFilter = fspecial('average',3); %均...
function [d0,mmef,fnef,fnfval] = salt_calcNLSolution(S_fine,S_coredata,S_saltparameters) d0min = S_fine.th(1)*1.001; %minimum test/seed d0, x1.001 usually, x1.03 for ECHO_EBONY d0max = S_coredata.prel_f*d0min; %maximum test/seed d0 dd0 = (d0max-d0min)/S_coredata.pump_sz; %st...
function [ dir2out, file2out ] = fn_IncrementFileStructure(inType, inputVal ) % Function will increment either a file or directory %inType = 'file'; inputVal = 'Z:\Jon\proj\toolbox\jontools\test.txt'; %inType = 'dir'; inputVal = 'Z:\Jon\proj\toolbox\jontools\test'; if strcmpi(inType,'file') slashLoc = find(...
clear;clc; %% specify the initial state estimate to have zero velocity x = 5.3; y = 3.6; initialState = [x; 0; y; 0]; KF = trackingKF('MotionModel', '2D Constant Velocity', 'State', initialState); % Create the measured position from a constant-velocity trajectory vx = 0.2; vy = 0.1; T = 0.5; pos = [0:vx*T:2; 5:vy*T:6...
function [enderr, minerr, mfobj, iter] = testvalid(opt, tY, ee, vort) mfobj = min(opt.fobjs); iter = numel(opt.fobjs); if vort enderr = cell(nargout(@errmsr)-1, 1); [enderr{:}] = errmsr(opt.vars_opt.psi*opt.vars_opt.Lambda', opt.vars_opt.theta, tY, opt.l, ee); enderr = cell2mat(enderr); else enderr = op...
%% Load the models % Load sucrose model load('finalNodulatedPlant_sucrose.mat'); model_sucrose = finalNodulatedPlant; % Load ViNE load('../../finalNodulatedPlant.mat'); model_vine = finalNodulatedPlant; %% Combine the models % Get reaction formulas model_sucrose_formulas = printRxnFormula(model_sucrose, model_sucr...
function GainAdjustmentforCW6(filedir) % Get the file directory using NIRS toolbox fileset=nirs.io.loadDirectory(filedir,{'Subject'}); for i=1:length(fileset) filepath{i}=fileset(i).description; end % Gain Adjustment for i=1:length(filepath) load(filepath{i},'-mat'); if prod(systemInfo.gain)~=1 ...
function CS4640_week8 % % Example 1 % Create info and build Huffman tree and codes info1 = [1,5; 2,9; 3,12; 4,13; 5,16; 6,45] [H1,c1] = CS4640_Huffman_encode(info1) CS4640_show_tree(H1.nodes,H1.root); c1(:).code % encode a string im1 = [4,3,3,6,2,3,1] tab1 = [1:6]' cd1 = CS4640_im2Hcode(im1,c1,tab1)' cost_orig1 = len...
%Design a frequency-domain filter to remove periodic artifacts,such as %power-line interference. % Use this program to read the files ECG31.dat tic clc; clear all; fs=1000; %sampling frequency t=[1/fs:1/fs:4]; %time duration x0=reshape(load('C:\Users\Vivek Prajapati\Documents\MATLAB/ecg31.dat'),1,4000)-200...
function [onsetTime, offsetTime] = findOnsetOffset(binarySignal) %compute onset and offet time of binary signal %NOTE: units are frames, the results must be multiplied by the frameRate if %you want to have seconds if size(binarySignal,2)~=1 binarySignal = binarySignal'; end onsetTime = find(diff(binarySignal)==1)...
function [y_n] = eqdif(b, a, x_n) % EQDIF determina a saida por meio da eq de diferencas % y_n(0)=0; matlab nao aceita for n=1:length(x_n) y_n(n) = 0; ia=2; while ia<=n y_n(n) = y_n(n) - a(ia)*y_n(n-(ia-1)); ia = ia+1; if ia > length(a) break; end ...
function aafDerankedSamples = DerankSamples( tCopula, aafRankedSamples ) % % storage allocation aafDerankedSamples = zeros( size(aafRankedSamples) ); % for iCol = 1:size( aafRankedSamples, 2 ); % aafDerankedSamples(:, iCol) = tCopula.atMarginalCDFs(iCol).DerankSamples( aafRankedSamples( :, iCol) ); % end;%...
function uN=surfNormal(S) % Calcules the normal vector field of a given surface through spectral % differentiation N=cross(fftD(S,1,1), fftD(S,2,1)); dA=sqrt(dot(N, N, 3)); uN=bsxfun(@rdivide, N, dA); end
% polynomial: 5x^2 - 7x + 3 function evaluate_polynomial(x) a = 5; b = -7; c = 3; % y = a*x^2 + b*x + c % returning disp(a*x^2 + b*x + c) % printing end
clear all; close all; %% File loading and data processing filename = '180.csv'; stringfund = strfind(filename, 'samsung'); if stringfund > 0 Fs = 100; else Fs = 50; end stringfund = strfind(filename, 'd1'); if stringfund > 0 HEIGHT = 1.8; else stringfund = strfind(filename, 's...
% Esta vista muestra información sobre la aplicación function aboutLayout(status, file) % construir la ventana hs = build(500, 430); % mostrar la 'figura' de la ventana hs.fig.Visible = 'on'; % -------------------------subfunciones-------------------------------- % "build": % agrega los comp...
function m = matvec_double_layer_resistance(X, domain) % MATVEC_DOUBLE_LAYER: perform a matrix vector product using the % double-layer formulation with Power-Miranda completion, i.e. % u(x) = -q/2 + -D[q](x) + S[F](x) + R[T](x), F is the net force on all % inner walls, and T is the net torque on all inner walls. Use...
%% Convert .nd2 files to .tif files % You will set this code running, and then bring the NIS-Elements % window into focus. Convert the first movie in a folder full of movies % and this code will do the rest of them with the same settings that were % chosen for the first one. number_of_movies = 6; longest_...
%% % Check results with: % a) MS-06-84.PDF (see diagrams page 8..11) % b) https://www.asco.com/en-gb/Pages/calculators-flow-calculator.aspx % c) https://www.swagelok.com/en/Resources/CVCalculator % d) https://www.teesing.com/en/pageid/calc-flow-cv-calculator %% clc c = conversion_factors(); X = 400 dP = 69...
function Ei200_uvw110_at200auto(varargin) data_source= fullfile(pwd,'Data','Fe_ei200.sqw'); avrg_par=[0,0,1007.2656]; no_chkpnts= 'True'; Imax = 1; if nargin == 0 repPoints1= [-0.3375,-0.1125,0,0.1375,0.3875; 130,20,0,15,145]; repPoints2 = [-0.3375,-0.1375,0,0.1625,0.3875; 130,20,0,20,150]; ...
function c = getColor(r, g, b) % Detailed explanation goes here if (r > 60) && (r < 105) && (g > 55) && (g < 95) && (b > 100) && (b < 185) c = 'blue'; elseif (r < 100) && (g < 75) && (b < 100) c = 'black'; elseif (r > 240) && (g > 100) && (g < 200) && (b > 140) c = 'orange';...
function [W_obs,xrank] = compute_ranksum_obs(x,y) nx = numel(x); ny = numel(y); x = x(:); % ensure columns y = y(:); % Compute the rank sum statistic based on the smaller sample [ranks, tieadj] = tiedrank([x; y]); xrank = ranks(1:nx); W_obs = sum(xrank); end
close all; clear all; clc; %Finite Difference Beam Propagation %Constants Definition um = 10^-6; mm = 10^-3; nm = 10^-9; degrees = 180 / pi; NLambda = 10; %Points per wavelength lam0 = 1; %free spave wavelength %Simulation Parameters W0 = 0.5*lam0; %Width of Initial Gaussian phi_t = 0 * degre...
function rgb = dark_salmon rgb = [0.91372, 0.58823, 0.47843]; end
function [R,Q,Qh]=CovEst_QQh(Rh) % function [R,Q, Qh]=CovEst_QQh(Rh) % [trace(Q+Qh), Q, R, Qh]=toepQQh(Rh) : Rh+Qh=R+Q, R,Q,Qh>0, R Toeplitz, and trace(Q+Qh)=minimal % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% n=length(Rh); cvx_begin quiet variable Q(n,n) symmetric; variable Qh(n,n) symmetric; variable r(...
%% Reset fclose('all'); close all clear clc %% timestamp = datestr(now,'yyyy-mm-dd HHMM'); %% Dependencies addpath('C:\Users\jonesg5\Documents\GitHub\d12pack') addpath('C:\Users\jonesg5\Documents\GitHub\export_fig') %% File paths topDir = '\\root\programs\Light-and-Health\IAI_CircadianMonitoringAndRegulation\CMR2-Ex...
function [loser] = wholoses(plr,box) loser=0; % "0" means no loser yet % the player having no piece on table will lose for x=1:8 for y=1:8 if plr==1 && box(x,y)==10 %king1 is present KING=10 loser=0; return; elseif plr==2 && box(x,y)=...
classdef EmEng < OptimEng % Generic expectation maximization % It implements multiple restarts % We should add support for mini-batches and other speedups methods(Abstract) %displayProgress(eng,data,currentLL,iter,r); eng = initializeEM(eng, model,data,r); [ess, currentLL] = Estep(eng, ...
function varargout = addLabel(GID) GIDout = GID; % output starts with everything that is in input Nmenus = GIDout.Nmenus; % these are the additional stuff we want the output to have % initialize them first, so if the user didn't specify a menu item % it will appear as blank for menu=1:Nmenus GIDout.task...
function varargout = brcontrol(varargin) %brcontrol M-file for brcontrol.fig % brcontrol, by itself, creates a new brcontrol or raises the existing % singleton*. % % H = brcontrol returns the handle to a new brcontrol or the handle to % the existing singleton*. % % brcontrol('Property','Value',...
% this file is to illustrate successful recovery rate for signal with two % frequency compoents close to each other, with frequency separation delta=0.001 % n: number of time instance we consider % t: time instances we consideration % nc: dimension of Hankel matrix % s: # of sinusoid components, the maximal rank the H...
function v_rot = rodrigues_rot(v,k,theta) [m,n] = size(v); if (m ~= 3 && n ~= 3) error('input vector is/are not three dimensional'), end if (size(v) ~= size(k)) error('rotation vector v and axis k have different dimensions'),end k = k/sqrt(k(1)^2 + k(2)^2 + k(3)^2); % normal...
% ======================================================================== % % Simulating a model of heteroskedasticity % % ======================================================================== clear all; clc; RandStream.setDefaultStream( RandStream('mt19937ar','seed',123456) ) % Simulate the model t = 50...
% trains SVM on the first half of data set and uses it to predict the % values on the second half of the data set function [nPredictedTargets, percentCorrect, predictedFlags, solutionsTable] = SVM(dataFileBaseName, traceLength) [noFlagData, flags] = svmFormat(dataFileBaseName, traceLength); [frames, columns] = size(...
function [ I_depth ] = plane_sweeping( I,P1,P2,window_size,threshold,matching_function,plot_im_matching ) weights = ones(window_size)/window_size.^2; [rows,cols] = size(I{1}); corners = [1, cols, 1, rows]; I_depth = inf(rows,cols); best_matching = inf(rows,cols); if strcmpi(matching_function,'NCC') best_matching=-...
function pdColor = stim2pdColors(stim, base, N) Add2StimLogList(); % Stim has to be a number < 4^4 = 255 % stim2pdColors returns stim in 4 bits in base 4 % stim = pdColor(1)*4^0 + pdColor(2)*4^1 + pdColor(2)*4^2 + pdColor(3)*4^3 % pdColor(i) = {60, 120, 180, 240} %{ pdBit0 = mod(stim, 4); pd...
function arrivalObj = read_antelope(dbname, subset_expr) % LOAD_ARRIVALS Load arrivals from a CSS3.0 database fprintf(2,'Loading arrivals from %s',dbname); % Open database db = dbopen(dbname,'r'); % Apply subset expression db = dblookup_table(db,...
function x_dot = HSTdynamics(t,init_state,mu,J,rho,params,flag) % HSTdynamics: Contains full ODE dynamics for all spacecraft states. % % Inputs: % t - time [s] % init_state - initial state vector [r; v; omega; q] % mu - central body gravitational parameters [km^3/s^2] % J - spacecraft inertia...
function varargout = separateDays(traceInput,dwtfname) % separateDays Split combined traces by date they were obtained. % % separateDays(FILENAME) splits the traces from a .traces file input into % subsets with matching paths in their traceMetadata.ids field. (This field % gives the filename of the original ...
function n_pts = get_cyl_points(circum,h) %Get the number of points required for a cylinder of circumference circum %to have the same grid spacing as h n_pts = floor(circum/h) / 2;
function [morphedPts,morphType] = applyPointMorph(cPts) % morph 1, 2 or 3 random points. numPtsToMorph = randi(3,1); indicesToMorph = sort(randperm(size(cPts,1),numPtsToMorph)); geom = polygeom(cPts(:,1),cPts(:,2)); objCenter = [geom(2) geom(3)]; morphType = [num2str(numPtsToMorph) 'pt...
function varargout = simulateParallelCascade(varargin) % simulateParallelCascade MATLAB code for simulateParallelCascade.fig % simulateParallelCascade, by itself, creates a new simulateParallelCascade or raises the existing % singleton*. % % H = simulateParallelCascade returns the handle to a new simulat...
function [xdata ydata] = create_input_struct(crv_1, crv_end, not_this_crv, input_csv, x_ax_shift, x_col_num, crv_col, y_col_num, min_len, x_div_by); ydata = []; xdata = []; for curr_crv=crv_1:crv_end if ~(curr_crv == not_this_crv) cur_curve_indx = find(input_csv(:,crv_col) =...
function show_cf(img_dir, fmt, sc_para) database = retr_database_dir(img_dir, fmt); tic for n = 1:length(database.path) fprintf('Show contour fragment: %d of %d\n', n, length(database.path)); func_show_cf(database.path{n}, sc_para ); end function func_show_cf(im_name, para ) ...
close all; clear all; clc; PC_IP = '192.168.7.1'; BEAGLEBONE_IP = 'http://192.168.7.2'; % Initialise ROS on remote master setenv('ROS_MASTER_URI', strcat(BEAGLEBONE_IP, ':11311')) setenv('ROS_IP', PC_IP) rosinit sub = rossubscriber('/hovercraft/usb_cam/image_raw', rostype.sensor_msgs_Image); fig_msec = figure; hold...
%% 主测试:对动态算法,传统IP模型,优化单行线法则进行测试 clc; clear; D=load('tsp_map.txt'); m=size(D,1); n=size(D,2); RobotNum_test=10; RobotNum_start=1; test_para=10; disp('选取测试集') nobs=[]; obs=[]; nobs=[]; obs=[]; m_D=size(D,1); n_D=size(D,2); for i = 1:m_D for j = 1:n_D if D(i,j) == 1 obs=[obs j+(i-1)*n_D]; % 障碍...
%主程序 random_signal_len=10000; ts=clock; %用户随机信号生成 user_1st_send = user_send(random_signal_len); user_2nd_send = user_send(random_signal_len); %用户m序列生成 user_1st_register = [0 1 0 1]; user_2nd_register = [1 0 1 0]; user_1st_seq_m = sequence_m(user_1st_register,random_signal_len); user_2nd_seq_m = ...
%%% Code for reading data file in hard drive. Currently it is reading the %%% entire file on each iteration, but can be improved to extract only the %%% needed data. clc; clear all; close all; FileName_ECG = 'OpenBCI-RAW-ecg22.txt'; %FileName_HRV = 'HRV.txt'; readFormat = '%d %f %*f %*f %*f %*f %*f %*f %*{hh:mm:ss.SS...
%% plot IDT and mechanics at the same time whichRow = 'BT'; % whichRow = 'BB'; datadir = './IDTs/190514_QAOM05_%s%02d/*.mat'; % IDT data directory % dev = 16; ffigure; % shft = 1; renorm_mech = 20; renorm_IDT = 2; for dev = 1:33 dev fns_FSW = filefun(sprintf... ('../20190514_QAOM05_optics/fsw_scans/%sD%02dO01...
%% Nuri Mert Vural- 201801286 %% Music Sequence clc; close all; clear; %Load data load('nngc_mus.mat') epoch=1500; in_size=size(nngc_data(:,1:end-1),1); %% SRNN - 8000 close all; s_rnn=SRNN(ones(in_size,1)',movmean(nngc_data(:,end)',1),75); s_rnn.SGD_train(5e-5,0.95,epoch) %% CWRNN - 8000 close all;...
function [ Qd, Rd, Sd ] = c2d_weights( sys, Qc, Rc, Ts ) %C2D_WEIGHTS Discretize the weights for the optimal control problem % % This function will compute the optimal discrete-time weights that make % the discrete-time LQR cost function equivalent to the continuous-time LQR % cost function. % % The algorithm used in t...
function x=GaussPivot(A,b) [m,n]=size(A); if m~=n, erros('Matrix A must be square'); end nb=n+1; Aug=[A b]; for k=1:n-1 [big,i]=max(abs(Aug(k:n,k))); ipr=i+k-1; if ipr~=k Aug([k,ipr],:)=Aug([ipr,k],:); end for i=k+1:n factor=Aug(i,k)/Aug(k,k); Aug(i,k:nb)=Aug(i,k:nb)-factor*...
%% Plot the Operating Point and the Oprating Range % ######################################################################## % Plot operation map % % Input: % - [obj] Parameters of DAB3 % - [obj] Parameters of Ctrl % - [obj] Parameters of OP % Output: % - [] plot the operating point and the op...
figure(1) plot_compare_h print -djpeg figureh_c.jpg figure(2) plot_compare_he print -djpeg figurehe_c.jpg figure(3) plot_compare_ca print -djpeg figureca_c.jpg
clearvars close all load('paths.mat') addpath(genpath(paths(1).main_path)) cluster_path = paths(1).stage3_path; fig_path = strcat(paths(1).fig_path,'Traces\'); data = load_clusters(cluster_path); % define the color scheme depending on the stimulus type if contains(data(1).name,'p17') color_scheme = [1 0 0;0 1 0...
function [sol] = hsvHistogram(path_to_image, count_bins) %citesc imaginea image = imread(path_to_image); %extrag RGB r = image(:, :, 1); g = image(:, :, 2); b = image(:, :, 3); %conversi din RGB in HSV [h s v] = RGB2HSV(r, g, b); %initializare liste HSV h_count = zeros(1, count_bins); s_count = zeros(...
clear; format long; clc; close all; %% Parameters of stl filename = './Current_pp.stl' ; [p,t,tnorm] = stlread(filename,1); % (vertices of each point) , (point num for each point), ... %normal vector trin=length(tnorm); normx=tnorm(:,1);normy=...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [spi1,spi2,spi3,spi4]=MAINquadrant_emi__(valori_emi,r,nx,ny) %compute quadrant emissions %domain dimensions and other variables dimx=nx; dimy=ny; %prova_emi=valori_...
function outputImage = reconstruct_image(origImage, basis) % Reconstruct an image given the basis and coefficients. % Expects: MATLAB array, and a basis array % Returns: MATLAB array coeffs = transpose(origImage(:))*basis; [elements ~] = size(basis); componentImages = basis .* kron(coeffs, ones([elements 1])); outp...
clc; clear all; close all; disp('Zadanie odwrotne ') disp('Wilczynski Patryk, Tokarek Paweł') %pause % syms theta1 theta2 lambda3 %definiowanie zmiennej MATLAB sym theta1 theta2 lambda3 l=[sym(1) sym(1) sym(1)] %definowanie stałej alfa=[sym(3*pi/2) sym(0) sym(0)] theta=[theta1 theta2 sym(0)] lambda=[sym(0) sym(1) l...
function [throatArea , throatVolume] = throatAandV(throatRadius ,... throatShapeFactor , throatLength , throatGeometry) %% % This function calculates the cross section area and volume of each throats % (pore or throats) %% global n_t clayVolume a=1; for ii = 1:n_t if throatGeometry(ii) == 1 th...
function dw = backstopParallel(dz,w,p,z,param) %MANDIST.BACKSTOPPARALLEL Backpropagate weighted input derivatives to weight % Copyright 2012-2015 The MathWorks, Inc. [S,Q,N] = size(dz); R = size(p,1); p = reshape(p,1,R,Q); % 1xRxQ dz = reshape(dz,S,1,Q,N); % Sx1xQxN z1 = bsxfun(@minus,w,p); % SxRxQ d = si...
function [r,p] = test_disc_disc_cont(D,i,j,k,alpha) %This function test the independence between X and Y conditionally on Z in %the case where X and Y are discrete and Z is continuous %INPUTS % D: n*p dataset of n samples of p parameters % i: dimension corresponding to X % j: dimension corresponding t...
clear tab = niak_read_csv_cell ('qc_report_common_final.csv'); tab = strrep(tab,'Missing','Fail'); %% Extract labels for each rater PB and YB list_subject = tab(2:end,1); labpb = tab(2:end,[4,7]); labyb = tab(2:end,[10 13]); %% Mask only entries documented by both raters maskpb = ~strcmp(labpb,''); maskyb = ~strcmp(l...
clc, close all, clear all load('teapot'); %loading matrix S % % Matrix S stores all the control points of all the patches of % % teapot surface such that % % S(:,:,:,k) control points of kth patch, where k=1..32 % % Size of S(:,:,:,k) is 4 x 4 x 3, i.e., 16 control points and each % % control point has three va...
function basemaps=read_basemap_xml(xml_file) xml_struct=parseXML(xml_file); basemaps_nodes=get_childs(xml_struct,'Basemap'); basemaps=[]; for it=1:numel(basemaps_nodes) tmp=get_node_att(basemaps_nodes(it)); fields=fieldnames(tmp); for ifield=1:numel(fields) basemaps(it).(fields{ifield})=tmp.(fields{...
%% cleaning clear all clc %% read necessary files vy=dlmread('vely.dat',' '); vz=dlmread('velz.dat',' '); phase=dlmread('phase.dat',' '); %% draw streamlines % specifying the starting poitns %[sx,sy] = meshgrid(0:20:1500,0:10:50); sy1=1.0/(size(vz,1))*(2:size(vz,1)-1); sz1=15*ones(1,size(vz,1)-2)/size(vz,2); sy2=1...
vbl = Screen('Flip',DataStruct.PTB.wPtr); Common.While;
classdef SPX_Signals %SPX_SIGNALS Summary of this class goes here % Detailed explanation goes here properties end methods(Static) function [x,i] = findFirstLessEqEnergy(X, energy) % Returns the first signal with energy less than or equal to % given thresho...
% MJLMEXC.M % For expanded, magnetization profile plot (Bloch Equa) % Called by mjljm mjlmexv = get(mjluimex,'Value') ; if mjlmexv == 1 ; set(mjluimex, 'BackGroundColor', 'white') ; if mjlslpv == 1 ; % Semilog plots set(mjluislp, 'BackGroundColor', 'white') ; end ; else ; set(mjluimex, 'BackgroundColor', ...
clc clear dim=zeros(1,20); dim(:)=500; ran=zeros(1,20); ran(:)=1000; results=zeros(50,100,11,20); dim(11)=2;ran(11)=65.536; dim(12)=2;ran(12)=5; dim(13)=3;ran(13)=1; dim(14)=30; dim(10)=30; dim(16:20)=30; for o=1:20 objective_function=o for p=1:50 p d=dim(o); range=[-ra...
function [simulation_state, matlab_simulation_variables] = MatlabDispatch(simulation_parameters, simulation_state, matlab_simulation_variables) % load testvariables0.mat %Shortening Generator variables min_load = simulation_parameters.generators(1).minimum_load/100 * simulation_parameters.generators(1).rated_ca...
% (4) dy(1)/dt = -y(1) + y(2)*y(3) % dy(2)/dt = -y(2)+(y(3)-2)*y(1) % dy(3)/dt = 1-y(1)*y(2) % Using the function AB2.m to comptue the numerical solution to (4). % Also plots the graph of y(1), y(2), y(3) versus time. % And a 3D plot of the curve y(1)t, y(2)t, y(3)t function [y,t] = solve_ODE_system() % Give...
function result = converge(func, newres, tol) result = newres; newres = func(result); while (norm(newres - result) > tol) result = newres; newres = func(result); end end
function [AreaData, AreaNames, AreaPars] = feature_AreaD1(V, ttChannelValidity, Params) % MClust % [Data, Names] = feature_AreaD1(V, ttChannelValidity) % Calculate area feature for 1st derivative for each channel. Normalizes % for number of samples in waveform. % % INPUTS % V = TT tsd % ttChannelValidity = nC...
function ten_site_plot_no_sim() a = 0.1; %to print the pars b = 0.9; %adjust x = fsolve(@ten_site,rand(1,19)); %to solve the equations given by ftion ten_site xs = x(1:10); %lattice 1 average occupancies ys = [0 x(11:end)]; %lattice 2 average occupancies %plotting: subplot(2,1,1) plot(xs, "-o") hold o...
function D = DFT_set(N, Q) % 生成对应的DFT码本集合 % N 为天线数量 ULA/UPA % Q 量化精度 %% if nargin == 1 M = N; else if length(N) == 2 M = [2^Q 2^Q]; else M = 2^Q; end end if length(N) == 1 % DFT n = (0 : N - 1); phase = (0 : (M - 1)) * 2 * pi / M; D = exp(1i * n.' * phase) / sqrt(N); ...
stimRate = 50; % stimImpulse = [sin([1:1:300]/100) + 1]'; %% rates = 10:10:200; nRates = length(rates); for iStim = 1:nRates stimImpulse = ones(500,1) * rates(iStim); networkActivity = run_network(stimImpulse, stimRate); pnResp(:, iStim) = networkActivity(3,:)'; end %% plot(1000:3500, pnResp(1000...
% [数据类型](https://ww2.mathworks.cn/help/matlab/data-types.html) % MATLAB的数据类型主要有: % - 数值类型 % - 字符和字符串 % - 日期和时间 % - 分类数组 % - 表 % - 时间表 % - 结构体 % - 元胞数组 % - 函数句柄 % - 映射容器 % - 时序 % 本节就简单探索一下数值的简单玩法。 %% [数值类型](https://ww2.mathworks.cn/help/matlab/numeric-types.html) % double 双精度数组 % single 单精度数组 % int8 8 位有符号整数数组 % in...
function g_interf_est = RecovExactXcorrMoveCam(initial_weights, d_interf, g_interf_est, nmove, T, tol) X1 = inf; X2 = inf; deltaX = inf; we = optimvar('we', nmove*nmove); xmat = optimvar('xmat', 2*T-1, nmove*nmove); Xfun = @(we, xmat) computeWeights(nmove, d_interf, xmat, we); Xexp = fcn2opt...
classdef SurrogateSelector methods (Static) function [xPreSample, zPreSample, xDistant] = chooseDistantPoints(n, xSample, zSample, xTrain, xmean, sigma, BD) % choose 'n' of the xSample data, preferably not near to the xTrain data % % n -- the number of points to return % xSample, zSa...
function dcdpval = exp_d2Dproc_dcdp(coefs,bvals,pars,more) [m,n] = size(bvals); devals = exp(bvals(1:m-1,:) * coefs); ddevals = exp(bvals(2:m,:) * coefs); % colnames(devals) = more.names; % colnames(ddevals) = more.names; % names(pars) = more.parnames; H1 = more.d2fdxdp(ddevals,more.qpts,devals,pars,more.more); H2...
function out = restore() % RESTORE() % Description: % Restores the configuration to initial default. % Examples: % dj.config.restore out = dj.internal.Settings.restore(); end
%% Rankine Cycle Parameters format compact format short close all clear clc %% Data Import % The header are as follows: % Time (sec) Boiler Temperature (C) Turbine Inlet Temp (C) Turbine Exit Temp (C) Boiler Pressure (PSIG) Turbine Inlet Pres (PSIG) Turbine Exit Pres (PSIG) Fuel Flow (L/min) Generator (RPM)...
function tf=mapContains(M, k) % TODO: Replace this function with M.isKey(k). isKey is built-in and does % the exact same thing! tf = ~isempty(find(contains(M.keys, k))); warning("MSTD DEPRECATION NOTICE: Replace the function mapContains() with <map>.isKey(<key>)!"); end
function q = produitphiderp2(x,k,il,jl,n) %Entree x valeur courante % k n° du maillage % il,jl indice de la fonction à multiplier % n nombre d'intervalles %Sortie produit phi'J*phi'I q=phibasederp2(x,k,il,n)*phibasederp2(x,k,jl,n); end
function test() prototxt = {'3_prototxt_solver/lenet5/train_val.prototxt','3_prototxt_solver/lenet_300_100/train_val.prototxt', '3_prototxt_solver/L2/train_val.prototxt' , '3_prototxt_solver/vgg16/train_val.prototxt' }; caffemodel = '4_model_checkpoint/lenet5/lenet5.caffemodel.quantize.normalize','4_model_checkpoint/...
function [xpos,zpos,gvals,ep,Nvorts] = initializer(Nx,omega,gam,av,bv) xvals = linspace(-1,1,Nx); zvals = -1/2:2/Nx:(1/2-2/Nx); dx = 2/Nx; disp('Mesh-size is') disp(dx) ep = .95*dx; xpos = []; zpos = []; ovals = []; cfun = @(x,z) (x/av).^2 + (z/bv).^2; ofun = @(x,z) omega*exp(log(eps)*(cfun(x,z)).^18); chi = @(r) 1....
function Q = rota0011fill(A00, A11, bgval) %------------------------------------------------------------------------------ % % The quincunx grid as constituted by A00 and A11 is rotated and mapped % onto a rectangular grid together with the corresponding values. % The excess area is filled by padding with value bgval i...
function [backs, takes] = ex31( ) close all; v = VideoReader('Barcelona.mp4'); h = v.Height; w = v.Width; O = 1; F = 400; M = read(v,[O,F]); N = size(M,4); prev = M(:,:,:,1); takes = []; %We always need the first one takes = cat(1, takes, 1); backs = []; for i=1:N cur = M(:,:,:,i); %We calculate the distance ...
classdef NaiveBayesClassifier < pipeline.classification.Classifier %NAIVEBAYESCLASSIFIER Naive Bayes classifier as Pipeline Step %% TODO: This code is almost identical to SVMClassifier % Create template function for doExecute %% Code methods function obj = Naiv...
function [ output_args ] = Outer_Loop3( input_args ) %UNTITLED15 この関数の概要をここに記述 % 詳細説明をここに記述 end
% Author Deepak. % Just provide the path of the image to add the noise or to restore the % image. clc; f = imread('Place the path of your image file'); figure imshow(f),title('Original Image') [M N] = size(f); % Any type of noise can b added to the image provided. Just see the % imnoise2 file to see the variou...
classdef IterativeMethod < handle %ITERATIVEMETHOD An iterative method. % This is a base interface for all iterative methods that tranform % the current iterate to the next. % % See also: RUNNERACF. %======================== METHODS ================================= methods (Abstr...