text
stringlengths
8
6.12M
function [R, sunpos] = svLocalFrame(svPos,epochs,sunpos) % function to create the satellite local frame rotation matrix % offsetECEF = R(:,:,i)*offset; if nargin < 3 % if isempty(strfind(path,'\mice\src\mic')) % AttachToMice(); % end % get sun position for each time jd = epochs2jd(epochs);...
function savejs() load('torch/trainData.mat'); data = double(train_data); save('trainData.txt', 'data'); load('torch/testData.mat'); data = double(test_data); save('testData.txt', 'data'); load('torch/trainLabel.mat'); train_label = double(train_label'); save('trainLabel.txt', 'train_label'); load('torch/testLabel....
function [Xn T] = normalizePoints(Xh) m = mean(Xh(1:2, :), 2); d = mean(sqrt((Xh(1, :) - m(1)).^2 + (Xh(2, :) - m(2)).^2)); s = sqrt(2) / sqrt(d); T = [s 0 -s * m(1); 0 s -s * m(2); 0 0 1]; Xn = T * Xh; end
function NewMask=watershedSegment(ImageFrame,Mask,seedMask) oldMask=Mask; I_eq_c = imcomplement(ImageFrame); %complement the image because we are about to apply the watershed transform, which identifies low points, not high points. mask_em=seedMask; mask_em(mask_em>1)=1; mask_em(1,:)=0; mask_em(:,1)=0; mask_em...
function out = tswopOneRandomNoise(x) out = zeros(size(x)); out(:,:) = x(:,:); i = randi(size(x,2)); out(:,i) = rand(2,1) .* 2 -1;
%BPneuron 算法实现 %@Author:alicewithrabbit %email:imroxaswc@gmail.com %release date:2016/9/6 %未采用最新的feedforwardnet函数,感觉不太好用 %读取训练数据 clc;clear; fid=fopen('Iris_train_data.txt'); train_data=textscan(fid, '%f%f%f%f%f',75); f1=cell2mat(train_data(1)); f2=cell2mat(train_data(2)); f3=cell2mat(train_data(3)); f4=cell2mat(train_d...
function M = tensor_mul(T, v, d, mode) %TENSOR_MUL is the tensor multiply function % T is a tensor % v is a vector % d is the dimension shape = size(T); if mode == 0 shape_T = int32(ones([1, d])); shape_T(1:length(shape)) = shape; T = reshape(T, shape_T); shape_v ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ETH Zurich, Switzerland % Separation Processes Laboratory % % Project: Lithoplatelets % Year: 2021 % MATLAB: R2019b, Windows 64bit % Authors: Anna Jaeggi (AJ) % % Purpose: % Post-process and plot the orientati...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2010 - 2015 Moon Express, Inc. % All Rights Reserved. % % PROPRIETARY DATA NOTICE: % The data herein include Proprietary Data and are restricted under the % Data Rights provisions of Lunar CATALYST Space Act Agreement % No. SAAM ID#...
function [ validPublish ] = PublishResults(pulseData,handles) %publish results into table validPublish = 0; try voltage = pulseData.nSig.Vptp/1000; P4P2 = round((pulseData.pulseResult(1,1)*100))/100; P3P1 = round((pulseData.pulseResult(1,2)*100))/100; N4N2 = round((pulseData.pulseResult(1,3)*100))/100;...
% lookupGeometries.m: % Takes in a 12-column momentum lookup table `table`, an auxillary lookup % table `auxtable` for storing results from extra simulations, a list of % momentum triples `momenta` that you want to find geometries for and an % error tolerance to aim for. % % It will return a matrix bestGeometries with...
clear load pretest.mat fs = 30; shift = 0.2; t = ((1:24)/fs)'+shift; for sub = 1:size(width_pretest, 3) pretest_sub = squeeze(width_pretest(:,:,sub)); xx = pretest_sub(:,4) == 0;pretest_sub(xx,4) = 2; idx1 = ~isnan(pretest_sub(:,4)) & (pretest_sub(:,4) == pretest_sub(:,2)); idx2 = ~isnan(pretest_s...
function [delXG, delYG] = GoalDelta(vx, vy, gx, gy, goalR, goalS, alpha) % This function gives delX, delY of attraction caused by the goal point dGoal = sqrt((gx-vx)^2 + (gy-vy)^2); % distance bw goal and current position thetaG = atan2((gy-vy),(gx-vx)); % angle between goal and current position % delXG = 0; delYG...
addpath RWTHMindstormsNXT; %establish memory map to status.txt. fstatus = memmapfile('status.txt', 'Writable', true, 'Format', 'int8'); fstatus.Data(6) = 49; j3 = memmapfile('junction3.txt', 'Writable', true); %open config file and save variable names and values column 1 and 2 %respectively. config = fopen('c...
function out = merge(input1, input2) %function out = merge(input1, input2) % combines two matrices size by side and pads the one with smaller length % with NaNs at the bottom %P Robbins 2/95 out=[]; l1 = []; l2 = []; w1 = []; w2 = []; [l1,w1] = size(input1); [l2,w2] = size(input2); if l1 == l2 o...
classdef LMNNet < handle % This class performs training of a LMNNN multi-layer neural-net. % properties % act_func is an ActFunc instance for computing feed-forward activation % levels in hidden layers and backpropagating gradients act_func % out_func is an ActFunc insta...
function writeSmoothAbs() % % FUNCTION: % This function is used to write the code for smoothAbs % MaxOrder = 8; %Should be at least 1 N = MaxOrder + 1; %% Set up the constraints: % The value and slope should be 1 at the right transition point, and zero % for any higher derivatives. xRight = ones(1,N)...
%-------------------------------------------------------------------------- queue(id_min,:)=[]; %删除要发生的事件 count=count-1; %-------------------------------------------------------------------------- if mark_j>0 %颗粒之间碰撞 id=queue(1:count,2:3)==mark...
clear all ; close all subs = {'alex','dina','genevieve','jeremie','russell','valerie'} ; comps = {1:64,1:64,1:64,1:64,1:64,1:64} ; % all subjects, right and left fcomps = {[64,80,12],[41,31,40],[61,48,15],[6,84,79],[79,80,50],[75,77,41]} ; latvis_fmri = [25,23,40,21,50,20] ; latvis_eeg = [26,14;16,6;11,23;...
load (fullfile('Train','Train.mat')); %% offsets=[0 1; -1 1;-1 0;-1 -1]; for i = 1:size(imgResize,1) grayImage = rgb2gray(imgResize{i}); % glcm =graycomatrix(grayImage,'Offset',[0 pixel_dist; -pixel_dist pixel_dist; -pixel_dist 0; -pixel_dist -pixel_dist]); % [glcmfeature,GlcmImage] = graycoprops(glcm,{'All...
%Here are test code rgb_img = 'stego_white_pocket_test.bmp'; gray_img = 'lena_gray.bmp'; Bit_index = 8; Bit_plane_analysis(rgb_img, Bit_index); %Bit_plane_analysis(gray_img, Bit_index); %============================= Display bit planes for image %======================= % @test_image: The test bitmap image file pa...
function [points] = getHarrisPoints(I, alpha, k) % Finds the corner points in an image using the Harris Corner detection algorithm % Input: % I: grayscale image % alpha: number of points % k: Harris parameter % Output: % points: point...
function NS = make_NS() NS.ode.fn = @NS_ode; NS.fn = @NS_fun; NS.dfdx = @NS_dfdx; NS.dfdp = @NS_dfdp; NS.d2fdx2 = @NS_d2fdx2; NS.d2fdxdp = @NS_d2fdxdp; end
% Problem 3 (d) a0 = 0; a1 = 2; a2 = 1; T = exp(linspace(0, 2i*pi, 500)); aT = a0*T.^0 + a1*T.^1 + a2*T.^2; figure(5) plot(real(aT), imag(aT), '-', "color", "black"); %plot(a^2 + b^2 = 1) % Problem 3(e) % 25 x 25 Toeplitz matrix c25 = zeros(25,1) ; r25 = zeros(1, 25) ; c25(1, 1) = a0; r25(1, 1) = a0; r25(1, 2)...
function [] = F3() %Neville input_file1 = fopen("realmadrid.txt", "r"); m = fscanf(input_file1, "%d", 1); n = fscanf(input_file1, "%d", 1); m for i = 1:n + 1 tline = fgets(input_file1); A = str2num(tline); if(i == 1) continue; end [t k] = size(A); k = k / 2; X = linspace(A(1), A(k), m); ...
function y=shif(ns,nq); %сдвиг элементов массива после уменьшения его длины nq %на единицу if nq~=0, for i=1:nq, ns(i)=ns(i+1); end; end; y=ns;
function lilycommand = find_lily_command() % FIND_LILY_COMMAND - Returns the complete path of the lipyond executable. % Lilypond must be previously installed. The searched path is: % /Applications/LilyPond[*].app/Contents/Resources/bin/lilypond % % Usage: lilycommand = find_lily_command() % % Locate LilyPond's folder...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Sparse Representation recovery with L1Magic for face recognition % z. li % 2009.03.10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear; path(path, 'l1magic/Data'); path(path, 'l1magic/Optimization'); facep...
clear; close all; clc; %% constraint_viol & CON_VIOL = nan(2426,15,4); MAX_ITR = zeros(4,1); REG_VIOL = cell(4,1); %% load models load('learned_functions/PVTOL_raw_100_new.mat'); max_itr = itr; MAX_ITR(1) = max_itr; CON_VIOL(:,1:max_itr,1) = constraint_viol(:,1:max_itr); reg_err_all = zeros(itr,1); viol_all = zer...
function [results]=ABM_eval_uniform_incentive(rain_field_true,radar_field,gauge_xy,... budget,alpha_P,max_par,min_par,rate,params,... X,Y,folder,loop_ID) % function to run the ABM model (based on uniform incentive) % this function can also be used to test the performance of the optimized funct...
function [y] = gabor_f(x)%%输出x的gabor变换,为长l=128的列向量 y = []; t = 1:length(x); for d = 0:log2(length(x))-2 a = 2^(2*d+2); for p = 0:length(x)/(2^d)-1 b = p*2^d; for q = 0:2^d-1 e = 2*pi*q/(2^d); g = exp(-a*(t-b).^2+1i*e*t); y = [y;sum(g'.*x)]; end end...
function u = controller(params, t, phi, phidot) % STUDENT FILLS THIS OUT % % Initialize any added state like this: %t persistent newstate t_last if isempty(newstate) % initialize newstate = 0; t_last = 0; end dt = t_last - t; newstate = newstate + dt*phi; t_last = t; k...
Q_mean = 0; for i = 1:(num_frames-2) Q = q_fsB(frames(:,:,i),decod_frames(:,:,i)); Q_mean = Q_mean + Q; end Q_mean = Q_mean/(num_frames-2); MSE_mean = 0; for k = 1:(num_frames-2) x=frames(:,:,k); y=decod_frames(:,:,k); MSE_1 = MSE(x,y); MSE_mean = MSE_mean + MSE1; end MSE_mean = MSE_mea...
function IFMCleanData = cleanIFM(bench, IFMData) config = bench.config; Percentil = config.ifmCleanPercentil; % :TODO: check if it is the full pupill or the naomi pupill Nexclude = int32(bench.meter2pixel(config.fullPupillDiameter) / 4.); if nargin<2 if isempty(bench.IFMData) error('IFM has not been measured...
%-------------------------------------------------------------------------- %***********calculating the lower bound for parameter error**************** %-------------------------------------------------------------------------- %-------------------------------------------------------------------------- %Inputs: ...
% dunn's index demo clear all clc le=40; data=random('Normal',0,1,le,2); data=[data; random('Normal',2,1,le,2)]; idsR(1:le,1)=1; idsR(le+1:2*le)=2; distM=squareform(pdist(data)); [ids]=kmeans(data,2); [ids2]=spectralClust(1,data,2,1); disp(sprintf('Dunns index for kmeans %d', dunns(2,distM,ids))); d...
xxxxa=whos; %xxxxnames=a.name; %xxxxclasses=a.class; for xxxxk=1:length(xxxxa) if strcmp(xxxxa(xxxxk).class,'double') assignin('base','xxxtest',b(:,idx2(k))); xxxxa(xxxxk).name s=eval('unique(xxxxa(xxxxk).name)') pause if length(s)==2 if...
function [t,w,pedges] = GLinterval(a,b,NPanels,pedges) % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % [t,w,pedges] = GLinterval(a,b,NPanels) % Returns nodes, weights and panel edges for composite 16 point % Gauss-Legendre quadrature using NPanels equisized panels over (a,b) % % [...
function uav_rs2hsc_posecalibration_rev2() load rs0params.mat rs0params rs0_RTcol2dpt load rs1params.mat rs1params rs1_RTcol2dpt load setup.mat video_dir_uavcalib_uavrs video_dir_uavcalib_ugvrs ... csv_dir_uavcalib_marker img_step squareSize time_margin %UAVRSの動画 %動画からFrameを保存する ...
function [epoch_std, year] = mydatestd (epoch) temp = mydatevec(epoch); year = temp(:,1); [year_len, year_start] = mydatestd_aux(year); std_year_len = mydatestd_aux(); epoch_std = (epoch - year_start) ./ year_len .* std_year_len; end %!test %! % mydatestd() %! test('mydatestd_aux') ...
function [] = test_calc_b_LTX_2() % function [] = test_calc_b_LTX_2() % % Make a grid x_min = 0; x_max = 0.8; y_min = 0; y_max = 0; z_min = -0.5; z_max = 0.5; num_x_pts = 20; num_y_pts = 1; num_z_pts = 20; num_contours = 20; % % Make a grid % x_min = -1; % x_max = 1; % y_min = -1; % y_max = 1; % z_min = -1.2; % z_m...
% Blair, Gupta, and Zhang 2008's ring attractor oscillatory interference model % eric zilli - 20110908 - v1.0 % % This manuscript deals with both grid and place cells, but this % implementation focuses only on the grid cell component. % % (Notice this is the 1D version of the model, so the output is just a % series o...
%% Task 1: Linear Regression % The task is based on the Machine Learning online course by Andrew Ng % https://www.coursera.org/learn/machine-learning % The dataset is taken from the MATLAB built-in datasets % % Instructions % You will need to complete the following functions: % % plotData.m % computeCost.m...
function [X, d, XDefl, XBlock, dDefl, dBlock] = curtis_unitary_eig(Q) [m, n] = size(Q); % If w is an eigenvector of the Hermitian part of Q and the projection of % Qw into the orthogonal complement of w has norm less than the following % value, then w is deemed an eigenvector of Q. % NOTE: It's not yet clear how to b...
function [r q] = Find_RiskFree_and_Dividends_Shimko(C,P,K,S0,T) % Estimates of the risk free rate and dividend yield from David Shimko. % Requires inputs: % C = Call prices % P = Put prices % K = Strikes % S0 = Spot Price % T = Time to maturity % Returns: % r = Estimate of the risk free rate % q = Estimate ...
% Exercise session 4: DMT-OFDM transmission scheme clear all; close all; Nq = 6; M = 2^Nq; cpr = 600; SNR = 25; fftSize = 2^10; frameSize = fftSize/2-1; z=Nq*frameSize; % Convert BMP image to bitstream [bitStream, imageData, colorMap, imageSize, bitsPerPixel] = imagetobitstream('image.bmp'); % Append with zeros to ...
function data = normalize(d) % normalize(data) - scale before svm. Three different variants each giving different results % the data is normalized so that max is 1, and min is 0 (-1) % data = (d -repmat(min(d,[],1),size(d,1),1))*spdiags(1./(max(d,[],1)-min(d,[],1))',0,size(d,2),size(d,2)); % normD = range(d) + ep...
% nuevo_vector=fuerzas_en_ejes_anatomicos(vector,eje_medial_lateral, eje_rotacion_int_ext,lado) % La funcion recive como parametros una Fuerza en coordenadas globales y % dos ejes anatomicos (eje medial/lateral y rotacion int/ext). Calcula el % tercer eje anatómico y descompone el vector de fuerza en esos tres ejes. %...
function [ v ] = probvelocidad(q, params) %Se definen las coordenadas generalizadas x1=q(1); y1=q(2); x2=q(3); theta=q(4); %Se defininen las coordenadas que no varían con el tiempo xA=0; yA=0; %Se llaman a las funciones de las restricciones y el jacobiano pues %son necesarias para el cálculo de la velocidad J=jacob(q,...
% specsquare.m plot the spectrum of a square wave f=1000; % "frequency" of square wave phi = pi/4; time=10; % length of time Ts=1/10000; % time interval between samples t=Ts:Ts:time; % create a time vector % x=sign(cos(2*pi*f*t)); % square wav...
function showExp(hObject) data = guidata(hObject); fprintf('*******************************\n'); fprintf('Trial 123, correct 80.2 %%\n'); fprintf('stim \tst Ton Toff parameters\n'); for i = 1:8 fprintf('%s \t %d %4d %4d',... char(data.exp.names(i,2)),... ...
function [ newGenome1,newGenome2 ] = CrossOver( Genome1,Genome2,positions ) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here newGenome1=Genome1; newGenome2=Genome2; crossOver=exprnd(10); if crossOver < max(positions) end end
function [ M ] = diffMaps( E, l, E2, l2 ) % Compute the difference between the resulting segmentation and another % (not necessarily a segmentation) M=zeros(size(E)); for i=1:size(E,1) for j=1:size(E,2) for k=1:size(E,3) if (E(i,j,k) == l && E2(i,j,k) < l2) || (E(i,j,k) ~= l && E2(i,j,k) >= l2)...
function lidar_update(obj, z, params) obj.XX(params.ind_yaw)= pi_to_pi( obj.XX(params.ind_yaw) ); %if all(obj.association == 0) % obj.n_k= 0; % obj.Y_k= []; % obj.L_k= []; % obj.gamma_k= []; % obj.q_k= 0; % obj.H_k= []; % obj.number_of_associated_LMs= 0; % return; %end association = obj.ass...
function [S_x,S_y]= smoothing_filter(x,y) for i=3:length(y)-2 S_y(i)=(y(i-2)+y(i-1)+y(i)+y(i+1)+y(i+2))/5; end S_y = S_y(3:length(S_y)); % S_x = x(3:length(x)-2); end
function aabb=makeAabb(side,centroid) % Make a cubic scene AABB with given side length, centred at centroid. if nargin<2 centroid=[0 0 0]; end aabb=0.5*side*[-1 -1 -1 1 1 1]+[centroid centroid];
function [eqtQ,eqt,sbs]=p_equal_treatmentQ(clv,x,tol) % P_EQUAL_TREATMENTQ checks if the vector x satisfies the equal % treatment property (ETP) using Matlab's PCT. % % Usage: [eqtQ,eqt]=clv.p_equal_treatmentQ(x,tol) % % Define variables: % output: % eqtQ -- Returns true (1) if the solution x satisfies ETP, % ...
% IRIN - Arquitectura Comportamiento % % Diego Dominguez % Miguel Reino % Andres Ripoll % %% Borrado de las variables de entorno clear; % Su código aquí %% 1 - Recorrido comportamiento filename = 'robotPositionComp'; delimiterIn = ' '; headerlinesIn = 1; A = importdata(filename,delimiterIn,headerline...
function presentStimuli(wPtr, trialAngles, locations, cont, phase_offset) global params; % Inpute: % Angles - is an array of angles to present each gabor % locations - is a matrix of n*2 location of each corresponding stimulus % This function will draw all the stimuli rotated by angles in the specific % location...
%========================================================================= % % Program to investigate the effects of heteroskedasticity % on the size of the trace test of cointegration % %========================================================================= function coint_hetero( ) clear all clc ...
% [avge,maxe] = Ipedmerror(PL,PU,D) % % compute the average and max edge error between a partial EDM D % and the bound pEDMs PL,PU. function [avge,maxe] = Ipedmerror(PL,PU,D) [n,n] = size(PL); avge = 0; maxe = 0; m = 0; e = 0; for i=1:n for j=1:n if (PL(i,j)>0) e = max(PL(i,j)-D(i,j),0)...
function Lf = drift_L(dt, xGauss, mu0) if (abs(dt) > 1.e-14) a = xGauss(1)/(1-xGauss(2)^2-xGauss(3)^2); T = 2*pi*sqrt(a^3/mu0); % Orbit period dt = mod(dt,T); L0 = xGauss(6); OptionsOde = odeset('AbsTol',1.e-12,'RelTol',1.e-12); ...
% Amir kabir University of Technology (Tehran Polytechnic) % Computer & Information Technology Engineering Department % Resource Allocation in Wireless Networks % DTPC Simulation using MATLAB % Programmer: SeyedHedayat Hosseini % Date: December, 2015 % Matlab Version: R2014b % ************* MAIN SCRIPT *********...
function fDyn = getDyn(A, B, X0, Px, Pu) % returns dynamical constraints global u x; % number of agents N = length(u); % time horizon h = size(u{1},2); fDyn = []; for n = 1:N x{n} = X0(:,n); for t = 1:h % System dynamics xt = x{n}(:,t); ut = u{n}(:,t); x{n} = [x{n}, A...
%----------------------Experiment 1---------------------------------------- [t1,m,Fs] = signalGenerator(); %taking input from Signal Generator in time domain legend('m(t)') %-------------------------------------------------------------------------- frequency_domain = fft(m); frequency_domain_1 = fftshift(frequenc...
% Ejemplo Convolucion 1D en el dominio del espacio y frecuencia % % D.Mery, PUC-DCC, Septiembre 2017 % http://dmery.ing.puc.cl close all N1 = 1000; N2 = 17; f1 = 2*sin((1:N1)'/N1*2*pi*10)+rand(N1,1)-0.5; f2 = ones(N2,1)/N2; figure(1) plot(f1) title('sinus+noise') g = conv(f1,f2); f1p = [f1; zeros(N2-1,1)]; f2p = [f2...
function ip=a_init_dev ip(1).aliases={'T_K' 'T_C'}; ip(1).units={'K' 'C'}; ip(1).full_name='Operating Temperature'; ip(1).type='number'; ip(1).n=[1 1;1 1]; ip(1).range=[-inf inf]; ip(1).values={}; ip(1).default=[300]; ip(2).aliases={'type'}; ip(2).units=''; ip(2).full_name='Device Type'; ip(2).type='string'; ip(2).n=...
%read data from simlation [f,a,p] = textread('C:\Documents and Settings\Bruce Land\My Documents\WebSites\ece576\DDA\AnalogSimNiosII\SimData2.txt',... 'freq=%f, amp=%f, phase=%f') [f,i] = sort(f); a = a(i); p = p(i); figure(1), clf; subplot(2,1,1) semilogy(log10(f),a,'bo','markersize',4) line([log10(4...
function Sproj_analysisPipe_plotStats_topoER(stat,lay) %% ft_topoplotER stat.mymodel = stat.model{1}.weights; load('C:\Users\Admin\Desktop\FieldTrip\fieldtrip-20180128\template\layout\easycapM20.mat'); cfg = []; figure cfg.parameter = 'mymodel'; cfg.layout = lay; cfg.comment = ''; ...
% ----------------------------------------------------------- % ----------------------------------------------------------- % f------The Observed Picture(M*N); % phi------Signed Distance for Segamentation(M*N); % p------The introduced Auxillary Variable, p = (phi_x, phi_y), (M*N,M*N); % n------The introduced Auxillary ...
function [nelio,points] = tarkistajaeliminoi(indeksi,points,suunta) %%%%% tarkistaa indeksiä vastaavan pisteen ympäristön ja eliminoi, mikäli mahdollista. %%%%% palauttaa asetetun nelion ja uuden pistejoukon nelio=[]; piste = points(indeksi,:); %%%% poistetaan peruspiste joukosta %%% indeksit = [1:indeksi-1,indeksi+1:...
function varargout = getargs(args,default_values) %GETARGS Process positional arguments from the input arguments % %ARGOUT=GETARGS(ARGIN,DEFAULT_VALUES) processes input arguments (typically % from VARARGIN), by replacing DEFAULT_VALUES by valid ARGS items % (items different from [], the empty numeric array) % %ARGOUT: ...
% Plot one example of the mixture, groundtruth and separated results for % 2-source conditions clear all; close all; clc sample_i = 126; source_i = 1; % show the first signal SourceNumber = 2; data_dir = sprintf('/vol/vssp/ucdatasets/s3a/Qingju/EusipcoEvalResult/Mixture%d/',SourceNumber) taglegArray = {{'Oracle IBM',...
function output = get_gamma_dot_c_DSEA(t, y, tau_r, config) % Get the control input for the current state and desired reference moment, % using the DSEA method, which is presented in % Valk, L., Berry, A., and Vallery, H., % "Directional Singularity Escape and Avoidance for Single-Gimbal Control Moment Gyroscopes," % ...
classdef NLDemand < Estimate % Estimation and simulation code for nested logit. properties alpha sigma d % Utility without the price effect end properties (SetAccess = protected, Hidden = true ) marketid % Protected? nestCount = 0 nest ...
Btot_PR_map=sqrt(Bpol_PR_map.^2+Btor_PR_map.^2); finesse_data_X=reshape((Rpos_PR_map(:,:)-R0),NP*Nradial,1); finesse_data_Z=reshape(Z_PR_map(:,:),NP*Nradial,1); [XX,ZZ] = meshgrid(X_scale,Z_scale); frame_rank=1001; disp('loading new frame rank#'); disp(frame_rank); f=frame_rank; if (f<10) frame_name='00'; else...
% ------------------------------------------------------------------------ % script to plot ecotron variable anomalies in different periods % initalise close all axcolor = [0.3 0.3 0.3]; cmap_temperature = flipud(mf_colormap_cpt('temperature')); cmap_tas = flipud(cmap_temperature(1:6,:)); cmap_pr = flipud(mf_colorma...
function [area] = energy_enclosed(fn,x,y) %xx = meshgrid(x,x); %yy = meshgrid(y,y); %[xx yy] = meshgrid(x,y); rho = sqrt(x.^2+y.^2); tMin = 0; % angle tMax = 2*pi; rhoMin = min(min(rho)); rhoMax = max(max(rho)); %fn(rho > rhoMax/2) = 0; %fn(rho > 5) = 0; fn rho fn = rho .* fn area...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % CZ4003 - COMPUTER VISION % % LAB 2 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Edge Detection + Hough...
function oe = eci2oe(state, GM) r_ijk = state(1:3); v_ijk = state(4:6); r = norm(r_ijk); v = norm(v_ijk); % Create all necessary vectors hVec = cross(r_ijk, v_ijk); h = norm(hVec); nVec = cross([0, 0, 1], hVec); n = norm(nVec); eVec = (1/GM)*((v^2 - GM/r)*r_ijk - dot(r_ijk, v_ijk)*v_ijk); e = norm(eVec); % Compute...
function [expectation_Psoriasis, expectation_Seboreic, expectation_Lichen, expectation_ptyriasisRosea,expectation_cronisdermatitis,expectation_pityriasisRubraPilaris,variance_Psoriasis,variance_Seboreic,variance_Lichen,variance_ptyriasisRosea,variance_cronisdermatitis,variance_pityriasisRubraPilaris] = compute_expectat...
%THIS code is used to calculate P and F for the given blade; clear clc R=5;%radius of rotor B=3;%number of blades; V_0=10; n=3000/60;%this is the rotational speed in rpm; rho_a=1.225;%the density of the atmosphere; beta_p=0;%pitch angle; n_element=8;%the number of ring elements; omega=n*2*pi;%angular velocity; for i=...
function varargout = shared(varargin) %SHARED Get a shared (owning) reference. % % [{DM} OUTPUT1, {DM} OUTPUT2, {DM} OUTPUT3] = SHARED({DM} ex, char v_prefix, char v_suffix) % [{SX} OUTPUT1, {SX} OUTPUT2, {SX} OUTPUT3] = SHARED({SX} ex, char v_prefix, char v_suffix) % [{MX} OUTPUT1, {MX} OUTPUT2,...
% 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,...
function BW_seedpoints=select_seedpoints(Global_BW,objects_num) % This function is for selecting the large objects in the global detection results % as the seed points for the watershed method % % Input: im_ori = an astronomical image % Global_BW = a binary image which is objects detection results,the value 1 ...
function [H, f, A_constr, b_constr] = make_QP(T, uT, uK, A, B, theta, x0, Qf, qf, Q, q, R, r, Hx, hx, Hu, hu) %%% augmented system form %%% % system is assumed to be in augmented form % % augmented state is [x(t) u(t)]^T % % du(t) is input to augmented system % % input to syst...
% script to test guided filter % calling filtered = guilded_filter(input, guide, epsilon, win_size) original = imread('peppers256.png'); original = double(original); original = original / 255; sd = sqrt(.001); win_size = 5; input = imnoise(original, 'gaussian', 0, sd*sd); guide = input; filtered = guid...
function [ x1, y ] = kesisim( x1, y1, x2, y2 ) y=[]; for k=1:length(x1) y(k)=min(y1(k),y2(k)); end end
function isInside = sys( x, y ) if( x^2 + y^2 < 15 ), isInside = 1 ; else isInside = 0 ; end
%% Homework 3 % Ezra Davis (epd9) %% 1 Linear Independence and basis %% 1a % $\alpha \vec u + \beta \vec v = [6.5, 0.5]^T$ is a linear combination of % $\vec u$ and $\vec b$ by definition because it is the sum of scalar % multiplications of $\vec u$ and $\vec b$. alpha = 2; beta = 1.5; u = [1, 1].'; v = [3, -1].'; alph...
% This script takes as input a sequence of images (specified by dataFile) % and converts them to an aedat-logfile composed of events. % It also converts the ground truth of the flow field between two frames % (given in a flo-file specified by gtFrame) to event-based ground truth (a % mat-file gtEvent with three 2...
function varargout = plot(obj,alpha) plot(obj.Support,0.25) n = obj.N; if(obj.dim == 2) X = obj.Support.unifGrid([n,n]); xplot = X(1,:,1); imagesc(xplot,xplot,obj.Eval);set(gca,'YDir','normal');axis image; elseif(obj.dim == 3) fprintf('Plotting 3D Isosurface...this may t...
function [classifier, err_count, run_time, mistakes, mistakes_idx, SVs, TMs] = HomOTL2_K_M(Y, K1, K2, options, id_list,classifier) % HomOTL2: HomOTL-II %-------------------------------------------------------------------------- % Input: % Y: the vector of lables % K: precomputed kernel for all ...
% 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,...
function [P2final] = Pdepthtest(P2E, K, x1,x2) xtestpoint1 = x1(:,1); xtestpoint2 = x2(:,1); P1 = [eye(3),zeros(3,1)]; P1K = K*P1; xhat1 = inv(K)*xtestpoint1; X = zeros(4,4); Depth = zeros(4,2); for i=1:4 xhat2 = inv(K)*xtestpoint2; A = [P1(3,:).*xhat1(1,1)-P1(1,:);...
function Comprobar(hemi); %% Comprobar si los datos estan corregidos correctamente. %% hemi = 'lh'; % %filter = '.pial'; %afilter = '.aparc.annot'; estnumber = ['-1']; InputDir = '/media/Data/ibas/Compatibilidad_Proyecto_PEPs/Procesamiento_FreeSurfer'; mkdir('/media/Data/ibas/Compatibilidad_Proyecto_PEPs/Procesamiento_...
clear all fig = openfig('series_series_simulation_detailed.fig'); axObjs = fig.Children; dataObjs = axObjs.Children; x_fig = dataObjs(1).XData; y_fig = dataObjs(1).YData; z_fig = dataObjs(1).ZData; Mx=y_fig(:,1); fx=x_fig(1,:)*150e3; z_fig(:,19)=z_fig(:,18); z_fig(:,20)=(z_fig(:,18)+z_fig(:,23))/2; z_fig(:,21)=(z_fig(...
function visualize_map(map,path) %This function visualizes the 2D grid map %consist of obstacles/start point/target point/optimal path. % obstacles for obs_cnt = 2: size(map, 1) - 1 scatter(map(obs_cnt, 1)-0.5,map(obs_cnt, 2)-0.5,250,155,'filled'); hold on; grid on; %g...
% ODE_01.m clear close all clc tMin = 0; tMax = 10; tSpan = [tMin tMax]; y0 = [1,0]; m = 2; b = 0.2; k = 3; K = [m b k]; [t,sol] = ode45(@(t,y) FNT(t,y,K),tSpan,[y0]); y = sol(:,1); %dTdt = sol(:,2); figure(1) xP = t; yP = y; plot(xP,yP) grid on; box on xlabel('t') ylabel('...
function r = dot_product(x,y,z,i1,j1,i2,j2) r = x(i1,j1)*x(i2,j2) + y(i1,j1)*y(i2,j2) + z(i1,j1)*z(i2,j2); end