text stringlengths 8 6.12M |
|---|
%% this m script will generate daily mean surface current plots along with wind
close all
clear all
tic
%% Define some configuration parameters
conf.start_date=datenum(2016,09,02,16,0,0);
conf.end_date=datenum(2016,09,04,19,0,0);
conf.x_interval=30;
conf.date_format='mm/dd';
conf.ymin=-40;
conf.ymax=40;
conf.y_in... |
%% Parte 1: itaValue
% Você pode usar unidades em seus cálculos para facilitar a interpretação
%física do resultado. No exemplo abaixo é possível ver um exemplo do
%cálculo da força gravitacional e da pressão
m = itaValue(5.2,'kg');
g = itaValue(9.81,'m/s^2');
F = m*g
S = itaValue(2,'m^2');
p = F/S
%%... |
% close all
% clc
% plot the involved endmembers in a multi-event cases.
labelsize = 20;
fontsize = 18;
%% before post-processing
% gt = members_old{1};
% lt = members_old{2};
% ls = members_old{3};
linewidth = 2;
% figure
% hold on
% if ~isempty(gt)
% stem(gt(:,2),gt(:,1),'r','LineWidth',linewidth);... |
function [ FigHandle ] = fGenerateIQPowerValsPlots(PlotPath, X, Freq, Scale, IRef, QRef)
figure('units','normalized','outerposition',[0 0 1 1]);
figtitle('I-Q Modulation and Power at 1/8 Wavelength Offsets');
MaxS = 8;
IArray = zeros(MaxS+1,1);
QArray = zeros(MaxS+1,1);
fprintf('\nI-Q Power Values for One Wavelength... |
function checkProximityToMatrix(h0,v0,thetaPol1,thetaPol2,targetMat)
%% Plot the proximity of every matrix to the target matrix as a function
%% of HWP angles
%
% CHECKPROXIMITYTOMATRIX show the proximity of density matrices to the
% target matrix. The system consists of 2 sequential configurations of a
% calcite cryst... |
function [M] = bitsconverter(x)
x=x.'; %take transpose
M=zeros(numel(x)/2,2);
for k=1:numel(x)/2
M(k,:)=[x(2*k-1) x(2*k)];
end
end
|
%% Logical AND
% In this example, we use the "generalized" delta rule to train a
% single-layer network that has two input units and one output unit (with
% the logistic sigmoid activation function) to learn the logical AND
% function.
%
% Let o_i and t_i be the acquired and the ideal output value of the i-th
% o... |
% Main code and parameters
% MAE 511: Dynamics Second project
% MAE 789: Dynamics Project
clear all;
clc;
close all;
fclose('all');
% Naming Convention
% Goal is to make all variables more "readable" within the code
% oVcmbO = o_d/dt V of cm wrt b, expressed in O frame
% oVXcmbO = x-component of o_d/d... |
%--------------------------------------------------------------------------
% 创建一个Microsoft Excel服务器,改变单元格A1的边框颜色
%--------------------------------------------------------------------------
% 创建一个Microsoft Excel服务器,返回句柄Excel
Excel = actxserver('Excel.Application');
Excel.Visible = 1; % 设置服务器为可见状态
W... |
function S = trefoilKnot(n, m)
u=ainit(2*pi*(0:n-1)'/n, 3);
C=[sin(u)+2*sin(2*u); cos(u)-2*cos(2*u); -sin(3*u)];
S=tubular(C,0.5,m);
xx=S([1:end,1],[1:end,1],1);
yy=S([1:end,1],[1:end,1],2);
zz=S([1:end,1],[1:end,1],3);
surf(xx,yy,zz);
camlight; shading interp; axis equal; view(2);
end |
function str = isodate(t)
%ISODATE Returns the date as an ISO 8601 string (yyyy-mm-dd).
% Usage:
% str = isodate
% str = isodate(t)
%
% See also: datestr, datetime, date, now
if nargin < 1
t = now;
end
str = datestr(t, 29);
end
|
%function []=tmd_submodel_atlas_compact
% =====================================================================
% Function to make a submodel from a model ModName (TMD format)
% calculated on bathymetry grid Gridname
%
% PARAMETERS
%
% INPUT: User specified interactively
%
% OUTPUT:
% Model_<Name_new> ... control f... |
function y = hpf(x,Fs,order,freq)
[b1,a1] = butter(order,freq/(Fs/2),'high'); %design butterworth filter coefficients
y = filtfilt(b1,a1,x); |
classdef ResidualDenoising
%RESIDUALDENOISING enumeration of the avalaible methods for denoising
% the high-pass residual coefficients from the primary wavelet pyramid
% --------------------------------------------------------------------------
%
% Part of the Generalized Riesz-wavelet toolbox
%... |
function [A, B, C, D, ax, ay] = C_Jordan(a, b, a0, b0)
%C_CONTROLABLE Crea las matrices del modelo de estados de la forma de
%Jordan
%
%Se tiene en cuenta que a1 se corresponde con Yz^(n-1), a2 con Yz^(n-2),
%... an con Y, y lo mismo para bi. No se consideran polos múltiples.
if size(a) ~= size(b)
err('a y b debe... |
function [x,y,z] = sph2cart_SR(theta,phi,r)
x = r.*sin(theta).*cos(phi);
y = r.*sin(theta).*sin(phi);
z = r.*cos(theta); |
function flag_list2 = GetNodeByPSet_old(Property,Property_2,energy_level)
load NodeList;
flag_list2 = 1;
element = size(NodeList,2);
elements = element +1;
PSet_Creat(energy_level,elements,'NodeList_PSet');%建立空的多色集,n+1行7列
load NodeList_PSet_Set;
for i = 1:element%为多色集赋值,其原有的值添加进去
for j = 1:4
if j == Nod... |
%函数名称 ChannelsStatus = DIReadChannel(obj,StartChannelNo,ChannelNum)
%入口参数 obj 被打开的串口对象
% StartChannelNo 所要读取通道的开始通道号
% ChannelNum 所要读取的通道个数
%出口参数 ChannelsStatus 所要读取通道的的状态
%说 明 该函数用于读取某个通道的状态
function ChannelsStatus = DIReadChannel(obj,S... |
function [ outVal, outGr, outHes ] = ExtMaratos( x0, VGH )
% Extended Maratos function
n = length(x0);
outVal = 0;
outGr = zeros(n, 1);
c = 100;
% computes the value of function in point x0
if VGH(1) > 0
i=1;
while (i<=n/2)
outVal = outVal + x0(2*i-1) + c*(... |
function [xfft,xffta, xfftph, f]=vfft1(x,dt)
%
% functia citeste vectorul x si scalarul dt, care este
% int. de timp dintre doua citiri ale valorii lui x
% si returneaza vectorul transformata Fourier, modulul, faza, toate cu dimensiunea
% jumatate si vectorul frecvente, adica abscisa
%
n=max(size(x)); %dimensi... |
function [est_signature] = classe2nb(est_signature, classe)
% fonction qui determine le premier nombre via la procedure decrite dans le
% sujet
el1 = [1 1 1 1 1 1; 1 1 2 1 2 2; 1 1 2 2 1 2;...
1 1 2 2 2 1; 1 2 1 1 2 2];
el2 = [1 2 2 1 1 2; 1 2 2 2 1 1; 1 2 1 2 1 2;...
1 2 1 2 2 1; 1 2 2 1... |
function [error] = logistic_xval_error(X, Y, part)
% LOGISTIC_XVAL_ERROR - Logistic regression cross-validation error.
%
% Usage:
%
% ERROR = logistic_xval_error(X, Y, PART)
%
% Returns the average N-fold cross validation error of the logistic regression
% algorithm on the given dataset when the dataset is partitione... |
classdef element
properties
Ke
geometry
con
dof
end
end |
function leaf_labels = leaf_cnt(Tt)
% 函数功能: 找到子树t的每个叶子节点的类别标签
% 函数输入参数:
% Tt: 以节点t为根节点的分类树子树
% 函数输出值: 每个叶子节点的类别标签集数组
persistent leaf_n;
if ~isempty(Tt.class) && (Tt.class ~= inf) %判断为叶子节点
k = length(leaf_n);
k = k + 1;
leaf_n{k} = Tt.labels; %将类别标签存入数组
return;
end
leaf_cnt(Tt.child_left); %递归... |
classdef SINCAL < handle
%SINCAL stellt Zugriff auf PSS(R)SINCAL zur Verfügung
%
% Detaillierte Beschreibung fehlt!
%
% Die SINCAL-Instanz wird verwendet, um alle, mit dem Zugriff auf
% SINCAL relevanten Variablen und Methoden zusammenzufassen.
% Version: 1.1
% Erstellt vo... |
%This script is just a rehashing of find_microsaccades.m but reformatted to
%handle the data format from Patrick Mayo's lab.
VELOCITY_THRESHOLD = 50; %deg/s <--Best thresholds found thus far by using plotcalc_sac
ACCELERATION_THRESHOLD = 6e3; %deg/s^2
MIN_DURATION = 10; %in samples, could be 3? should be 18?
SMO... |
function x2 = create_var(j)
if j >0
syms x2 real
else
syms x2 real
end |
function earth_rose(E, nbins)
%EARTH_ROSE direction rose from earth coordinate angles.
%
% Syntax:
% EARTH_ROSE(E, nbins)
%
% Inputs:
% E: Angular current direction in degrees, earth coordinates.
% OPTIONAL:
% nbins: number of bins to plot histogram
%
% Example:
% theta = [110 110 ... |
classdef RobustLifter < handle
%LIFTER Summary of this class goes here
% Detailed explanation goes here
properties
tree;%adjacency matrix of the spanning tree of the source mesh
treeRoot;%the root of the spanning tree
treeRootOnTarget;%the corresponding index to the treeRoot o... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FINAL EXAM: PY331
%~~~~~~~~~~~~~~~~~~~
% Program #3: Fields--- Particles interacting with E and B fields
% Author: Spencer R Bertsch
% Date: May 9, 2017
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%clear all variables
clear
clc
%%%%%%%%%%%%%%%%%%%%
%... |
function skel = removeTPAWithCommentRobust( skel, comment, mode , steps,twoPointAnnotation)
%REMOVETPAWITHCOMMENT Remove three-point annotations with the specified
% comment. Additionally don't delete nodes with degree greate than 2
% INPUT comment: string
% see skeleton.getNodesWithComment
% mode: stri... |
%产生 [2^n 2^(n-1) ... 1] 的行向量,然后求和,将二进制转化为十进制
function pop3=decodebinary(pop)
global length N;
[px,py]=size(pop); %求pop行和例数
for i=1:py
pop1(:,i)=2.^(py-1).*pop(:,i); %pop的每一个行向量(二进制表示),for循环语句将每个二进制行向量按位置
py=py-1; % 乘上权重
end
pop2=sum(pop1,2); ... |
%% Finite Difference BOUNDARY Honeycomb Spectra
clear
%% set grid size
mx = 100/2;
%% set up honeycomb lattice
a = 1; % 0.7, 0.965, 1.1
q = 4*pi/(a*sqrt(3));
k1 = q*[1;sqrt(3)]/2;
k2 = q*[1;-sqrt(3)]/2;
k3 = k1+k2;
v11 = a*sqrt(3)/2; v12 = a*sqrt(3)/2;
v21 = a*1/2; v22 = -a*1/2;
detv = v11*v22-v12*v21;
%% qu... |
function [attributes] = CreateAttributeVector(pathToImage)
% Transformacija na dadena slika vo binarna matrica i konstrukcija na
% instanca so 7 atributi koja se vrakja na izlez
% Prag za crveni polinja
threshold1 = 120;
% Prag za crni polinja so nijansa na siva
threshold2 = 200;
% Otstranuvanje na crvenite polinja... |
%changing the amplitude
The higher the amplitude the louder the sound
[y,Fs] = audioread('Nokia.wav');
[z,Fz] = audioread('I Will Always Love You.mp3');
[w,Fw] = audioread('Myvoice.wav');
%changing the Amplitude by 1/2
p = audioplayer(0.5*y,Fs);
q = audioplayer(0.5*z,Fz);
r = audioplayer(0.5*w,Fw);
play... |
MCMCPar = struct()
Extra = struct()
Measurement = struct()
ParRange = struct()
MCMCPar.n = 10; # Dimension of the problem (Nr. parameters to be optimized in the model)
MCMCPar.seq = MCMCPar.n; # Number of Markov Chains / sequences
MCMCPar.DEpairs = 3; # Number ... |
for i = 1:1:length(z)
ang(i) = data{3}(z(i));
end
plot(ang, beta(3:2+length(z)), 'ro')
figure
plot(ang, beta(3+length(z):2+2*length(z)), 'bo');
figure
plot(beta(3:2+length(z)), beta(3+length(z):2+2*length(z)), 'bo'); |
function [sol,nfinal]=rombint2D(f,a,b,c,d,z)
%rombint2D(f,a,b,c,d,lengthf) integrated the fuction f(x,y,z) over the square
% a<x<b, c<y<d, and may carry an extra (unintegrated) dimension z or not,
% so that f=f(x,y,z) or f(x,y)
NN=length(z);
relerr=1;
abserr=1;
limit=1e-6;
nmax=25; %max power for number of points... |
function res = huberpdf(x, varargin)
% pdf of a univariate Huber distribution
%
% Possible Input Combinations:
% x
% x, qH -> mu = 0, sigma = 1
% x, mu, sigma -> qH = 0.8
% x, mu, sigma, qH
% x, mu, sigma, cH, bH, aH - this option is provided, to improve performance, because it allows to a... |
%% Class represents buckets builder
classdef Builder < handle
properties
buckets
triangles
vertices
bucket_size
end
properties(SetAccess = private)
end
methods
function builder = Builder(triangles, vertices, bucket_size)
builder... |
function H = computeTransMatrixH(pt, realPos)
A = zeros (8, 9);
for i = 1:4
x = pt(i, 1);
y = pt(i, 2);
rx = realPos(2*i-1);
ry = realPos(2*i);
A(2*i-1, :) = [x, y, 1, 0, 0, 0, -rx*x, -rx*y, -rx];
A(2*i, :) = [0, 0, 0, x, y, 1, -ry*x, -ry*y, -ry];
end
A = A' * A;
[~, ~, d]=svd(A);
H = reshape(d(:,... |
function n = mwlmaxn(ui1,ui2) ;
% Attempts to get max fig number
% Fails if there are gaps in fig numbers
% Called by mwlwm
%figure(100) ;
%n2 = gcf ; close ;
global mmgfincr ;
n = mmgfincr ;
set(ui1,'Value',n) ;
set(ui2,'String',num2str(n),...
'BackGroundcolor','white') ;
|
%%Function to sort data from text file into table
function M=readTempData(filename)
p=inputParser;
%read from text file
M=readtable(filename,'Delimiter','tab','ReadVariableNames',false);
%Set table property information
M.Properties.Description='ASOS Weather Data';
M.Properties.VariableNames{'Var1'}='Station'... |
%EPTOOLS: Data type for potential manager
% A potential manager object PMAN is either a struct or a cell
% array of structs. In latter case, each entry is called a
% block. In the former case, there is just one block. The PMs for
% blocks are appended in order.
%
% Each block has a potential data type, number of p... |
clc;
close all;
clear all;
gradient=[[12,14,23,13],
[16,11,21,18],
[21,24,23,12],
[12,21,20,10]];
image=[[4,4,3,2],
[3,7,6,1],
[2,7,6,2],
[0,1,0,2]];
T=[[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]];
display(gradient);
display(image);
display(T);
for i=1:1:4
for j=1:1:4
least=gradient(i,j);
x=i;... |
function YcrossSetLabel = PartitionCrossSet(size,k)
numberOfSets = k;
div = size/k;
YcrossSetLabel = zeros(size,1);
current = randperm(size, size);
n = 1; start = 1;
while n <= numberOfSets
for i = start: start + div - 1
YcrossSetLabel(current(i)) = n;
end
start = start + div;
n = n + 1; ... |
%% Visualize_Results
close all
cmap2use=jet(MaxN+1);
periodcounter=0;
for Period = Periodlist
periodcounter=periodcounter+1;
ExcitationRatioFname = [Wave '_' Arc '_ExctRtio_T_' ...
num2str(Period) 's_output' Inputfilename(1:end-4)];
Ratios = load(ExcitationRatioFname);
if RayleighOrLove
... |
function drawTrace(tree, index)
hold on
figure(2)
for i=2:size(tree,2)
parent = tree(i).parent ;
line( [tree(parent).t tree(i).t], [tree(parent).y(index) tree(i).y(index)] )
end
hold off
end |
% The Graphic User Object Toolbox version 2.08
% ===============================
%
% The graphicuserobject (GUO) class supports the grouping of uicontrol and axes
% objects ("child objects") as well as other graphicuserobjects ("child GUOs")
% into a composite ... |
function y = fun3( x )
%k f-ja skaiciuoja reiksme taske.
% ivedimas pvz; x=5 y = func( x ) arba func(5)
y =cos(x);
end
|
function [wing_ref_area, AR, thrust, MTOW, Cl_takeoff] = SizeAircraft(weight_fuselage, sensor, span_wing, wing_ref_area, num_wings, dens_lin_wing, RegConst, airfoil_Cl_max, delta_Cl, air_density, Takeoff_velocity, thrust_to_weight, sensorWeight, sensorContainerWeight, weight_propulsion)
% Iterative method to solve for... |
function [processed_data, cut_points, model_cvs, c_predicted, residuals, all_IvT, avg_colourplot] = ...
visualise_fcv_trials(fcv_data, params, cut_params, bg_params, chemo_params)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function out = CreateRenderingMatrixFromBRDFInterf(obs, source, brdf, num_lin, param)
k=size(source, 1);
T = num_lin;
out = zeros(k, 2*T-1);
obs_angle = linspace(obs(3)+90, obs(4)+90, 2);
wall_points = zeros(2, 2);
for j=1:2
obs_direction = [cos(obs_angle(j)*pi/180), sin(obs_angle(j)... |
function [e,W] = RLS_algorithm(M,u,d,delta,delta_d)
%% REQUIRES
% u: tap-input vector
% d: desired signal vector
% mu: step size parameter
% delta: delay of channel
% M: filter order
% Returns
% W: Tap weight vector
% e: estimation error
W = zeros(M,1);
N = length(u);
u = u(:);... |
clc
clear all
close all
L = 10;
dx = 0.1;
x = 0:dx:L;
dt = 0.05;
T = 20;
t = 0:dt:T;
%% Test for upwind
c = 0.5;
N = length(x);
u = zeros(N,1);
f = zeros(N,1);
for k = 1:N
u(k) = exp(-(x(k)-2).^2);
end
h = figure;
h1 = plot(0,0);
title('Upwind')
ylim([0 1]);
for k = 1:length(t)
u = upwind_solver(u,f, c, ... |
addpath('../../bin');
addpath('../');
TOL = 1e-3;
INTEGMETHOD = 'accurate';
DEL = 1e-8;
const;
% Background magnetic field
B0 = 2.4864e-7;
% Cold plasma density
Ne = 5e6;
% electron mass
me = ME;
% Temperature in eV
kT = 5e3*Q; % 5 keV
% electron charge
qe = -Q;
% maxwellian distribution
Ne_h = .1e6;
fe = @(vperp... |
%-----------------------------------------------------------------------
% Developed by: Neelakanda Bharathiraja
% Email: syslancer@gmail.com
%-----------------------------------------------------------------------
% Script file to set the add_exec_event_listener during model startfcn
% callback.
% Logic: We ca... |
clear;
%% define system parameters and form the PSS object.
k0=0.5; krho=0.3;
rho_dot=[-.1 .1];
no_params=2;
rho={};
for i=1:no_params
rho{i}=pgrid(strcat('rho',num2str(i)),-1:1:1,rho_dot);
end
%no. of masses
n=4;
% Define dependence of spring stiffness on parameters.
k(1)=k0+rho{1}*krho;
k(2)=k0+rho{2}*krho;
k(... |
function [X] = replaceFirst(X, value=0)
%REPLACEFIRST Replace first element of matrix/vector with given value.
X(1) = value;
end
|
% Calculates the visibility of the cities
function visibility = GetVisibility(cityMatrix)
global distanceMatrix;
visibility = 1 ./ distanceMatrix;
end
|
function stable_camva(a)
% STABLE_CAMVA Act like camva without changing zoom (aka dolly zoom)
%
% Inputs:
% a angle input to camva
%
% Note: This will mess up interactive view orbitting. So set up your
% view first...
%
% See also: camva
old_a = camva;
old_t = camtarget;
old_p = campos;
cam... |
function [F_uni,V_uni,C_uni,IND_V,IND_F,F_count]=unique_patch(F,V,C,epsOrderDiff)
numFacesIni=size(F,1);
%Removing unused vertices
[F,V]=removeNotIndexed(F,V);
%Removing double vertices
[V_uni,IND_V,IND_IND]=uniqueEps(V,'rows',epsOrderDiff);
F=IND_IND(F); %Fix indices in F
%Removing double FACES
[F_uni,... |
y1=user1sym();
y2=user3sym();
y3=user5sym();
y4=user7sym();
y5=user10sym();
y6=user12sym();
%//SYMBOL BASED CONFIGURATION\\
u1=[y1,y2,y3,y4,y5,y6];
v1=[1,3,5,7,10,12];
plot(u1,v1,'r-*');
grid on;
title('simulation for No of users vs BER in SYMBOL BASED ');
xlabel('NUMBER USERS');
ylabel('BER');
|
function conf = compute_confusion(p,y,Nclasses)
%COMPUTE_CONFUSION. Compute a confusion matrix.
%
%author: Jesus Fernandez-Bes
conf = zeros(Nclasses,Nclasses);
for c_pred = 1:Nclasses
for c_real = 1:Nclasses
conf(c_pred,c_real) = sum( y==c_real & p==c_pred );
end
end |
function verts = compute_mds_spectral(M, k)
%
%
% Section 7.2.2 of Spectral Mesh Processing_cgf10
% Texture mapping using surface flattening via multidimensional scaling_tvcg02
%
n=size(M,1);
M = M.*M;
J = eye(n) - ones(n) / n;
B = -0.5 * J * M * J;
[eigvector,eigvalue] = eigs(B,k,'LM');
eigvalue = dia... |
clc
close all
clear all
% check bestofn for n = 3, 5, 7
p = 0:0.001:1;
f3 = bestofn(3);
f5 = bestofn(5);
f7 = bestofn(7);
figure
hold on;
plot(p, f3(p), "b")
plot(p, f5(p), "r")
plot(p, f7(p), "g")
title("Probability of Winning a Best-Of-N Tournament")
xlabel("Probability of Game Win (p)")
ylabel("Probability of T... |
D=192;
N=D;
Nu=D;
lambda=25;
du_max=0.1;
u_max=1.6;
u_min=0.6;
M=zeros(N,Nu);
for i=1:Nu
M(i:N,i)=s(1:N-i+1);
end
Mp=zeros(N,D-1)
for i=1:(D-1)
Mp(1:N,i)=s(i+1:N+i)-s(i);
end
I=eye(Nu);
K=((M'*M+lambda*I)^(-1))*M';
dUp=zeros(D-1,1);
Y0=zeros(N,1);
dU=zeros(Nu,1);
n=2500; %okres symulacji
U(1:n)=Upp;
Y(1:1... |
%kinematics for 3RRR parallel manipulator
%ini variables for 3RRR parallel manipulator
R = 290;
a = 0;
r = 130;
xc = 230;
SA = 170;
L = 130;
%ini plots variables
figure;
axis([-150 550 -100 550])
grid on
title('Simulated Parallel robot workspace')
xlabel('mm');
ylabel('mm');
hold on
%calculati... |
kXAdj = linspace(-3,3,MtxSize);
kYAdj = linspace(-3,3,MtxSize);
kX = kXAdj*(2*pi)/FOX;
kY = kYAdj*(2*pi)/FOX;
KVec = zeros(2,numel(kX)*numel(kY));
bOut = zeros(numel(kX)*numel(kY),2*param.numCh);
kOut = zeros(numel(kX)*numel(kY),2);
NumIt = 0;
for xDx = 1:numel(kX)
for yDx = 1:... |
[num,raw,txt] = xlsread('CRIq computation.xls');
txt{8,4} = 20;
xlswrite('CRIq computation.xls',txt); |
mex -v findlocmax_native.cpp CXXFLAGS="$CXXFLAGS -fopenmp" LDFLAGS="$LDFLAGS -fopenmp"
mex -v extend_xlink_native.cpp CXXFLAGS="$CXXFLAGS -fopenmp" LDFLAGS="$LDFLAGS -fopenmp" |
function graph_input_OpeningFcn(hObject, eventdata, handles)
updateGraphInput(handles);
|
figure(1, 'position',[0,0,1280,800]);
plot(0:0.1:1, 0:0.1:1, "w.-", "linewidth", 1)
hold on
rel1 = 5
top1 = [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1]
[p_i1, r_i1] = pr_curve(top1, rel1, "k+-;q1;")
title("Biểu đồ P/R")
xlabel("R")
ylabel("P")
legend("show")
top2 = [1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, ... |
% recebe um path, array de inteiros, e imprime na mesma linha com sep a
% separar
function printPath(path, sep)
aux = '';
for i = 1:length(path)
fprintf('%s', aux);
fprintf('%d', path(i))
aux = sep;
end
end |
clear
% clc
dp = '/Volumes/Data/PX/DataAnalyzing/Resting/';
dp_img = fullfile(dp,'DataPreprocess','Smoothed');
dp_hm = '/Volumes/Data/PX/DataAnalyzing/Resting/DataPreprocess/Rest';
para.op = fullfile(dp,'NetworkConstruct');
group = {'1','2'};
subvec = {7,1:28};
% modes = {'detrend', 'filter', 'covariates reg... |
function [f] = gabor_filter(I,theta)
I = double(I);
% guassian distribution
r = 0.5;%Aspect ratio (?)
b = 1;%Bandwidth (b)
lam = 3;%Wavelength (?)
%sigma = (1/pi)*sqrt(log(2)/2)*(2^b+1)*lam/(2^b-1);
sigma = (lam/pi)*sqrt(log(2)/2)*(2^b+1)/(2^b-1);
% mu = [0 0];
limit = 20;
inc = 1;
[X, Y] = meshgrid(-limit:inc:limit... |
function [ result ] = BackwardEuler( )
%BACKWARDEULER Summary of this function goes here
% Detailed explanation goes here
% y(count+1) = y(count) + h * (y(count) - 2 * x / y(count));
f = @(x,y) y - 2*x/y;
h = 0.1;
x = 0;
count = 1;
y = zeros(1, 10);
y(1) = 1;
while count <= 10
... |
function fObs = getObs(Obs,k)
% Returns obstacle avoidance constraints
global Mw Z zLoop ZLoop bigM epsilon;
% number of states
n = length(Obs);
% time horizon
k = length(Mw);
% Obstacle avoidance constraints
fObs=[];
for i = 1:k
Wi = Mw{i}*ones(n,1);
fObs = [fObs, Wi(Obs)<=0];
end
|
function [ Fbar ] = fixed_point_identical_full(lam, d, w_range, Gbar, g, Fbar0)
%
dw=w_range(2)-w_range(1);
N=length(w_range);
Fbar=zeros(1,N);
Fbardmin1=zeros(N,1);
Fbard=zeros(N,1);
grev=fliplr(g);
Fbar(1)=Fbar0;
Fbardmin1(1)=Fbar(1)^(d-1);
Fbard(1)=Fbar(1)^d;
for n = 1:(N-1)
Fbar(n+1)=Fbar(n)-lam*d*dw*(Gbar(n... |
%this functions has been copied from FOCUS, so reference it properly
%it is basically to calculate slices of a wavefield when an emission slice
%is given. It uses the spectral propagator, based on angular spectrum
%theory.
function [fftpress] = fftasa(p0,z,medium,N,delta,f0)
% Usage:
% [fftpress] = fftasa(p0,z,... |
function [sub] = submission(wT1,wT2)
load()
|
% McNemar test
%
% INPUTS:
% t1_n: Set 1 negative examples
% t1_p: Set 1 positive examples
% t2_n: Set 2 negative examples
% t2_p: Set 2 positive examples
%
function [chi2] = mcnemar_test(t1_n,t2_n)
b = size(setdiff(t2_n,t1_n),2);
c = size(setdiff(t1_n,t2_n),2);
chi2 = (b-c)^2 / (b+c);
end
% func... |
clear all ; close all;
% make the retinotopic stimuli:
[xg,yg] = meshgrid(-400:400,-400:400) ;
width = length(xg) ; height = length(yg) ;
circmask = double(sqrt(xg.^2 + yg.^2) < 350);
fullfield = sqrt(xg.^2 + yg.^2) < 150 ; fullfield = fullfield.*circmask ;
left = (xg<0) .* circmask ; right = (xg>=0) .* circ... |
% Copyright (c) 2017 Zi Wang
function optimum = add_mesg_choose(nK, xx, yy, KernelMatrixInv, ...
sigma0, sigma, l, xmin, xmax)
% This function returns the next evaluation point using add-MES-G.
% nK is the number of sampled maximum values.
% xx, yy are the current observations.
% KernelMatrixInv is the gram maxtrix... |
function [x] = OMP(A, y, s) % s is the sparse coefficient
x = zeros(84,1);
r = zeros(size(y,1),1);
r = y ; % Initial residual value
I = []; % The initial I is an empty matrix,
% which is then used to add the selected max(abs(A'*r))
for k =1:s
[num, index] = max(abs(A... |
clear all;
close all;
M=csvread('data_RFE_RemoveRelevantVoxels.csv');
M=M.*100;
x = [0:9];
y1 = M(:,1);
y2 = M(:,2);
plot(x,y1,'-b',x,y2,'-r');
l=legend('10%','30%');
xlabel('Feature Extraction level');
ylabel('Accuracy');
title('Accuracy Vs Feature Extraction Level')'
saveas(gcf,'D:\thesis\Latex\IIITB_... |
function [ A ] = VAR_MA_implied_higher_order( setup,j )
%calculates the MA coefficient of order j implied by a higher order VAR
%(coefficients for which are part of setup)
temp=[setup.VARsymA;kron(eye(setup.VARsym_order-1),eye(setup.size_obs)) zeros(setup.size_obs*(setup.VARsym_order-1),setup.size_obs)];
%companion fo... |
function [weights] = lrAnalytic(X, y, lambda = 0)
%lrAnalytic Computes the analytic solution for linear regression
% weights = lrAnalytic(X, y, lambda)
% computes the analytic solution for linear regression using the normal equations.
% X is the matrix whose rows are the data points of the training set
% ... |
function main()
dataCenterObjectsIncludingRoom = ImportEcostreamXml('MyRoom.xml');
load2DModel(dataCenterObjectsIncludingRoom);
end |
% 作西安全市平均PM2.5时间分布图
clear,clc
load PM2_xian.mat
x0=PM2_xian(:,1);
y0=PM2_xian(:,2);
x=1:116;
y=interp1(x0,y0,x,'spline');
plot(x,y,'-*'); |
function [coeffs,fun,F,xcoeffs] = damped_beam(n)
%DAMPED_BEAM QEP from simply supported beam damped in the middle.
% [COEFFS,FUN,F,XCOEFFS] = nlevp('damped_beam',N) constructs an N-by-N
% quadratic matrix polynomial lambda^2*M + lambda*D + K from a finite
% element model of a beam clamped at both ends with a damper... |
%% update_vel_pos(p,n);
function update_vel_pos()
global vel El El_lim_up El_lim_low
global n w k_pb_i R iteration k_pb_f k_gb_i k_gb_f k_pb k_gb c_gb c_pb delta_t;
global NumVer p pbest_loc gbest_loc
R = n /iteration;
k_pb = k_pb_i + R*(k_pb_f - k_pb_i);
k_gb = k_gb_i + R*(k_gb_f - k_gb_i);
c_pb = rand*k_pb;
... |
%function [] = energy1_case1_analytical(p, c, r)
D = 3;
% c = rand(D, 1);
% p = rand(D, 1);
% r = rand(1, 1);
arguments = 'c, r';
variables = {'c', 'r'};
Jnumerical = [];
Janalytical = [];
p_ = @(c, r) p;
c_ = @(c, r) c;
r_ = @(c, r) r;
for v = 1:length(variables)
variable = variables{v};
switch variable
... |
%% Initialisation and binary random signal
close all;
N = 2000;
u = randi(2, N, 1) - 1.5;
init
Tend = (N-1)*Te;
t = (0:Te:Tend)';
%% Simulation
simin.signals.values = u;
simin.time = t;
sim('ce1');
y = simout.Data;
% setting = window, window_width, color, linestyle, samples_per_group
settings = {
"none", N, "[... |
%%%%%%%%PLOTTING%%%%%%%%%
X_det1=load('/home/naman/Downloads/httperf-0.9.0-varrarive/Speed/RR1/Extra Load');
Y_det1=load('/home/naman/Downloads/httperf-0.9.0-varrarive/Speed/RR1/mean');
%%%
X_det2=load('/home/naman/Downloads/httperf-0.9.0-varrarive/Speed/RR2/Extra Load');
Y_det2=load('/home/naman/Downloads/httperf-0.9.... |
function result = function_c(x,y)
result = 1;
end |
function [AccRatio,X,sRMSE]=myRWM(Nsteps,xo,xobs,d,s,lb,ub,sz)
n = length(xo);
%% initialization
X = zeros(n,Nsteps);
sRMSE = zeros(Nsteps,1);
X(:,1) = xo;
dM = RunModel(xo,xobs);
sRMSE(1) = sqrt(mean((s.\(d-dM)).^2));
LogPiOld = -0.5*norm(s.\(d-dM)).^2;
accMovesTotal = 0;
%% move NSteps
for Step=1:Nsteps-1
accM... |
function varargout = SoundcardSpectralAnalyser_GUI(varargin)
% SOUNDCARDSPECTRALANALYSER_GUI Performs Real-Time Analysis on soundcard data
%
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
... |
function [ rsq, rsq_adj ] = rsquared( x, y)
% Computes the R squared value between the input data points
% and the best fit line fitted to them using polyfit with an order of 1
%
% Inputs:
% x - x-value vector of data points
%
% y - y-value vector of data points
%
% Output:
% rsq = R2 value
%
% ... |
function y = Quartic(x)
j = 1:length(x);
y = sum(j.*x.^4);
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.