text
stringlengths
8
6.12M
%% Setup constants ySize = 500; %number of x pixels xSize = 500; %number of y pixels a=4; %radial Cycles per image b=4; %Number of windings per image, 0 = radial grating, phase=pi/4; %transfer function parameters, linear: c50=1000, %Rmax=1001,n=1,rectify=false c50 =.3; Rmax=1; n=17; rectify = true; %% Make image xC...
with = load('xforms_with_padding_short.mat'); without = load('xforms_without_padding_short.mat'); % with = load('xforms_with_padding.mat'); % without = load('xforms_without_padding.mat'); with = with.attr; without = without.attr; %% diff_norm = zeros(numel(with.differences), 1); figure(1); clf; axis([0, 10, 0, 10]) ...
function [scores] = computeCompressionScoresVar( datafile, CTfile ) load(CTfile); size(CT) [CT] = modify_CT(CT) data = textread(datafile); [N f] = size(data) scores = zeros(N,1); for i=1:N d = data(i,:); for j=1:size(CT,1) dims = CT{j,1}; dd = d(dims); els = CT{j,3}; ...
%% Convergence start=tic(); N = 73; pot = zeros(1,N); h = zeros(1,N); for i=1:N pot(i) = integr(1, 1, 17 + i, 'simpson'); h(i) = 1/(17 + i); end plot(h.^4,pot,'o') grid ON xlabel('h^{4}') ylabel('\Phi') time=toc(start) %% error test pot1000 = integr(1, 1, 1000, 'simpson'); errorInt = pot-pot1000; loglog(1./h...
function [output, state, dstate, input] = rk4f(... block,... dt,... time,... Xi,... inputf,... finput... ) numSteps = numel(time); output = zeros(numSteps,block.numOutputs); state = zeros(numSteps,block.numStates); dstate = zeros(numSteps,block.numStates); input = zeros(numSteps,block.numIn...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % Generated by MATLAB 9.7 and Fixed-Point Designer 6.4 % % % %%%%%%%%%%%%...
%ROBOT PARCIAL clc; clear all; syms q1 q2 L1 L2 L3 L4 d T = DH(q1, L1+L2, L3,0)*DH(q2, 0, L4, pi)*DH(0,d,0,0) q1=0.0; q2=0.0; L1=0.2; L2=0.8; L3=0.6; L4=0.4; d=0.2; i=1; flechaDH(0,0,0,0); for q1 = 0.0:pi/24:pi for q2 = 0.0:pi/24:pi/2 for d = 0.0:0.1:0.8 Aux=eval(T); posX(...
function [C, a_status] = map_fill(C, varargin) % % NAME % % function [C, a_status] = map_fill(C [,<floodValue>]) % % ARGUMENTS % INPUT % C class curvature_analyze class % % OPTIONAL % floodValue any value to insert at each map reference % % OUTPUT % C class curva...
vn = tools.makeFitSummaries('data/20150615-nancy/fits', true, 'ASD'); vp = tools.makeFitSummaries('data/20150615-pat/fits', false, 'ASD'); vr = [vp vn]; %% vt = vr; fns = fieldnames(vt); tps = unique({vt.type}); for ii = 1:numel(fns) fn = fns{ii}; if ~isempty(strfind(fn, 'is_')) disp(fn); for ...
%% STK2Datetime.m % Author: Julianna Evans % Date: 08.01.17 % Last Revision: 08.01.18 % Converts STK strings to MATLAB datetime variable based on position of % characters in the string. function [datetimeVAR] = STK2Datetime(stkSTR) % STK string format: 'DD MMM YYYY HH:MM:SS.SSS' %% Check if the STK datetime string ...
opt1D = initOptnlpp4m(); [rhoNew, VpotNew, DNew, VNew, occ, ... efermi, INDNew, HMatNew, iter,update] = metaltest1(opt1D); Npole = 60; T = opt1D.temperature; Gap = 0.0; DeltaE = 2.0; mu = efermi; hs = opt1D.hs; Ls = opt1D.Ls; NsGrid = opt1D.NsGrid; itertol = opt1D.itertol; Ne =...
% 4. Target beats, speed not constant function [CFG, DATA] = EB4(CFG, DATA, test_idx) [CFG, DATA] = EB_Core(CFG, DATA, test_idx);
function [ ] = SpikingGraphVid( spikes,weights,celltypes,voltage ) %UNTITLED Summary of this function goes here % Detailed explanation goes here %% spikes = SimValues.spikes; weights = SimValues.WeightMat; celltypes = ones(length([SimValues.EcellIDX SimValues.IcellIDX])); celltypes(SimValues.IcellIDX) = 2; %% Calcu...
% Kaja Coraor % Comp 590 % Assignment 2 - Part 1 from = imread('airplane small.jpg'); to = imread('ocean small.jpg'); %***************************************************************** % Create mask % e = imfreehand(); % BW = createMask(e, h_im); % mask = BW; %*****************************************************...
function[out] = ARmodel(x) global year p is res t model switch model case 1 % Original Model vals = num2cell(x); [r0,a] = deal(vals{:}); for i = 1:t m(i) = a*i; r(i) = exp(m(i)*i)/((1/r0)-1+exp(m(i)*i)); end case 2 % Model 1 vals = num2cell(x); [r0,a]...
% Test Cases: [out1] = beMyHero(movieOptions1, friendList1, nflxList1, stats1); [out1_soln] = beMyHero_soln(movieOptions1, friendList1, nflxList1, stats1); % out1 => Based on condition 1, X-Men would be a great choice! % [out2] = beMyHero(movieOptions2, friendList2, nflxList2, stats2); [out2_soln] = beMyHero_soln(mo...
// RUN: rm -rf %t // RUN: env CINDEXTEST_COMPLETION_CACHING=1 \ // RUN: c-index-test -test-load-source-reparse 2 local %s -fmodules -fmodules-cache-path=%t -I %S/Inputs \ // RUN: | FileCheck %s // CHECK: complete-module-undef.m:7:1: ModuleImport=ModuleUndef:7:1 (Definition) Extent=[7:1 - 7:20] @import ModuleUnde...
classdef uiTestPKI < matlab.uitest.TestCase properties physician end methods(TestMethodSetup) function createApp(testcase) testcase.physician = PISdisplay; testcase.addTeardown(@delete,testcase.physician); end end methods(Te...
function GetCellSize( obj, mesh ) % Hcell = getStdCell( mesh.cell.N, enumStdCell.Line ); Hcell = StdLine(mesh.cell.N); Vcell = StdLine(mesh.cell.Nz); Vq = zeros( numel(Hcell.rq)*numel(Vcell.rq) ,( mesh.cell.N + 1 ) * ( mesh.cell.Nz + 1 )); hq = repmat(Hcell.rq,numel(Vcell.rq),1); vq = repmat(Vcell.rq,1,numel(Hcell.rq))...
function [optParams] = main(dirname, header, outFile, lambda, noprior, parUse, contactPotential) naa = 20; if isempty(lambda) lambda = 1000; end tstart = cputime; %% read input disp(strcat('start ', dirname)); conpot = 'conpot.free.dun.list'; if ~isempty(contactPotential) conpot = contactPotential; end [l...
clc; clear; close all; %read the images. Original_Image1 = imread('toy_formatted2.png'); Original_Image2 = imread('toy_formatted4.png'); %Apply Gaussian Filtering to the images I1_filtered=double(gaussian_filter(Original_Image1, 2.0)); I2_filtered=double(gaussian_filter(Original_Image2, 2.0)); %get the number of row...
function regenerateClasses(source) error('does not work'); fprintf('Source = %s\nPress enter to continue, or Ctrl-c to stop\n',source); pause; cd(source); classes = classesBFS('-source',source,'-topOnly',true); nclasses = numel(classes); supers = cell(nclasses,...
function scans_to_process = sVBM_warp_timepoint_to_MNI_via_existingpushwarp( scans_to_process, templatepath, smoothingFWHM ) %sVBM_warp_timepoint_to_MNI_via_long - warp from DARTEL space to MNI % % Syntax: scans_to_process = sVBM_warp_timepoint_to_MNI_via_long( scans_to_process, dartelpath) % % Inputs: scans_to_proces...
function cc=consistency_measure_3d(ti,Y) % LBP of TI: [Hti8_1,Hti8_2,Hti8_3]=LBP_3d(ti,8); [Hti12_1,Hti12_2,Hti12_3]=LBP_3d(ti,12); [Hti16_1,Hti16_2,Hti16_3]=LBP_3d(ti,16); for i=1:size(Y,4) i re=Y(:,:,:,i); [Hre8_1,Hre8_2,Hre8_3]=LBP_3d(re,8); [Hre12_1,Hre12_2,Hre12_3]=LBP_3d(re,12); ...
function check = test_rerun() N = 100; A = -5*gallery('grcar',N,3); b = ones(N,1); xi = [5.0523-29.5113i, ... 5.0523+29.5113i, ... 9.3187-25.2383i, ... 9.3187+25.2383i, ... 12.1265-21.3194i, ... 12.1265+21.3194i, ... 14.0793-17.5109i, ... 14.0793+17.5109i, ... 15.4216-13...
function y = oddballtrain(stimuli, trainset, totalstim, probs, minstim, filename, codes, format) % ODDBALLTRAIN Produces a sequence file using the Oddball train paradigm % % ODDBALLTRAIN(stimuli, trainset, totalstim, probs, minstim, filename, path, codes, format) % % stimuli a cell containing the stim...
hold on grid on plot(averagegroup(r5.Host_Peer_Count,rep),averagegroup(r5.DHT_MsgFwd_Count,rep),'bo-') plot(averagegroup(r10.Host_Peer_Count,rep),averagegroup(r10.DHT_MsgFwd_Count,rep),'b*-') plot(averagegroup(r20.Host_Peer_Count,rep),averagegroup(r20.DHT_MsgFwd_Count,rep),'bx-') plot(averagegroup(r30.Host_Peer_...
classdef FixedMultiIndexSet < handle properties (Access = private) id_ end methods function this = FixedMultiIndexSet(varargin) if(nargin==1) this.id_ = MParT_('FixedMultiIndexSet_fromMultiIndexSet', varargin{1}.get_id()); else this.id_ = MParT_('FixedMultiIndexSet_newTotalOrder',varargin{...
function data=acquire(ip_addr,samps,dec,ave_dec) % Red Pitaya Acquire Utility % Borut Baricevic % function data=f_acquire(ip_addr,samps,dec) % % Returns two columns containing the acquired samples on two channels % % ip_addr: Red Pitaya IP address % samp : Acquired samples (max 16k) % dec : Red Pitaya decimation...
figure subplot(3,1,1) plot(x,y,'m') t=title('Voltage with Frequency Span of -20 to 20 kHz') t.FontSize=18; ylim([0 30]) z=ylabel('Voltage (V)') z.FontSize=16; c=xlabel('Frequency (kHz)') c.FontSize=16; subplot(3,1,2) plot(x_1,y_1) t=title('Summation of Delta Dirac Function') t.FontSize=18; ylim([0 30]) z=ylabel('Voltag...
function [ x1, x2 ] = QPNR( a, b, c ) %QPNR obliczanie pierwiastków równania kwadratowego % a,b,c - wspó³czynniki trójmianu kwadratowego % x1,x2 - pierwiastki l1=-b+sqrt(b^2-4*a*c); l2=-b-sqrt(b^2-4*a*c); if abs(l1)>abs(l2) l=l1; else l=l2; end x1=l/(2*a); x2=(-b/a)-x1; end
function [ features ] = extractGaborFilter( image, class, radius ) %% Pobranie wymiarów obrazu. image = cat(3, repmat(image(:,:,1), 1, 1, radius), image); image = cat(3, image, repmat(image(:, :, size( image, 3 )), 1, 1, radius)); image = cat(2, repmat(image(:,1,:), 1, radius, 1), image); image = cat(2, image, repmat...
function [x,y] = epitrochoid(t) % definita tra 0 e 6*pi a=2; b=3; c=1; x = (a-b)*cos(t)-c*cos((a/b+1)*t); y = (a-b)*sin(t)-c*sin((a/b+1)*t); end
% This class provides the framework for both % of the agent types in our model. % Declare consumption, outcome, and behaviour within % that interacts with the Tank % List for both fish, plant in the same arrays classdef (Abstract) Agent < matlab.mixin.Heterogeneous % Must be implemented methods (Abstrac...
function [ WSN_ANNWavelet_Input_DataCell, WSN_ANNWavelet_Target_DataCell, SignalPrediction_Possibilty_YesNo ] = WSN_ANNWavelet_DataPreparation( SensorDataMatrixLabelled_Cell, SensorGroup, FaultyData_YesNo, WindowSize, ContinuousWindow_YesNo, Wavelet_Level, Wavelet_Filter, FeatureEnergySignal_YesNo ) %% Function Input a...
if isunix==0 data_folder='D:\Raw\AlzheimerEEG\Multivariate AFAVA artefact free'; save_folder='D:\Extracted\Alzheimer\Multivariate AFAVA artefact free\AFAVA_1sectrials\'; else data_folder='/home/engbiome/INECO/INECO_fieldtrip/'; save_folder='/home/lspyrou/Documents/results/INECO/'; end %% fidx_patient...
function [ dt,t,w] = parametersTime( t_max,nn ) dt =2* t_max/(nn); % time spacing in s t = linspace(-t_max,t_max,nn); w = linspace(0,1,nn)/dt; end
function [finterp] = bilin_interp(x,y,f,yi,xi) %define lengths and allocate space n = length(xi); m = length(yi); finterp = zeros(m,n); %get four points to interpolate with [idxx,idxy] = interpidx2D(y,x,xi,yi); %loop over all xi's and yi'x for i = 1:n for j = 1:m %get grid point values x0 = x(idx...
%% Segmentation part clc; clear; close all; %% load image img = imread('Dataset/2euro_b1.jpg'); figure;imshow(img,[]); title('image'); %% Preprocessing % Gaussian filter img1 = imfilter(img,fspecial('gaussian',[9 9],2)); figure;imshow(img1,[]); title('Gaussian filter'); % Sharpening img1 = imsharpen(img1); figure...
load SpikeTimeGaussian load GaussianMovieData SetGlobalVals(); load('Global'); % WW(:,1) - Event marker, marks important event on the screen % StimTime - Array that contains the start time of a new event(can be % reapeat or non reapet event) % number of neurons to include N = 251; lengthOfSTAFilter = 4000; numOfSessi...
allPhonemes = {'p' 't' 'k' 'pcl' 'tcl' 'kcl' 'dx' 'm' 'n' 'ng' 'nx' 's' 'z'... 'ch' 'th' 'f' 'l' 'r' 'y' 'pau' 'hh' 'eh' 'ao' 'aa' 'uw' 'er' 'ay'... 'ey' 'aw' 'ax' 'ix' 'b' 'd' 'g' 'bcl' 'dcl' 'gcl' 'q' 'em' 'en' ... 'eng' 'sh' 'zh' 'jh' 'dh' 'v' 'el' 'w' 'h#' 'epi' 'hv' 'ih' 'ae'... 'ah' 'uh' 'ux' 'oy'...
clear; close; clc; %numerical function c = nCr (n,r) c = factorial(n)./factorial(r)./factorial(n-r); endfunction sum = 0; for r = 1:15 sum += r^2 * nCr(15,r) / nCr(15,r-1); end; sum clear; %theoretical r = 15; sum = (-2*r^3 + 45*r^2 + 47*r)./6
% w : 0 or somthing else % 0 means initial condition function general_settings(w,handles) global gsettings cpath = getcurrentdir(); if (w == 0) try load([cpath '\settings.dat'],'-mat','gsettings'); catch gsettings.URL = 'http://web2.clarkson.edu/projects/airlab/software/resuspension_gui/index....
function [cost, grad] = softmaxCost(theta, numClasses, inputSize, lambda, data, labels) % numClasses - the number of classes % inputSize - the size N of the input vector % lambda - weight decay parameter % data - the N x M input matrix, where each column data(:, i) corresponds to % a single test set % labels -...
function presence = thresholdPattern(field, density) % This function takes an input map of values and converts them to a % presence/absence configuration according to the requested density. The % noise pattern is assumed to vary over [0,1], so these are the starting % limits for the bisection method. A hard limit...
% msi3d_dce_cpd % Generates evenly distributed, interpolated binary images between two % input binary images. This approach is inspired by the morphological % skeleton interpolation (MSI) algorithm of Chatzis and Pitas [1]. % Depending on the mode specified, the input images are simplified by % reducing ...
function setSharedAccessStartTime(obj, sharedAccessStartTime) % SETSHAREDACCESSSTARTTIME Sets start time for shared access signatures % The input time should be of type datetime and should be in the UTC time zone. % % % create a policy and set the time to the current time % myPolicy = azure.storage.blob.SharedAcc...
function img_lab = color_rgb2lab( img_rgb ) [h,w,c] = size( img_rgb ); r = img_rgb(:,:,1); g = img_rgb(:,:,2); b = img_rgb(:,:,3); q = [0.3811, 0.5783, 0.0402; 0.1967, 0.7244, 0.0782; 0.0241, 0.1288, 0.8444]; % TODO: RGB to LMS l = q(1) * r + q(4) * g + q(7) * b; m = q(2) ...
% subplt8.m ---------------------------------------------------------- % % - This script shows a slight expansion of the ideas found in subplt.m % by increasing the number of axes from 3 to 8. Also the axes are % arranged in two columns which allows the use of two different x axes % (one for each column). % - Note that...
function [raschModel] = raschModel(betaN, deltaI) N = length(betaN); I = length(deltaI); raschModel = 1./(1+exp(ones(N,1)*deltaI-betaN*ones(1,I))); end
function price = calcHigh ( speedAboveLimit ) if (speedAboveLimit > 0) if (speedAboveLimit < 16) price = 2600; elseif (speedAboveLimit < 25) price = 4900; elseif (speedAboveLimit < 35) price = 7800; elseif (speedAboveLimit >= 36) price = 9000; end else price =...
function dirsoundok = EDB2directsound(eddatafile,S,R,visplanesfroms,visplanesfromr) % EDB2directsound - Checks if the direct sound is valid. % Checks if the direct sound path from a number of source % points to a number of receiver points are obstructed by any planes. % % Input parameters: % eddatafile The name ...
function [smap,scanpath,smaps] = saliency_model(model_name,input_image_path) disp(input_image_path); %read image input_image = imread(input_image_path); %set output size parameters [M, N, C] = size(input_image); % get saliency map: switch nargout(model_name) case 1 [smap] = feval(model_name, input_image, input_...
function [ newnet ] = concat( net,varargin ) %HORZCAT layer = struct('wij',net.wij,... 'bi',net.bi,... 'activation',net.activation_fcn); nVarargs = length(varargin); for k = 1:nVarargs layer = [layer,struct('wij',varargin{k}.wij,... '...
%% Proyecto LTDS %% Primero % Cargamos imagen RGB Img = imread('lena_rgb.png'); % Creamos tres variables cada una con un color R, G y B ImgR = Img(:,:,1); ImgG = Img(:,:,2); ImgB = Img(:,:,3); % Guardamos tamaño y número planos de colores [m n p] = size(Img); % Mostramos las cuatro imagenes imshow(Img); pause imsho...
clc; clear all; close all; P =importdata('movedg1.dat'); w= "P:\sem8\project 3d mapping\im\im_"; w1= "P:\sem8\project 3d mapping\imrgb\irgb_"; image=[]; rgb=[]; for j = 1:20:798 load(sprintf('%s%d',w1,j)); load(sprintf('%s%d',w,j)); im = zeros(size(i,1),size(i,2),3); if (j>=2)...
syms theta d y a alpha [cos(theta) -sin(theta) 0 0; sin(theta) cos(theta) 0 0;0 0 1 0; 0 0 0 1]... *[1 0 0 0; 0 1 0 0; 0 0 1 d; 0 0 0 1]... *[1 0 0 0; 0 1 0 y; 0 0 1 0; 0 0 0 1]... *[1 0 0 a; 0 1 0 0; 0 0 1 0; 0 0 0 1]... * [1 0 0 0; 0 cos(alpha) -sin(alpha) 0; 0 sin(alpha) cos(alpha) 0 ; 0 0 0 1] % [...
function [cbc_unstack,cbc_flag_unstack]=ReorganizeCBCData( cbc) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here %% recode loinc and flag : so when unstack the labels for the lab are clear [sql_loinc,code_cbc]= GiveListLoincCBC; cbc.loinc_l=cbc.loinc; for l=1:length(code_cbc) cbc.lo...
%% Name - Sheel Nidhan % Date - 15 December, 2019 % Code for plotting the centerline statistical quantities from re5e4 frinf % data clear; addpath('./aux_plots/'); dirout = './'; %% Figure 1 - Plotting the defect velocity and wake width based on that as a function of x/D close all; figure; x0=0; y0=...
clc; clear all; close all; rand('seed', 1e6) randn('seed', 1e6) %% Data Preparation load NewsvendorData_Label; [~,train_]=size(Dtrain); %% Compulsory Parameters n_hid1 = 10; %First hidden layer n_hid2 = 100; %Second hidden layer D = size(XtrainB, 1);%Number of input features [~, O] = size(unique(Ltrain)); %% Junbin'...
%% Machine Learning, Stanford University % Insert all learning and examples here.
function [coefs approx] = noteDct(x, Ndct, sr) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [coefs approx] = noteDct(x, Ndct, sr) % % Description: Compute the DCT of a signal and approximate it with the % first Ndct coefficients x is the signal Ndct is the number ...
function S_ = MBMP_STAP2(Y,A,D,e,Z) %% Inputs % Y - Measurement vector % A - Dictionary matrix % D - Branch vector % e - threshold parameter % Z - Secondary data %% Outputs % S_ - Set of targets %% Initialization [N,L] = size(Z); % R = Z*Z'/L; R = sqrtm(Z); Y = R*Y; A = R*A; D = [D ones(1,size(A,2)-length(D))];...
%Terminou um runAll, limpou: %http://www.mathworks.com/help/matlab/ref/restoredefaultpath.html %Faz uma pasta com mkdir, bota as imagens e sai dela com ajuda do cd. %https://www.mathworks.com/help/matlab/ref/mkdir.html %https://www.mathworks.com/help/matlab/ref/cd.html %Manda todas as imagens lááá para dentro do LaTeX:...
% %Leemos nuestra imagen DICOM % img=dicomread('brain_014.dcm'); % %Le damos un formato doble a nuestra imagen con im2double y luego le % %damos un ajuste % imgp1=im2double(img); % imgp1=imadjust(imgp1); % %Multiplicamos pixel por pixel nuestra matriz % imgp1=imgp1.*255; % imgp1...
clear all clc stepLength = 0.0001; threshold = 10^-6; mu = [1 10 100 1000]'; startingPoints = [1 2]; for i =1:length(mu) xMinimum(i,:) = RunGradientDescent(startingPoints,mu(i),stepLength,threshold) ; end x1 = xMinimum(:,1); x2 = xMinimum(:,2); tab = table(mu,x1,x2)
function WriteOutFSResultImages(Locations,Values,OutFile) %BasePath = '/share/users/js2746_Jason/Studies/ModMedCogRes/Model58_XAgeGroup_MFreeSurfer_YFluid_WCogRes_VCogRes_COVnGMV_Sex_StudyID_Nboot5000_18-Mar-2013_11-11'; %P = fullfile(ResultsFolder,'BrainToParameters_JASON.nii'); if ismac BasePath = '/Users/jason/...
clear all; close all; a=0:10; b=sin(a); subplot(2,1,1); plot(a,b); xlabel('a'); ylabel('y=sin(a)'); grid; title('sin(a), entre a=0:10'); a=0:0.1:10; b=sin(a); subplot(2,1,2); plot(a,b); xlabel('a'); ylabel('y=sin(a)'); grid; title('sin(a), entre a=0:1:0.1:10');
clc clear all close all delete(instrfindall) s=serial('COM4'); // the same port number with Arduino set(s,'BaudRate', 115200); // BaudRate shall be the same with Arduino fopen(s); figure(1) subplot 311 title('yaw') subplot 312 title('pitch') subplt 313 title('roll') Yaw(1) = str2double(fscanf(s)); Pitch(1) = str2do...
clear clc close all m1 = 1; m2 = 1; L1 = 1; L2 = 1; delta_t = 0.001; final_time = 10 t = 0:delta_t:final_time; t = t'; t_plot = 0:0.001:9.998; t_plot = t_plot'; sizes = size(t); y = 0.3*sin(5*t) + 0.4*ones(sizes(1),1); x = 0.3*cos(5*t) + 0.2*ones(sizes(1),1); cos_theta2 = (x.^2 + y.^2 - L1^2*ones(sizes(1),1) - L2^...
function [xs,ys,info] = sedumi2csdp(As,bs,cs,K,opts) % function [x,y,info] = sedumi2csdp(A,b,c,K,opts); % % DESCRIPTION % This function solves a cone optimization specified in Sedumi format % using the CSDP solver. The function converts the inputs from % Sedumi format to CSDP format, solves the problem with CSD...
mergeh5_chunks('2019-08-08', 6500) ;
import sqc.op.logical.* %% %% Fig 1.1 % let the first 3 bits be data bits, the last 2 bits be measure bits: % '|measure_bit_1,measure_bit_2,databit_3,databit_2,databit_1>' % disp('|measure_bit_2, measure_bit_1, databit_3, databit_2, databit_1>'); InputS = QState('|00000>+|00111>'); % InputS = QState('|00001>+|00110>');...
function updatePlotFcn(h,data) %UPDATEPLOTFCN is an example function for updating a line plot % Copyright 2015 The MathWorks, Inc. % update x axis x = datenum(data.lastUpdate); h(1).XData(end+1) = x; h(2).XData(end+1) = x; h(3).XData(end+1) = x; % update y axis h(1).YData(end+1) = data.crzy_bid; h(2).YData(end+1) = ...
% pltvar.m ------------------------------------------------- % To demonstrate the workspace plotter, this script creates several vectors % in the workspace (including a structure containing two vector fields) and % then starts the workspace plotter by calling plt with no arguments. % ----- Author: ----- Paul Mennen % ...
run('/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl/load_recorded_data.m') run('/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl/Initialization.m') %% Defining constants global d_1, d_1 = 0.0892; % [m] global a_2, a_2 = -0.425; % [m] global a_3, a_3 = -0.39243; % [m] global...
%% Build link capacity function [ token_matrix ] = build_tokens(conn, wdm_order, c_lrpon, small_br) token_matrix = zeros(size(conn,1),size(conn,1),wdm_order); for i = 1:wdm_order token_matrix(:,:,i) = c_lrpon./small_br.*conn; end end
function [ spos, s ] = LsqFitStressCalc( upos, ucalc, E, nu, spacing, winsize ) %LSQFITSTRESSCALC directly calculates local LSQ fitted displacement field % gradients to obtain material strains which are then used % to compute stresses. Based on code by Tobias Schoch. %Input: % <upos> ...
function write_tif_raw(img,name) %% img=single(img); t = Tiff(name,'w'); tags.ImageLength = size(img,1); tags.ImageWidth = size(img,2); tags.Photometric = Tiff.Photometric.MinIsBlack; tags.BitsPerSample = 32; tags.SampleFormat = Tiff.SampleFormat.IEEEFP; tags.RowsPerStrip = 16; tags.PlanarConfiguration = Tif...
classdef TPA_MultiPatchTracking %TPA_MultiPatchTracking - implements image tracking techniques % using multiple patches %----------------------------- % Ver Date Who Descr %----------------------------- % 06.01 28.11.17 UD Adopted to TPA % 05.08 20.11.17 UD Connection between patche...
function [x_hat_min, Sigma_min] = KF_propagate(x_hat_plus, Sigma_plus, u, sigma_u, dt) x_hat_min = x_hat_plus + u * dt; Sigma_min = Sigma_plus + sigma_u^2; end
function [ax, C, R] = GetConicParameters(Ch) s=size(Ch,1); if Ch(3,3)>0 Ch = Ch/-Ch(3,3); end C = -Ch(1:s-1,s); T = [eye(s-1),-C]; T = [T; [zeros(1,s-1) 1];]; Chcenter = T*Ch*T'; Chcenter = 0.5*(Chcenter+Chcenter'); [ V, D ] = eig(Chcenter(1:s-1,1:s-1)); ax = sqrt(abs(diag(D))); R = V; end
function [k, b] = get_line(x1, y1, x2, y2) k = [y2 - y1, -(x2 - x1)]; b = y2 * (x2 - x1) - x2 * (y2 - y1); end
% this routine is to realize the contour for the MCMC simulation result % It uses the former simulation result sampling.mat % also, it use a code from http://www.mathworks.com/matlabcentral/fileexchange/1487 % % Yiming Hu, Oct, 2012 load sampleing; mYX = [chain(:,1),chain(:,2)]; vXEdge = linspace(0,4,400); vYEdge = l...
function periodHours = getPeriodHours(system_info) days = diff(system_info.settings.year_divisions_days); days = [system_info.settings.year_divisions_days(1); days]; DayHours = system_info.settings.day_divisions_hours(:,2)-system_info.settings.day_divisions_hours(:,1); NightHours = 24 - DayHou...
function net=load_network(opts) net=load(fullfile(opts.modelDir,opts.modelName)); net=net.net; net.layers{end}.type='softmax';
function name = getBlockNameFromHandle(hBlock) % Convert block handle to block name % % name = getBlockNameFromHandle(hBlock) % % Given a block handle (e.g. as returned by gcbh), determine the name of the block % (e.g. as returned by gcb) name = getfullname(hBlock); % correct odd issue with newlines appearing ...
function[a] = q4(p,n) n = input(prompt); a = zeros(n,n); ele1 = p; ele2 = (1-p)/((n^2)-1); a(:,:) = ele2; a(1,1) = p; a; end
function fig = genJumpPlot(experiment, plotTitle, plotFiltered) % VARIABLES % experiment: An experiment data structure as generated from % getExperimentData(). % plotTitle: Optional argument for the title of the plot generated. % Defaults to 'Filtered RSSI vs Time'. % ...
%% 3D Finite Element Cubic Interpolation (Residual Approach / TE16) % % Author: Gustavo Charles P. de Oliveira % Date: November, 2010 % Updated: October, 2013 % % Description: Code to develop a cubic interpolation for finite % element on 3D-space. Basically, we fit an arbitrary function over pattern % element ...
function myGammaPosition = GammaPosition(aBot,aStrikeVec) myTrades=aBot.ownTrades; myStockTrades=find(strcmp(myTrades.ISIN,'ING')); myStockVolumes=zeros(length(myStockTrades),1); for i=2:length(myStockTrades), myStockVolumes(i)=myTrades.volume(myStockTrades(i))*myTrades.side(myStockTrades(i)); end myStockPositio...
function [FeatureVector] = momentsALI(im) %im=imread(filename); im=double(im); s=strel('disk',1,0);%Structuring element F=imerode(im,s);%Erode the image by structuring element Bound=im;%-F; [rows,cols] = size(im); x = ones(rows,1)*[1:cols]; % Matrix with each pixel set to its x coordinate y ...
function [biny,sep]=en_zone_sub_new(r,kcr,biny) p1=1-1/4-1/16+1/64; p2=1-1/4+1/16; if kcr<160 %kcr criterion needs to be checked further nsep=2; p=[p1 p2]; biny=[biny SFcode(1,5)]; elseif kcr<450 nsep=3; p=[p1 p1 p2]; biny=[biny SFcode(2,5)]; elseif kcr<3600 nsep=4; p=[p1 p1 p1 p2]; biny=[biny SFcod...
filefolder = 'C:\Users\praveen\Desktop\imgp\8\Input Images\'; imagefiles = dir(fullfile(filefolder,'*.*')); nfiles = length(imagefiles); for i=[3] filename = imagefiles(i).name; fullfilename = fullfile(filefolder,filename); im2 = imread(fullfilename); im = im2double(rgb2gray(im2)); [rows,co...
% SPHSP Spherical Sample Points % maps a set of point evenly space in elev and angle to another % set of point which is evenly space in distance along the sphere. el_start = -pi/2; el_end = pi/2; el_incr = pi/30 az_start = 0; az_end = pi; az_incr = pi/30; % generate a set of points evenly spaced in radians...
% generate ellipse a = [ 1; 2; 3; 4]; f = fopen('plane.txt', 'w'); for y = 0:4 %y += (1 * rand(1, n) - 0.5) / 10; for x = 0:4 %x += (1 * rand(1, n) - 0.5) / 10; z = (a(1) * y + a(2) * x + a(4)) / a(3); % (1 * rand(1, n) - 0.5) / 10; fprintf(f, '%.2f,%.2f,%.2f\n', x, y, z); end end fclose(f);
% load data for train data_path = '../data/data_without_events.txt'; raw_data = load(data_path); raw_data = raw_data(1:10000,:); normal_dataset = create_normal_dataset(raw_data); save('normal_dataset.mat','normal_dataset');
%% generate_parents.m % according to the cumulative probability arrays, pick a desired number of % parent pairings % m x 2 array of parent pairings % Round num_parents up to closest even num % # parents proportional to pop'n size (1 = same as pop'n size, will % produce half as many children) function parent_mat = gen...
% Weaver Image Reject Filter clc;clear all; costheta = 0:.01:1; theta = acos(costheta);%rad figure;title('IRR (dB) vs Theta (rad)'); xlabel('Theta'); ylabel('Image Rejection Ratio'); hold on; %case1----> epsilon = 0 IRR1 = IRR_fun(0.00,costheta);plot(theta,IRR1,'*m'); %case2----> epsilon = 0.25 IRR2 = IRR_fu...
function G = kronMatrix( varargin ) % % G = kronMatrix( varargin ) % % Constructor for the kronMatrix class. This class is used to % represent objects of the form: % \sum [A{i} (x) B{i}] % % Object's fields are: % G.a = cell array containing A{i} if i>1. % G.b = cell array containing B{i} if i>1. ...