text
stringlengths
8
6.12M
% calculate rate of C2H5O2 + NO2 -> C2H5O2NO2 % Updated 7/18/06 AEP % Based on JPL Data Evaluation #15 % rate=kNO2C2H5O2(T,M) function j=kNO2C2H5O2(T,M) k10o=1.2e-29.*(T./300).^(-4.0).*M; k10oo=9.0e-12.*(T./300).^(0); k10=(k10o./(1+(k10o./k10oo))).*0.6.^((1+(log10(k10o./k10oo)).^2).^(-1.0)); j=k10;
data = csvread('first_model.csv',1,1); global solar_mean; global solar2_mean; global wind_mean; wind = data(:,3); solar = data(:,5); solar2 = data(:,7); no_of_days = size(data,1)/24; no_of_decision_hours = 4; solar_data = zeros(no_of_days,no_of_decision_hours); wind_data = zeros(no_of_days,no_of_decision_hours); ...
% exm13_zplane_freqz_second_order.m % 例13,离散系统频响特性,2阶IIR系统 % 北京邮电大学,尹霄丽 % 2018年12月 r=0.9; theta=pi/4; % exm13_zplane_freqz_second_order.m p1=r*exp(j*theta); p2=conj(p1); B=[1]; A=poly([p1 p2]); figure(1); zplane(B,A); h=findobj(gcf,'type','line'); set(h,'linewidth',2); figure(2)' freqz(B,A); h=findobj(gcf,'type','line'...
%#codegen function [ ] = Serial_write( ms ) coder.ceval('Serial.write',ms); end
load('engine_data.mat'); datainput=engine_AFR; [UCL,CL,LCL,SampAVG]=my_conplot(datainput,5);
%gui_post_process ADVISOR 2002 % This file calculates average efficiencies, % energy balance, input-output powers, etc. % Results of the calculations are displayed using results figure when % clicking on the energy balance button global vinf drivetrain=vinf.drivetrain.name; global fc_retard_kj tc_in_regen_kj tc...
%[2015]-"Moth-flame optimization algorithm: A novel nature-inspired %heuristic paradigm" % (9/12/2020) function MFO = jMothFlameOptimization(feat,label,opts) % Parameters lb = 0; ub = 1; thres = 0.5; b = 1; % constant if isfield(opts,'T'), max_Iter = opts.T; end if isfield(opts,'N'), N =...
function [av_inaction_service , av_inaction_client ] = average_inaction(lambda, mu, step, flag, schedule_value) % функция находит среднее время простоя сервиса % и время ожидания клиентов в очереди count_inaction_service = 0; count_inaction_client = 0; av_inaction_service = 0; av_inaction_cliet = 0; for i...
clear all; close all; clc; % THIS SCRIPT IS FOR THROUGHPUT TEST OF STOPPING TRAINING AT %DIFFERENT CODEBOOK LEVELS FOR VARYING NUMBER OF USERS initialize_static; %Simulation Parameters Nusers = [1 2 4:4:16]; %Number of users in the network T_cycles = [10 50 100]*1e-3; %Length of one complete time cycle in...
% CHGWDECCFS 1 次元複数信号の分解係数の変更 % % DEC = CHGWDECCFS(DEC,'ca',COEFS) は、レベル DEC.level における % approximation 係数を行列 COEFS 内に含まれる係数と置き換えます。 % COEFS が単一の値 V の場合、係数のすべてが V に置き換えられます。 % % DEC = CHGWDECCFS(DEC,'cd',COEFS,LEV) は、レベル LEV における % detail 係数を行列 COEFS 内に含まれる係数と置き換えます。 % COEFS が単一の値 V の場合、LEV はレベルのベクトルで...
close all clearvars -except dataFolderPre dataFolder nodeIDGrimm dataFolderGrimm mintsDotMats nodeID deliverablesFolder dtSteps dt dmSteps startDate endDate grimmDotMats mintsDotMats %% Main2 - Save Mints Data % Collecting and Saving GRIMM Time Tables saveMintsDates(dataFolder,mintsDotMats,nodeID,"GPSGPRMC",start...
%This function can be used to reconstruct a signal using Overlap Add Synthesis function recon = OLA(input,frameLen,hopLen,winName) %input is expected to be a 2D matrix where each column of the matrix is an overlapped frameLen %frameLen is the length of each overlapped frame as number of samples %hopLen is amoun...
function output= normalize(input) im=single(input); max_im=max(max(im)); min_im=min(min(im)); for i=1:1:size(im,2) for j=1:1:size(im,1) im(j,i)=((im(j,i)-min_im)/(max_im-min_im))*256; end end output=im;
function out = checkIntervals(intervals) out = 1; if ismatrix(intervals) % Check if number of columns is two [rows, cols] = size(intervals); if cols == 2 % Check if bounds are correct for i = 1:rows if intervals(i, 1) > intervals(i,2) ...
% ************************************************************ % % point_poly.m % % % Author: % Date: % % ************************************************************ % clear, clf format short #Loading in Polygons and Coordinates data load Polygons.txt load Coord.txt #Storing ncol and nrow [ncol,...
function results = S3VM(x,y,label) tt = cputime; addpath('liblinear-1.51-objective'); addpath('liblinear-1.51-objective\matlab'); %% obtain the multiple low-density seperators % obtain SVM's decision values as the baseline de_values = SVM_descision_values(x,y); % rounding predicted labels by the balance constraint ...
function [ind_max1, ind_max2, max_val, ind_min1, ind_min2, min_val] = maxminPixel(image) intensity_vals = imread(image); intensity_vals = rgb2gray(intensity_vals); max_val = max(max(intensity_vals)); max_val = max_val(1); [ind_max1, ind_max2] = find(intensity_vals == max_val); ind_max1 = ind_max1(1); ind_max2 = ind_max...
function trialseq = CGNG_sequence(settings,data,id) trialseq = []; col = length(fieldnames(id)); if data.baseline == 0 for it = 1:settings.general.blocks % Get trial types go_left = int64((settings.general.trials * settings.general.go) * settings.general.side); go_right = int64((set...
function prox_main(dataset, gridNum) % dataset = 'MNIST'; % gridNum = 1; % dataset : toy, covtype, rcv1, avazu, MNIST. % dataset = 'covtype'; if strcmp(dataset, 'covtype') passes = 20; factorNR = 0.1; factor = 0.1; lambda2 = 1e-5; lambda1 = 1e-4; batchSize = 1; elseif strcmp(dataset, 'rcv1') ...
% % Function: [ret] = ReorderMMFromFolder (ifolder, algorithm, field, precision, save_permutation_vector, do_not_show, do_not_print, get_stats) % % Reads a sparse matrix A from a Matrix Market (MM)-formatted file, % applies Reverse Cuthill-McKee reordoering to it and writes it to % an output MM file. It also...
function data = setrep0(data, clm_idx) % Set repeated data as 0. % % Prototype: data = setrep0(data, clm_idx) % Inputs: data - data with repeated rows % clm_idx - column for index % Output: data - data with repeated rows set by 0 % % See also norep, delrepeat, imurepair, imuresample. % Copyright(c) 2009-2020,...
function [ kmat ] = matker( mt, sigma) %MATKER Summary of this function goes here % Detailed explanation goes here N = size(mt,1); kmat=zeros(N); for i=1:N for j=1:N kmat(i,j)=rbfker(mt(i,:),mt(j,:),sigma); end end end
classdef enumSWERegion < int8 %ENUMSWEREGION Summary of this class goes here % Detailed explanation goes here enumeration Sponge (3) % sponge cell Wet (4) % well cell (SWE) Dry (5) % dry cell (SWE) PartialWet (6) ...
function y = d_tanh1(x) y = (4*exp(2*x))./((1 + exp(2*x)).^2);
% Notes: run setup.m before this script clear; fid = fopen('l1_logistic.txt','w'); % we write all results into this txt file datasets = {'colon-cancer','rcv1.binary','news20.binary'}; % test datasets dataset = datasets{3}; % choose a dataset for test % Input the data datapath = strcat('./D...
x = [1 2 3 4 5 6]'; t = (0:0.02:2*pi)'; a = [sin(t) sin(2*t) sin(3*t) sin(4*t) sin(5*t) sin(6*t)]; y = a*x+(-4+8*rand(length(a),1)); x_hat = intvar(6,1); residuals = y-a*x_hat; bound = sdpvar(length(residuals),1); F = [-bound <= residuals <= bound]; optimize(F,sum(bound)); x_L1 = value(x_hat); optimize([],residuals'*...
%*********************************************** % COMPUTATIONAL ECONOMICS WS15/16 % Prof. Alexander Ludwig % % PROBLEM SET I % Despoina Balouktsi - 5917774 % Maddalena Davoli - 5701809 % Jorge Quintana - 5702248 % %*********************************************...
function level_weight = sgmga_aniso_normalize ( option, dim_num, level_weight ) %*****************************************************************************80 % %% SGMGA_ANISO_NORMALIZE normalizes the SGMGA anisotropic weight vector. % % Discussion: % % It is convenient for the user to initialize the anisotropic...
BenzeneTolueneEthylbenzeneStyreneMethylstyrene; C = [2;3;4]; cPr = cPr(:,C); cG = cG(:,C,C); cH = cH(:,C); ch = ch(:,C); alpha = alpha(C); %alpha = [3.083969465648855 1.343511450381679 1]; %paper -> already very good %alpha = [3.066252447253957 1.369532253533125 1.020242664518052]; %fit to curves %alpha = [3.06808...
% Assignment 1;Problem 4 % Maclaurin series for 1/(1-x),|x|<1 % f(x) = 1 + x + x^2 + .... %% Setting up the problem x = 0.75; trueVal = 1/(1-x); approxVal = 1; atol = 0.001; err = abs(trueVal-approxVal) i=1 %% Performing Computation while (atol < err) approxVal = approxVal + x^i err = abs(trueVal-approxVal...
clc;clear all;close all; % HologramHelperClass.supperposition(conj(E_sample)) %% Input image (virtual plane) global lambda k AmpImage N M dW z; N = 3; dW = 20e-6; %Spacing between elements z = 100e-6; % Distance of Image plane from the resonator plane dW = 100e-6; %Spacing between elements z = 1000e-6; % Distance of...
function DayNightbargraphnew(allData,selectedGroups,analysistype) b=[]; errdata=[]; groupavg=[]; grouperror=[]; for i=1:length(selectedGroups) A=[]; AE=[]; for j=1:length(allData{selectedGroups(i)}{analysistype}) current = (allData{selectedGroups(i)}{analysistype}{j}); ...
function R = Euler2R(ax,ay,az) % get rotation matrix from Euler angles % % R = Euler2R(ax,ay,az) % % By ZHENG Fan % 2015-10-23 R(1,1) = cos(az)*cos(ay); R(1,2) = cos(az)*sin(ay)*sin(ax)-sin(az)*cos(ax); R(1,3) = cos(az)*sin(ay)*cos(ax)+sin(az)*sin(ax); R(2,1) = sin(az)*cos(ay); R(2,2) = sin(az)*sin(ay)*sin(ax)+cos(a...
clear clc fprintf('Problem i'); % u1 = 0, u2 = 1 % x1(k+1) - x1(k) = 0 ==> x1(k)^3 - x1(k) = 0 % x2(k+1) - x2(k) = 0 ==> 2x1(k) + 2x2(k) - 1 = 0 % Solve for x1 x1_ = roots([1 0 -1 0]) % solve for x2 x2_ = zeros(size(x1_)); for i=1:length(x1_) x2_(i) = (1 - 2*x1_(i))/2; end x1_ x2_ % Linearization % A = 3x^2...
function [S,I,R] = SIRPC1(So,Io,Ro,b,a,t,n) %asigancion de datos iniciales N=So+Io+Ro; h=t/n; S(1)=So/N; %normalizacion de los valores I(1)=Io/N; R(1)=Ro/N; tp=0:h:t; for k=1:n %calculo de la derivada en la posicion actual fs=-b*S(k)*I(k); fi=I(k)*(b*S(k)-a); fr=a*I(k); %predicc...
%% Calculate temperature from AWS temperature, absorbed radiation, and distributed absorbed radiation function [dist_temp] = distribute_temp(SWaws,SWabs,T) Tc = T-273.15; tf = 9.7721; Tres_aws = Tc-(SWaws*tf); dist_temp = (SWabs*tf) + Tres_aws + 273.15;
% Homework 2 - Question 2 data = csvread('brca.csv'); lambda = generate_lambda(0, 0.1, 0.01); Y = data(:, end); size(Y) X = data(:, 1:end-1); %a) disp("2a) 5-fold CV") perform_cross_validation(X,Y,5, lambda, 1); disp("Average MSE and Sparsity as a function of lambda") snapnow %b) disp("") disp("2b) 10-fold CV") perfo...
clear variables path = 'C:\Users\60069978\Documents\MATLAB\medicion18\'; lut_1 = [path 'camara_1\LUT_curada_camara_1.txt']; lut_2 = [path 'camara_2\LUT_curada_camara_2.txt']; % tuerca de fundición % r = 40.075/2; % tuerca maquinada r = 21.325/2; set(0,'DefaultFigureVisible', 'on'); x_pedido = 205; y...
function [im,fov,tr] = nii2matrix(name) % This function is a wrapper of read_nii_img, that can read an image from a % file and automatically reshape/descale the data based on info from the % header [raw,h] = read_nii_img(name); % Get dimensions: tr = h.pixdim(5); dim = h.dim(2:4); fov = h.dim(...
%% Create Spectrograms % Need to load ERSP into workspace first! %% 1) load regions addpath(genpath('/nfs/erp-modaf/elec_files/')) load wholehead_elecs.mat %all PFC all_PFC = cat(2, wholehead_elecs{1,2},wholehead_elecs{2,2}, wholehead_elecs{3,2}); %PFC left left_PFC = wholehead_elecs{2,2}; %PFC mid mid_PFC = w...
%Define% M_PI_180 = pi/180; M_180_Pi = 180/pi; %Physical constants% Kuka_LBR_param.dblGravityAcc = 9.81; %Link lengths Kuka_LBR_param.dblLinkBaseLen = 0.1575; Kuka_LBR_param.dblLink1Len = 0.2025; Kuka_LBR_param.dblLink2Len = 0.2045; Kuka_LBR_param.dblLink3Len = 0.2155; Kuka_LBR_param.dblLink4Len = 0.2175; Kuka_LBR...
%% This script for personal analysis(merge emoi&scl and high&gamma data) clc;clear; File_path1 = 'D:\07-Script\DAP_3.0.2.1\'; File_path2 = 'D:\07-Script\All in One\'; emoiscl_Files = dir([File_path1,'*_for_visualization.xlsx']); highgamma_Files= dir([File_path2,'*_gamma&high alpha.xlsx']); if length(emoiscl_Files) ==...
function yfit_pred = predictionlsf(time_int,coeff) t = time_int(:); a = coeff(1); b = coeff(2); c = coeff(3); freq = 1/4500; yfit_pred = (a*1)+(b*sin(2*pi*freq*t))+(c*cos(2*pi*freq*t));
% first direct search % generate some random points cn = 48; max_runs = 10; globalResults = zeros(3,max_runs); % tic; % for run=1:max_runs % % n = 20; % points = (rand(cn,n) - 0.5) * 2 * 10; % evals = zeros(1,n); % results = zeros(cn+1,n); % % options = psoptimset ( 'CompletePoll', 'off', 'Di...
function tf = getShouldEncodeMessage(obj) % GETSHOULDENCODEMESSAGE Gets the flag to base-64 encoded messages % A logical is returned. % Copyright 2019 The MathWorks, Inc. tf = obj.Handle.getShouldEncodeMessage(); end
function M = npend_alphas_DAE_M_1(I1,L1,d1,g,m1,omega1,theta1,in8) %NPEND_ALPHAS_DAE_M_1 % M = NPEND_ALPHAS_DAE_M_1(I1,L1,D1,G,M1,OMEGA1,THETA1,IN8) % This function was generated by the Symbolic Math Toolbox version 8.1. % 04-Dec-2018 02:30:11 t2 = cos(theta1); t3 = sin(theta1); M = reshape([m1,0.0,0.0,1.0,0...
%Exercise 3, Andrew Banman %Compute the homology of RP2 from a triangulation. stream = api.Plex4.createExplicitSimplexStream(); a = 0; b = 1; c = 2; d = 3; e = 4; f = 5; stream.addElement([a,b,d]); stream.addElement([b,e,d]); stream.addElement([b,c,e]); stream.addElement([a,e,c]); stream.addElement([d,e,f]); stream.a...
close all clear all clc multiple = true; answer = questdlg('Would you like to observe the impact of the number of models?','Yes','No'); if strcmp(answer,'No') multiple = false; end if multiple finished = 0; tmp = 1; while finished ~= 1 [file, path] = uigetfile('*.mrsbel'); load([path...
clearvars; clc; clf; fmin=10e3; fmax=742.5e6; N_perdec=5; N=N_perdec*log10(fmax/fmin); f=[10.^(log10(fmin)+(0:1:N)'/N_perdec);fmax]; %f=[1:0.5:10]'*1e6; s=2*pi*f*1j; tz=1.656e-7; tp2=6.596e-10; G_HBR=3.421e14; G_RBR=1.673e14; G0_HBR=G_HBR./s.^2.*(s*tz+1)./(s*tp2+1); G0_RBR=G_RBR./s.^2.*(s*tz+1)./(s*tp2+1); Hs_HBR=G0_H...
% BRRIEF: % Template for explicit invariant set computation. You MUST NOT change % the output. % INPUT: % Q, R: State and input weighting matrix, dimension (3,3) % OUTPUT: % A_x, b_x: Describes polytopic X_LQR = {x| A_x * x <= b_x} function [A_x, b_x] = compute_X_LQR(Q, R) % get basic controller parameters...
%Johnathan Fernandes %SY Q-35, GR 1710168 %Control Systems Course Project %Aim: DC motor speed control using PID controller clc; clear all; close all; L=0.2 %Motor inductance R=1 %Motor Resistance Il=0.005 %Moment of intertia Kt=0.1 %Torque constant Kb=0.1 %Back EMF Kd = 0.324117712006743 %Derivative gain Kp = 13.96...
function child=mutRand(child,interval,mutProb) if(mutProb>rand) chromoSize = length(child); % Tamanho do cromossomo mutPosition = round((1 + (chromoSize-1)*rand)); % A posição da mutação é definida aleatoriamente mutation = interval(1) +(interval(2)-interval(1))*rand; ...
% plot combined bezier curve function combinedbezier (P) hold on [sx, sy, sz] = size(P); for i = 1:sx j = P(i, :, :); a = squeeze(j)'; bezier(a, linspace(0,1, 10)); plot(a(1, :)', a(2, :)', 'ro') end hold off end
function deriv = compute_deriv_log_pE_wrt_PK_params_and_T10(PK_params, PK_parameterisation, T10, E, time_vec, flip_angle, TR, TE, Gd_dose, Noise_Prior) if isfield(Noise_Prior, 'precision') noise_precision = Noise_Prior.precision; noise_var = 1/noise_precision; else error(sprintf('%s can only handle Gaussian no...
function [centx,centy,points] = EstimateCentroid(cx,cy,wx,wy,img,bfm) points.Count = 0; i = 0; I = imcrop(img,[cx-wx/2 cy-wy/2 wx wy]); %I = imadjust(I,[0.1;0.6],[0;1]); if ~exist('bfm','var') || (exist('bfm','var') && bfm ==0) I = imgaussfilt(I,1); I = imcomplement(I); I = imadjust(I); elseif exist('...
%% Plot Wind Trajectory close all; plot3(PLOT_DATASET_HELIX.y.ref,PLOT_DATASET_HELIX.x.ref,PLOT_DATASET_HELIX.z.ref,'b','LineWidth',2); hold on; plot3(PLOT_DATASET_HELIX.y.resp,PLOT_DATASET_HELIX.x.resp,PLOT_DATASET_HELIX.z.resp,'r','LineWidth',2); grid on; xlabel('y (m)','Interpreter','LaTex','FontSize',18); ylabel('...
% ==================================================================================================================== % Copyright 2019 by Mohamed W. Mehrez & Wenrui Ye % All rights reserved. % =========================...
% assigning a and b a = [ 1 2 3 4 5 6 ]; b = []; % indiviual for the first one b(1) = a(1) + a(2); % checking the the length of a in greater than 2 if length(a) > 2 % adding the before and after for i = 2 : length(a) - 1 b(i) = a(i-1) + a(i) + a(i +1); end end % adding the last one seperatly b(l...
function O = RobustCoPlot(I) % Implements Robust CoPlot technique expanded on by "Robust Coplot % Analysis", DOI:10.1080/03610918.2013.875571 % % Explanation of input structure, I % I.X : Input data to be analyzed by Robust CoPlot. Input data % can be a text file, which contains a da...
function writeAdjModeGraph(fid,NUM_MODES,transitionMap,selfAdj) % diagBelowLeft = 0; % diagBelowRight = 0; % diagAboveLeft = 0; % diagAboveRight = 0; %TBD: fix it properlty for non-hybrid systems if NUM_MODES == 1 fprintf(fid,'\nmode1: 1 mode1'); else for mode1 = 1:NUM_MODES adjModes = {}; ctr...
clear; clc; fid = fopen('input.txt'); result = 0; vc = @(s) nnz(ismember(lower(s),'aeiou')); while 1 tline = fgetl(fid); if ~ischar(tline) break end cond1 = false; cond2 = false; cond3 = true; if vc(tline) >= 3 cond1 = true; end for i=2:length(tline) if t...
clear all; close all; clc;format compact; % Calculate parameters of A4973 % Given Itrip = 1.2; %A % Wanted Vref = 1; %0-1V Rt = 30e3; %Ohm Ct = 680e-9; %F +/- 5% %% Current limiter Rs = Vref/(2*Itrip) %Ohm %% Driver disable time Toff = Rt*Ct %s
clear all close all clc % con script calor2D.m % coordenadas de los nodos % xnod=[x y] xnod=[0 0; 5 0; 0 5; 5 5]; % matriz de conectividades icone % icone=[i j k] % filas=elementos % columnas=numeracion de los nodos icone=[1 2 3; 2 4 3]; % condiciones de conveccion % c_...
close all stdnIQ = 8; qcno_dB = 45; qcno = 10^(qcno_dB/10); T = 1e-3; Aiq = stdnIQ*sqrt(2*T*qcno); Np = 30000; deltaPhiOporn = [-pi:pi/180*1:pi]; Nphi = length(deltaPhiOporn); udPlus = zeros(1,Nphi); udMinus = zeros(1,Nphi); Pimore = zeros(1,Nphi); Piless = zeros(1,Nphi); for i = 1:Nphi ...
integrated_positions = zeros(N,1); % initial condition is taken from actual position integrated_positions(1) = angPos(1); temp_pos = angPos(1); for i = 2:N temp_pos = temp_pos + dt* gyro_angVel(i-1); integrated_positions(i) = temp_pos; end figure; % subplot(2,1,1) plot(t,angPos); hold on % subplot(2,1,2) plot...
function [step,direc,enab] = stepper(t,pos, varargin) opt.outfreq = 100000; % Hz opt.stepsperrev = 4000; opt.enablehi = false; opt = parsevarargin(opt,varargin, 3); stepsize = 360/opt.stepsperrev; t2 = (t(1):1/opt.outfreq:t(end))'; pos2 = interp1(t,pos, t2); step = false(size(t2)); direc = false(size(t2)); if op...
function OCECgo_Validate_Calibration(h) % This function validates the user-provided calibration data. %% GET / VALIDATE DATA TABLE % Get data Cal.Table = get(findobj(h, 'tag', 'Cal_Table'), 'data'); % Remove all NaN rows Cal.Table = Cal.Table(~any(isnan(Cal.Table), 2), :); set(findobj(allchild(h), 'tag', 'Cal_Table'...
tic; ticBytes(gcp); parfor kk=1:2 fname = sprintf('dataset/ten_100_10_%d.mat', kk); t = getCurrentTask(); % fname run(fname, t.ID, kk); % If not using parfor, use some random value instead of t.ID % run(fname, 999, kk); end tocBytes(gcp) toc
function [dout, stat]= robuststack(din,par) %Robust stacking scheme is based on Pavlis and Vernon, %Computers & Geosciences, 2010. % din: seismic traces to stack. By default, each column contains one % trace. The default stacking dimension is 2 (columns). This can be % specified in "par", which is a struc...
classdef I_Assembly %I_Assembly Import Class properties name string volume double mass double parts I_Part solids I_Solid CAM I_CAM features I_Feature joints I_Joint end methods function obj = I_Assemb...
function [h ha p pa]=rtpread_all(fname) % function [h ha p pa]=rtpread_all(fname) % % *.rtp -> rtp/rtpZ/rtp_1/rtp_1Z % *.rtpZ -> rtpZ/rtp_1Z % *.rtp_1 -> rtp_1/rtp_1Z % *.rtp_1Z -> rtp_1Z % % *.mat -> will read h,ha,p,pa or some variants % % Breno Imbiriba - 2010.08.25 [fnd fnb fne...
function imwrite(Q, varargin) % IMWRITE Write quaternion image array to graphics file. % (Quaternion overloading of standard Matlab function.) % % This function takes the same parameters as the Matlab function IMWRITE, % but the first must be a quaternion array, with elements of type uint8, % uint16, or double. The ty...
function [burstTimes, burstVector timeLine YmaxSmoothReshape threshold T S_orig] = detectBursts(X,Y,header, varargin) %function [burstTimes, burstVector] = detectBursts(X,Y,header,varargin) % % X = timestamps from CSC file % Y = Y data from CSC file % header = header from CSC file (obtained by readCSCfile) % ...
% Raizes de equacoes do 2 grau clear; % entrada de parametros a = 1 b = 2 c = 1 det = b^2 -4*a*c if (det > 0) disp('raizes reais e distintas') ; r1 = (-b + sqrt(det)) / (2*a) r2 = (-b - sqrt(det)) / (2*a) end if (det == 0) disp('raizes reais e iguais') ; r1 = -b/(2*a) r2 = r1 end if (det < 0) ...
function retResetColorMap(params) % retResetColorMap(params) % % 4/2010, JW: Broken off from doRetinotopyScan % % For some reason, the experiments '8 bars (slow)', '8 bars (LMS)', and '8 % bars (LMS) with blanks' have some special demands for setting the % colormaps. This bit of code is for those three experiments only...
function Y = dwtgroup(X,n) % DWTGROUP Change ordering of elements in a matrix % % Y = DWTGROUP(X,n) Regroups the rows and columns of X, such that an % n-level DWT image composed of separate subimages is regrouped into 2^n x % 2^n blocks of coefs from the same spatial region (like the DCT). % % If n is nega...
function v_list = import_v_list() %% Refer to import_robot_params % syms qx qy real % syms qdx qdy real % syms L I m q qd [3 1 ] real % syms p pd n_bwd n_fwd [2 1] real % syms Irot N real %% List v_list.q = { 'q1' 'q(1)'; 'q2' 'q(2)'; }; v_list.qd = { 'qd1' 'qd(1)'; 'qd2' 'qd(2)'; }; v_list.L...
clc; % close all; haptic_experiment_with_filter; DEGREE_TO_RADIAN = 0.0174532925; N = length(filtered_angPos); % Number of samples %UNDER_DAMPED k_spring = 1.0; % N/cm M_mass = 10.0; % g b_damper = 0.001; % N*s/cm % Discrete model from matlab with Ts = 0.001s A_0_0 = 1.0; A_0_1 = 0.001; A_1_0 = -0.0001; A_1_1 = 1.0; ...
function [files] = jdir(folder, regexp) %[files] = jdir(folder, regexp) home = pwd; cd(folder); files = dir(regexp); cd(home); end
%% Stelling 5 % % In Matlab is een character vector geen verzameling van % symbolen. % Antwoord = 0;
function varargout = generate_stim_poisson_harmaline(genes,tspan,ngen) rand('state',100*sum(clock)); randn('state',100*sum(clock)); if nargin<3 ngen = 1; end if nargin<1 genes = 1; end if nargin<2 tspan = [0 2000 12000 14000 0.01]; end if length(genes)==1 Ni = ge...
% QA2 function ShowTestImage(n) allTestImages = loadMNISTImages('./t10k-images.idx3-ubyte'); allTestLabels = loadMNISTLabels('./t10k-labels.idx1-ubyte'); figure; image = allTestImages(:, n); label = allTestLabels(n); image2D = reshape(image, 28, 28); label = ['Label: ', num2str( label)]; ...
%GPS_Preprocessor %Select active data_matfile if exist('data_matfile','var')~=1 || ~exist('OK','var') error('Run GPS_DiagnosticProcessorDemo first \n') end nsamps=length(t_sec); fprintf('\n dt=0.01, %5.2f-min segment length\n log2(nsamps)=%5.2f Jmin=%3i \n',nsecs/60,log2(nsamps),Jmin) nfreqs=3; ...
%% Signal - Reconstruction %Step Function Definition T=1;N=3;T1=generate_T1(3,1);t=linspace(-T1,T1,1000); [x,y,s]=generate_vars(1,t); subplot(3,1,1);plot(t,x);title('Cos(2\pi * x)');ylim([-1.5 1.5]); %Dicontinued Cosine + Step Function subplot(3,1,2); plot(t,y,'r',t,s,'c');title('Previous + Step Functi...
%% Ligne à retard %% Expression du débit u_A = 200; delta_p_list = linspace(-20e3, 150e3, 1000); p_M = 75e3; u_dp = zeros(1000,1); for i = 1:length(delta_p_list) u_dp(i) = flow_from_deltap(u_A, delta_p_list(i), p_M); end figure; plot(delta_p_list, u_dp ); %% Adimensionnement p_list = linspace(-1.5, 1.5, 10...
function in=makelen(in,size) % function out=makelen(in,size) % function changes the length of vector in to be the length size % size must be a multiple (1/12,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,11,12) of length(in) oldsize=length(in); param=oldsize/size; prm=size/oldsize; if ~(param-1) return elseif param>1 ...
function coords = getStimCoords(stimulus, Scale, rotation, correctionPx) coords = []; if nargin == 1 Scale = 1; end switch stimulus case 'E' %a capital 'E', standard size is width of 1 (unitless) sq2 = sqrt(2); xCoords = Scale .* [-0.5 0.5 -0.5 0.5 -0.5 0.5 -0.5 -0.5]; ...
function B = remove_desert(B, mask) [~, ~, k] = size(B.MODISReflectance); mask3D = repmat(mask, 1, 1, k); B.MODISReflectance(mask3D==1) = NaN;
%******************************************************************** %Damage Evolution function based on non-linear damage evolution model by %Marko and Starkey %Author: Shruti Motiwale %Code Status - Results not verified %Please update the code status and specify modifications %***************************************...
function dFs_toe_c1_20 = dFs_toe_c1_20(in1,in2,us,ud) %DFS_TOE_C1_20 % DFS_TOE_C1_20 = DFS_TOE_C1_20(IN1,IN2,S_TOE,US,UD) % This function was generated by the Symbolic Math Toolbox version 8.4. % 24-Jun-2020 13:53:54 Fy_toe = in2(:,2); dFs_toe_c1_20 = Fy_toe.*-2.0;
A = [pi 6; exp(1) 2]; b = [exp(2);8/pi]; P = [10^(-4); 1-10^(-4)]; ls = [.7 .4]; f_full = [P/ls(1); P/ls(2)]; cvx_solver mosek; cvx_begin variables Z(2*2,1) t(2*2,1) maximize( f_full' * t ) subject to A*Z(1:2) + b >= t(1:2); P'*Z(1:2) == ls(1); A*Z(3:4) + b...
[x,y,z]=textread('Table_Plr.txt','%f %f %f','headerlines',1); %zz=log10(z); zz=zeros([size(z),1]); for i=1:size(z) yy(i)=y(i)/1000; zz(i)=fitmy1(x(i),yy(i)); end diffz=zz-z; tanz=tan((z-0.5)*pi); tanz1=tanz; for i=1:size(tanz) if(tanz(i)>10) tanz1(i)=10; elseif(tanz(i)<-10) tanz1(i)=-1...
clear all load('PassiveLosses_2-3GHz.mat') %Load files from ads load('ThirdOrdIMD_h_sim_2_35.txt') load('ThirdOrdIMD_h_sim_2_4.txt') load('ThirdOrdIMD_h_sim_2_45.txt') load('ThirdOrdIMD_l_sim_2_35.txt') load('ThirdOrdIMD_l_sim_2_4.txt') load('ThirdOrdIMD_l_sim_2_45.txt') load('Pload_sim_2_35.txt') load('Pload_sim_2_4....
function f=f4(x) f=x.*x.*x.-3; %f=sin(x); end%function
[ex,ey,ez]=ellipsoid(-0.71723682172839798,-0.20814674547121634,0.95652471515699222,0.3,0.3,0.3); surf(ex,ey,ez); hold on [ex,ey,ez]=ellipsoid(-2,0,0.95652471515699222,1,1,1); surf(ex,ey,ez); p_start = [-0.98708953342897176,0.16016945087929513,0] plot3([0,-0.98708953342897176],[0,0.16016945087929513],[0,0]) plot3(0,...
%% test ReCon approach % this script compares the performance of original clustering algorithms % with the performance of their ReCon versions. Parameters for each % algorithm are tuned to the best. The results are the same as Table 6 of % the original paper. clear load('s1'); % load a dataset %% Original version %%...
function val = get(p2,prop_name) % GET Get properties from the specified object % and return the value % "Copyright (c) 2000 and The Regents of the University of California. All rights reserved. % % Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without f...
function [outheader,outdata]=LW_fastwavelet_multiCF(header,data,freqVect,type,centFreq,stdev,mothersize,DownSamp,postprocess,baseline,baseline_start,baseline_end,output) %parameters nEpochs = header.datasize(1); nChannels = header.datasize(2); srate=1/header.xstep; xsize=header.datasize(6); xstep = header.xstep * ...
clear all; close all; N = 1024; s = linspace(1, 10, N); X = (1/N)*ones(1,N); %%% initial pdf of X %X = exp(-s); %X = rand(1,N); %X = X/sum(X); A = -eye(N); B = zeros(1,N); Aeq = []; beq = []; lb = zeros(1,N); ub = ones(1,N); options = optimoptions('fmincon','MaxFunctionEvaluations',1000000, 'MaxIterations', 1...
function NL = get_network_load(A) if isempty(A) NL = nan; return end if ~islogical(A) A = 1*logical(A); end N = size(A,1); M = sum(sum(A))/2; slots = (N^2 - N)/2; NL = M/slots; end %function [network_load N_active active_nodes] = get_network_load(Wframes) % % N = size(Wframes,1); % days = size(Wfra...