text stringlengths 8 6.12M |
|---|
function [ bs, block ] = Score( s, DNA, n)
% s - odkud začíná konsenzus
% DNA - typ cell, ve které jsou zadané sekvence
% n - jak bude konsenzus dlouhý (jak daleko od začátku je konec konsenzusu)
% bs .. to skóre součet maxim (frekvence)
% block .. výpis o jaké konsenzy se jednalo
for i = 1: length(DNA)
... |
clc
clear
close all
labeltsize=25;
fw = 'normal'; %%是否加粗斜体之类
fn='Times New Roman';
linewide1=5;
mkft = 15;
load 2N.mat
figure(1);
hold on
plot(SNRout,Pd_SGLRT_mc,'k-o','linewidth',linewide1,'MarkerSize',5)
plot(SNRout,Pd_SRAO_mc,'r-x','linewidth',linewide1,'MarkerSize',mkft)
plot(SNRout,Pd_SWALD_mc,'b-x','linewidth',l... |
% determine the 3dB mainlobe width
function res = res(af, delay_delta)
s = size(af);
res = zeros(s(1),1);
% loop across the Doppler axis
for jj=1:s(1)
% figure out the mainlobe boundary for this slice
[~, mid] = max(af(jj,:));
the_max = 0;
the_min = 0;
for ii=mid:s(2)
if af(jj,ii) < ... |
function analyzesim(varargin)
% function analyzesim(filename,opts)
% or analyzesim()
% Runs the standard set of analysis procedures on a file, or in the base workspace.
% Calculates center of mass, swimming direction, kinematic parameters,
% muscle work, fluid stress and energy. Saves to an output file
% ('outfi... |
classdef neighbourhood < handle
properties
label
m % row
n % column
end
properties (Transient)
n_selfneighs
end
methods
function obj = neighbourhood(m, n, varargin)
if nargin<1
obj.m = 1;
obj.n = 1;
... |
%Nhom 1
%53
%Pham Ba Tung
%B15DCDT221
I0=imread('chuoi.jpg');
size(I0)
subplot(2,2,1 )
imshow(I0)
I=rgb2gray(I0);
I1=im2bw(I0);
subplot(2,2,2)
imshow(I)
subplot(2,2,3)
imshow(I1)
[n m] = size(I);
T = 128;
for i=1:n
for j=1:m
if I(i,j) < T
I(i,j) = 0;
if j<m
I(i,j+1) = I(i,... |
function tokenList = split(str, delimiter)
% SPLIT Split a string based on a given delimiter
% Usage:
% tokenList = split(str, delimiter)
% Roger Jang, 20010324
tokenList = {};
remain = str;
i = 1;
while ~isempty(remain),
[token, remain] = strtok(remain, delimiter);
tokenList{i} = token;
i = i+1;
end
|
% CLASSIFYRBFN Classify data with radial basis function network.
% OUT = CLASSIFYRBFN(X,MODEL) classifies the data in X (N samples-by-D
% features) by using a radial basis function network (RBFN), where MODEL is
% a structure with the RBFN parameters: centroids, spreads, and weights.
% OUT is a structure wit... |
% this function is to calcaluate and draw 2 dimensional histogram.
function samples = twoDbin
load PTsampleing.mat;
X = chain(:,1);
Y = chain(:,2);
xbins = -1.5:1:1.5;
% xbins(find(xbins==0))=[];
ybins = -1.5:1:1.5;
% ybins(find(ybins==0))=[];
xNumBins = numel(xbins);
yNumBins = numel(ybins);
Xi = round(interp1(xbin... |
function [Vstart,Vstop,Xstart,Xstop] = create_goal(fig)
cmap = lines(5);
F = [1 2 3 4;
5 6 7 8;
1 2 6 5;
2 3 7 6;
3 4 8 7;
1 4 8 5];
% Start
x = 130;
y = 300;
z = 20;
w = 20;
h = 20;
Vx_start = [x x+w x+w x x x+w x+w x];
Vy_start = [y y y+h y+h y y y+h y+h];
Vz_start = [0 0 0 0 z z z z];
Vstart =... |
% Enhances the contrast of the image
% Adapted from http://imageprocessingblog.com/histogram-adjustments-in-matlab-part-i/
function [out] = enhance_contrast(im)
hsvimg = rgb2hsv(im);
for ch=2:3
hsvimg(:,:,ch) = imadjust(hsvimg(:,:,ch), ...
stretchlim(hsvimg(:,:,ch), 0.01));
end
out =... |
clc
clear all
close all
%
% a=input('Enter the Choice')
disp('This is a MASK of Median Filter')
q1=input('Enter the size of Mask ')
g1=[1 1 1;1 1 1;1 1 1]
subplot(2,2,3)
imshow(g1,[])
title('This is Mask')
a1=imread('cameraman.tif');
subplot(2,2,1)
a11=double(a1);
imshow(a1)
title('Original image')
... |
%% Params
verbose = 0;
use_interval = true;
solvers = {'mosek' 'mosek_INTPNT_ONLY' 'sedumi' 'sdpt3'};
basis = 'CG_red';
slack = 'slack(z=x+t-1)'; slackcode = 3;
%slack = 'slack(z=x-t)'; slackcode = 1;
nout = 5;
dist_A = low2high_dist('W-type', nout, use_interval, 0);%infea
dist_B = low2high_dist('uniform', nout, use_i... |
function [ numfluxSolver, surfluxSolver, volumefluxSolver ] = initFluxSolver( obj )
%INITNUMFLUXSOLVER Summary of this function goes here
% Detailed explanation goes here
if obj.option.isKey('NumFluxType')
if obj.option.isKey('nonhydrostaticType')
if obj.getOption('NumFluxType') == enumSWENumFlux.HLL &&.... |
function [ vwillr ] = percentr( vtime,vhigh,vlow,vclose,len )
%PERCENTR 计算willr,根据mc
% version 1.0 , luhuaibao, 2013.9.27
[~,id] = sort( -vtime );
% 最近的排在上面
vhigh = vhigh(id);
vlow = vlow(id);
vclose = vclose(id);
var0 = max( vhigh(1:len ) );
var1 = var0 - min( vlow(1:len) ) ;
if var1 ~= 0
vwillr = 100 - (... |
clear, clc
xrng = [100 1000];
yrng = [-350 350];
xdiv = 40;
ydiv = 40; % number of x/y divisions
hbins = linspace(xrng(1), xrng(2), xdiv);
vbins = linspace(yrng(1), yrng(2), xdiv);
frmat = zeros(xdiv, ydiv);
frtrls = zeros(xdiv, ydiv);
targetdir = 'C:\Users\Hrishikesh\Data\krPTBData\';
[filename pathname] = uiget... |
% Extract pixel pairs from both HSI and RGB images manually and let the
% algorithm to pick up some random pixels for manifold alignment.
if ~exist('hsiToRgbManifoldDatasetGen', 'var')
hsiToRgbManifoldDatasetGen = false;
end
if hsiToRgbManifoldDatasetGen
fb_HSI_Image = RotateHsiImage(hsiCubeData.Dat... |
function [ out ] = nonan_Image( img )
out = zeros(size(img));
for k=1:size(img,3)
for i=1:size(img,1)
for j=1:size(img,2)
if ( isnan(img(i,j,k))) out(i,j,k)=0;
else out(i,j,k) = img(i,j,k); end
end
end
end
end
|
function RunBatNew( filename )
%RUNBAT runs a batch file via Windows start menu using Java Robot class
%Input:
% <filename> batch file (.bat)
%CL
% Get Windows version
winvers = system_dependent('getos');
% Create java robot to generate native system input events
import java.awt.Robot;
import java.awt.event.*;
r... |
clear ; %clears all the variables
close all; %closes extra windows
clc %clears the screen
% =============================================================== Part 1: K MEANS ======================================================
% ----------------------------------------------------------(a)--------------------... |
function [ X, interactionX ] = createAgeGenderSizeRegressionMatrix(groupVector,polynomialDims,varargin)
numCovars=length(varargin);
% Create a balanced groupVector
positiveGroup=find(groupVector > 0);
numPositive=length(positiveGroup);
negativeGroup=find(groupVector < 0);
numNegative=length(negativeGroup);
groupVect... |
function interactive_graph_gui
% data
showLabels = true; % flag to determine whether to show node labels
prevIdx = []; % keeps track of 1st node clicked in creating edges
selectIdx = []; % used to highlight node selected in listbox
pts = zeros(0,2); % x/y coordinates of vert... |
clear; close all; clc;
%% Threshhold, Adaptive Equal
% I = imread('fingerprint.png');
% I = double(I);
% fingim = otsu(I);
% figure('Name','Adaptive Equalization, Fingerprint');
% subplot(1,3,1);imagesc(I); title('Original Image');
% subplot(1,3,2);imagesc(fingim); colormap gray; title('Otsu Threshold');
% adt = ... |
%time_score driver
% sets paths to kml files and a wrfout, then runs the time_score function
kml_path = '/bigdisk/james.haley/wrfcycling/wrf-fire/wrfv2_fire/test/TIFs/doc.kml';
wrfout_path = '/bigdisk/james.haley/wrfcycling/wrf-fire/wrfv2_fire/test/cycling_best_ig_single/wrfout_d01_2013-08-13_00:00:00';
time_score(km... |
function d = mismatch( h1, h2 )
% MISMATCH computes the mismatch distance between the two histograms
d = sum ( h1 ~= h2 );
end |
clear
clc
close all
A = tf([1.3],[1,1.3])
G = tf([1],[.00303,0,0])
H = tf([1000],[1,1000])
GOL = A*G*H;
bode(GOL)
margin(GOL)
figure()
rlocus(GOL)
C1 = tf([1,1],[1,650])
C2 = tf([1,5],[1,300])
C = C1*C2;
CGOL = C*GOL
bode(CGOL)
margin(CGOL)
figure()
rlocus(CGOL)
K = 5;
GCL = K*CGOL/(1+K*CGOL);
figure()
step(GCL)
figur... |
function mtlscale(infile, outfile, factor)
%function mtlscale(infile, outfile, factor)
[file_type,info_blocks,n_channels,n_lines, sampling_rate,...
first_line,last_line,n_directions,comment1, comment2] = mtlrh(infile)
if (file_type ~= 2) error('Wrong filetype'); return; end;
if (nargin < 3) factor=1; end;... |
function result = xcat(dim,varargin)
% Array concatenation with singleton expansion.
% Author: Vladimir Golkov
if ~isscalar(dim) && ~isempty(dim)
% dim not provided, first argument is array
varargin(2:end+1) = varargin; % TODO is this fast?
varargin{1} = dim;
end
sizelist = [];
for i=1:numel(varargin)
s... |
function [T] = makebins(Set,Y,bins)
% MAKEBINS divides a given data set into cell bins
% -Set is the Data set (usually consisting of alignment identity score
% values and their respective sequences
% -Y is the result of running MATLAB's discretize function on Set
% -bins is the number of bins that the data wi... |
% testing the stereo door corner camera
addpath(genpath('../utils/pyr'));
addpath(genpath('../corner_cam'));
addpath(genpath('../stereo_cam'));
close all; clear;
npx = 80;
width = npx/10;
floornpx = 80;
nsamples = 80;
% door is centered at origin
door_corner1 = [-1 0 0];
door_corner2 = [1 0 0];
door_width = abs(door... |
function LoadGamma(CLUT)
physicalDisplay = 1;
Display.ScreenID = 0;
[OriginalGammaTable, dacbits, reallutsize] = Screen('ReadNormalizedGammaTable', Display.ScreenID);%, physicalDisplay);
save('OriginalSetup3CLUT.mat', 'OriginalGammaTable');
CLUT = 'NIH_Setup3_ASUS_V27.mat';
load(CLUT);
AllScreens = Screen('Screens')... |
% min_angle = minAngle(angles_array, indices_of_min_energy)
% This function extracts the angles corresponding to minima in energy;
function min_angle = minAngle(energies, indices)
min_angle = angles_array(indices_of_min_energy);
end |
close all
clear all
clc
%%
code_folder = '/Users/akira/Documents/GitHub/MN-Model/Test Size';
data_folder = '/Users/akira/Documents/GitHub/MN-Model/MN Parameter';
%%
type = 'S';
%%
model_folder = '/Users/akira/Documents/GitHub/Twitch-Based-Muscle-Model/Model Parameters/Model_8';
cd(model_folder)
load('modelParameter')... |
function z = polynomial_probs(data,n,resolution,lim)
C = mean(data,1);
R = max( vecnorm(data-C,2,2) );
P = @(L) max( 1 - (norm(L-C)/(3*R))^n, 0 );
X = linspace(-lim,lim,resolution);
Y = X;
[Xg,Yg] = meshgrid(X,Y);
Z = zeros(size(Xg));
for i=1:resolution^2
xx = Xg(i);
... |
% function m = Gaussian(n)
clear; clc; close all;
n = 10;
m = zeros(ceil(6*n),ceil(6*n));
sigma = 3*n;
% for i = 1:n
% for j = 1:n
% top = -(i^2+j^2)/(2*sigma^2)
% m(i,j) = 1/(2*pi*sigma^2) * exp(top);
% end
% end
io = floor(size(m,1)/2);
jo = floor(size(m,2)/2);
for i = 1:size(m,1)
for j = 1:size(m... |
function [ output_args ] = StressPlot( Maps )
%STRESSPLOT Summary of this function goes here
% Detailed explanation goes here
figure
% S11 = Maps.S12_F;
% S12 = Maps.S12_F;
% S13 = Maps.S13_F;
% S22 = Maps.S22_F;
% S23 = Maps.S23_F;
% S33 = Maps.S33_F;
S11 = Maps.crop.S{1,1};
S12 = Maps.crop.S{1,2};
S13 = Maps.... |
function T_new = transform_TFT(T_old,M1,M2,M3,inverse)
% Tranformed TFT
%
% short function to transform the TFT when an algebraic transformation
% has been aplied to the image points.
%
% if inverse==0 :
% from a TFT T_old assossiated to P1_old, P2_old, P3_old, find the new TFT
% T_new associated to P1_new=M1*P1_ol... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 本函数用于下载指定证券代码(多个请用‘,’隔开)相应指定起始和截止日期之间的日
% 行情数据,保存到backtest Cache中,文件名为证券代码。
% 这里的日行情数据格式如下:
% 732686 4.460868254 4.48874868 4.419047614 4.453898147 11022101 6.39 215.9386515
% 732687 4.426017721 4.432987827 4.286615588 4.377226974 21426743 6.... |
%% Utility functions
classdef Util < handle
%%
methods (Static)
%%
% Scale and randomize data (matrix or filename). Use for
% convenience instead of individual functions.
function [data outfile] = scaleAndRandomize(data, numOutputs, inputMinValue, inputMaxValue, outputMinValue, output... |
function [itrs, w_s, AUCs, timing] = OPAUC(X,y,X_test,y_test,eta,lambda,n_delta,u)
% Usage: OPAUC algorithm
% nargin < 8: standard OPAUC
% nargin == 8: OPAUCr (OPAUC for large scale data)
% Author: xzhang
% Date: 2017.11.16
% Version: 1.2
tic;
'new~'
% Returns
AUCs = [];
itrs = [];
timing = [];
w_s = ... |
%Name:
% getu
%
%Purpose:
% This method will be used to apply the Dirichlet boundary condition.
% Where Vbound indicates we need the displacement to be zero.
%
%Parameters:
% A - ((2x#vertices) x (2x#vertices)) stiffness matrix
% F - ((2x#vertices) x 1) vector which represent the force value of each
% ... |
clc
clear
% x = [1,2,3;4,5,6;];
x = double(rgb2gray(imread('/Users/INNOCENTBOY/Documents/MATLAB/pic/256/4.1.01.tiff')));
h = ones(5,5);
% h = h/25;
M= size(x,1);
N= size(x,2);
m= size(h,1);
n= size(h,2);
h2 = fft2(h,M+m-1,N+n-1);
x2 = fft2(x,M+m-1,N+n-1);
h1 = fft2(h,M,N);
x1 = fft2(x,M,N);
out = x1.*h1;
out = ifft2(o... |
function pixelgrid( h )
% Generates horizontal and vertical pixel grid lines for every pixel in an
% open image specified by the handle h. Operates on an already displayed
% figure and image.
%
% Required Input
% ==============
% h Figure handle correspoding to the open image to operate on
%
% Reference
% =====... |
function[nll] = negPopLogLikelihood(motion,f,r,params)
% function[nll] = negPopLogLikelihood(motion,f,r,params)
%
% motion: (e.g., specifies [direction, speed] for xz motion)
% f: tuning curve function handle
% r: "neural responses"
% params: parameters for tuning curves
%
% nll: negative loglikelihood
%
% ... |
function [mapout,xgrid] = sz1SM(data,paramstruct)
% SZ1SM, Significant derivative Zero crossings
% Steve Marron's matlab function
% Creates color map (function of location and bandwidth),
% showing statistical signicance of slope of smooth
% Colored (or gray level) as:
% blue (dark) at p... |
classdef AbstractAnimator < handle
% An abstract animator class
%
% @author omar @date 2017-06-01
%
% Copyright (c) 2017, UMICH Biped Lab
% All right reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted only in compliance wi... |
function pdMat = randPD(n)
[u,~,~] = svd(rand(n,n));
pdMat = u * diag(rand(n,1)) * u'; |
% history points for smoothWavyWall
%
%-----------------------------------------------------%
% points
nx=10; % nx=number of x-points
ny=100; % ny=number of y points per x-location
h=0.50; % height to go up to in Y
casename='smoothWavyWall';
%-----------------------------------------------------%
% get x locations fro... |
% Reads multiple folders recorded on same/different days and produces
% matrix with all sessions and folders recorded
%
% Revision history:
%
% v1.0 September 1, 2016. Basic script prepared.
% Data file is format:
% [subjectName_Date_chChannelNumber_uUnitNumber_unitType.mat]
% (for example: aq_20161231_ch1_u1_m.mat);
... |
function summary=SG_analyse_bootstrap(N,restricted)
if nargin==0
N = 1000 ;
end
%nDS = numel(dir(sprintf('../results/bootstrap/data*_r%d.mat',restricted)))/45 ;
nDS = 100;%
%effect_types = {'dynamics','choiceUpdate','successUpdate','forceUpdate'};
% for each random group
parfor iB=1:N
rng('shuffle');
... |
%% *_Branin Function_*
%
% Syntax:
% Y = UQ_BRANIN(X)
% Y = UQ_BRANIN(X,P)
%
% The model contains M=2 (independent) random variables (X=[X_1,X_2])
% and 6 scalar parameters of type double (P=[a,b,c,r,s,t]).
%
% Input:
% X N x M matrix including N samples of M stochastic parameters
% P vector including parameter... |
function varargout = colorSelector(varargin)
% COLORSELECTOR MATLAB code for colorSelector.fig
% COLORSELECTOR, by itself, creates a new COLORSELECTOR or raises the existing
% singleton*.
%
% H = COLORSELECTOR returns the handle to a new COLORSELECTOR or the handle to
% the existing singleton*.
%
% ... |
ps = ProcessDays(psparse,'IntraGroup','Cells',ndresp.SessionDirs,'AnalysisLevel','AllIntraGroup');
InspectGUI(ps)
figure; plot(ps)
% compare mean lifetime sparseness and median population sparseness
load sparsityobjs
% get indices grouped according to site
gind = groupDirs(sparseframe);
% find sites with more than 1... |
function [dat] = mainFrequencyAnalysis(dat);
%H1 Line -- loop to calculate on frequency analysis on a structure array
%Help Text --
%input requirements: dat is a structure array (output of impHYDAT)
%
%output details: dat, is the same arry entered in output with a filed that
% contain the frequency ... |
function [ret] = showPossible(i_x, i_y)
global board;
thisPiece = board(i_x,i_y).possible;
thisPiece(isnan(thisPiece)) = 0;
ret = thisPiece;
end
|
%Author : Vignesh Waren Sunder
%Signal Digitisation and Reconstruction
%Coded using MATLAB R2019a- academic use
%GitHub: vicky-ML
close all
clc
%Generating Signal
t = 0:0.001:2; % set the time domain range (1 to 2 with 1000 steps)
f1 = 6;
f2 = 9;
x = sin(2*pi*f1*t)+sin(2*pi*f2*t); %Sanalog
figure
sub... |
clc
clear all;
close all;
global epsilon;
global p;
%ep = 0.001;
eps = linspace(3,3,1);
iter = linspace(1,1,1);
epsilon = 0.01;
op = odeset('reltol',1e-9,'abstol',1e-11);
for i=iter
figure(i)
hold on;
p=eps(i);
epsilon = 0.1/(p^3)
val = epsilon*(p^3)
[t,y] = ode45('mms2d',[0,1000],0.01,op);
... |
function h = mrpln02b_PlotPairwiseFactorsInFG(fg, values, plot_flags)
factor_color = plot_flags.factor_color;
factor_line_width = plot_flags.factor_line_width;
factor_linestyle = plot_flags.factor_linestyle;
h = []; odometryPathXCoords = []; odometryPathYCoords = [];
for i=0:double(fg.size)-1
if ~fg.exists(i), co... |
function second = Q_ra(x_1,x_1_r,x_2,x_2_r,P_a,P_b)
% Eq. 4 in Ref.[2]
second=P_b*(x_2-x_2_r)/((x_1-x_1_r+P_a*(x_2-x_2_r))^2+(P_b*(x_2-x_2_r))^2);
end |
%NAME: Jadeja Jaydevsinh G.
%ROLL NO: 12MEC08
%BATCH: ME-2nd sem,2013
%DEPARTMENT: Electronics & Communication.
%SUBJECT: ADC
%1.Aim: To verify the nyquist theoram.
close all;
clear all;
t=-10:0.01:10;
T=8;
fm=1/T;
x=sin(2*pi*fm*t);
subplot(311);plot(t,x);
n=-10:1:10;
j=ones(1,length(n));
subpl... |
%% This code is the code of the part 3
%% Calcul of matrix Ks and Ms
% function Part3(Samcef)
close all
run Dimensions
run Geometry
nElementT = 0;
for i = 1 : 45
nElementT = nElementT + element(i,5);
end
nodeList = zeros(nElementT,3);
basic_dofs = zeros(29,6);
for i = 1:29
basic_dof... |
% Marco Bettiol - 586580 - BATCH SIZE ESTIMATE
%
% CBT Simple Test
%
% This script implements a simulation of the estimate obtained
% using CBT in a batch of size n.
%
% Nodes are initially uniformily picked-up in the interval [0,1)
clear all;
close all;
clc;
n=16; % batch size
disp(['Size :' int2str(n)]);
nodes=... |
function [A,X,res] = DN_NMF(Y,opts)
%function [A,X,res] = nmf_qp_cg(Y,A,X,MaxIter,tol_c,lambda)
% The Damped Newton (DN) algorithm developed by
% Copyrirght R. Zdunek, A.-H. Phan, and A. Cichocki
%
% DN
%% line 61 is changed
defopts = struct('NumOfComp',[],'A0',[],'X0',[],'MaxIter',500,'Tol',1e-6,'lambda',1); % Theta... |
%clear
% ---------------------------------------------------------------------- %
% 実験設定。
% クエリ数を変更した際にはデータセットを新しく用意する必要があります。
% ---------------------------------------------------------------------- %
%実験名
exName = 'ex1204stl';
%実験日
todaysDate = datetime('now','TimeZone','local','Format','yMMd');
% iExperiment: 何周目の実... |
function [ array_stddev, array_mean ] = my_stddev( one_dim_array )
% pusing bro, ada obat nyamuk?
% dapatkan panjang array
n_array = length(one_dim_array);
% dapatkan nilai mean
array_mean = my_mean(one_dim_array);
% dapatkan stddev kuadrat
stddev_sum = 0;
for i = 1:n_array
stddev_sum = stddev_sum+((one_dim_arra... |
%% A. Benchmark
ngrid=8361;
grouprankmtgppv7alls120g8361mars=zeros(ngrid,12);
for ns=1:ngrid
[transdat,lambda] = boxcox((senscoreMARSgppv7alls120g8361(ns,:)+1)');
Y = pdist(transdat);
Z = linkage(Y,'ward');
[~,T] = dendrogram(Z,4);
orimax=zeros(4,1);
for i=1:4
orimax(i,1)=max... |
%Q6*
function [image, correctLabel, predictedLabel] = PredictTest (n)
allTrainImages = loadMNISTImages('./train-images.idx3-ubyte');
allTrainLabels = loadMNISTLabels('./train-labels.idx1-ubyte');
mdl = fitcknn(allTrainImages', allTrainLabels);
allTestImages = loadMNISTImages('./t10k-images.id... |
function s = accuracy(x,y,value)
[ m, n ] = size(x);
if ( n != 1)
error('x is not a column vector');
endif
[ m, n ] = size(y);
if ( n != 1)
error('y is not a column vector');
endif
if (length(x) != length(y))
error('inputs column vectors x and y should have the same length');
endif
R = x >= value;
TP = sum(R.... |
function [ digit ] = FindDigit( I )
dir = 'letters/';
ext = '.bmp';
max_coeff = -2;
for i = 1:10
im = imread([dir sprintf('%d', i-1) ext]);
coeff = corr2(im, I);
if coeff > max_coeff
max_coeff = coeff;
digit = i-1;
end
end
end
|
function saveAsAvi_AI_ratio(matFilesPath, matFilesPrefix, aviFilesPath, aviFilesPrefix, ...
radius, nSides)
%% saving a video for changing activator/inhibitor levels
% in the colony.
files = dir([matFilesPath filesep matFilesPrefix '*.mat']);
nTimePoints = numel(files);
videoPath = [aviFilesPath filesep aviFiles... |
clear
% For plotting
h = figure;
hold on;
grid on;
title('Earth temperature vs albedo');
xlabel('Temperature (K)');
ylabel('Albedo');
% Variables
alpha = 0; % Albedo - describes how much sunlight Earth reflects.
sigma = 5.67 * 1e-8; % Stefan-Boltzmann constant - total intensity.
I = 344; % Incident - short-wave radia... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 10