text
stringlengths
8
6.12M
clearvars close all clc res = suma_z_przedzialu_f2(8); disp(res);
N = 512; n = 0:1:N-1; x = cos((2*pi*n)/10); fprintf("X = DFTsum(x)") t = cputime; X = DFTsum(x);cputime-t A = DFTmatrix(N); x2 = transpose(x); fprintf("X = A * x") t = cputime; X2 = A * x2;cputime-t
classdef nuclearIdentity < basicIdentity & nuclearProxDual properties end methods function obj = nuclearIdentity(alpha,dims) obj = obj@basicIdentity(alpha,dims); end end end
% function out = popup_obstacles(u) global dt p_i p_f p_task NUM_UAV NUM_TASK cnt chk_range global wpt_list task_list wpt popup % % load Obstacles_LLH.mat % Obstacles_LLH(:,2:3) = Obstacles_LLH(:,2:3) ; D2R = pi/180; scale = 1 ; load Obstacles_LLH.mat % Obstacles_LLH(:,2:3) = Obstacles_LLH(:...
function daneCut=prepareData(subj) electrodeSet=[10,15,21,23,28,39]; %81 Fs = 256; % Sampling Frequency N = 4; % Order Fc1 = 49; % First Cutoff Frequency Fc2 = 51; % Second Cutoff Frequency h = fdesign.bandstop('N,F3dB1,F3dB2', N, Fc1, Fc2, Fs); Hd = design(h, 'butter'); Fc1 = 8; % First Cutoff Frequency ...
% Check whether a sequence of number is graphical, i.e. a graph with this degree sequence exists % INPUTs: a sequence (vector) of numbers % OUTPUTs: boolean, true or false % Note: not generalized to directed graph degree sequences % Source: Erdős, P. and Gallai, T. "Graphs with Prescribed Degrees of Vertices" [Hungaria...
%PSO %Copyright:jiaowenlong %2017.4.17 clc clear %设置问题相关变量 popsize=2000;%个体数量 degree=100;%循环次数 [popmax,vmax]=Init(popsize);%初始化求最大值群体的位置和速度 [popmin,vmin]=Init(popsize);%初始化求最小值群体的位置和速度 %计算初始群体的适应度,群体最优个体 [value_max,gbestvaluemax,gbestmax]=calfitvaluemax(popmax); [value_min,gbestvaluemin,gbestmin]=ca...
% Loads s-parameters from adress "path" and antennas s1 and s2 % Returns an array with two columns % Column 1 is the frequency % Column 2 is the complex S parameter function [data] = loadData(path,s1,s2) currDir = pwd; cd(path); sParam = strcat('S',num2str(s1),'_',num2str(s2)); fileName = strcat(sPar...
function ijObj = ijStart %ijStart: open ImageJ's main menu % % $Id: ijarray2plus.m 311 2008-07-31 20:25:12Z histed $ %global IMAGEJ_OBJ %if isempty(IMAGEJ_OBJ) % ijObj = ij.ImageJ(); % IMAGEJ_OBJ=ijObj; %else % ijObj = IMAGEJ_OBJ; %end %ijObj = ijObj = ij.IJ.getInstance; if isempty(ijObj) ijObj = ij.Imag...
function [] = parseTiles(scanFile, regions, wavelengths, varargin) p = inputParser; p.addRequired('scanFile', '', @ischar); p.addRequired('regions'); p.addRequired('wavelengths', @(x)validateattributes(x,{'numeric'})); p.addParameter('parse',true,@islogical); p.addParameter('inDir', '', @i...
% Finds various properties of a drone configuration % Clear workspace and command window clc clear fprintf('>> %s\n', mfilename) % Distances travelled: % Vehicle has to travel the listed distance with the payload, it at % the target, then travel the listed distance without the payload % These distances are in...
## Copyright (C) 2023 Gabriel Zalles ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distri...
% For each mask (ROI), % computes BIC for each model for each subject % populates the log model evidences array (rows = subjects, columns = % models) which gets passed to BMS % which estimates the excedence probabilities (????) % % % which ROIs to look at (one at a time) as paths to nifti files roi_m...
% CMPU250 - Professor Eric Aaron % HW2 - Kyle Patterson % April 2018 % #################################################################### % ### ### % # ...
function score=DoG_based(im1,im2) %% parameters sigma1 = 0.65; sigma2 = 0.2; ksize = 5; num = 100; pad = 24; imsize = 160; blm = 0.33; %% reading images and create image for each layer a0 = imread(im1); a0 = imresize(a0,[imsize,imsize]); a0pad = imgpadding(a0,pad); a1 = calc_next(a0); a1pad = imgpadding(a1,pad); a2 =...
function d = distance(x,y,x0,y0) d = sqrt((x0-x)^2+(y0-y)^2);
function nii_subtract (P,N, outname); % Adds all 'P'ositive images, Subtracts all 'N'egative images: saves result % P = filenames to add (optional) % N = filenames to subtract (optional) % outname = filename of output (optional) % if not specified, prefix 'sum' appended to first filename % % Example % nii_su...
function [ORFlength, start_pos, stop_pos] = findORF(dnaseq) %Function to find the length of the longest open reading frame of a %sequences called dnaseq dnaseq = upper(dnaseq); %fill in here. ' startCodon = 'ATG'; stopCodons = {'TAA'; 'TGA'; 'TAG'}; finalStart = 1; finalStop = 0; found = false; % this becomes true once...
%Stack several green functions function GFstack %All Green functions' name are saved in gfname.txt GfFile='gfname1.txt' seisfile = cell(1,1); % read green file name to seisfile fdf = fopen(GfFile,'r'); kk = 1; while feof(fdf) ~= 1 seisfile{kk} = fscanf(fdf, '%s', 1); kk = kk + 1; end seisfile FileNum = kk - 1;...
clear all % close all clc tic %% plot data data = csvread('data/VehA_dip_min.csv'); data = data(300:1200,:); data(:,1) = data(:,1) - data(1,1); % normalize time stamps % save('data.csv','data') % figure; % plot(data(:,1),data(:,2)); % follower speed m/s % hold on % plot(data(:,1),data(:,3)); % leader speed m/s % % pl...
function sinoOut = binningDetecotRows( sinoIn, k ) % combine multiples rows of the detector for FDK method % % Meng Wu at Stanford Univeristy % 2012 - 2013 if nargin < 2 k = 2; end if k <= 1 sinoOut = sinoIn; return; end if mod( k , 2) == 0 h = [ 1/2; ones(k - 1, 1); 1/2 ] / k ; else h = ones(k,...
function [y_puss,y_puss_mlpg] = parametric_uss(units_list,units_path,spssynthdir,fname) % Purpose: Synthesize from parametric form of units zstr_full = 'u_000000'; mgc_path = strcat(units_path,'mgc/'); lf0_path = strcat(units_path,'lf0/'); bap_path = strcat(units_path,'bap/'); Y_mgc = []; Y_lf0 ...
% Code used for the analysis of aircraft loads. % Calculate cosines for each beam for i = 1:size(beams,1); x1 = nodes(beams(i,2),2); x2 = nodes(beams(i,3),2); x3 = nodes(beams(i,4),2); y1 = nodes(beams(i,2),3); y2 = nodes(beams(i,3),3); y3 = nodes(beams(i,4),3); z1 = nodes(beams(i...
function data = CGNG_data disp('Welcome to our Experiment!'); data.nr = input('Subject Number: '); data.training = input('Training?: (0/1) '); data.baseline = input('Memory Baseline? (0/1): '); if data.baseline == 0 data.colors = input('Colors? (0/1): '); end if data.training == 0 data.age = input('Age? '); ...
% Clear command window: clc; % Close figures: try close('all', 'hidden'); catch % do nothing end % Closing figures might fail if the CloseRequestFcn of a figure % blocks the execution. Fallback: AllFig = allchild(0); if ~isempty(AllFig) set(AllFig, 'CloseRequestFcn', '', 'DeleteFcn', ''); delete(AllFig); end...
%input I, matrice dell'immagine %input hp, (~8) spatial radius %input hc, (~16) range radius %input sc, (~16) scala clisterizzazione(risoluzione di grigi o colori) %input mc, (~50) segmenti con meno mc pixel vengono ignorati %output MSF, immagine filtrata con mean shift %output MSC, collezione dei cluster, gray-->MSC m...
function ThisSolution = callHeuBF(ThisInsData) %callHeuBF 调用BF算法 TODO 增加预处理后的影响 % 输入 % ThisSortedInsData 算法计算数据集 % 输出 % ThisSolution 包含*解*的数据集结构体 %% function callHeuBF(ThisInsData) % Local Functions: % # getAvailableVehicles % # findBestFitVehicle TODO 待写 ThisSortedInsData This...
% Verification of sampling theorem tfinal = 0.05; t = 0:0.00005:tfinal; fd = input('Enter the analog frequency :'); xt = sin(2*pi*fd*t); fs1 = 1.3*fd; n1 = 0:1/fs1:tfinal; xn = sin(2*pi*fs1*n1); subplot(3,1,1); plot(t,xt,'b',n1,xn,'r*-'); title('Undersampling plot '); fs2 = 2*fd; n2 = 0:1/fs2:tfinal; xn = sin(2*pi*...
function [training_set_norm, testing_set_norm] = split_train_test(features) % load new_features_63744 %Splitting the dataset into train and test training_set = zeros(32*15, size(features,2)); training_set_norm = zeros(32*15, size(features,2)); testing_set = zeros(637-(32*15),size(features,2)); testing_set_nor...
% To make N*M classification % Idx1 is labels of N % Idx2 is labels of M % re_Idx is labels of final function re_Idx = classify_xu(Idx1,Idx2,N,M) re_Idx = zeros(size(Idx1)); for i = 1:N for j = 1:M for t = 1:365 if Idx1(t) == i && Idx2(t) == j re_Idx(t) = ...
function [result, success] = attack(mpc, x, alg, verbose) if (nargin < 4), verbose = 0; end if (nargin < 3), alg = 'pdipm'; end % or tralm result = mpc; result.branch(:, 3:4) = [x x] .* result.branch(:, 3:4); opt = mpoption('out.all', 0, 'verbose', 0, 'opf.ac.solver', alg); result = runopf(resul...
function [mrk,cnt,mnt] = tl_proc_loadData(subj_code,phase_name) if nargin<2 [mrk1,cnt1,mnt] = tl_proc_loadData(subj_code,'Phase1'); [mrk2,cnt2] = tl_proc_loadData(subj_code,'Phase2'); [mrk3,cnt3] = tl_proc_loadData(subj_code,'RT'); fprintf('Concatenating phases...\n') if not(isempty(mrk3)) ...
function [V_Tr] = Calc_V(AcelT,DcelT,PulsesIni,PulsesFin,Time) %Poli4_Pos(t0,t1,x_0,v_0,v_1,a_0,a_1) %Poli1_Pos(t0,x_0,v_0) %Rep_Tr(Tr1,Tr2,Tr3,t0,t1,t2,t3) %Pulses(t0,t1,x_0,v_0,v_1,a_0,a_1) syms v t; PulsesAcel=Pulses(0,AcelT,0,0,v,0,0); PulsesDcel=Pulses(0,DcelT,0,v,0,0,0); Total_Pulses=PulsesAcel+PulsesDcel...
% Creates folder if does not exist function folder_create(folder) if(exist(folder,'dir')~=7) success=mkdir(folder); if(success==0); fprintf('impossible to create directory %s\n',folder); end end end
function makeTexture_GA %make closed contour stimuli for the V4 GA; generate mask in addition if %selected %we use an offscreen window to generate these textures so that we can %activate anti-aliasing global screenPTROff screenNum Mstate %get screen size screenRes = Screen('Resolution',screenNum); %get parameters...
% fclose(ser); delete(instrfindall); instrfindall clc
function pass = uq_SVR_test_AllCombined( level ) %UQ_SVR_TEST_ALLCOMBINED test (most of) all possible combinations of %major parameters. The search space has been reduced so that the results %may not be meaningful. The aim here is only to make sure that everything %wil run. % Input : level % - normal: all combined o...
function [rotationMtx, movedPoints] = fitPointsToScalp(scalp,fiducials,electrodes,headshape) %fitPointsToScalp - Find a rigid transformation the best fits 2 sets of points %function [rotationMtx, movedPoints] = fitPointsToScalp(scalp,fiducials,electrodes,headshape) % Uses function: rigidRotate % % scalp = face vert...
% % input: m=matrice non orientata % % orienta la matrice rispettando la sincronizzazione delle DM % cioè in tutti gli angoli ci sono 1, mentre in alto a destra 0 % % output: a=matrice orientata % function [a] = orientaDM(m) l=length(m); a=zeros(l,l); %caso 1: lo 0 è nell'angolo in alto a sinistra if (m(1,1)...
function [ xm ] = deviation_rayon( x,u,z,thetaD ) %DEVIATION_RAYON Summary of this function goes here % Detailed explanation goes here xs = x - z*(x-u); thetaM = atan(x-u) + thetaD; xm = xs + z*tan(thetaM); end
Sample_time = 1; constant_model = containers.Map; constant_model("1") = [4 6]; constant_model("0") = [2 3]; t_data = unifrnd (0, 0.5, 20, 1); ret = random_set_partial_sequence( t_data, constant_model ); disp(t_data); disp(ret);
function mu = getmu(q0,x,y) % mu = getmu(q0,x,y) TWratio = 2.2; g = 9.801; yt = 15e3; Is = 2156; vt = 420; mu = TWratio * g * yt * (1/tand(q0)-1/tand(cal_deg(0,0,x,y)))/Is/vt; end
function [outputImage] = enhanceHistogram( originalImage ) %EnhanceHistogram function uses histogram equalization to enhance images. % Histogram equalization on greyscale images. greyscaleImage=rgb2gray(originalImage); outputImage = histeq(greyscaleImage); end
function auc = auc(vector) %this function returns a scalar value that tells us the area under the %curve for the following curve made from the input vector : we have the %number of values in vector that are greater than a threshold v/s the %threshold. The assumption is that all values in vector lie between 0 and %1. %...
function DETS = runfacedet(I,imgpath) fileID = fopen('varin_2.txt','r'); % image full path varin_2 = fgets(fileID); fclose(fileID); tmppath=tempname; pgmpath=[tmppath '.pgm']; if nargin<2 detpath=[tmppath '.vj']; else detpath=[imgpath '.vj']; end imwrite(I,pgmpath); %root=[fileparts(which(...
close all; clear all; clc; addpath('./utils/'); db_name = 'MNIST&USPS'; param.choice = 'evaluation_PR_MAP'; loopnbits = [32 64]; num_test=500; runtimes = 1; % change several times to make the rusult more smooth param.pos = [1:10:40 50:50:1000]; % The number of retrieved samples: Recall-The number of retrieved samp...
%% DATA ANALYSIS clc clear all close all %% Load data % read the data file %dataPath = '/Users/Paolo/Documents/AAU/2015-2016/Fall Semester Project/MYO-SMC705/pd_patch/results/'; %addpath( dataPath); fid = fopen( './tasks_CLEANED.txt'); data = textscan( fid, '%f%f%f%f%f%f%s', 'delimiter', {' ',';'}); fclose(fid); % ...
function restored_image=dequan_dct_coef(quantized_coef,width,height,QTAB) n_bw=width/8; %宽方向方块数 n_bh=height/8;%纵方向方块数 restored_image=zeros(height,width,'uint8'); %没有使用uint8,防止溢出以便观察解码输出和编码前是否一致 %(三)按块反量化及填入图片 for i=1:n_bh for j=1:n_bw dequantized_coef=dequantize(quantized_coef(:,(i-1)*n_bw+j),QTAB);%反量化 restored_...
function [c] = number2letters(u) w= ["one" "two" "three" "four" "five" "six" "seven"... "eight" "nine" ]; r=["eleven" "twelve" "thirteen" "fourteen" "fifteen" "sixteen"... "seventeen" "eighteen" "nineteen"]; y=["ten" "twenty" "thirty" "forty" "fifty" "sixty"... "seventy" "eighty" "ninety"]; t=["hundred" "te...
addpath('../controllers'); addpath('../solvers'); addpath('../trajectory_generator'); addpath('../classes'); addpath('../utilities'); addpath('../'); addpath('../../matlab_utils/src/'); addpath('../structs_rosbagsData/'); addpath('../transform_estimator/');
N = 100; %Number of runs in a sequence random_number_tracker = zeros(1,N); %row matrix of zeros to keep track of the random numbers generated. for i=1:N random_number_tracker(1,i) = rand; %populating the matrix end %Now, lets find out the sample mean mean = sum(random_number_tracker)/length(random_number_tr...
% Test Cases: [woven1] = sweaterWeather('Tebs iet erasrpdsetri l h ie', 'h ettm owa tie wae saltetm!') [woven1_soln] = sweaterWeather_soln('Tebs iet erasrpdsetri l h ie', 'h ettm owa tie wae saltetm!'); % woven1 => The best time to wear a striped sweater is all the time! % Output variable(s) should be identical to...
function [ret] = pcz_latex_vpa(A,disp_mode,sed_user,prec) %% % % file: pcz_latex_vpa.m % author: Polcz Péter <ppolcz@gmail.com> % % Created on 2016.04.02. Saturday, 09:51:45 % % Examples: % pcz_latex_vpa(M,2, { 'Dd_' '\\\\dot\{\\\\delta\}_' ; 'd_' '\\\\delta_'}) if nargin < 2 || isempty(disp_mode), disp_m...
datos [t, x] = mrk4(f, intervalo, x0, N); graficas
%Pupil Gen npix= 256; %number of pixels across the pupil diameter lambda= 700.*10^-9; error= 10*10^-9; pupil=[]; %ncount=[]; %mcount=[]; %counter=1; %G_mat=[]; success=1; %Scanning through Z -35 to Z 35 %% for n=0:5 for m=-5:5 %ncount(counter)=n; %mcount(counter)=m; %counter=counter+1; ma = abs(m); if m==0 & n==0 ...
function [Factor,eigenvector] = DFM_extraction(X, plag, K, type) % Function returning filtered factors from a DFM either with PCA or % filtered and smoothed with Kalman. %-------------------------------Inputs------------------------------------- % X: Dataset from which the factors should be extracted (t x N) % plag:...
% bias plot close all; clear all; hold all; clc; load('GMLE-bias-T10'); h10=plot(batchsizes,bias); clear fiscpn i k l n p p_idle p_succ_cond_idle prb_stop_slot D GMLE load(['GMLE-bias-T20']); h20=plot(batchsizes,bias); clear fiscpn i k l n p p_idle p_succ_cond_idle prb_stop_slot D GMLE load(['GMLE-bias-T30']); h30=...
function folder_processing(varargin) %% Funkcia folder_processing.: % Vstupné argumenty funkcie.: % FOLDER = Cesta k priečinku, v ktorom sa nachádza aspoň jeden taký % pod-priečinok, kde sú uložené údajové súbory s *.edf príponou. close all; FOLDER = varargin{1}; subfolders = dir(FOLDER); subfolders = struct2...
function liste = capData( liste, min_value, max_value ) for i = 1:length(liste) if liste(i) < min_value liste(i) = min_value; elseif liste(i) > max_value liste(i) = max_value; end end end
%{ To use these functions, make sure that all Box table imports have the same length, all Weight table imports have the same length, and all Statistics table imports have the same length. To do this, you need to make sure not to include the notes and # of stools columns in some of the Weight table imports. Also, make s...
function reportLF(LF,Flows,Currents,GentorLF,Load,Motor,Shunt,Slack) global Report Report=zeros(length(LF(:,1)),10); P=zeros(length(LF(:,1)),2); Q=zeros(length(LF(:,1)),2); B=zeros(length(LF(:,1)),2); G=zeros(length(LF(:,1)),2); % for i=1:length(LF(:,1)) LF(i,6)=LF(i,3)*LF(i,5); P(i,1)=LF(i,1); ...
%%% % This function determines the received symbol and counts the bit(symbol) % error rate. %%% function BER = Decider(Num_UE, Symbols, s, y) Decision = zeros(Num_UE, 1); for l = 1 : Num_UE % Compare the received symbol with QPSK symbols % Choose the QPSK symbol that is closest to recei...
function [idx,params] = get_params() idx.x = 1; idx.y = 2; idx.theta = 3; idx.v = 4; idx.w = 5; idx.n_states = 3; idx.n_inputs = 2; idx.n_hor = 3; idx.n_dim = 3; %Weight matrix %params.Qunit = [1,1,0.33]; %params.Runit = [1e-1,1e-1]; params.Qunit = diag([10,10,8]); params.Runit = 1e-8 * eye(1); params.Qfinal = 100;...
% This script plots the experimental data of Figure 2 contained in the % paper % C. Kuemmerle, C. Mayrink Verdun, "A Scalable Second Order Method for % Ill-Conditioned Matrix Completion from Few Samples", ICML 2021. % % In the experiment, the performance of several algorithms for exact matrix % completion of (1000 x 1...
%{ This is a test script to check the efficiency of polyninomal trajectory path: given waypoints v: given velocity T: total time %} path = [0, 0; 1,0]; v = [0,0.1; -0.1,0]; T = 2; % p(t) = a_0 + a_1 * t + a_2 * t^2 + a_3 * t^3 A = [1 0 0 0; ... 1 T T^2 T^3;... 0 1 0 0;... 0 1 2*T 3*T^2];...
classdef lslAdapter < mladapter % CHANGE THE CLASS NAME! The name of this file must be identical with it. properties % Define user variables here. They will be both readable and writable. % Will read the outcome from the trial inlet, (9 = aborted) CurrentOutcome Outcomes % Cell ar...
function process_data(type,results) global binf %binf structure: % data_files: {'test.dat'} % path: 'D:\Val\battery_testing\process\' % header_names: {1x11 cell} % no_header_lines: 1 % batname: 'Hawker Genesis 12AH spiral wound lead acid' % batnum: 'number' % ...
function llk=Exp4_TotalLikelihood(llk_trial) llk=nansum(llk_trial(:));
% This program is implemented by Manizheh Ghaemi (Author of article "Forest Optimization Algorithm") % This program is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; EXPRESS OR IMPLIED. % Questions/Comments: Please email Manizheh Ghaemi at: % Manizheh.Ghaemi@yahoo.com. % Proper Acknow...
addPaths; scat_coeffs = []; label_dir = './unit_labels/'; input_dir = './grlogs/'; filter = 'gr'; las_files = dir(strcat(input_dir, '*.las')); label_files = dir(strcat(label_dir, '*.csv')); data = struct('Ordovician',[], ... 'Kope', [], ... 'Utica', [], ... 'PointPleasant'...
figure p1=subplot(4,1,1) area(DatumUhrzeit,BLHA0) legend("Hand=1 Automatik=0",'Location','northwest') axis tight grid on pos = get( p1(1), 'Position' ); pos(4) =pos(4)/ 10; % Increase height. pos(2) =0.95 set( p1(1), 'Position', pos ) ; offset=0.9 abstand=1/5 hoehe=1/6 p2=subplot(4,1,2) plot(D...
function Hd = test2 %TEST2 Returns a discrete-time filter object. % MATLAB Code % Generated by MATLAB(R) 9.2 and the DSP System Toolbox 9.4. % Generated on: 18-Dec-2018 00:49:25 % FIR Window Bandpass filter designed using the FIR1 function. % All frequency values are in Hz. Fs = 1.6; % Sampling Frequency Fstop1 = ...
function obj = downloadLatestGithubVersion(obj) % Biafra Ahanonu % Started: 2021.03.25 [22:11:25] (branched from ciatah.m) % Blank function end
%% 1.5a ??? t_s = 1; n = 200; step = 1; time = t_s:step:n; w_t = transpose(wgn(n,1000,0)); s_t = zeros(1,n); for j = 1:n if j < 101 s_t(j) = 0; else s_t(j) = 10*exp(-(j - 100)/20)*cos(2*pi*j/4); end end x_t = repmat(s_t,1000,1) + w_t; mean_x = @(t) mean(x_t(t,:)); ...
function quantized_coef=huffman_decode(accode,dccode,width,height,QTAB,ACTAB,DCTAB) n_bw=width/8; %宽方向方块数 n_bh=height/8;%纵方向方块数 quantized_coef=zeros(64,n_bw*n_bh);%量化后系数 %(一)处理DC分量 %1.1 DC霍夫曼解码 dc_magnitude_array=dc_huffman_decode(dccode,DCTAB); %1.2 DC反差分 for i=2:length(dc_magnitude_array) dc_magnitude_array(i)=dc_ma...
function [ k, nf, cir1, pk_pwr ] = select_cir_samples( r, cir ) % SELECT_CIR_SAMPLES Compute the delay spread of the input CIR % % Outputs: % k is an array of the selected indices % nf is the noise floor % cir1 is the modified cir, noise set to zero % % Inputs: % r is the range in meters from transmitter to rec...
%exam 3 F14 - 1 m = input("mass of box: "); f = input("pushing force: "); s = input("desired distance s in m: "); angle = input("angle of force: "); k = input("spring coefficient: "); syms v vF = solve(cosd(angle) * f * s == .5 * k * s.^2 + .5 * m * v.^2,v); sprintf("velocity of box at %.2f is %.2f m/s", s , abs(vF(1...
function xs = completePathImageSequence( xs, x0, x1, flipSequence ) k = size(xs, 3); if flipSequence xt = x0; x0 = x1; x1 = xt; end j = 0; for i = 1 : k xt = xs(:,:,i); if max( xt(:)) < 0.01 j = j + 1; end end if j > 0 xs(:,:,2:end) = xs(:,:,1:end-1); xs(:,:,1) = x0; ...
%% 水塔水位问题 clear,clc; name='某小镇某天的水塔水位.xlsx'; X=xlsread(name,'Sheet1','D1:E24'); x=X(:,1); y=X(:,2); figure('Name','水塔水位vs时间') plot(x,y,'o'); xlabel('time(s)') ylabel('foot(10^-^2)') grid on new_x=0:0.1:93270; new_y=spline(x,y,new_x); hold on plot(new_x,new_y); plot(35930,new_y(359301),'rp',39332,new_...
function PostProcessingV2(X,Y,Cn,Cv,Cell,file,TimeStep,XgID) if TimeStep ==0 % InitVtk(file) end % CnNN=Cn(~any(ismember(Cn,XgID),2),:); % CnNB=Cn(~(sum(ismember(Cn,XgID),2)==2),:); % CnBB=Cn(any(ismember(Cn,XgID),2),:); CreateVtkVol(Y,Cell,X,file,TimeStep) % Lv.L=ones(size(Cv,1),1); % Lv.L0=ones(si...
function plotTraceSnippets(filepath,filename,snippets,mvLineAt) %% Load data dbstop if error vidfolder=filepath; cd(filepath) in=load(filename); fprintf('\n\nPlotting %s',filename) % Check for laser pulses -- laserTrace=[]; try strcmp(in.stimulus.type,'laser_pulses'); laserTrace=in.stimulus.laserTrace; fprin...
img=imread('Sampad.jpg'); img=rgb2gray(img); [rows,cols]=size(img); output=img; % I=zeros(size(img)); Sox=[-5 -4 0 4 5; -8 -10 0 10 8; -10 -20 0 20 10; -8 -10 0 10 8; -5 -4 0 4 5]; Soy=Sox.'; img=double(img); X=50; Y=70; Sx=270; Sy=300; th=45; for r = X:X+Sx-4 for c=Y:Y+Sy-4 Gx=sum(sum(Sox.*img(r:r+4,c:c+4...
f = 'preFinal/preFinal_'; ext = 'jpg'; n=load('f.txt'); for i = 1:1:n s1='.'; s2=int2str(i); s3='img'; s=strcat(s2,s1); s4=strcat(s3,s2); inp = imread([f s ext]); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 sigma=5; K=0; for x1=-2:2 for ...
function fVal = fun4prob1(x) % function for assignment 3 ;problem 1 fVal = x^2*cos(x); end
Upp = 0; Tp = 0.5; Umin = -1; Umax = 1; kstart = 7; u = Upp*ones(100, 1); y = zeros(100, 1); for k = kstart:100 y(k) = symulacja_obiektu5y(u(k-5), u(k-6), y(k-1), y(k-2)); end csvwrite('sprawko/wykresy/zad1_u.csv', u) csvwrite('sprawko/wykresy/zad1_y.csv', y)
clc,clear close all %% dir={'/yolov2','/ssd','/fasterrcnn','/fasterrcnnzf','/CSCNET'}; model = {'yolov2','ssd','fasterrcnn-vgg','fasterrcnn-zf','CSCNET'}; diroutput = '/ap/'; data = 'train_loss.mat'; draw=0; clss = {'Insulator'; 'Rotary_double_ear'; 'Binaural_sleeve'; 'Brace_sleeve'; 'Steady_arm_base'; '...
classdef (Abstract) Linearisable < handle %LINEARISABLE Summary of this class goes here % Detailed explanation goes here properties end methods result = linearise(this, data); params = delinearise(this, linParams); params = delineariseND(this, linParams); end end
function [trainStimulusDesignMatrix, testStimulusDesignMatrix] = splitStimulusDesignMatrix(stimulusDesignMatrix, trainFrac) stimulusLength = size(stimulusDesignMatrix, 1); trainLength = ceil(stimulusLength * trainFrac); trainStimulusDesignMatrix = stimulusDesignMatrix(1:trainLength,:); testStimulusDesig...
function [errorSignal, FY1, FY2, FY3] = encodeDPCM(movie, bits) firstFrame = movie(:,:,1); info = size(movie); % for k=2:2:info(1) % go through all even rows and flip them left right % firstFrame(k,:) = flip(firstFrame(k,:)); % end X = transpose(firstFrame); % transpose video such that X = X(:); % save to X ...
[muHat,sigmaHat] = normfit(err); y = gaussmf(err,[sigmaHat muHat]); figure(2) scatter(err,y) %% k = 1; ind = []; Bin = []; err = lfe(:,1)-lfe(:,2); d = lfe(:,1)-lfe(:,2); while ~isempty(err) ind = find(err(:)==err(1)); Bin(k,1) = err(1); err(ind) = []; ind = []; k=k+1; end % ...
function [palette,palette_label,palette_tsi,exp_comp,target_mw,target_hc] = ... set_target_details(surr) % PALETTE COMPOUNDS switch surr case 'dooley' palette = {'NPBENZ','NC12H26','IC8H18','TMBENZ'}; otherwise palette = {'MCYC6','C7H8','C6H6','IC8H18','NC12H26'}; end % LABELS switch surr...
%% n = SimulateNoise(m, k, snr_hf, an) % % Generates noise to corrupt MRI data. The noise power is computed % relatively to the average power in the highest frequencies sampled. % % Copyright, Matthieu Guerquin-Kern, 2012 function n = SimulateNoise(m, k, varargin) %% Default inputs if nargin<2 error('SimulateNoise...
function [n_alpha, n_single, p_alpha, alphas, separable_fraction, Xp]... = SeparabilityAnalysis(X, varargin) %Performs standard analysis of separability and produces standard plots. % %Inputs: % X - is a data matrix with one data point in each row. % Optional arguments in varargin form Name, Value pairs. Poss...
% This script reproduces the experiment of Figure 4 of the paper % C. Kuemmerle, C. Mayrink Verdun, "A Scalable Second Order Method for % Ill-Conditioned Matrix Completion from Few Samples", ICML 2021. % % It performs a comparison of the execution time of different algorithms % (in seconds) as a function of the matr...
classdef waypointFinder2D < handle % Class: waypointFinder2D % % This is an A* path planner for small autonomous robots. Given start and % goal points and obstacles defined as counterclockwise contours, the % waypoint finder finds a collision avoiding path through the world. % % Required inputs to constructor function:...
%% Finished %1.1 Calibration of dark noise function [mean, std] = DarkNoiseCalibration(filePath) % use the first image to get the background for calibration preImage = imread(filePath); imshow(preImage, []) rect = imrect; position = rect.getPosition; croppedImage = imcrop(preImage, position); ...
classdef clusterMachine < AClassifier % FSM properties(SetAccess=protected) k = [0 0]; dataFormatName = []; % which data to use? dataFormatDofStr = []; dataFormatDofNum = []; dataFormatfitting = []; dataFormatQuad = []; dataFormatClusterParam = []; dat...
%% figure(1);clf; linc = [.125, .125, .125]; % line color % plot real line x = [-1, 1]; y = [0, 0]; plot( x, y , 'color', linc); axis equal; axis off; hold on; if 0 r = ones(1, 500) * 0; x = linspace(-1000, 1000, 500); z = complex(r, x) ./ 50; g = (z - 1) ./ (z + 1); plot(real(g), imag(g)); en...
function write_m(a,name,num1,num2) % write_m(a,name,num1,num2) % a array % name root for file number % num1,num2 numbers to form file name name_num1_num2 % if either num1<0 or num2<0 it is not used % write array to file same as created by call write_array subroutines % the mode of reading may ch...
hold off clear all DData = load('distance.dna'); N = size(DData,1); time = DData(1:N,1); lgt = log(time); D = DData(1:N,2); D_v = DData(1:N,3); P = DData(1:N,4:6); P_v = DData(1:N,7:9); f = fittype('a*x+b'); fitD_m = fit(lgt,log( D ),f,'StartPoint',[1 1]); figure(1); plot(lgt, log(D), '-k.', lgt ,log(D+sqrt(D_v)),...