text stringlengths 8 6.12M |
|---|
%% FAN/LPC Entry
% Find row in cycle definition corresponding to Station 2
Station_2 = find(ismember(Cycle(:,1),2),1);
% Assign Station 2 Mach number to corresponding array element
Cycle(Station_2,11) = S2Mach;
% Calculate station properties and initial geometry
Cycle(Station_2,:) = Station2(Cycle(Station_2,:));
%%... |
function [p] = myNewtonInterpol(x, y)
p(:,1) = y;
for l = 2:1:length(x)
for k = 1:1:length(x) - l + 1
p(k, l) = ( p(k + 1, l - 1) - p(k, l - 1) ) / (x(k + l-1) - x(k));
end
end
p = p(1,:);
end |
%{
mp.Cell (manual) # list of cells
cell_id : int # unique cell id in database
-----
cell_type : enum # cell type
cell_label : enum # molecular or fluorescent label
cell_note : varchar(256) # note
cell_ts = CURRENT_TIMESTAMP : timestamp # don't edit... |
function [ c ] = width_curve( img,space_width,x1,x2,y )
c=zeros(x2-x1)
for x=x1:x2
y0=y
end
|
function [sparsityPattern, estX] = gbAMP(y,g,A,Aind,sigVar,sparsity,numOfVecs,noisVar)
numOfChunks = size(A{end},2);
estX = zeros(numOfChunks,numOfVecs);
sparsityPattern = cell(numOfVecs,1);
for iVec = 1 : numOfVecs
yVec = y{iVec};
Atmp = A{Aind(iVec)};
gAtmp = g(iVec)*Atmp;
... |
image = im2double(imread('cameraman.tif'));
size(image)
kernelA = ones(5) / 25;
kernelB = [-1 0 1];
basic = basic_convolution(image, kernelA);
figure('Name', 'Basic Convolution');
subplot(131); imshow(image); title('Input image');
subplot(132); imshow(basic); title('Filtered image');
subplot(133); imshow(basic_conv... |
%This is the main file of GRNG, it includes several parts below each with an
%annotation on the top
% URNG generate random number
result=zeros(10000,1);
%x_axis=zeros(10000,1);
in_array=zeros(10000,1);
for z=1:10000
in=rand(); %this part generate random 64 bit number in [0.1]
Bitwidth=64;
count=0;
tempin=in;
r... |
%% Parallel Beam convolution back projection reconstruction
% Projection driven reconstruction
%% Read Phantom
p=phantom(256);
%p=imread('dayabay.jpg');%读入其他图像
%p=double(p(:,:,1));
%% Input arguments and parameters initialization
N=size(p,1);
M=round(N*sqrt(2)+1);
d = 1;
delta = 1;
phi = 180;
% d=input('请输入平移采样... |
function batchSortZStack
root = pwd;
selectedDirs = uipickfiles();
zstackDirs = []
for i=1:length(selectedDirs)
cd(selectedDirs{i})
temp = subdir('ZSeries-*');
zstackDirs = [zstackDirs temp'];
end
for i=1:length(zstackDirs)
if zstackDirs(i).isdir
cd(zstackDirs(i).name);
disp(zstackD... |
function [Fs, IndexWindow, ClockWindowed, RawEMG] = thalmicNormalize(Clock, RawEMG, WindowSize, WindowShift, Norm)
Fs = floor(1/mean(diff(Clock)));
%% define moving windows, removing ones that exceed the limits
IndexWindow = [1:WindowShift:size(RawEMG,1);...
(1:WindowShift:size(RawEMG,1))+WindowSize];
Ind... |
function [t,x]=mab4(f,intervalo,x0,N)
h=(intervalo(2)-intervalo(1))/N;
t=intervalo(1):h:intervalo(2);
x(:,1) = x0(:);
% xi+2 = xi + 2hf(ti+1, xi+1)
% function [t,x]=meuler(f,intervalo,x0,N)
[~, x] = mrk3(f, [t(1), t(4)], x(:, 1), 3);
x=x.';
ev(:, 1) = f(t(1), x(:,1));
ev(:, 2) = f(t(2), x(:,2));
ev(:, 3) = f(t(3), x(... |
% Solving for real rate...
% Solving Steady State Consumption given candidate rate
cond=2*tol;
while cond>tol, % policy iteration with 5 steps
% Update Variables to Steady State
% Save this policy
iter=iter+1;
c_in=c;
% Update drift and vol
mu = zeros(N,1) ; % Initialize Vecto... |
%function [componentModel, chainModel] = trainClassifiers(trainingPath, imagePath, noTrees)
% This function trains classifiers for both components and chains
%
% Usage:
% [componentModel, chainModel] = trainClassifiers(trainingPath, noTrees)
%
% Input :
% trainingPath = path to the t... |
% cga
%
% This is a typical GA that works with continuous variables
% Uses - single point crossover
% - roulette wheel selection
%
clear
%cd M:\GA_labyrinthine_09Feb15
global funcount
funcount = 0;
warning off %#ok<WNOFF>
% Defining cost function
nvar = 8*4;
ff = 'GA_labyrinthine_COMSOL_09Feb15';
... |
function x=removeOverencoding(x,overEnc)
% REMOVEOVERENCODING removes excess FOV
% X=REMOVEOVERENCODING(X,OVERDEC)
% * X is the data to be cropped
% * OVERENC is the overencoding factor, see variable Alg.OverDec in file
% reconAlgorithm.m
% ** X is the cropped data
%
overEnc(overEnc<0)=1;%To not remove if ... |
function rotCoords = rotateCoordinates(coords,degAngle)
% ROTATECOORDINATES rotates coordinates by an angle given in degrees.
% The pivot point is at [0,0]. If you want to rotate around another point
% translate the coordinates by the appropriate amount first, rotate them,
% and translate them back.
rotMatrix = ... |
function shrcd = makeShrcd()
% Load msenames
try
msenames = loadresults('msenames');
catch
msenames = importMsenames('.\data\CRSP\');
end
msenames = msenames(:,{'Permno','Namedt','Nameendt','Shrcd'});
msenames = msenames(msenames.Nameendt >= 19930101,:);
idx = msenames.N... |
A = [4 1 -2; 4 4 -3; 8 4 0]; % set up matrix A values
[L,U,P] = lu(sparse(A), 0); % perform LU decomp and obtain only the
% non-zero values (sparse).
L = full(L); % transform L matrix to full version
U = full(U); % transform U matrix to full v... |
x=centers(:,1);
y=centers(:,2);
z=centers(:,3);
testPts=(0:0.01:3);
response=zeros(length(testPts),1);
for k=1:length(response);
test_vector=c_star*testPts(k);
response(k)=abs(sum(exp(-2i*pi*(test_vector(1)*x+test_vector(2)*y+test_vector(3)*z))));
end
plot(testPts,response) |
%%
%% Priodyuti Pradhan, Complex Syatems Lab
%% priodyutipradhan@gmail.com,
%% Indian Institute of Technology Indore
function ER_greedy(N, k, Iter)
clc
fprintf('Number of nodes: %d\n', N);
fprintf('Average degree: %d\n', k);
fprintf('Number of Iterations: %d\n', Iter);
p = k/N;
fprintf('Connection probab... |
function saveNodeFile(file, nodes, book, varargin)
out = fopen(file, 'w');
num_partitions = nargin -3;
labels = 'Id,Label,Book';
for i = 1:num_partitions
labels = [labels, sprintf(',Partition%i', i)];
end
labels = [labels, '\n'];
fprintf(out, labels);
for k=1:length(nodes)
row = sprintf('%i,%s,%i', k, node... |
function r = non_maximal_suppression(corner_map, x, y, lenW)
x = x+floor(lenW/2);
y = y+floor(lenW/2);
subO = corner_map(x-floor(lenW/2):x+floor(lenW/2), y-floor(lenW/2):y+floor(lenW/2));
cont = 0;
[m,n] = size(subO);
for i=1:m
for j=1:n
if (corner_map(x,y) >= subO(i,j))
cont = cont+1;
end
end
... |
function out = Task_Assignment(u)
global iter_prcd NUM_UAV SetTaskAllocation p_i p_f p_task NUM_TASK TASK_STATUS
global OBS_NUM OBS_VRT vrt_config DistPathForTask iter_wpt cnt_terminate
global chk_range HLI_pos second_choice wpt
global idxMinTask MinDistTask cnt
meet_pts = zeros(1,6); % searching points
... |
function y = AWGN(x,SNRdB)
% y=awgn_noise(x,SNR) adds AWGN noise vector to signal 'x' to generate a
% resulting signal vector y of specified SNR in dB
% These are from implementation of AWGN channel
L=length(x);
SNR = 10^(SNRdB/10); % SNR coneversion from SNRdB
Esym=sum(abs(x).^2)/... |
% Reads in previously-saved trc and ekf marker position data, replays
% visualization using ekf_state and lg_ekf_hatInvState (joint angles)
EKFCodePath = 'C:\Users\kgwester\Documents\ResearchWork\MatlabWrapper\';
addpath('..\..\');
addpath(EKFCodePath);
partNum = '17';
i_targ = '85';
i_set = '1';
i_jump = '1';
mak... |
function [ h1 ] = bigfig()
%BIGFIG - makes a figure window that covers the entire screen.
scrz=get(0,'ScreenSize');
h1=figure('Position',scrz);
end
|
% Set 1 of Returns
%sret1_mat = mvnrnd(mu_vec,sigma_mat,T_c);
%emu1_vec = mean(sret1_mat)';
%esigma1_mat = mycov1(sret1_mat);
%x1_vec = esigma1_mat\one_vec;
%esigma2g1_c = ((one_vec'*x1_vec)^(-1));
%er1_mat = inv(esigma1_mat)-esigma2g1_c*(x1_vec*x1_vec');
%z1_vec = er1_mat*emu1_vec;
%ewg1_vec = esigma... |
clc;
AAA=0;
fs=44100;
[AAA ,fs]=audioread('boy.wav');
sound(AAA,fs);
pause(1);
clc;
lop=1;
lop2=1;
while (lop==1)
userreq=input('===================(yes/no)================ :','s');
if strcmp(userreq, 'no')
[AAA ,fs]=audioread('trygain.wav');
sound(AAA,fs);
pause(1);
... |
%% Energy
%%
set(0, 'DefaultFigurePosition', get(0,'screensize'));
clc; clear; close all;
%% Introduction
%
% In this exercise we take a deep look into the _Energy Function_. In
% particular, we are interested in it being a decreasing function as the
% states changes. Thus the dynamics must end up in an attractor. A ... |
%%
tic
clear
clc
format long g
%% Import Data From File (Skip if second time)
%Uncomment the bottom line if used first time
tic
%masterdata = xlsread('in_sample_data.xlsx');
%save masterdata.mat
toc
%% Importing Data From Matrix (Save time)
% Saving the improted
tic
masterdata = importdata('masterdata.mat');
so = m... |
function[edgList] = find_interleave(cycle, bridges)
edgList = [];
% iterate though every pair of bridges
% comparing if they are interleaved
B = size(bridges,1);
for i = 1:B
for j = i+1:B
if is_interleaved(cycle,bridges{i,2},bridges{j,2})
edgList = [edgList; ... |
close all;
clear all;
load h.txt
subplot 221;
plot(h, '.'); grid
xlabel('n');
title('h(n)');
f = 0 : 100 : 200000;
M = abs(freqz(h,1,f,176400));
subplot 223;
semilogy(f/1000, M); grid;
axis([0 200 0.000001 10]);
xlabel('f[kHz]');
title('Mag[H(f)]');
% Como 3 de cada 4 muestras son cer... |
function [] = processCaptureData(filename,expStartTime,expEndTime,maxHeightAfterScaling,...
touchPointAfterScaling,staticSpringStrectchingPointAfterScaling,...
minHeightAfterScaling,angleDeg,mdisc,discRadius,spread,...
errStartTime,errEndTime,optiTrackWandScalingFactor,dataSetName)
%% Parse Tension Experiment
%%%... |
%% Generate many different initial conditions from 10% to 1000% of original
%% value. Returns a cell array. Note that the input parameter 'nconditions'
%% specifies the number of different conditions PER PARAMATER (e.g. 3
%% parameters and nconditions = 2 results in 2^3 combinations).
function initConditionsCell =... |
%%
rng(mean('hyperalignment'));
colors = get_hyper_colors();
sub_ids = get_sub_ids_start_end();
datas = {Q, TC, Q_norm_l2, TC_norm_l2, Q_norm_Z, TC_norm_Z};
%% Example inputs
n_units = 30;
% Use indices in Q in case index chosen from Q does not exist in
% Q_int_rm.
% ex_idx = datasample(1:length(Q{1}.left), n_units, '... |
function [obj ] =objective( S_real,g,L_mat,b0,N )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
obj = 0;
for i=1:N
obj = obj + (exp(-b0*g(i,:)*L_mat*L_mat'*g(i,:)') - S_real(i))^2;
end
end
|
clear;close all
addpath(genpath('./data_processing'))
use_gpu = 1
if exist('../+caffe', 'dir')
addpath('..');
else
error('Please run this demo from caffe/matlab/demo');
end
% Set caffe mode
if exist('use_gpu', 'var') && use_gpu
caffe.set_mode_gpu();
gpu_id = 0; % we will use the first gpu in this d... |
function radOutput = deg2rad(degInput)
pi=3.1415926;
radOutput=degInput*pi/180; |
global MPI_COMM_WORLD;
load 'MatMPI/MPI_COMM_WORLD.mat';
MPI_COMM_WORLD.rank = 71;
Alluxio_Row_mv_version3;
|
function main(Q4trainFeatures, Q4testFeatures, Q4trainLabels, Q4testLabels, Q5trainfeatures, Q5testFeatrues )
% -----------------------------------------------
% ***** QUESTION 4-3 ***********************
trainData = dlmread(Q4trainFeatures);
testData = dlmread(Q4testFeatures);
trainLabels = dlmread(Q4trainLabels,'... |
fid=fopen('C:\Users\admin\Desktop\sin.txt')
data=fscanf(fid,'%d',[1,inf])
fclose(fid)
fwrite = fopen(['C:\Users\admin\Desktop\shu.txt'],'w');
for write = 1:length(data)
fprintf(fwrite,'sin[%d]= 8"d %1.0f;\r\n',write-1,data(write));
end
fclose(fwrite); |
function quat = calcQuat(v1,v2)
a = cross(v1,v2);
b = acos(dot(v1,v2)/(norm(v1)*norm(v2)));
quat = [cos(b/2) a];
k = sqrt((quat(2)^2 + quat(3)^2 + quat(4)^2)/(1-quat(1)^2));
quat = [cos(b/2) a/k];
% b = sqrt((norm(v1))^2 + (norm(v2))^2) + dot(v1,v2);
% quat = [b a];
% quat = quat/norm(quat);
end |
classdef PhyLoad
properties
nodeIndex
loadX = 0
loadY = 0
loadMoment = 0
end
methods
function obj = PhyLoad(nodeInput, xLoadInput, yloadInput, momentLoadInput)
if nargin > 0
obj.nodeIndex = nodeInput;
end
if... |
function [Correspond] = BuildNoisyCorrespondences(T_ow, T_cw,...
CalibrationGrid, KMatrix,CameraHeight, CameraWidth,mu,std)
% This function takes points from our simulated calibration grid in xy
% coordinates and transforms this into camera-sensor uv coordinates using
% the Homogenous transformation T_oc = T_ow\T_c... |
function matUpdateExternalField( obj, time, fphys2d, fphys3d )
delta = obj.externTimeInterval;
% find step
s1 = floor( time/delta ) + 1;
s2 = s1 + 1;
alpha1 = ( delta * (s2 - 1) - time ) / delta;
alpha2 = ( time - delta * (s1 - 1) ) / delta;
eta = obj.etaExt(s1) * alpha1 + obj.etaExt(s2) * alpha2;
for m = 1:obj.Nmes... |
function [y] = find_cluster(image)
%[z x] = size(image);
flag = 1;
im = rgb2gray(image);
contra=contrast(im)
Entropy=entropy(im)
img=rgbnormalise(image);
imshow(img);
% blur_content1= blurr(image)
% blur_content2= blurr(img)
if (contra < 0.30)
blur_content=blurr(image)
else
blur_content=blurr(img)
end
% ... |
function [pred,se,ci] = GpTrainTest(x,y,xs,ys,X,Y)
%UNTITLED7 此处显示有关此函数的摘要
% 此处显示详细说明
gprMdl = fitrgp(x,y,'KernelFunction','squaredexponential',...
'FitMethod','exact','PredictMethod','exact');
[pred,se,ci] = predict(gprMdl,X,'Alpha',0.01);
% disp('plotting')
% figure()
% set(gca, 'FontSize', 24)
% f = [ci(:,... |
function [time]=tem_less_iteration(u1,u2)
time=fsolve(@(t) rownanie3(u1,u2,t),3225);
function te=rownanie1(u,t)
te=0;
a=4.444e-7;
X=0.09;
for i=1:19
te=te+2.*(sin(u(1,i))./(u(1,i)+sin(u(1,i)).*cos(u(1,i)))).*exp(-(u(1,i).^2).*(a.*t./((X./2).^2)));
end
function te=rownanie2(u,t)
te=0;
a=4.444e-7;
... |
function Ranks = review_paper_topNN(Table,Align_data,filename,Names,numFeature_end,k)
% REVIEW_PAPER_TOPNN runs the Nearest Neighbor Experiment
% -Table is the Statistics Table with each column representing one
% statistic
% -Align_data is the identity score table with sequence numbers
% -filename is the name... |
%% Stelling 1
%
% Een for-lus gebruik je als je weet hoe vaak je iets kunt
% herhalen.
%
Antwoord = 1;
|
function [diff_L2, norm_ex_L2, diff_H1, norm_ex_H1 ] = principal_periodique_aux(h, namemsh, visualisation, validation, Acst, alpha)
% =====================================================
%
%
% une routine pour la mise en oeuvre des EF P1 Lagrange
% pour l'equation de Laplace suivante, avec conditions de
% Dirichlet su... |
clc;
clear all;
%develop H
Nt = 4;
Nr = 4;
nt = 0:Nt-1;
nr = 0:Nr-1;
%arbitary value of scatter
L = 8;
%give the AoA and AoD azimuths
phi_l_T = 0+(2*pi)*rand(1, L);
phi_l_R = 0+(2*pi)*rand(1, L);
%get freq, wavlth and distance between ULA
freq_mm = 30e9;
c = 3e8;
lambda_wav = c/freq_mm;
d = lambda_wav;
... |
function [ i, q] = ethernet_read(len)
t = tcpip('192.168.1.10', 7, 'NetworkRole', 'client');
fopen(t);
data = fread(t,len);
x = data(1,1:256);
y = data(1,257:end);
for j = 1:length(x)/2
i[j] = ( x[2*j -1] *256 ) + x[2*j] ;
q[j] = ( y[2*j -1] *256 ) + y[2*j] ;
end
end |
clear, clc, clf
close all
full_white_value=64; % äldre matlabversion - detta värde plottas som vitt (max) med image-kommandot
%full_white_value=255; % nyare matlabversion - prova denna om din plot verkar mörk!
load T_DOE_gen2
%DOE = load ('T_DOE_gen2.mat')
%DOEmat = cell2mat(struct2cell(DOE));
N=1024; % NxN är matrisst... |
clc;
clear all;
close all;
syms t
x1=t.*t-2.*t;
x1s=laplace(x1);
x2=t;
x2s=laplace(x2);
x3s=x1s.*x2s;
x3=ilaplace(x3s); |
function is_simple = IsPointSimple(binary_image, i, j, k, use_mex_simple_point)
%Internal function
if use_mex_simple_point
% MEX function (fast)
is_simple = PTKFastIsSimplePoint((binary_image(i-1:i+1, j-1:j+1, k-1:k+1)));
else
% Matlab function (slow)
is_simple = PTKIsSimplePoint(binary_image(i... |
classdef KMeans_ < BaseEstimator & TransformerMixin
% The KMeans algorithm clusters data by trying to separate samples in n
% groups of equal variance, minimizing a criterion known as the inertia
% or within-cluster sum-of-squares. This algorithm requires the number
% of clusters to be specified.
... |
%% genetic_alg_outer.m
% This is the 'outer' wrapper function for the Genetic Algorithm
% population-based heuristic method for solving the makespan problem. This
% script translates desired methods for each operation from a string input
% into a function handle, with the respective required arguments. These
% are th... |
function [L,groundtruth] = L_simulation_noNoise(Ntask,Nworker,Ndom,Redun,ndom)
p0 = 0.05;
p1 = 0.75;
%prop = 0.5;
groundtruth = zeros(1,Ntask);
L = zeros(Ntask,Nworker);
for task_j = 1:Ntask
labelSet = randperm(Ndom,ndom);
groundtruth(task_j) = randsrc(1,1,labelSet);
prob = zeros(1,ndom);
for k = 1:ndo... |
function totalHamiltonian = hubbardHamiltonian_2D( t, U, Lx, Ly, noOfUp, noOfDn, NUM_CORES )
if (Lx==2) || (Ly==2)
error('Lx and Ly must be both greater than 2.');
% If we want to deal with the case of Lx = 2 or Ly = 2, put this statement:
% kinetic = unique( kinetic, 'rows', 'stable');
% before the defi... |
function figHandle = plotProductValueCurve (X, theta, d)
V = getProductValue (X, theta, d);
figHandle = plot (X, V);
title (sprintf('Value [\\theta=%.2f, d=%d]', theta, d));
xlabel ('Fraction of people who adopted the product');
grid on;
axis ([0 1 0 1]);
axis square;
set (gca, 'FontSize', 18);
% eof
|
function [inputMovie] = removeStripsFromMovie(inputMovie,varargin)
% Removes vertical or horizontal stripes from movies.
% Biafra Ahanonu
% started: 2019.01.26 [14:17:16]
% inputs
% inputMovie = [x y frames] 3D matrix movie.
% outputs
% inputMovie = [x y frames] 3D matrix movie with stripes removed.
% change... |
function [pos,int,FWHM] = gausfast(q,data,peaks)
% function [pos,int,FWHM] = gausfast(q,data,peaks)
%
% IN:
%
% q q-vector for the data
% data data in a vector
% peaks number of peaks you want to fit
%
% OUT:
%
% pos positions of the peaks fitted by zooming on the peak
% int normalise... |
iasi_paths
a=[1021 2345 3476 4401];
for f = findfiles(['/asl/data/rtprod_iasi/' datestr(JOB(1),'yyyy/mm/dd') '/ecm.iasi_l1c_full.*.v1.rtp_1Z'])
if exist([dirname(f{1}) '/strowsubset_' basename(f{1})],'file');
disp([dirname(f{1}) '/strowsubset_' basename(f{1})])
[head1 hattr1 prof1 pattr1... |
function [y] = LG_single(xk)
%function counting next approximation of root
y = xk - LG_zmin(xk);
end
|
function varargout = prism_compressor(lambda0,apex_angle,theta0,a,t,s)
% calculate second and third order phase for a pair of FS prisms at any input angle, any prism apex angle, for a single pass.
% From Diels, Rudolph: Ultrashort Laser Pulse Phenomena
% apex_angle = prism apex angle in [deg]
% a,t,s = distance... |
function [J, grad] = cost(theta, X, y)
extended_theta = repmat(theta, rows(X), 1);
hypotheses = sigmoid(dot(extended_theta, X, 2));
positive_hypotheses = y.*log(hypotheses);
negative_hypotheses = (1 - y).*log(1 - hypotheses);
J = 1/rows(X) * sum(-positive_hypotheses - negative_hypotheses);
grad = arrayfun(@... |
function out = ltscalar(z,n,m)
% Computes the n-th derivative with respect to z of the function
% K_m(z) = z^m * (1-exp(-2*z))/(2*z);
%This corresponds to the first eigenvalue for the boundary integral
%formulation of the wave equation on a sphere (Sauter, Veit, 2011).
if n==0
out= z.^(m-1).*(1-exp(-2*z))... |
function Edge_Length_Distribution(varargin)
%% Edge length distribution of presents
% Edge_Length_Distribution(presents)
% Edge_Length_Distribution(presents1, presents2, ...)
subplot(3,1,1)
ys = [];
for i = 1:nargin
[y, b] = hist(Small_Edges(varargin{i}), 2.5:5:252.5);
ys = [ys;... |
clear;clc
a=[1 1;1 -1]
b=[6;2]
x=inv(a)*b
x1=a\b
|
% Generate test datasets for matio library
%
% Copyright 2010-2013 Christopher C. Hulbert. All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
%
% 1. Redistributions of source code must retain the ab... |
%==========================================================================
% input parameters for interferometry
%==========================================================================
%- frequency sampling in Hz -----------------------------------------------
%- The sampling should be evenly spaced for the inver... |
XC=0;YC=0;ZC=0;XR=1;YR=1;ZR=2;N=30;
[xx,yy,zz] = ellipsoid(XC,YC,ZC,XR,YR,ZR,N);
figure(10);
surfl(xx,yy,zz);
xlabel('x'); ylabel('y'); zlabel('z');
grid on;
axis([-2 2 -2 2 -2 2]);%re-align the axis of x and y
|
function b=BINGM_num(a,n)
% This function is different from the function BINGM, which is for symbol
% cumputation;
% The input,a, and the output, b, are column vectors
% n is the power exponent of input a
MAG=sqrt(a(1)^2+a(2)^2);
theta=atan2(a(2),a(1));
b=[MAG^n*cos(n*theta);MAG^n*sin(n*theta)];
end |
function [Idx, Dist] = findnn_hellinger(D1, D2)
Idx = [];
Dist = [];
for hs = D1'
distances = [];
for h = D2'
distances = [distances; ...
comparehistograms(hs, h, 'hellinger')];
end
[val, id] = min(distances);
Idx = [Idx; id];
Dist ... |
clear all; close all; clc;
Fig = figure();
% set(Fig, 'Name', 'Path Scoring Simulator', ...
% 'NumberTitle', 'off', 'OuterPosition',get(0,'ScreenSize'), 'Resize', 'off');
% AXES = axes('Parent', Fig, ...
% 'Units','normalized',...
% 'Position',[0.045 0.045 0.512 0.946],...
% 'View',[30 10]);
set(Fig... |
%Code to plot color coded up/down spatial maps of cells.
%Uses sigexamples.mat to gain up/down information
%Needs r_out for both the example cells for selection.
%Load Data
%Experimental Session
[expFile, basedir] = uigetfile('.mat', 'Select processed traces file for Experimental Session');
load(fullfile(basedir, expF... |
function [ ratio ] = getTeethAppearance( img1 )
%GETTEETHAPPEARANCE Summary of this function goes here
% Detailed explanation goes here
%Lab = colorspace('RGB->Lab',img1);
%Luv = colorspace('RGB->Luv',img1);
%Ua = mean2(Lab(:,:,2));
%Oa = std2(Lab(:,:,2));
%Uu = mean2(Luv(:,:,2));
%Ou = std2(Luv(:,:,2));
... |
function [ order ] = graphtopoorder( dg )
%Sort a directed acyclic graph from a sparse input matrix
% obj = biograph(dg);
% order_cells = sort3(obj);
% order = cell2mat(order_cells);
G = digraph(dg);
order = toposort(G);
end
|
%% Load conv6 features (data struct, feat vector)
disp('Loading conv6');
load(fullfile(cachedir, 'rcnnPredsKps', [params.kpsNet 'Conv6Kps'], class));
% Flip the X and Y components of each heat map, and concatenate it back to
% a row vector
feat = flipMapXY(feat, [6 6]);
% Resize the heatmap to the dimensions specified... |
function [ data ] = getAllData( obj, tileSeparate )
%GETALLDATA Get all the image data
% This method extracts all the image data from a CZIReader object
% INPUT:
% tileSeparate. If true, add two more dimensions that are used as indices
% for tile position
%
% AUTHOR: Stefano Masneri
% Date: 13.10.2016
progBa... |
close all
global MMA_DEBUG;
global MMA_REL_TOL;
global MMA_ABS_TOL;
global MMA_FLAT_VERTEX_ON;
MMA_DEBUG = false; %set to true to MA_DEBUG
MMA_REL_TOL = 1e-6; % relative tolerance to merge nearby medial pts, etc
MMA_FLAT_VERTEX_ON = false; % set to true if you find some medial branches to be missing
... |
function filter_pred=TPMBM_prediction(filter_upd,F,Q,p_s,weights_b,means_b,covs_b,Lscan,k)
%Author: Angel F. Garcia-Fernandez
%TPMBM prediction
%Prediction for Poisson component
Ncom=length(filter_upd.Pois);
Nx=size(F,1);
for i=1:Ncom
filter_pred.Pois{i}.weightPois=p_s*filter_upd.Pois{i}.weightPois;
filter_p... |
run 'parameters.m'
filename = "../data/A_qpsk_32ksps_cnc_1.iq";
shift =0;
[f,errmsg] = fopen(filename, 'rb'); % change filename to whichever you want
iq_samples = fread (f, 20e6,'float'); % the entire file will be loaded onto memory. (Not an issue if RAM has around 500MB free space)
total_samples = length(iq_samp... |
clc
clear
%%.......Author: Claire Veillard..............%%
%%......Date 25/06/2019.......................%%
%% PREAMBLE
%See Veillard, C. M., John, C. M., Krevor, S., & Najorka, J. (2019).
%Rock-buffered recrystallization of Marion Plateau dolomites at
%low temperature evidenced by clumped isotope thermometry and
%X... |
%Name: Matlab/CUDA: Signals and Systems Lab 5th
%Auther: Changgang Zheng
%Student Number UESTC:2016200302027
%Student Number UoG:2289258z
%Institution: Glasgow College UESCT
%Question: Perform convolution. 3.5(d)(e)(f)(h)
function problem_3rd
%% problem 3.5(d)
N=64;
n=[0:63];
X1=[ones(1,8)];
... |
function [type ngc] = test_cris_grid(vchan)
% function [type ngc] = test_cris_grid(vchan)
%
% Returns the type (888 or 842) cris grid and the
% number of guard channels.
%
% INPUT
% vchan - list of channels
%
% OUTPUT
% type - 888/842 - HighRes or LowRes grid indicator
% Will return -1 if main grid is wr... |
function [clim] = View3D(vol,MIPs,map)
s = size(vol);
if exist('loc')
x = MIPs(1);
y = MIPs(2);
z = MIPs(3);
MIPs = 0;
else
MIPs = 1;
end
clim = [min(vol(:)), max(vol(:))];
if clim(1) < 0
clim(1) = 0;
end
if MIPs
imgx = reshape(max(vol,[],1),[s(2),s(3)])';
imgy = resha... |
clear all, close all
Im1=double(imread('testTY1.jpg'));
Im1=imbinarize(Im1);
h=[1,1,1;1,1,1;1,1,1];
Im1=imerode(Im1,h);
Im1=imerode(Im1,h);
Im1=imopen(Im1,h);
Im2=not(Im1);
[blackMatrix, n2]=bwlabel(Im2);
h= figure(1), imshow(Im1)
blackProperties=regionprops(blackMatrix,'all');
resultsT=(blackMatrix*0)+1;
resultsY=(bla... |
function [flt_timeseries] = FltInterp(flt_pos,hname,dname,VarOp, ...
h_filter,v_filter,t_filter)
%---------------------------------------------------------------------
%---------------------------------------------------------------------
%
% This function generates a time series ... |
function [varargout] = OneMeasReal_1D_Mkr(Data, SweepVals,ParamNames,MainParam,MeasurementName,AX,IsPreview)
% plot 1D data to line with marker at data point
% varargout: data parsed from QES format to simple x, y and z,
% varargout{1} is x, varargout{2} is y, varargout{3} is z, if
% not exist in data, ... |
# -*- octave -*-
function [z,zf,fs]=demod_efr
fn = "wav/iq_135kHz.wav";
[y,fs,bits]=wavread(fn);
fs
z = y(:,1)+1i*y(:,2);
f0 = 1e3*sscanf(fn(end-9:end-7), "%f");
fc = 139e3;
osc = @(f,fs, N) exp(2*pi*i*f/fs *[0:N-1]');
z .*= osc(f0-fc, fs, length(z));
bw= 1.8e3;
b= fir2(5000,[0 bw/fs bw/fs 1], ... |
/*
HTTP 请求的内容格式,告诉服务器的
Content-Type
multipart/form-data; boundary=可以是数字,字母的任意组合
1. boundary(分隔线),要求和 Content-Type 中保持一致
2. name 是上传文件脚本中的字段名 `userfile`,提示每个公司的字段名是不一样的,可以咨询后台人员
3. filename 是保在服务器上的文件名
4. Content-Type 上传文件的文件类型
大类型/小类型
text/plain
text/html
text/xml
image/png
image/jpg
image... |
function H2_matrix_eq = H2_matrix(L1,L2,theta1)
%H2_MATRIX
% H2_MATRIX_EQ = H2_MATRIX(L1,L2,THETA1)
% This function was generated by the Symbolic Math Toolbox version 7.0.
% 22-Oct-2018 17:33:03
t2 = cos(theta1);
t3 = sin(theta1);
H2_matrix_eq = reshape([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0... |
%% gen_sample_sig: Generate sample signal.
function sig = gen_sample_sig(f_sample, duration, t_total)
pos = 1;
part_len = floor(f_sample * duration);
sig_len = floor(f_sample * t_total);
sig = zeros(sig_len, 1);
while pos <= sig_len
sig(pos) = 1;
m = ceil(pos / part_len) - 1; % Ass... |
function heel_y_grad = heel_y_grad(in1)
%HEEL_Y_GRAD
% HEEL_Y_GRAD = HEEL_Y_GRAD(IN1)
% This function was generated by the Symbolic Math Toolbox version 8.4.
% 13-Jun-2020 13:02:33
q1 = in1(:,1);
q2 = in1(:,2);
q3 = in1(:,3);
q4 = in1(:,4);
q5 = in1(:,5);
t2 = cos(q1);
t3 = cos(q2);
t4 = cos(q3);
t5 = cos(q4... |
% ==========================
% Demo: ODE-based simulation
% ==========================
% Setup main model parameters
theta = 0.4;
d = 4;
initialAdoptionsProbability = 0.05;
startTime = 0;
stopTime = 150;
% Solve ODE to compute the fraction of adopters over time
[Time_ode, Adoptions_ode] = simODE (theta, d, ...
... |
function [ DB ] = boundary_error( feat1, feat2, readerobj )
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
frSize = size(read(readerobj,1)); % frame size
w = frSize(1); h = frSize(2);
blockSize = floor(w/3) * floor(h/3);
diff = ((feat1 - feat2).^2);
bs = 1... |
%#codegen
function [ ] = EnableInterrupts( )
% ENABLEINTERRUPTS Enables the hardware interrupts
coder.ceval('EnableInterrupts');
end
|
digitDatasetPath = fullfile(matlabroot,'toolbox','nnet', ...
'nndemos','nndatasets','DigitDataset');
imds = imageDatastore(digitDatasetPath, ...
'IncludeSubfolders',true, ...
'LabelSource','foldernames');
%should be power of 2 generally
imds.ReadSize = 512;
rng(0)
imds = shuffle(imds);
[imdsTrain,imdsVal,im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.