text
stringlengths
8
6.12M
% function [tdata,udata] = % SpectralChebyshevFFT(Nx,Ny,a,b,nu,x0,y0,u0,tmax,jacobian) % % % % Author: Diako Darian % Date: 11.07.2015 % % % This function advances RHS of the 2D Burger's equation in time % by means of fourth order Runge-Kutta method, % in the case of Chebyshev spectral collocation method...
% TODO: Add comments %% Init clear; clc; close all; addpath(genpath('../../Solvers')); addpath(genpath('../../Utilities')); % Parameters sigma = .001; % Standard deviation of noise seed = 18; % Seed bSilent = false; % Silent/verbose mode bSave = 0; % Flag for saving all results RandStream.setDefaultStream(RandStre...
function [s] = create_s(triggers, t) [rows,columns] = size(triggers); rows_triggers = rows; [rows,columns] = size(t); rows_t = rows; w = []; m_index = 1; t_index = 1; markers_added = 0; % track number of markers added (for managing inconsistent sample rate) time_frame = 1.0; %scan only for the ran...
clc; close all; clear all; %% parameters lambda = 0.00053; %mm ff = 100; %mm Dslm = 0.008; %slm pixel size NN = 2054; MM = 2452; dx = 0.00345; %mm % Object pixel sizes dy = 0.00345; %mm du = lambda * ff / (dx * NN); dv = lambda * ff / (dy * MM); u_b = double(loadFPImage('USAF_z=0.fpimg')...
function [segmented, centroids] = kmeans_segment(image, Kclusters) [a, b, c] = size(image); tmp = im2double(image); tmp = reshape(tmp, [a*b, 3]); [idx, centroids] = kmeans(tmp, Kclusters); segmented = zeros(a*b,3); for i=1 : a*b segmented(i, :) = centroids(idx(i), :); end s...
function [yi, ypi] = said(x, y, xi, chi, eta, c) % SAID 1-D piecewise Said interpolation % SAID(X,Y,XI,CHI,ETA,C) interpolates to find YI, the values of the % underlying function Y at the points in the array XI, using % piecewise Said interpolation. X and Y must be vectors % of length N. % % C...
function [ output ] = crowdCPush( echoQueryNum, edgeNum, deviceVector, queryVector, cacheSize, contentDataRaw ) edgeCacheContent = zeros(edgeNum, 1e5); edgeCacheSize = zeros(edgeNum, 1); edgeCacheSize(:, :) = cacheSize; deviceVectorCum = zeros( edgeNum, 1 ); for i = 1 : edgeNum deviceVectorCum(i) = sum(deviceVect...
function W = constructW2(feat1,feat2,options) k = options.k; len1 = size(feat1,1); len2 = size(feat2,1); W = zeros(len1+len2); dist21 = EuDist2(feat2,feat1); %dist22 = EuDist2(feat2,feat2); [~,sortIndex] = sort(dist21,2); for i = 1:len2 W(len1+i,sortIndex(i,1:k)) = 1; W(sortIndex(i,1:k),len1+i) = 1;...
%此程序比较单期和多期单一价格货物收益情况 clc clear close all load JL_Single2_p0_1 [R1,id1] = max(revenue_m); h1= plot(c(id1),R1,'k*','MarkerSize',5); hold on h2=plot(c,revenue_m,'k-','LineWidth',2); tran_T2=tran_T(id1); fprintf('多期,最大收益为:%.2f,发生在当仓容为:%d\n', R1,c(id1)) load JL_Single3 h3=plot(c,revenue_m,'r-','LineWidth',2); [R2,id2] ...
function [p]=Update_Pressure(w,Constant) gamma=Constant.gamma; rho=w{1}; rhou=w{2}; rhov=w{3}; rhoE=w{4}; u=rhou./rho; v=rhov./rho; p=(gamma-1)*(rhoE-(1/2).*rho.*(u.^2+v.^2)); end
%% REminer 결과 그래프에서 패턴을 분리하여 여러 기능을 수행하는 프로그램 clear; Pixels = zeros(49,3); WeightedPixels = zeros(49,3); Arrays = zeros(49,1); WeightedArrays = zeros(49,1); load('name.mat'); for ecoli = 1:49 clearvars -except ecoli Pixels Arrays name WeightedPixels WeightedArrays; str = sprintf('Screenshot_%d.png',e...
function fnval = Lorenz_fun(t,x,p,more) % Right side function for Lorenz differential equation % x(1) = x, x(2) = y, x(3) = z % p(1) = sigma, p(2) = r, p(3) = b p = exp(p); n = size(x,2); if n == 1, x = x'; end r = x; r(:,1) = -p(1).*x(:,1) + p(1).*x(:,2); r(:,2) = p(2).*x(:,1) - x(:,2) + x(:,1).*x(:,3); r(:...
clear; syms l0 l1 l2 l3 x1 x2 x3 x1d x2d x3d; l0=4;l1=4;l2=1;l3=1;x1d=0;x2d=0;x3d=1; tt(6,100)=0; for k=1:50 x1=0;x3=0;x2=2*pi*k/100; t3=twist_wqh([0,0,1]',[0,l1+l2,0]',0); t2=twist_wqh([0,0,1]',[0,l1,0]',0); t1=twist_wqh([0,0,1]',[0,0,0]',0); g3=twist2gab(t3,x3); g2=twist2gab(t2,x2); g1=twi...
clear; joints_3D = load('/home/chenf/Documents/pose_estimation/data/human3.6M_ori/joints_3D.mat'); joint = joints_3D.joints_3D{1,1}(:,:,1); joints_2D = load('/home/chenf/Documents/pose_estimation/data/human3.6M_ori/S1/joints.mat'); joints1 = joints_2D.joints{1}(:,:,1); joints2 = joints_2D.joints{2}(:,:,1); joints3 = j...
% P3.10 colordef white; clear; clc; M = 250; k = -M:M; w = (pi/M)*k; % [0, pi] axis divided into 501 points. w0 = pi/2; figure(1); n=[-25,25]; h=(0.9).^(abs(n)); H=dtft(h,n,w); subplot(2,1,1); plot(w/pi,abs(H)); grid; xlabel('frequency in pi units'); ylabel('|H|'); title('Impulse Response M...
function outstruct = buildStructWrtTime(obj, timestr, label2find, tfind, deltaT) % BUILDSTRUCTWRTTIME(obj, timestr, label) Find static/dynamic embryos % Give the times, folders, and time uncertainties of all % dynamic samples or fixed samples matching the supplied channel 'label', % depending on whether they ma...
function [bin] = img_segment(img) imghsv = hsv_segment(img); %Call user defined function for HSV segmentation imgcbcr = ycbcr_segment(img); %Call user defined function for YCbCr segmentation [r,c,v] = size(imgcbcr);...
function y=vecrev(x) %Usage: y=vecrev(x) % % Reverse a vector, x. [n,m]=size(x); if n>m y=fliplr(x); else y=flipup(x); end;
function new_image = harmonic_mean_cvip( imageP, mask_size, varargin) % HARMONIC_MEAN_CVIP - performs a harmonic mean filter % % Syntax : % ------- % new_image = harmonic_mean_cvip( imageP, mask_size) % new_image = harmonic_mean_cvip( imageP, mask_size, ignore_zeros) % % Input Parameters include :...
%%%%% INTRODUCTION %%%%% % RRT, the Rapidly-Exploring Random Trees is a ramdomized method of % exploring within dimensions. This method can effectively generate a path % to reach any point within certain limited steps due to its random % characteristics. % This method is proprosed by LaValle, Steven M. in % Oc...
function unixTime = datenum2unix(matlabDatenum) %DATENUM2UNIX Converts MATLAB datenums to UNIX time % Rounds down to whole seconds unixPivotDatenum = datenum(1970,01,01); unixTime = floor(86400*(matlabDatenum - unixPivotDatenum)); end
clear all ; close all ; cd('C:\shared\mkt') ; fid = fopen('ES.txt') ; data = textscan(fid,'%s %s %f %f %f %f %f','delimiter',',','Headerlines',1) ; fclose(fid) ; d5 = data{6} ; d5 = d5(1:5:end) ; d5 = d5(length(d5)/2:end) ; %d5 = d5(end-50000:end) ; % make a moving average: clear mvg p mean for p = ...
function [ kurt ] = Kurtosis( X ) %[ kurt ] = Kurtosis( X ) % Calculation of Kurtosis based on % H. Yu and T. Fingscheidt, "A Figure of Merit for Instrumental % Optimization of Noise Reduction Algorithms", in Proc. 5th Biennial % Workshop on DSP for In-Vehicle Systems, Kiel, Germany, Sep. 2011, pp. % 140-147....
function [tau] = mjd20002tau(mjd2000) % % - tau: represents te value of the time at the Modified Julian Date since 2000 Jan % 12:00:00 (mjd2000) following the criteria from Matlab to measure time. Date = mjd20002date(mjd2000); tau = datenum(datetime(Date));
<<<<<<< HEAD clear; close all; file_name = './data/test_2semg_12345.txt'; semg_channel = 1:2; semg_channel_count = 2; force_channel = 3; semg_max_value = 2048; semg_min_value = -2048; force_max_value = 5; semg_sample_rate = 5100; % Approximate target_sample_rate = 300; test_output_filename = './data/output/exp_ard_D...
global config; config.setatten = @(a)atten_santec_1550.attenuation(a); attens = [15:-1:4]; gain_piezo = 2000; atten_piezo = 28; wlmin = 1530; wlmax = 1540; % attens = [attens flip(attens)]; data_all = []; Ps_all = []; fname = sprintf('TD67_powerSweep_%s', datestr(now, 30)); %% for atten = attens % at...
function [detectedPlane, isObjectDetected, supportEdges, vanishingPoint_uv,inclinationAngle, gpCorrected]=detectStair(figHandle, grayImg, uvdPoints, xyzPoints, gp, selectMethod, predictedPlane, inclinationDetected, stepsPlanes ) % selectMethod can be 'RansacFit' or 'PlanePredicted' % for 'RansacFit', the stair plane i...
answ = randi(3, 100000, 1); prize = randi(3, 100000, 1); sum(answ == prize)/100000 #nie zmieniamy wyboru answ = randi(3, 100000, 1); prize = randi(3, 100000, 1); sum(answ != prize)/100000
function [ dy ] = ffun1( t,y ) v1 = 1; v2 = 2; dy = zeros(2,1); dy(1) = v2/(sqrt(1+((y(2)-v1*t)/y(1)).^2)); dy(2) = v2/(sqrt(1+((y(2)-v1*t)/y(1)).^2)) * ((y(2)-v1*t)/y(1)).^2; end
function SaveDataPts( cX, cFileName) % % function SaveDataPts( cX, cFileName) % % cX : N by D matrix of N points in D ddimensions % cFileName % lHeader = [size(cX,1) size(cX,2)]; fid = fopen(cFileName,'wb'); fwrite(fid,lHeader,'integer*8'); fwrite(fid,cX','real*8'); fclose(fid); return;
%read binary data given cmm_type t and cmm_dim s from fid %for lists read nr entries and skip ns entries function data = cmm_read_data(fid, t, s, nr, ns) if nargin <4 nr=-1; ns=0; elseif nargin<5 ns = nr; nr = 1; end c = from_cmm_type(t); if isempty(s) % scalar if str...
% function: make_compressed_paired_plot % ################################### % removes nodes that aren't in large flows % David Choi % 10/01/2017 function [small_flow, small_cluster, flow_Z, original_K, new_param] = make_compressed_paired_plots(Z, ... flow_rec, A_rec, param, common_ordering) if ~isempty(common...
function P_in = ncav2Pin(n_c, eta, CAL, f_mech) % convert n_cav wanted to input power Pin, taken into account the various % efficiencies % n_c: intracavity photon number wanted % eta: efficiency between P_in and the reflector, i.e., eta = eta_coupler * eta_switch ... % CAL: from piezo_scan_fit % f_mech: mech freq...
%randomly generate industry indeces %NFIRM = 3000; %NOBS = 100; means time %NIND = 30; %industry matrix likes: % ind1 ind2 ind3 ind1 ind2 ind3 ind1 ind2 ind3 %firm1 1 0 0 1 0 0 1 0 0 %firm2 1 0 0 ...
function [ ] = eddiesTable( fileName ) eddies = load(fileName); names = fieldnames(eddies); eddies = eddies.(names{1}); eddies = filterBU(eddies); areas = zeros(1, length(eddies)); amps = zeros(1, length(eddies)); majTomin = zeros(1, length(eddies)); extremas = zeros(1, length(eddies)); for i = 1:length(eddies) a...
% With this script, we seek to push further the analysis of trajectories at % the time of the detection of deterministic regularities. In particular, % we show that the extent to which subjects transiently increase their % beliefs in the probabilistic hypothesis correlates with the extent to % which the ideal observer ...
function ReportML recordMAT = 'C:\Matlab\MyMATLABRecord\recordML.mat'; if exist(recordMAT) load(recordMAT); writetable(recordML,'Report.xlsx'); disp('数据写入:Report.xlsx'); else disp(['找不到数据文件:',recordMAT]); end end
function [ax,h]=plott(varargin) % [ax,h]=plott(X) % X is a sensor structure % or % [ax,h]=plott(X,r) % X is a sensor structure % or % [ax,h]=plott(X,fsx) % X is a vector or matrix of sensor data % or % [ax,h]=plott(X,fsx,r) % X is a vector or matrix of sensor data % or % [ax,h]=...
%@(#) utgles.m 1.3 98/09/10 10:24:37 % %function utgles(compfile,resfil,resfil2,compwork) function utgles(compfile,resfil,resfil2,compwork) % if nargin<2, resfil='utgles.results'; disp('results will be printed on utgles.results and utgles2.results'); end if nargin<3, resfil2='utgles2.results'; if nargin>...
%{ Análisis de Señales y Sistemas - TP Laboratorio Nº 3 Función FSERIED - Grupo 6 Argumentos: - x: Señal de entrada - n: Variable independiente - N: Cantidad de coeficientes a calcular - k: Cantidad de coeficientes a calcular Retorna: - ak: Coeficientes de Fourier Repositorio disponible en: http...
%This programs does a brute fit to look for initial guesses of A and B. % If hf constants are unknown for upper or lower or both levels, make an % array of Au values to test close all addpath(genpath('C:\Users\Felix\Desktop\Thesis full program 16 jan 2017\Base programs')) addpath('C:\Users\Felix\OneDrive\Thesis fu...
close all set1 = [.098 .091 .086 .078 .071 .065 .061 .058 .054 .05 .047]; set2 = [.094 .087 .079 .072 .067 .064 .061 .057 .054 .051 .048]; set3 = [.096 .09 .083 .076 .071 .067 .061 .056 .054 .051 .049]; set4 = [.22 .2 .187 .175 .167 .158 .15 .146 .139 .133 .129]; set5 = [.145 .125 .114 .103 .093 .084 .079 .072 ....
function result = splain(xi,yi) % sprawdzenie danych wejciowych (dlugosci wektorow) if length(xi) ~= length(yi) error('Wektor xi oraz yi nie sa tej samej długoci'); end % wyznaczanie dlugosc wektora n = length(xi); di=yi; % wektor h - odleglosc przesuniec miedzy poszczegolnymi punktami h = zeros(n...
function [evals, settings, results] = catEvalSet(folders, funcSet, maxFE) % Finds unique settings and prepares its data for further processing. % [evals, settings] = catEvalSet(folders, funcSet) returns cell array % 'data' of size functions x dimensions x unique settings and appropriate % 'settings'. % % Input: % f...
function [tp, fp, fn, n] = calculate_accuracies(plotdata, labels) blink_length = 10; lookahead = 1; tp = 0; detections = plotdata.pts > plotdata.ucl | plotdata.pts < plotdata.lcl; blinks = [0; diff(labels)]; n = sum(blinks==1); detections = [0; diff(detections)]; blinks = [0; diff(labels)]; sequences = [fi...
function Simulation_mapper() %Simulation_mapper: Simulationsmethode der <a href= "matlab:help('mapper')">mapper</a> Funktion %Dabei werden 1000000 Bits mit der Methode <a href= %"matlab:help('generateBits')">generateBits</a> generiert %Anschließend werden die Bits in Symbole mithilfe der Konstellationspunkte %umgewande...
function imgOut = add_tint_img(imgIn, RED, GREEN, BLUE) % tints an image by adding RED, GREEN, AND BLUE directly to the pixel % values of an image. imgIn can be an RGB or GRAYSCALE % written by Efron Licht in 2016. You can use, copy, or edit this code for % any reason whatsoever. Go nuts. %% INPUT CHECKING assert(nar...
classdef MicroClusterList < handle % A `handle` is a reference to an object. % List of micro-clusters properties MC_list; end properties (Constant) INF = 1e15; end methods function obj = MicroClusterList() obj.MC_list = cell(1,0); ...
function text = indentText(text,n) % indentText Indent text % Copyright 2012-2015 The MathWorks, Inc. if nargin < 2 n = 1; end spaces = repmat(' ',1,n*4); for i=1:numel(text) text{i} = [spaces text{i}]; end
% findIdentifiable Find all k-identifiable nodes from a test matrix. % V = findIdentifiable(T, k) returns all k-identifiable nodes of test % matrix T. % % V = findIdentifiable(T, k, ID) uses identifiability matrix ID instead % of computing it from scratch. Test matrix T is ignored. % % [V, ID] = fin...
function checkRes = isCombineDataStructHaveField( combineDataStruct,baseField,checkField ) %判断combine结构体是否存在字段 % combineDataStruct 联合结构体 % baseField 基本字段,‘rawData’ % checkField 要检查的字段 checkRes = isfield(combineDataStruct,baseField); if ~checkField return; end st = getfield(combineDataStruc...
function mRes = idAuxMergeCorTableWithArg2D(vArg1, vArg2, mCor) sizeArg1 = size(mCor, 1); sizeArg2 = size(mCor, 2); lenArg1 = length(vArg1); lenArg2 = length(vArg2); if((sizeArg1 ~= lenArg1) || (sizeArg2 ~= lenArg2)) sprintf('Inconsistent lengths of the matrix and the argument vectors'); end mRes = zeros(lenArg...
% The following is your RPI's IP Address. Make sure it's correct PI_IP = '172.24.1.1'; pi = tcpclient(PI_IP, 3000); pi.write(uint8('Hello from MATLAB')) pause(0.1) char(pi.read())
clear all close all filez=dir('outputs*.mat'); numsubs=42; for i =1:length(filez) load(filez(i).name); end xvals=linspace(0,1,25); for i=1:length(rois) roival=rois(i); % the value of the roi being inspected dist=openfig(sprintf('distmtx%d.fig', roival),'reuse'); distax=gca; hell=openfig(sprin...
function [BCSpectrum] = stripOffset(xScaleLocal, rawSpectrumLocal) searchMin = 1400; searchMax = 3700; BCSpectrum = rawSpectrumLocal - min(rawSpectrumLocal(searchX(xScaleLocal, searchMin):searchX(xScaleLocal, searchMax))); end
function [xx,yy]=a_pdata(x,y,flag) % assumes y is piece-wise const between x values % length(y)=length(x)-1; nx=length(x); ny=size(y,2); if ny ~= nx-1 error('a_pdata: length(y) must equal length(x)-1') end nn=2*nx-2; if flag == 1 xx=zeros(1,nn); xx(1)=x(1); xx(2:2:nn-2)=x(2:nx-1); xx(3:2:nn...
function p = get_frontcon(m, C) % To draw the efficient portfolio frontier % m - mean (expected return) % C - Covariances (risk) % NumPorts - number of random portfolio p = Portfolio; p = setAssetMoments(p, m, C); p = setDefaultConstraints(p); end
function MNBP=minNoBlockPayoff(clv,tol); % EXACT_GAME computes the minimum no blocking payoff from game v using % the Matlab's Optimization toolbox. Uses Dual-Simplex (Matlab R2015a). % A core is non-empty iff mnbp<=v(N) % % Source: J. Zhao (2001), The relative interior of base polyhedron and the core, Economic Theo...
%This code is for extension of the models, implementing hoicks in the boid %world %LEGEND FOR STUFF % CHECK % TEMPORARY % DELETE % OPTIMIZE function [polarisation]=hoick_world(p) close all; %-------- CONTROL VARIABLES----------% phase_mode = 1; hoick_mode = 0; hoick_type_mode=1; make_movie = 0; type=1; hoick_advan...
function[NRMSE,Xest]=NRMSE(hest,V,N,X) Xest=conv(hest,V); figure plot(X,'blue'); hold on plot(Xest,'red'); legend('Original','Estimated') rmse=0; Xest=Xest(1:N); for k=1:N rmse=(Xest(k)-X(k))^2+rmse; end rmse=sqrt(rmse/N); NRMSE=rmse/(max(X)-min(X)); end
function [sol] = ProxMappingCVX(domain, Bundle, data, BarX, f, g, x_lbt, c, LS) x = zeros(domain.n,1); delta = 1.0e-16 / domain.n; domega_c = 1 + log(c + delta); if Bundle.size == 0, cvx_begin cvx_quiet(true); variable x(domain.n); minimize -sum(entr(x+delta) -domega_c.*x); ...
clear all ;close all ; cd c:/shared/MRE ; ls t1 = load_untouch_nii('RF_Test_MRE_2017_05_25_2_WIP_3D_T1_0.8mm_SENSE_2_1.nii'); vc = load_untouch_nii('rf_vc4_in_t1.nii.gz'); vc.img(1,1,:) = -11; vc.img(1,2,:) = 38; mre = load_untouch_nii('rf_procpval_ImagBulk_in_t1.nii.gz'); mkdir imgs cd imgs; for i=70:100 ...
function [w, k0, z, deps, cs, rhos, alphas] = Initialization(freq, ... c0, dz, depth, Layers, N, Coll, dep, c, rho, alpha) w = 2 * pi * freq; k0 = w / c0; z = 0 : dz : depth(end); deps = cell(Layers, N); cs = cell(Layers, N); rhos = cell(Layers, N); alphas = cell(Layer...
filename=strcat(DATA_FOLDER,'q_profile.mat'); load(filename,'q_initial_profile'); %filename=strcat(DATA_FOLDER,'flux_geometry.mat'); %load(filename,'X_PR_map'); %load(filename,'Z_PR_map'); %for p=1:NB_THETA % q_PR_map(p,:)=q_initial_profile; %end %flc_inc=sqrt((X_PR_map.^2+Z_PR_map.^2)+((R0+X_PR_map).*q_PR_map).^2)...
function K = SamplePrecisionMatrix(A,b,D) % SAMPLEPRECISIONMATRIX(A,b,D) Sample precision matrix K ~ G-Wishart_A(b,D) % % Sample a precision matrix K which is distributed according to a % G-Wishart distribution with graph structure A, degrees of freedom b, % and scale matrix D % % Inputs: % (1) A is the adjacency matr...
%% Main with Lab difference load flagDatabase.mat; load meanLabDatabase.mat; % Load file and adjust if neccessary im = im2double(imread('test_images\test8.jpg')); im = adjustInputSmall(im); % Calculate mean L, a, b values for each cell (16x8) in inputImage meanLabCellColors = extractLabCellColorsSmall(im); % Reprodu...
function features = analyze_sound(soundfile,parameters,handles) % ANALYZE_SOUND - Extract sound features from sound target. % % Usage: features = analyze_sound(soundfile,parameters,handles) % % Check if in server mode if nargin < 3 handles = []; end % Get pm2 path pm2path = find_pm2_pathes; if isempty(pm2path) ...
% This is material illustrating the methods from the book % Financial Modelling - Theory, Implementation and Practice with Matlab % source % Wiley Finance Series % ISBN 978-0-470-74489-5 % % Date: 02.05.2012 % % Authors: Joerg Kienitz % Daniel Wetterau % % Please send comments, suggestions, bugs,...
% split - splits a string (or a cell array of string) into a cell array % % Syntax % B = split(A, sep) % % Reference % "Estimation of low-rank tensors via convex optimization" % Ryota Tomioka, Kohei Hayashi, and Hisashi Kashima % arXiv:1010.0789 % http://arxiv.org/abs/1010.0789 % % "Statistical Performance of Convex T...
function subgroup_list = getSubGroup(s,group_list) subgroup_list = []; for i = 1:length(group_list) if (group_list(i,1) == s) subgroup_list = cat(1,subgroup_list,group_list(i,:)); end end
function ppl=Scaled_Rank(y,n,ppl,index) % fitness assignment based on rank if index==0, % not index==1 since it is 1 over something.... [y_sort, perm]=sort(y,'descend'); else, [y_sort, perm]=sort(y); end raw_rank=[1:n]; scaled_rank=1./((raw_rank).^(1/2)); % it is one over somet...
function [X,S] = calculator2(D) %UNTITLED Summary of this function goes here % Detailed explanation goes here global K_S S_0 mu_max Y_XS X = Y_XS ./ 3 .* (S_0 - D .* K_S ./ (mu_max - D)); S = D .* K_S ./ (mu_max - D); end
% this function return the transformer's (input argument) loss function FValue=SP_tlosscost1(InValue) global KWTransformersTypes ShortCircuitLosses Tag = find(KWTransformersTypes == InValue); FValue = ShortCircuitLosses(1,Tag);
function proj = cuboid_proj(cg, cubs, varargin) %function proj = cuboid_proj(cg, cubs, varargin) % % Compute a set of 2d line-integral projection views of one or more cuboids. % Works for both parallel-beam and cone-beam geometry. % % in % cg ct_geom() % ells [ne,9] cuboid parameters: % [x_center y_center z_center...
function d=humanInterp(drad,thetas) bothlegs=[7 8 9 16 10 11 12 17]; d=fitradbas(drad(bothlegs,:),drad,10,thetas); d(bothlegs)=thetas; d(1:3)=0;
clc; clear all; close all; global t_prev q_prev %m1=6; m2=6; m3=6; l1=4; l2=4; l3=4; a=4; g=9.81; x1=pi; x2=pi/2; x3=pi/2; q_prev = [x1 x2 x3]'; xdot1=0; xdot2=0; xdot3=0; x0=[x1,xdot1,x2,xdot2,x3,xdot3]'; tstart=0; tfinal=10; t_prev = 0; [TT,XX]=ode45('dynderiv',[tstart tfinal],x0); figure(1...
%CONTENTS MATGEOM Geometric Computing Toolbox. % Version 1.0 26-07-2017. % % MatGeom Provides low-level functions for geometric computing. It is % possible to create, display, compute intersections... of various % geometrical primitives, in 2D and 3D. % % The library is organized into several modules: %...
function [closing, opening, blinks] = extract_eye_movements(s, d1, thr_opening, thr_closing) %EXTRACT_EYE_MOVEMENTS Summary of this function goes here % Detailed explanation goes here closing = zeros(size(s)); opening = zeros(size(s)); p_closing = (d1 <= thr_closing); p_opening = (d1 >= thr_opening); % Find event...
%Main_code % Latest_Heuristic_NE %% 3 Individuals, Performance and corresponding Index Individual for each Gen, Connection & Input Connections are added % Present Code: Gen and Speciation is different. % Speciation could be same, Gen might be different % Speciation depends on Connection matrix and input Array(In)...
function [x_UKF, Ps] = UKF_RTS_smooth(x_UKF, Ps, Q, dt, weights) for k = length(x_UKF)-1:-1:1 sigmaPoints = MerweScaledSigmaPoints(x_UKF(k,:),Ps(k).M,weights); sigmas_F = UKF_f(sigmaPoints,dt); [xb,Pb] = UnscentedTransform(sigmas_F,weights,Q); Pxb = UKF_cross_variance(xb,x_UKF(k,:),weights,sigmas_F,sig...
function plot_mse(features_struct, labels, settings) % Load custom Google colors custom_colors = load_google_colors(); % Convert MSE values within struct to matrix of singles mse_ptsd = single([features_struct(logical(labels)).mse])'; mse_ctrl = single([features_struct(logical(~labels)).mse])'; % Count number of sub...
function [signalVideo] = readData(path) data = load(path); signal = data.dane_wynikowe.EEG_signal; %podzielic dane dla kazdego etapu events = data.dane_wynikowe.Events{:,[1 4]}; %nazwy eventow z czasem ich rozpoczecia time = data.dane_wynikowe.EEG_time; eventSignal = {}; ...
function dJ=fuzzy_ga_temperature(x) pro_mem_eff; N=50; fis=readfis('fuzzy_con_ga_3'); para_in1=x(1:14); para_in2=x(15:28); para_out=x(29:42); fis_ga=set_fuzzy(para_in1,para_in2,para_out); con_e_max=[0.0697*ones(1,25) .0886*ones(1,25)];% .1003*ones(1,25) .1052*ones(1,25) .1003*ones(1,25) .0886*ones(1,25) .0697*ones...
function Q = wskaJak2(params) R = 2; k = 0.1; ke = 5; mr = 5; r = 0.5; mw = 0.5; L = 0.1; %moment bezwladnosci ramienia Jr = 1/3*mr*r*r; %moment bezwładności bez wody J1 = Jr; %moment bezwładności z wodą J2 = Jr + mw * r*r; P = params(1); I = params(2); ...
%WB_Patlak_process.m % % PROCESS % % TACT curves handles1=guidata(handle1); % Populate from handle, so that new ROI is added handles2=guidata(handle2); % Populate from handle, so that new ROI is added [activity1, NPixels1, stdev1]=generateTACT(handles1, handles1.image.ROI); ...
function rip_fitcdf1 %% Clean close all clear all clc Par(1) = .1; % decision level Par(2) = .1; % standard deviation of drift (units/sec) Par(3) = 1; % drift rate (units/sec) Par(4) = 0.100; % indecision time p.dt= 0.001; %step size for simulations (seconds) nSteps = 600; %number of time steps [Y...
function [Y, SigmaArr] = Im2Patch( imgEst,imgNoisy, par ) b = par.patsize; NumPatches = (size(imgEst,1)-b+1)*(size(imgEst,2)-b+1); Y = zeros(b*b, NumPatches, par.Chas, 'single'); NY = zeros(b*b, NumPatches, par.Chas, 'single'); k = 0; for i = 1:b for j = 1:b k = k+1; Epatch = imgEst(i:...
%********************************************************************* % Aposteriori error estimation % % This code is based on: % Bahriawati, C., & Carstensen, C. (2005). % Three MATLAB implementations of the lowest-order Raviart-Thomas % MFEM with a posteriori error control. % Computational Methods in Applied Math...
############################################################################################################# # Part of the Bayesian Spectrum Analysis (BSA) package in Octave, by Emma # Granqvist & Richard J. Morris, June 2011 # This code is only proof-of-principle, it is released freely and without any warranty # For ...
%% clear all % add analysis pathway project_dir = ''; log_dir = fullfile(project_dir, ['raw_data/logfiles']); subj_ID = {'01', '02', '03', '04', '09', '10', '11', '12', '13', '14',... '15', '16', '17', '18', '19', '20', '21', '22', '23', '24',... '25', '26', '27', '28'}; valid_runs = rep...
clc clear load \\10.106.67.26\matlab-data\EUMETSAT\T10\T10_20120226_P1; %Overlaying latitude and longitude over image case 2 figure('Color','white') Z=flipud(T10_P1(:,:,1)); R = georasterref('RasterSize', size(Z), ... 'Latlim', [10.0065163418805 39.9949317428787], 'Lonlim', [30.0055330666120 59.9944665088319])...
%% Practice_Part1_4 % exponentially damped sinusoidal signals A = 60; w0 = 20*pi; phi = 0; a = 6; t = 0:.001:1; expsin = A*sin(w0*t + phi).*exp(-a*t); plot(t, expsin)
% A table that is like a chess %0 for white cells and 1 for black ones n=7; % n*n table (up to you) table=zeros(n); %first we fill it with zeros % We scan every cell of the array and if the sum of % i (number of row) and j (number of column) of a cell % is...
function results = FitTCMData(dataFilePath, filmName, filmThickness, varargin) % Syntax: results = FitTCMData(<inputs>) % % Description: This function is adapted from the sequence of files used to % fit data generated by the TCM to extract thermal properties % of the sample mater...
function Reducer(key, intermValIter, outKV) count = 0; % The reducer function counts the occurances of all the keywords % from intermKVStore object while hasnext(intermValIter) data = getnext(intermValIter); count = count + data; end % add the frequency for each of the keywords add(outKV, key, count) end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Author: Hamza Bourbouh <hamza.bourbouh@nasa.gov> % Notices: % % Copyright @ 2020 United States Government as represented by the % Administrator of the National Aeronautics and Space Administration. All % Rights Reserved. % % Disclaimers % % No Warranty:...
function r = fhnfunode(t,y,p) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % fhnfunode % % The FitzHugh-Nagumo equations in scalar form %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% r = y; r(1) = p(3)*(y(1) - y(1).^3/3 + y(2)); r(2) = -(y(1) - p(1) + p(2)*y(2))/p(3...
%Find the transformation that registers model with the % scene, S <== T M. % Output: % param =[dx dy theta] function [tmodel,template_point,source_point,model_correspondence,transdist] = ICP(templates,source,thr,display_it) if nargin < 3 thr = 20; display_it = 0; end; if nargin < 4 display...
function test_suite = test_triangleArea %TEST_TRIANGLEAREA Test case for the file triangleArea % % Test case for the file triangleArea % Example % test_triangleArea % % See also % % % ------ % Author: David Legland % e-mail: david.legland@grignon.inra.fr % Created: 2011-08-23, using Matlab 7....
function [ interpolating_GPS,GridID_Set_for_interpolating_GPS ] = Get_GridID_Set_for_interpolating_GPS( gps_matrix) %% Get_GridID_Set_at_GPS_Singal_Blockage function description: % Imput: % Output: % GridID_LineID_near_GPS: Grid_ID, line num, line ID 12345....n % % Example % [ GridID...