text
stringlengths
8
6.12M
function saveNSS close all; clear all; % Input-3D processed texture videos, left and right views % Output-NSS features %% processed left and right views dataleft = load('src01_HRC102_2.mat'); dataright = load('src01_HRC102_0.mat'); imDL = dataleft.Ydst; imDR = dataright.Ydst; imDD = abs(imDL-imDR)...
function [radian] = DegreeToRadian(degree) radian = degree * (pi/180); end
%% Lecture 08 %whenever you have data that changes 1 order of magnitude, apply a %different measure that will account for small values (unlike least %squares, which large values will have large effect) .... so you do this through weighting %
clear clc num=500; dt=0.1; rol=7800; specific_heat=125; Conductivity=15; load('DATA_3D.mat'); load('3D_loadless_K.mat'); K=K1; load('3D_M.mat'); load('3D_L.mat'); %初始化 T(:,1)=DATA_3D(:,1); nodes_num=length(T(:,1)); %寻找边界条件节点编号 n=1; for i=1:1:nodes_num T_initial=DATA_3D(i,2); if T_initial==200 ini...
function val = N(m,x,L) % ------------------------------------------------ % funcion de prueba N para un m dado % ------------------------------------------------ val=sin(m*pi*x/L); end
function [result] = ALCOVE(model) % ------------------------------------------------------------------------ % This trains the alcove network given the design specification in the sole % argument, model. This argument contains critical information about the % model, and must include: % % distancemetric: 0 f...
%% ON bar of different widths at any location on the screen clear all; numOfPanelsAcross = 7;% 7 panels across numOfPanelsVertically = 2;% LEDdotsPerPanel = 8; % this shouldn't change! LEDs are always 8 dots in x and y. LEDdotsAcross = numOfPanelsAcross * LEDdotsPerPanel; % 56 for yvette's set up LEDdotsVertically =...
function feature = genFeatures(prob_t,worker_abil,graph) degree = sum(graph,2); abilityHist = histWorkerAbilities(worker_abil,graph); idx_neg = prob_t==-1; entropy_t = -prob_t.*log2(prob_t) - (1-prob_t).*log2(1-prob_t); nanidx = isnan(entropy_t); entropy_t(nanidx) = 0; entropy_t(idx_neg) = 1; feature = [entropy_t de...
function dt = readIDTbin(file) index = [1,11,41,137,245,341;10,40,136,244,340,436]; % max_desc = 100000; if exist(file, 'file') fid = fopen(file,'rb'); temp = fread(fid, [index(2,end), inf],'single'); fclose(fid); if ~isempty(temp) dt.info = temp(index(1,1):index(...
function availability = getAvailability(year, configuration, system_info) % getAvailability Summary of this function goes here % The calculation procedure follows the mechanism described in pp.43-49 % https://www.osti.gov/servlets/purl/5208341 to consider maintenance schedule. starting_year = system_inf...
% Names: Jens Daci and Jonathan Coskuner % Course: Signals and Systems % Description: This code reads the .wav file and does the following: % 1. Adds noise to the original signal (plots and saves file) % 2. Designs filter to cancel the noise (frequency response) % ...
function [ conn , info ] = recv( conn ) if ~isempty(conn.s) info = unpickle( fscanf( conn.s ) ); else error( 'The connection is not open' ); end
% Lec 7.1 : Introduction to Euler's Method % Solve ODE -IVP using Euler's Explicit Method % y'= -2ty ; y(0) = 1 t0 = 0; y0 = 1; % Initial conditions tEnd = 5; h = 0.001; N = (tEnd-t0)/h; %% Initializing Solutions T = [t0:h:tEnd]'; Y = zeros(N + 1,1); Y(1) = y0; %% Solving using Euler's Explicit Method for i = 1:N ...
function Fn_toe2 = Fn_toe2(in1,th,k,cmax,dmax,us,ud) %FN_TOE2 % FN_TOE2 = FN_TOE2(IN1,TH,K,CMAX,DMAX,US,UD) % This function was generated by the Symbolic Math Toolbox version 8.4. % 13-Jun-2020 13:04:19 q1 = in1(:,1); q2 = in1(:,2); q3 = in1(:,3); q4 = in1(:,4); q5 = in1(:,5); q6 = in1(:,6); qd1 = in1(:,7); ...
function [robotText_h] = LogAndDisplay(robotLog,robotNumber,status,robotCurrentConfig, robotCurrentTr,robotText_h) if robotNumber == 1 %Logs current pose and joint states robotLog.mlog = {robotLog.DEBUG,'Assembly',[status,robotLog.MatrixToString(robotCurrentTr)... ...
X_testing = importdata('./data/testing/X.dat'); y_testing = importdata('./data/testing/y.dat'); value = myClassifier.predict(X_testing); scatter (X_testing(y_testing==1), zeros(size(X_testing(y_testing==1))), 'g'); hold on; scatter (X_testing(y_testing==-1), zeros(size(X_testing(y_testing==-1))), 'r'); hold on; ...
function [ ObservationDistribution,Data_c ] = GetObjservationMatrix( flag_case,flag_ifTrain,DataArray ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here %k-means clustering classficiation Data_RawObserve = transp([DataArray{1};DataArray{2};DataArray{4}]); [Data_idx,Data_c] = kmeans(Data...
% ADVISOR data file: PTC_FUELCELL.m % % Data source: % % Data confirmation: % % Notes: % Defines all powertrain control parameters, including gearbox, clutch, hybrid % and engine controls, for a series hybrid using a thermostat control strategy. % To ensure proper operation, this file must be reloaded every time the F...
% to run the Genetic algorithm for different crossover rates fs =96000; noteON = 100 ; %100; noteOFF =3500; %3500 ; t = 0:1000/fs:4500; note = (t >= noteON) & (t <= noteOFF); N = length(note); f0 = 440; % sample 1 lb = [4, 0, 100, 1200, 0.1, 1200, 10, 200, 0.1, 700, 0.4]; % lower bound ub = [7, 3, 500, 1700 ,0.8...
%% Nuclear Reactor Theory %% %* Matrix assignment (Flux in lattice) *% %* Ahmed Mustafa Ishag -- U00038807 *% %* Adel Ali Ansari -- U00036658 *% %************************************************% clear all clc %% The input code disp('****Nuclear Re...
function [] = aggregate_cons_ground_pr(partition) close all kIm=63; %training; % test % kIm =33;% val %data_dir = '~/Dropbox/westeros04a/BSR/BSDS500/data/groundTruth/consistency_full/'; data_dir = '~/Dropbox/westeros04a/BSR/BSDS500/data/groundTruth/consistency_full0520/'; if(~exist('partition', 'var')) partition =...
function makeTuples( obj, key,traces,traces2,coordinates,masknums) import vis2p.* % detect & remove duplicates thr = 5; % threshold in microns mtraces = mean(traces); % get mean of traces d = squareform(pdist(coordinates)); % get pairwise distances d(logical(tril(ones(size(d,1),size(d,2)),0)))=thr; % select upper tri...
%% Regression test data generator % This program should be executed at the very beginning of refactoring a % major revision. This is for making legacy STRAIGHT v40_007d to be % compatible with MATLAB R2015b and Octave % Copyright(c) 2016, Hideki Kawahara, (kawahara@sys.wakayama-u.ac.jp) clear all close all original_...
%Joint angles of Wearable Jacket connected with Kinect clear all; close all; clc; telapsed = 0;tt = 0;lkinef = 0;font = 18;flag=0; cd('F:\github\wearable-jacket\matlab\kinect+imudata\'); addpath('F:\github\wearable-jacket\matlab\KInectProject\Kin2'); addpath('F:\github\wearable-jacket\matlab\KInectProject\Kin2\Mex'); a...
function plot_labcurve_rgbgamut(Lab, use_uplab) % ------------------------------------------------------------------------- % Default inputs if nargin<2 use_uplab = false; end if nargin<1 Lab = []; end % ------------------------------------------------------------------------- % Parameters target_Lintv = 1; t...
function [center0, center1, F00,F11,hf,axs,width] =... iq2prob_centers(iq_raw_0,iq_raw_1,auto) % iq2prob_centers: finds raw iq centers(where probability of distribution is maximum) % F00: the probability of |0> correctly measured as |0> % F11: the probability of |1> correctly measured as |0> % F01: the probability o...
function [ht, htOSF, protosymbol] = calcChanEst(fname, btcnt, OSF, show_td_plot) % %% FIXME: % 1) HARD coded preamble type % 2) No frequency error / SFO correction % 3) Hard code to use 60 symbols % % [ht, htOSF, protosymbol] = calcChanEst(fname, btcnt, OSF) % % Input: % fname : DSO file name % btcn...
function y = SecondOrder(u) sigma = 0.4; y =((u.^2.-sigma^2)./(sigma^4));
function sendParallel( FRAME, n, trig2use, ioObj, address ) % ----- parallel trigger if ismember( FRAME, 1 : n.trigger_frames ) TRIG = trig2use; else TRIG = 0; end for PP = 1:n.ports io64(ioObj, address(PP), TRIG); end
function ydata = tsnes_p(P, labels,X_initial) %TSNE_P Performs symmetric t-SNE on affinity matrix P % % mappedX = tsne_p(P, labels, no_dims) % % The function performs symmetric t-SNE on pairwise similarity matrix P % to create a low-dimensional map of no_dims dimensions (default = 2). % The matrix P is assumed to be...
function PlotVectorField(lon,lat,xvec,yvec,scale,Escale,pts,varargin); %--------------------------------------------------------------------- %--------------------------------------------------------------------- % % This function plots a horizontal vector field over the current % axis % % INPUTS % % (lon,lat,xvec,yve...
function Nodes = GetChebyshevNodesQuick(Number,Start,End) % Function Name: % GetChebyshevNodesQuick % % Toolbox: % Integration % % Purpose: % Produce a vector of Chebyshev nodes for use in numerical integration with % no input checking/parsing. % % Uses: % % Nodes = GetChebyshevNodesQuick(Number,...
function guiPD() %% ======================================================== % PeakDecon ver 0.1 % GUI-based Peak Deconvolution with NMF algorithm % ======================================================== % function guiPD() % ======================================================== % This software was int...
function r=find_ignition(f) % r=find_ignition(f) % finds the first frame with nodes where fire_area > 0 % arguments: % f wrfout file name % returns: % structure with ignited nodes and their coordinates p = nc2struct(f,{'Times'},{}); times=char(p.times)'; steps=size(times,1); r = []; for step=1:steps p=nc2s...
function [sumDist, segmentPoints] = segmentUpdate(inCSI, minLen, maxLen, temp) %Update segmentation for pattern fitting sumDist = 0; index = 2; start = 1; segmentPoints(1,1) = 1; while length(inCSI(1,start:end)) >= minLen len = length(inCSI(1,start:end)); minDist = 10000000...
% 熵值法确定权重,熵值法不需要目标值 % size(a,2)代表指标数 function w=entropy(a) clc; y=zeros(a); [m,n]=size(a); for i=1:n y(:,i)=a(:,i)/sum(a(:,i)); end s=zeros(1,n); p=zeros(1,n); for l=1:n s(1,l)=0; for j=1:m p(1,l)=y(j,l)*log(y(j,l)); s(1,l)=s(1,l)+p(1,l); end end k=(log(m))^(-1); e=-k*...
%% Top-k classification with tree hierarchy in Madantory Leaf Node Prediction. %% Train a multi-class logistic regression classifier for each node,K nodes were selected and classified by classifier. %% Usage: change the input dataSat on the top, %% and you can change the proportion of data for training and te...
function [s]=saveArduinoCOMPort(ports,saveFilePaths,varargin) % This waits for data to become avaliable from the Arduino, which is processing the matlab data, this data is then saved and can be used for later analysis % Biafra Ahanonu % started: 07/25/11 % inputs % % outputs % %...
bar_color = [0 0 178]/255; clf; family_values = countcats(categorical(family)); family_keys = unique(family); [~, sorting_indices] = sort(family_values, 'descend'); family_values = family_values(sorting_indices); family_keys = family_keys(sorting_indices); % "Tenor" means tenor trombone family_keys{strcmp(family_key...
%MSE Im_original为原始未经污染的图,Im_modified为去噪后的图 function Image_MAE=MAE(Im_original,Im_modified) if (size(Im_original)~=size(Im_modified)) error ('error:image sizes do not agree') end [m,n]=size(Im_modified); A=double(Im_original); B=double(Im_modified); sumaDif=0; for u=1:m for v=1:n sumaDif=sumaDif+abs(...
function stats = analyze_dpp(cfg, fig_path, pat, sz, nets, track) xlim_new = [nets.t(1) nets.t(end)]; if isfield(cfg.fig, 'plotpadding') xlim_new = [xlim_new(1)+cfg.fig.plotpadding(1) xlim_new(end)-cfg.fig.plotpadding(2)]; end ioi = xlim_new; if isfield(cfg.fig, 'interval_of_interest') % applied after padding ...
function [total] = makeSparsity(amps) total = 1-((nansum(amps).^2)./(nansum(amps.^2)))/length(amps); end
function [R, m, v] = getML_LIPRateDist(Monk, recompute) % get distribution of LIP spike rate during the 'ramp'. The begin and end % time of the ramp is computed separately for each coherence by fitting a % piecewise linear function to the average rate data within a session. % This time is then used for computing rate f...
function [ yhat, yhats,theta, MSEp, MSEs] = my_arx( na,nb,m,id,val) b=m+1; dimr=b^(na+nb); dimc=na+nb; W=zeros(dimr,dimc); for j=dimc:-1:1 i=2; d=1; while i<=dimr if W(i-1,j)<m && j==dimc W(i,j)=W(i-1,j)+1; elseif mod(d,b^(dimc-j))>0 && j<dimc W(i,j)=W(i-1...
%% Atmosphere Modeling and Temperature Differential Variation %% Variables P_SI=1.01325*10^5;%pressure in SI RO_SI=1.225;%density in SI T_SI=288.16;%temperature in SI g_SI=9.81;%garvity const in SI R_SI=287; a1=-6.5*10^(-3);%slope in Troposphere a2=3*10^(-3);%slope in Stratosphere a3=-4.5*10^(-3);%slope in Mesosphere ...
close all; m_in = csvread('./../Data/reg_train_in.csv', 1, 1); m_out = csvread('./../Data/reg_train_out.csv', 1, 1); test_x = csvread('./../Data/reg_test_in.csv', 1, 1); load('yte.mat') xte = test_x(:,1); t_xte = xte(xte>=2800 & xte<=3400); t_yte = yte(xte>=2800 & xte<=3400); x = m_in(:,1); t_x = x(x>=2800 & x<=3400);...
function edtffile = EDB2maketfs(edpathsfile,specorder,frequencies,Rstart,... EDcalcmethod,edgestartcoords,edgeendcoords,edgenvecs,... edgelengthvec,planeeqs,approxplanemidpoints,reflfactors,closwedangvec,planesatedge,elemsize,reftoshortlistE,re1sho,re2sho,... ...
function [splits] = split_ho(X,y, opt) % [splits] = split_ho(opt) % Splits data into train and validation set % INPUTS: % -OPT: structure of options, with the following field with default values % -X: not used % -y: labels matrix % set through the defopt function: % -nholdouts % -hopropor...
function K = fkkt(F) %% Fast Kramers-Kronig transform, exploiting NEXTPOW2 and built-in FFTW wrappers % % K[F(..)](:) = FKKT(F), built through the chain: % % > S[F] = hilbert(F) [Analytic-Signal] % % > H[S] = imag(S) [Hilbert-Transform] % % > K[H] = -...
function net = trainStackAutoencoder( samples,labels,loop ) %训练栈式自编码机 [n,m]=size(samples); n_out=max(labels); hidden1=200; hidden2=200; net1=buildAutoencoder(n,hidden1); eta=0.1; ae_loop=400; bitch_size=2000; fprintf('start train autoencoder 1\n'); for lp=1:ae_loop net1=trainAotuencoder(net1,samples,eta); end net2=...
function GAS = get_gender_assortativity_per_month(Aframes,GENDERS) birds_with_known_gender = GENDERS~=-1; months = length(Aframes); GAS = zeros(months,1); for m=1:months A = decompress_adjacency_matrix(Aframes{m}); active_birds = sum(A)~=0; appearing_bird_set = and(active_birds',birds_with_known_gend...
function g = recover_original_indices(groups,active) n = length(groups); original = find(active); g = cell(n,1); for i=1:n g{i} = original(groups{i}); end end
% testing % q = [pi/2 pi/3 pi/4 pi/2 pi/6]; q = [0 0 0 0 0]; twolink.plot(q); mdl.position = q; mdl.forwardPosition(); vis.update();
function resp = gen_normal_tuning(mu, s, pw, x) % evaluate generalized normal distribution with mean mu, sigma s, and power % p over supplied range rng %support vector mu x1 = repmat(x, length(mu), 1); mu1 = repmat(mu, length(x), 1)'; resp = (pw/( 2*s*gamma(1/pw)*sqrt(2)))*exp( -abs((x1 - mu1)/( ...
function [range] = mcrange2(true_model,option) % Monte Carlo approximation for the range between summary statistics nSims = 10000; % data data = forward_grav(true_model); observed_summaries = variablesummaries(data,data,option); summary_container = zeros(nSims,length(observed_summaries)); distance_container = zeros...
path = 'data\bruteforce\'; circle_size = 5; min_x = -567; min_y = -1; max_x = 680; max_y = 99; scale = 16; width = (max_x - min_x) .* scale; height = (max_y - min_y) .* scale; im = zeros(height, width, 3) + 0.3; aniso_thresh = 0.5; psi6_thresh = 0.75; phi_thresh = 0.4; range = -0.15:0.0...
function [certaintyThreshold, maxFoM] = certainityThresholdCFCMC(classifier, sim) % compute certainty threshold defined in Chapter 7.1.2 in the dissertation % first extract validation set saved in classifier object validX = classifier.ValidationSet(:,1:end-1); validGT = classifier.ValidationSet(:,end); % classify vali...
% A script that runs a semiimplicit and an implicit method on the Burgers % equation. h = 1/100; T = 50; k = 1/300; eta = .005; x = transpose(0:h:2*pi); f = x - pi; D = center_diff(length(f)); Laplace = right_diff(length(f)) * left_diff(length(f)); tic % Comment the next line out when using the implicit method % inve...
%% Load data % [Data,Lx,Ly] = daRead12('as_3.2p.da', 0); % [Data,Lx,Ly] = daRead12('MJ4_39.da', 0); Data = OpenNarayan; %% Bandpass [Bandpassed] = bandpass(Data); %% Plot voltage over time DataToPlot = Bandpassed; Fps=40; iPlot = 1; StepSize = 15; figure xAxis=[1:size(DataToPlot,3)]*(1/Fps); % x=30; % y=30; % xMi...
function graph = image_to_graph(image_path) raw_image = imread(image_path, 'png'); end
clear; rec = true; if rec recObj = audiorecorder; disp('Start speaking.') recordblocking(recObj,7); disp('End of speaking.'); x = getaudiodata(recObj); Fs = recObj.SampleRate; else load('handel'); x = y; clear y; end sound(x, Fs); pause; b = [1]; tau = 0.05; D = tau * Fs; a = [1,zeros(1...
function strBest = bestMusic(cellVar) strBest = 'i feel so attacked right now'; end
U = 0:0.01:10; sp = SolarPanel(1.2129, 0.69); I = sp.current(U); UI = [U;I]'; P = sp.current(U).*U; UP = [U;P]'; [Pp,Np] = max(UP(:,2)); Up = UP(Np,1); Ip = UI(Np,2); plot(U,I, 'Color', [0 0.25 1]); hold on plot(U,P, 'Color', [0.5 0.75 1]); plot([Up,Up], [Pp,Ip], 'ro'); line([Up Up], [0 Pp+1], 'Color', [0.5 0.5 0...
% THIS IS THE MAIN SCRIPT, THE PROGRAM STARTS AND ENDS HERE. %% environment variables data_path = '../data/'; results_path = '../results/'; result_name = 'ec_model'; %% use a dialog to get the image answer = questdlg('What type of image are you supplying?', ... 'Image Type', ... 'Photo', 'Screenshot','Screenshot');...
D = dir('*.png'); size = 500; imcell = cell(1,numel(D)); for i = 1:numel(D) imcell{i} = imresize(imread(D(i).name),[size size]); end %% hogVector = []; for k = 1:numel(D) hogVector = [hogVector; extractHOGFeatures(imcell{k})]; end %% class = [ones(1,7), -1*ones(1,6)]'; SVMModel = fitcsvm(hogVector,class,'Kern...
% This routine plots the various MMS solutions. close all clear all %______________ Initializtion mms_solution = 3; % 1 = Randy's % 2 = Ann Almgren % 3 = "Code verification by the MMS" SAND2000-1444, pg60 % Steady state solution if(m...
if ~exist('mcigncn1','var') load mcigncn1 end if ~exist('igncn1','var') load igncn1 end Elem={'U','Th','K2O'}; agemin=0; agemax=4000; nbins = 40; rsi=[40,80]; data = struct;g for i=1:length(Elem) test=mcigncn1.SiO2>rsi(1)&mcigncn1.SiO2<rsi(2)&mcigncn1.Elevation>-100&~isnan(mcigncn1.(Elem{i})); [c,m,e...
function CPdispSIRs(sirs) %%function CPdispSIRs(sirs) % sirs is a matrix % column j denotes the averaged sirs of each component in mode-j global NumOfMode NumOfComp tdalabStatus; fprintf('## SIRs of each Comp.:\n'); LNOC=max(NumOfComp); hstr=' '; for n=1:NumOfMode hstr=[hstr,' Mode ...
% inputs = load('6pointsinputs.txt'); % labels = load('6pointsoutputs.txt'); inputs = load('fg_inputs.txt'); labels = load('fg_outputs.txt'); [rows, cols] = size(inputs); data_matrix = zeros(rows, cols+1); test_runs = 20; weights = zeros(test_runs, cols+1); bloss = zeros(1, test_runs); hloss = zeros(1, test_runs); log...
%%Plot heat capacity from energy fluctuations C~ sE^2 K^2 where sE is %mean-square fluctuations in Energy %% Get energy fluctuation data %[file, path] = uigetfile("*.txt"); %file_path = strcat(path, file); %E = readmatrix(file_path); %k = [0.001 0.3 0.44 0.5 1 1000]; %k = [0.001 0.05 0.1 0.15 0.2 0.25 0.3 0...
clear; clc; close all; [KSpace1] = imagedomain(5, 5); [KSpace2] = imagedomain(-2,2); [KSpace3] = imagedomain(5, 0); [KSpace4] = imagedomain(0, 5); [KSpace5] = imagedomain(2, 2); [KSpace6] = imagedomain(-5,5); [KSpace7] = imagedomain(1, 1); [KSpace8] = imagedomain(-1, 3); [KSpace9] = imagedomain(-3, 2); [KSpac...
% convert a saliency map into a map of colored level sets under the % specified color map % Zoya Bylinskii, April 2016 % linked to: "What do different evaluation metrics tell us about saliency models?" function salMap_col = makeLevelSets(salMap, threshes, colmap) % salMap is a saliency map (distribution) % threshes i...
function [M] = backgroundmask(I) % function [M] = backgroundmask(I) % function to mask the background of an image, I % input: I, the grayscale image to find the background of % output: B, the background of I % method: find 'objects' in I, mask them from the image, fit the remaining % pixels with an ellipse, subtr...
function [tsi] = load_tsi_database tsi = {}; % TAKEN FROM S. Dooley et al. / Combustion and Flame 159 (2012) 1444?1466 tsi.NC12H26 = 7; tsi.IC8H18 = 6.8; tsi.TMBENZ = 62; tsi.NPBENZ = 53; % TAKEN FROM Li et al. / Combust. Sci. Technol., 184: 829?841, 2012 tsi.C6H6 = 28; tsi.C7H8 = 36.14; tsi.MCYC6 = 4.28; end
function [mapping,components] = estimate_components_stable(endmembers, options) %ESTIMATE_COMPONENTS_STABLE Summary of this function goes here % Detailed explanation goes here options = insert_param_when_absent(options,'reduced_dim',10); mapping = calc_projection_from_library(endmembers, options.reduced_dim); disp...
function specview(action,data) %SPECVIEW View spectrum and signal approximation % % Show spectrum and approximated signal. Give access to phasor phactory. % % specview(action,data) % % Data not used yet if (nargin<2) data = []; end; % Default action is to initialize the whole thing if (nar...
function [ p, Phi, R, A ] = cindir( q, EulerAngles ) %cindir This function allow the computation of the position and orientation %of the end-effector of the manipulator. %Intputs: - q: the values of the variables of each joints of the %manipulator (dim = (8x1)) % - EulerAngles: the type of Euler angles that w...
close all;clear; % % x = 1.5; nmax = 25; eps = 1; xvals = x; n = 0; % % while eps >= 1e-5 & n<=nmax % y = (x-sin(x)+x*cos(x))/(2*cos(x)-x*sin(x)); xvals = [xvals;y]; eps = % abs(y-x); x = y; n = n+1; % end plot(xvals);hold on; % plot(1:length(xvals),sin(xvals)+xvals.*cos(xvals),'r') x1_ = 1.e3; x2_ = 1/900; nma...
function [h, centerbins, out] = plot_loglog(x, y, linespec, pas) if nargin<3 linespec = '*'; end if nargin<4 pas = 1; end edgebins = 2.^(0:pas:12); sizebins = edgebins; sizebins = edgebins(2:end) - edgebins(1:end-1); sizebins(end+1) = 1; centerbins = edgebins; % centerbins(2:end) = (edgebins(2...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % B : Matrice (nP x nP) de la forme A\Mc % Fc : Vecteur (nP x 1) du laser % U : matrice de la temperature dans la plaque %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [ U ] = Usolve(A, Mc, Fc, nP, niter, niter_laser) %%% Condition initiale %%% U = zeros(nP, niter); %%%%%%%%%%%...
function hip_x_grad = hip_x_grad(in1) %HIP_X_GRAD % HIP_X_GRAD = HIP_X_GRAD(IN1) % This function was generated by the Symbolic Math Toolbox version 8.5. % 24-Apr-2020 12:32:12 q1 = in1(:,1); q2 = in1(:,2); t2 = q1+q2; t3 = sin(t2); t4 = t3.*(2.0./5.0); t5 = -t4; hip_x_grad = [t5-sin(q1).*(4.3e+1...
function wellqc(wellname) if strcmp(wellname,'SS160') minz=0; maxz=6000*3.28084; data=loadlas('177114095100_Orig+Edit+RckPhys.las'); kb=94.5; wdepth=50; figure plot(0.3048e6./data.dt_ed7,(data.depth-kb-wdepth)) set(gca,'Ydir','reverse') xlabel('Vp (m/s)') ylabel('Depth (m)') ...
# #Funcao para receber os dados dos tiros dos jogadores #Autor: Lucas Xavier de Morais # Jun - 2019 # function [v0 alpha] = dadostiro() while 1 tiro = inputdlg({'Velocidade inicial','angulo em graus'},'0 < v0 <= 100 e 0 < teta < 180'); v0 = str2num(tiro{1}); alpha = str2num(tiro{2}); i...
close all, clc, clear; %% Analyzes the results dw = load('data_90_200_Nant_4'); dm = load('data_90_100_Nant_4'); ds = load('data_40_50_Nant_4'); % The smallest wavelength (derived from highest frequency) lambda_min_w = dw.data.lambda_min; lambda_min_m = dm.data.lambda_min; lambda_min_s = ds.data.lambda_min; % Physica...
fileID = fopen('MeterID14.txt'); A = textscan(fileID,'%s %s %d64 %d', 'delimiter',','); fclose(fileID); date = A{1}; time = A{2}; energyConsumption = A{3}; startEnergy = energyConsumption(1); energyConsumption =energyConsumption - startEnergy; day1Consumption(1)=energyConsumption(1); for k=2:2881 day1Consumpti...
function dGrf_toe_c4_q1 = dGrf_toe_c4_q1(in1,in2,Fx,sampT) %DGRF_TOE_C4_Q1 % DGRF_TOE_C4_Q1 = DGRF_TOE_C4_Q1(IN1,IN2,FX,SAMPT) % This function was generated by the Symbolic Math Toolbox version 8.5. % 17-Oct-2020 02:27:13 q_t1 = in1(:,1); q_t2 = in1(:,2); q_t3 = in1(:,3); q_t4 = in1(:,4); q_t5 = i...
% Useful reference functions from assignments. cfg = []; cfg.method = 'mtmconvol'; cfg.taper = 'dpss'; cfg.tapsmofrq = 2; cfg.output = 'pow'; cfg.keeptrials = 'yes'; cfg.foi = [4:50]; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.toi = -0.5:0.05:1; TFRhigh = ft_freqanalysis(cfg,hpdat); cfg = []; cfg.baseline = [];...
# Q1_a DFS, IDFS, DFT, IDFT x1=[4,1,-1,1]; N1=4; Ydfs=dfs(x1,N1) Yidfs=idfs(x1,N1) Ydft=dft(x1,N1) Yidft=idft(x1,N1) #Q1_b: x2=[2,0,0,0,-1,0,0,0]; N2=8; Y2dfs=dfs(x2,N2) Y2idfs=idfs(x2,N2) Y2dft=dft(x2,N2) Y2idft=idft(x2,N2) #Q1_c: x3=[1,0,-1,-1,0]; N3=5; Y3dfs=dfs(x3,N3) Y3idfs=idfs(x3,N3) Y3dft...
function [CORR_IM, MASK] = vuDistortionCorrection(X, FieldMap, varargin) % vuDistortionCorrection performs a distortion correction estimation % using a field map. FieldMap should contain valid field map data only, by % running original fieldmap data through vuBrainExtractor. % % SYNTAX: % [CORR_IM, MASK] = vuD...
function [error] = supervised(odata,olabel,round) error=0; i=round; while(i~=0) data=odata; label=olabel; class1=find(label==1); [nrow,nlen]=size(class1); tmp=randperm(nrow,8); ls1=data(class1(tmp),:);%labeled data data(class1(tmp),:)=[]; ls1l=double(label(class1(tmp),:)); ...
% compute_TF_means.m % % Wrapper script for the main Time-Frequency (TF) analysis portion of the % main pipeline. % % This script computes the TF signal (filtered) and then computes the % z-score signal (where the baseline of the signal is used as the % distribution to compute the z-score of the rest of the erp signal...
function acceleration = ForwardDynamicSolver(joint, jointVelocity, tau) M = zeros(7,7); C = InverseDynamic(jointVelocity, joint, [0; 0; 0; 0; 0; 0; 0]); for n = 1:7 a = [0; 0; 0; 0; 0; 0; 0]; a(n) = 1; s = (InverseDynamic(jointVelocity,joint ,a) - C); M(n, n) =...
% Steepest descent algorithm with steepest descent direction Bk-df with Bk = I % f = @(x1,x2) (x1^2 + x2 - 11)^2 + (x1 + x2^2 - 7)^2 % df = {@(x1,x2) 2*x1 + 4*x1*(x1^2 + x2 - 11) + 2*x2^2 - 14} % {@(x1,x2) [2*x2 + 4*x2*(x2^2 + x1 - 7) + 2*x1^2 - 22} % They are defined in solution 2_0 %This initiates f, ...
function mean_shape = calc_meanshape_68(root_path,nameList,num_pts ) % fid = fopen(shapepathlistfile); % shapepathlist = textscan(fid, '%s', 'delimiter', '\n'); % if isempty(shapepathlist) % error('no shape file found'); % mean_shape = []; % return; % end % shape_header = loadshape(shapepathlist{1}{1}); ...
function [dist, U, train_b, test_b] = compare_samples(training, test_data, information) %COMPARE_SAMPLES Compare the test_data samples to the training data samples % using PCA. The dist matrix returned is a N x M matrix where N is the % number of training samples and M is the number of test samples. The value % at dist...
%% EvaluateDecadalMissions.m % RBES_Init_Params_Decadal; % [r,params] = RBES_Init_WithRules(params); %% Tier I missions mission_set{1} = create_test_mission('CLARREO',{'CLAR_TIR','CLAR_VNIR','CLAR_GPS'},2015,8,[]);% CLARREO mission_set{2} = create_test_mission('SMAP',{'SMAP_RAD','SMAP_MWR'},2015,8,[]);% SMAP mission_...
tmp = params.instruments_to_subobjectives.entrySet.iterator; while(tmp.hasNext) a = [a tmp.next.getValue]; end
function GG_v=g2_update(m,n) G_1=speye((m-1)); G_2=sparse((m-1),1); G_3=sparse(1,(m-2)); G_uint1=[-G_1,G_2]+[G_2,G_1]; G_uint2=[1,G_3,-1]; G_4=speye(n); G_5=[G_uint1;G_uint2]; GG_v=kron(G_4,G_5);
function[E Vout] = fiber2edge(F,V) %FIBER2EDGE - converts a fiber array to an edge array, where the vertices %of the edge array are the points of intersection of the fibers if isempty(F) E = []; Vout = []; return end ei = 0; for i=1:length(V) Vout(i).v = []; Vout(i).e = []; Vout(i).f = []; end ...
function[counter] = ... congestion(G, new_particles, full_soc, install, num_time_steps) %%G is a directed graph %function[soc, new_occupied, counter, occupied_dic, occ_size] = ... % congestion_time_step(G, soc, full_soc, new_occupied, counter, occupied_dic, ... % occ_size, install) n = G.numnodes; occupied_...