text stringlengths 8 6.12M |
|---|
cd c:/users/butr2901/pictures/;
icon = imread('fxlogo.png');
newicon = zeros(512,512,3) ;
for i=1:3 ; newicon(:,:,i) = imresize(icon(:,:,i),[512,512],'Method','nearest') ; end
newicon = uint8(mat2gray(newicon)*255) ;icon = newicon;
%binicon = (icon>mean(icon(:))*.75);
% imwrite(uint8(mat2gray(binicon)*255),'... |
function [w]=weights(xC, xF)
% Gives the linear interpolation weights for internal faces
%
% [w]=weights(xC, xF)
%
% w: linear interpolation weights
% xC: cell centers
% xF: face centers
% Face interpolated field allocation
w=abs(xC(2:end)-xF(2:end-1))./abs(xC(2:end)-xC(1:end-1));
end
|
function [] = ...
iota_evolution_view(evolution_parameter_file_in)
% function [] = ...
% iota_evolution(evolution_parameter_file_in, SHOW_PLOTS, RUN_EVOLUTION)
%
% evolution_parameter_file_in = filename of specification
% FIX THIS PATH FOR YOUR FILE STRUCTURE
%output_path = 'D:\JohnS\Plots and Notes\Ti... |
function out = ComputeROpt(s_est, brdf_est_sparse, brdf_est_sparse_indices, brdf_est_dim1, brdf_est_dim2, g_flat, alpha, tau, nmove, nsource, wall_points, wall_points_ids, T)
% 1.1.1 Compute V
R = 0;
brdf_est_opt = UnSparsify(brdf_est_sparse, brdf_est_sparse_indices, brdf_est_dim1, brdf_est_dim2);
brdf_... |
Gd = tf([1],[4 1]);
Gg = tf([0.4 0], [0.4 1]);
Gp = tf([1 0],[1 2 1]);
G2 = tf([1],[2 0.1 1]);
% Charakterystyki Filtr�w
figure;
bode(GD);
title('Filtr Dolnoprzepustowy ');
figure;
bode(GG);
title('Filtr Górnoprzepustowy');
figure;
bode(GP);
title('Filtr Pasmoprzepustowy');
figure;
bode(G2);
t... |
function produceavifrompic(pfrom,pto,pext,navi)
aviobj = avifile(navi);
aviobj.Quality = 100;
aviobj.compression='None';
cola=0:1/255:1;
cola=[cola;cola;cola];%%grey image
cola=cola';
aviobj.colormap=cola;
for i=pfrom:pto
fname=strcat(num2str(i),pext)
adata=imread(fname);
aviobj = addfra... |
function [C]=ilagrange(X,Y)
%idea sacada de internet codigos metodos numericos
[n,m]=size(X);
L=zeros(m);
for k=1:1:m
p1=1;
for j=1:m
if k ~=j
p1=conv(p1,poly(X(j)))/(X(k)-X(j));
end
end
L(k,:)=p1;
end
C=Y*L;
%http://sg... |
clc;
clear all;
close all;
%define modal parameters
wn1 = 350.46; % rad/s
zetaq1 = 0.035;
kq1 = 2.782e5; % N/m
wn2 = 988.76; % rad/s
zetaq2 = 0.099;
kq2 = 1.750e6; % N/m
M = [2 0;0 1];
C = [200 -120; -120 120];
K = [1e6 -6e5; -6e5 6e5];
%Define direct FRF
w = (0:0.2:1500)'; % frequency,rad/s
r1 = w/wn1;
r2 = w/w... |
function [ channel,best ] = OptimizeLineWithWall( test_case,channel,set_energy,linelength1,theta1,linelength2,theta2,linelength3,theta3,linelength4,theta4 )
%optimize the four line with four seperating wall
% remove the orignal line
% find the line that minimize delta T in it's own area
% ____________
% | T1 | ... |
function tri = triangulateFaces(faces)
%TRIANGULATEFACES Convert face array to an array of triangular faces
%
% TRI = triangulateFaces(FACES)
% Returns a 3-columns array of indices, based on the data stored in the
% argument FACES:
% - if FACES is a N-by-3 array, returns the same array
% - if FACES is... |
function disp(x)
% Copyright 2010-2012 The MathWorks, Inc.
if iscell(x)
nn_disp_text(x)
elseif isstruct(x)
switch x(1).type
case 'file_hit'
nn_disp_file_hit(x)
case 'text_hit'
otherwise
end
end
end
function nn_disp_text(text)
for i=1:length(text)
ti = text{i};
if... |
function [hasil1,hasil2] = matchColor(ciri1)
load red.mat
mred = cm;
load green.mat
mgreen = cm;
load blue.mat
mblue = cm;
load yellow.mat
myellow = cm;
warna_model = struct('nama',{});
warna_model(1).nama = 'merah';
warna_model(2).nama = 'hijau';
warna_model(3).nama = 'biru';
warna_model(4).nama = 'ku... |
% BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
% FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
% OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
% PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
% OR IMPLIED, INCLUDING,... |
realdrag32 = VarName3
FlowTime = Forcecoefficients;
mean(realdrag32)
plot(FlowTime,realdrag32,'r-','DisplayName','dynamicKEqn');
axis([300 900 -1.5 2]);
legend('show');
xlabel('Time (second)','FontName','Times New Roman','FontSize',14)
ylabel('Cd','FontName','Times New Roman','FontSize',14,'Rotation',90)
print(gcf, '-d... |
function safeCell = safeFieldName( strCell, varargin )
remove = {'(', ')', '?'};
replace = {...
'=', 'eq'; ...
'%', 'percent'; ...
};
replaceUnderscores = {' ', '.', ',', '\', '/', '-', '[', ']'};
lowercaseFirst = true; % convert first letter of field name to lowercase
useUnderscores = false; % convert some... |
function output = XuNonParalyzableDistri(n,t,tau,k)
m = n*t;
z = n*tau;
k_upper = floor(m/z)-1;
if k>k_upper
error('k need to be smaller than t/tau!')
else
if k~=0
lambda = m-(k)*z;
output = poisspdf(k,lambda)+gammainc(lambda+z,k) - gammainc(lambda,k);
else
output = exp(-m);
e... |
function [y] = euler(x , psy , pot)
global dt
k1 = eq_schro(x, psy , pot);
psy = psy + dt * k1;
y= psy;
end
|
% greet_me
% asks user for name, and greets them
% program asks user for their name
% checks for dashes on lines of code [done]
myname = input('What is your name?','s');
%'s' makes the input a string, variable myname
fprintf('Hello, %s.\n',myname,'how are you today?')
% %s for string
% \n for new... |
%% Exercise 2 - Big Mac Nutritional Data
%% 2.1 Import data
load Exercise2.mat;
%% 2.2a Aggregate variables to create a 1-by-8 cell array
% c1 is a 1-by-8 cell array, each cell of which contains a 27-by-1 entity
c1 = {country,energy,carbohydrates,protein,fat,fiber,sodium,serving_size};
%% 2.2b Aggregate variables to... |
%GMMB_FJ - Figueiredo-Jain estimated GMM parameters
% Produces a bayesS struct without 'apriories' or NaN in case of failure.
%
% Works with complex numbers directly.
%
% estimate = GMMB_FJ(data[, parameters])
% Parameters (default):
% Cmax the maximum number of GMM components
% set to -1 to use all data points ... |
function reduceVM_SRG(parameter, id, th)
%* VM(x1, (yj,zi))
id6 = id + 3 * (th - 1) ;
suffix = parameter.systemSuffix{id6} ;
fileNameVM = ['VM', suffix, '.mat'] ;
load(fileNameVM, 'VM')
subNo = VM.subNo ;
n = 0 ;
while subNo > 0
QN = VM.quantNo(:, 1) ;
equalX1 = (QN(1) == VM.quantNo(1, :)) ;
... |
% Wenn P, C, R und K gegeben ist
% Ziel: u und v berechnen
% benutze getUandV-Funktion
clear;
P = [8;-1;1]; % TODO
C = [4;2;3]; % TODO
R = eye(3); % kann in der Prüfung anders sein
K = [ % TODO
640 0 320;
0 480 240;
0 0 1;
];
[u, v] = getUandV(P, K, C, R);
fprintf('u =\t%d\n', u);
fprin... |
function pole_cplx = cplxpole(zta,wn,w,flag)
%
% Utility function: CPLXPOLE
%
% The purpose of this function is to compute the magnitude response of a
% complex pole or zero.
% Author: Craig Borghesani
% Date: 8/8/94
% Revised:
% Copyright (c) 1999, Prentice-Hall
if length(flag)==1,
s = sqrt(-1)*w(:)';
... |
function [x,y] = Bisection(f,a,b,tol)
fa = f(a); v=1; if fa>0, v=-1; end
if fa*f(b)>0
error('f(a) and f(b) have the same sign')
end
if (nargin<4), tol=0
end
x = (a+b)/2;
while (b-a>tol) && ((a<x) && (x<b))
if v*f(x)>0, b=x; else a = x; end;
x = (a+b)/2;
end
if nargout == 2, y=f(x); end;
|
function [tx, bits, gain] = txMosquito()
% Constants
fsep = 8e4;
nsamp = 16;
Fs = 120e4;
M = 16;
% Global feedback
global feedback_mosquito;
uint8(feedback_mosquito);
% Initialize feedback
if isempty(feedback_mosquito)
feedback_mosquito = 0;
end
% Decode feedback variable
block_mosquito = bitand(feedback_mosquit... |
%% EEPos UDF
% Purpose:
% Inputs:
% Outputs:
function [T,currenteepos,currenttheta] = EEPos(M,Slist)
ctheta = Talk(1,0);
T = FKinSpace(M,Slist,((ctheta/360)*2*pi)');
currenteepos = [T(1,4) T(2,4) T(3,4)];
currenttheta=ctheta;
end |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author: Mathieu Bresciani
%
% Computes time-optimal trajectory with initial and final conditions
% for position and velocity, velocity saturation and maximal acceleration
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function [output1] = Jb_LeftKneeSpringJoint(var1)
if coder.target('MATLAB')
[output1] = Jb_LeftKneeSpringJoint_mex(var1);
else
coder.cinclude('Jb_LeftKneeSpringJoint_src.h');
output1 = zeros(6, 20);
coder.ceval('Jb_LeftKneeSpringJoint_src' ...
,code... |
function [rotation_axis,rotation_increment]=rotation1(mean_ui,mean_vi)
xm=mean_ui;
ym=mean_vi;
m=sqrt(xm^2+ym^2);
rotation_increment=m;
teta = mod(atan2(ym,xm),2*pi)*180/pi;
if (teta>=315 && teta<=45) || (teta>=135 && teta<=225)
rotation_axis=[0 1 0];
elseif (teta<135 && teta>45) || (teta... |
% test splitting
%
% WTJ, 20190802
%%
% fm = 1.84838045e+09;
fm = 1.85066e+09;
znb.frange(fm);
%%
% 30 dB atten on the output, cable loss ~ 3 dB
znb.power(-50);
% znb.power(-17);
%% RF power sweep
% pows = W2dBm(linspace( sqrt(dBm2W(-50)), sqrt(dBm2W(-17)), 100 ).^2);
% redo, 20190807
pows... |
function X = SynthMMV(Y, HforVec, err, normfac)
% Solves problem of the form:
% min ||X||_2,1 s.t. ||Y-HX|| < err
% Inputs
% Y - n x r observation vectors
% H - n x N projection operator
% err - error tolerance
% normfac - maximum eigenvalue of projection operator
% Outputs
% X - N x r input vectors to b... |
function []=pendulum(th0, w0, F, n)
h=60/(n-1);
u=[th0, w0];
ut=zeros(2, n); ut(:,1)=u;
ti=0;
for i=1:n-1
k1=h*timeD(ti, u, F);
k2=h*timeD(ti+h/2, u+k1/2, F);
k3=h*timeD(ti+h/2, u+k2/2, F);
k4=h*timeD(ti+h, u+k3, F);
u=u+(k1+2*k2+2*k3+k4)/6;
ti=ti+h;
ut(:, i+1)=u;
end
t=linspace(0,60,n);
fi... |
% The function returns an array of modulation signs. The decided modulation
% signs represent the shortest distance between each element of x and the
% modulation signs of the constellation array.
function y = decision(x, const)
szX = length(x);
szConst = length(const);
distances = zeros(1, szConst); % initiate arrays... |
function [adjImg,imgPat,imgPat5,splitPat1,thin1]=TakeandProc(exposure)
%TAKEANDPROC Summary of this function goes here
% Detailed explanation goes here
cam=ReadyCam(exposure);
adjImg=takeimage(cam);
imbw=removingPixel(bradley(adjImg, [555 415], 5),800,1);
imRe=removingNoise(adjImg,imbw);
imgPat=bradley(imRe, [3 ... |
%@(#) setsparse.m 1.3 97/11/05 12:24:35
%
%function A=setsparse(Ain,i,j,x)
function A=setsparse(Ain,i,j,x)
[ia,ja]=size(Ain);
if max(i)>ia, Ain=[Ain;zeros(max(i)-ia,ja)];[ia,ja]=size(Ain);end
if max(j)>ja, Ain=[Ain zeros(ia,max(j)-ja)];end
A=setspars(Ain,i,j,x);
|
function [dates vals est] = GetSomethingByDay(tabla,oper,minyear,maxyear,drawFig, conn)
%%% GETSOMETHINGBYDAY Gets one operation by day
datos = {};
sqlquery = fileread('../DB/SQL_queries/Matlab/CustomByDay.sql');
sqlquery = strrep(sqlquery,'TABLE',tabla);
sqlquery = strrep(sqlquery,'OPER',oper);
... |
function vennmyown(k1,k2,k3)
if islogical(k1)
a7=sum(k1&k2&k3);
a2=sum(and(k1,k2))-a7;
a6=sum(and(k1,k3))-a7;
a1=sum(k1)-a2-a6-a7;
a4=sum(and(k2,k3))-a7;
a3=sum(k2)-a2-a4-a7;
a5=sum(k3)-a4-a6-a7;
else
a7=length(intersect(k1,intersect(k2,k3)));
a2=length(intersect(k1,k2))-a7;
a6=... |
clear all;
close all;
clc;
%ejercicio_36
[lambdas_simp, Q_simp] = mQRsimple( gallery( 'fiedler', 25 ), 2000, 1E-10);
[lambdas_dyna] = mQRdyna( gallery( 'fiedler', 25 ), 20, 1E-10);
eig_reales = sort(eig(gallery( 'fiedler', 25 )),'descend');
lambdas = [lambdas_simp,lambdas_dyna,eig_reales];
T = array2table(lambda... |
%% Input parser default
dy = dphilrob();
dy_example = dy(0, [1;2;3]);
d = size(dy_example);
assert(d(1) == 3);
assert(d(2) == 1);
%% Input parser non-default
dy = dphilrob('alpha', pi, 'Xi', 3);
dy_example = dy(0, [1;2;3]);
d = size(dy_example);
assert(d(1) == 3);
assert(d(2) == 1);
%% Input parser complete
pars.Qm... |
set_path; close all; clear; num_blocks = 2; n = 70;
min_x = 0; max_x = 1; min_y = 0; max_y = 1; min_z = 0; max_z = 1;
xy_background = zeros(n, n); zy_background = zeros(n, n);
% Display the projections
xm = linspace(min_x, max_x, n); ym = linspace(min_y, max_y, n); zm = linspace(min_z, max_z, n);
[X_xy, Y_xy] = meshgr... |
classdef Database < Base.Module
%MODULE Abstract Class for Modules.
% Simply enforces required properties. For future use.
properties(Abstract,SetAccess=private)
% If set to true, CommandCenter will call the save methods after every snap and experiment.
% If false, the save button w... |
function DrawFaceShape(x, y, color)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Draw face given x, y
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
orFace = [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 24 23 22 21 0] + 1;
orEbrowL = [24 23 22 21 26 25 24] + 1;
orEbrowR = [18 19 20 15 16 17 18] + 1;
orEyeL = [27 30 29 31 27 31 29 28 2... |
reset_data_analysis_environment
rho_tor_sale=sqrt(tor_flux_profile/max(tor_flux_profile));
close all
weight_transp_NBI=1.4e+13
PRE_COLLAPSE_STATS_FILENAME='initial_NBI60keV_R_precession_stats_all.mat'
load(PRE_COLLAPSE_STATS_FILENAME);
% NB_PART_SIM_TRANSP_RATIO=202016/length(r_avg)
% NB_PART_SIM_TRANSP_RATIO=0.5*(... |
classdef MeritFunction
% Weights should be properties of actual MeritFunction classes, not
% this one!!
% Changed accordingly for Transmission (Needed for ModeMatch,
% FieldEnergy!)
properties
% contains all separate merit functions
monitors;
m... |
function [pred] = TestModel(data, label, model)
% weights = zeros([size(data, 1), 1]);
% w = (model.sv_coef' * full(model.SVs));
% b = -model.rho;
% pred = sign(data * w' + b);
pred = svmpredict(label,data, model, '-q');
end
|
function [freq,Am,Ph]=ft_spect(dataIn,dt,varargin)
% ft_spect (version 2.0) calculates Amplitude and Phase spectra of an input
% signal with the desired frequency resolution and also filters the Phase
% spectrum for suppressing the floating rounding-off error.
%
% NOTICE#1: ft_spect can NOT remove the spectral l... |
function varargout = vlc_wrapper(task, varargin)
tasks = {'init' , ...
'release', ...
'open' , ...
'close' , ...
'frame' , ...
'play' , ...
'pause' , ...
'info' , ...
'cleanup'};
i = find(strcmpi... |
function [HD] = frequency_count_new(database )
% Count the number of time each row is present in the dictionary. Used for
% compression purposes.
uni = unique(database,'rows');
database = sortrows(database);
len_d=length(database(:,1)); %number of rows in the database
len_u=length(uni(:,1));
HD=zeros(length(uni(:... |
function donut=generate_donut(x0,y0,r1,r2,M)
xmin=x0-r2;
xmax=x0+r2;
ymin=y0-r2;
ymax=y0+r2;
i=0;
donut=[];
for k=1:M
for x=xmin:xmax
for y=ymin:ymax
r=sqrt((x-x0)^2+(y-y0)^2);
if r>=r1 & r<=r2
donut= [donut; 2*y x];
end
end
end
end
[a,b]=size (donut);
fprintf('Eventos: %d\n... |
function [SongName,SongInd]=SongMatch(neutralTune,TuneLibrary)
%Stores the length of the SongLibrary
lenSL=length(TuneLibrary);
%Initializes variable SongName (will maintain current string if the song is
%not in the library)
SongName='Song Not Recognized';
%Initializes variable SongInd
SongInd=0;
%initializes count... |
function y = tridsolve(a, b, c, f)
% Solve the n x n tridiagonal system for y:
%
% [ a(1) c(1) ] [ y(1) ] [ f(1) ]
% [ b(2) a(2) c(2) ] [ y(2) ] [ f(2) ]
% [ b(3) a(3) c(3) ] [ ] [ ]
% [ ... |
% Octave
%
% Contents file for Octave-specific functions
|
function sr = ATV_protocol(subject_id)
%ATV_protocol - Automates collection of raw data for Ankle Torque Variability test
%Guides user through three phases of data collection:
% 1) Preliminary info, i.e., subject ID, sensory threshold, etc. (some
% info may be inputs to this function)
% 2) Maximum Voluntary ... |
function rhs = rhs_skew_NCP(q,~)
global params
rhs = zeros(size(q)) ;
gamma = params.equation.gamma ;
gamma1 = gamma-1 ;
W_xi = params.deriv.W_xi ;
W_eta = params.deriv.W_eta ;
W_zeta = params.deriv.W_zeta ;
m11 = params.geom.m(:,:,:,1,1) ;
m12 =... |
function [ count ] = getNumberOfImages( settings )
%getNumberOfImages Get the number of data in a folder
% Detailed explanation goes here
D = dir([getPath('data', settings), '/*.mat']);
count = length(D(not([D.isdir]))) - 1;
end
|
function Xdot=ode_augmented_plant_ctrllr_observer(~,X)
global Ap Bp Cp A_comp B1_comp B2_comp C_comp D1_comp D2_comp
% Augmented State Vector(X):
% X =[X_comp ; Xp];
% WHERE
% Compensator State Vector, X_comp = [eIAz; eIAz_hat; alpha_hat; q_hat];
% Plant state vector, Xp=[alpha; q; dele; dele_dot]
% Define po... |
%% Test Implementation of GMR Algorithm
% On some datasets
%% ----------> run from ML_toolbox directory: >> addpath(genpath('./'));
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 1) Load 1D Dataset %%
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
... |
function [rmse] = compute_rmse(im1, im2)
if size(im1, 3) == 3
im1 = rgb2ycbcr(im1);
im1 = im1(:, :, 1);
end
if size(im2, 3) == 3
im2 = rgb2ycbcr(im2);
im2 = im2(:, :, 1);
end
yh = double(im1);
yl = double(im2);
rmse=10*log10(255.^2/mean((yl(:)-yh(:)).^2));
end |
indx = findPatrolCaches();
pilfered_caches = [1];
indx(pilfered_caches) = [];
c_f = cacheFood();
c_f = c_f(indx);
c_f = c_f / max(c_f);
f_w = 1;
d_w = 5;
t_w = 10;
squirrel1.task_id = squirrel1.DECEIVE;
deceive_bias = 0.4;
while(squirrel1.task_id == squirrel1.DECEIVE)
w = [1,deceive_bias];
d_indx = roulette(w)
... |
function [ rst ] = check_color( pos_seg, neg_seg, im )
%CHECK_COLOR Summary of this function goes here
%
% pos_neg and neg_seg
%
% pos_seg/neg_seg: [rho; theta; xmin; xmax; polarity]
% (x2,y2) ------------------------- (x4,y4) neg_seg
% / | -> \
% ... |
function P = predictTranslation( startX, startY, Ix, Iy, im0, im1, sigma)
%PREDICTTRANSLATIONSINGLEPT Calculating translation for a single corner pt
% startX, startY - the starting point
% im0, im1 - image frames at t and t+1
% Return value:
% P - the new position in im1
% Calculating gradients
if nargin < 7
sig... |
function [leaflet pass err any_passed] = solve_valve_pressure_auto_continuation(leaflet, tol, max_it, max_continuations, p_easy, p_goal, max_consecutive_fails, max_total_fails)
%
% Automatically runs a continutation sequence
%
% If any solve has passed then the leaflet that passed closest to goal is returned
%
%
... |
function [PAR, CON, SC, SCu] = par_robot
% definition of system parameters
PAR.b1 = 200.0;
PAR.b2 = 50.0;
PAR.b3 = 23.5;
PAR.b4 = 25.0;
PAR.b5 = 122.5;
PAR.c1 = -25.0;
PAR.g1 = 784.8;
PAR.g2 = 245.3;
PAR.l1 = 0.5;
PAR.l2 = 0.5;
% constraints
CON.x1 = [-pi, pi];
CON.x2 = [(-3/2)*pi, (3/2)*pi];
CON.x3 = [-pi, pi];
... |
function [ output ] = get_energy_characteristic( )
%GET_ENERGY_CHARACTERISTIC Summary of this function goes here
% Detailed explanation goes here
global en_type c1 c2 d1
hessian = zeros(2, 2);
if strcmp(en_type, 'arap')
hessian(1, 1) = 2;
hessian(2, 2) = 2;
output = norm(hessian);
end... |
% Plot Ca
dt = 5E-4; % time step for temporal integration
nmorphs = 3;
% load data files
load('Ca_store.mat');
load('Data_files');
itend = length(STATES_store);
ncells = XE*YE;
% setup scale
XS = [];
YS = [];
for n=1:ncells
for m=2:nmorphs
XS = [XS;max(max(POSITIONS{n,m,1})')];
YS = [YS;max(ma... |
function test_suite = test_normalizeAngle
% One-line description here, please.
% output = testNormalizeAngle(input)
%
% Example
% testAngle2Points
%
% See also
%
%
% ------
% Author: David Legland
% e-mail: david.legland@grignon.inra.fr
% Created: 2009-04-22, using Matlab 7.7.0.471 (R2008b)
% ... |
function [ struct,data_tokamak ] = BS_COMPASS_toroidal_coordinates( struct)
%BS_AUG_flux_coordinates Loads the flux coordinates in a struct. Determines
%also R,Z,phi and X,Y,Z-coordinates. Note Z is relative to center of plasma!
global par
% Either use nr_X and nr_Z as number of X and Z on map or as fractions on
% map.... |
%% 1 Generación Datos Tanque (Solo una simulación)
clearvars
clc
close all
format shortG
addpath('..\..\Funciones');
addpath('..\');
%% Parámetros de simulación
tsim = 5000;
tvar1 = 23;
tvar2 = 24;
ParametrosTanque
seed = randi(1,4);
%% Simulación
load_system('SimulacionTanque');
sim('SimulacionTanque');
save da... |
function [nm opts R] = rd_nmGUI(opts)
%
% function [nm opts R] = rd_nmGUI(opts)
%
% INPUTS:
% opts is an options structure for the model (optional)
%
% OUTPUTS:
% nm is the gui structure. This is a required output argument for the gui
% to work, and it must be called 'nm'.**
% opts is the options structure. This is ... |
function patches=GeneratePatches(Img, parameters)
% function patches=GeneratePatches(Img) generates patches that cover
% the root in the image Img. It does that by first extracting the midline,
% then computing the spline approximation of the midline, finding the
% tangent vectors and then extracting patches with size ... |
function [rmswfe,units] = displayPupil(pupil,mask,rays,clim)
if nargin > 2
[scale, units] = displayScaleFactor(rays);
else
[scale, units] = displayScaleFactor();
end
rmswfe = rmsWFE(scale*pupil,mask);
if nargin > 3
img = imagesc(pupil,scale*clim);
else
img = imagesc(pupil);
end
set(img... |
% Time needed for the K-NN2 model to create a complete graph
close all;
clear all;
global N START_POINT END_POINT STEP SAMPLES simMax MAX_P;
% Global Variables, should not change later
N = 128;
START_POINT = 2;
END_POINT = N;
STEP = 1;
SAMPLES = numel(START_POINT:STEP:END_POINT);
simMax = 100;
MAX_P = 1; % Max value... |
function test_suite = test_intersectEdges
%TESTINTERSECTEDGES Unit test suite for function intersectEdges.
% output = testIntersectEdges(input)
%
% Example
% testIntersectEdges
%
% See also
%
%
% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2009-04-22, using Matlab ... |
%%CDDF
clear;
parameter_initialization_two_stage;
volume_ratio=.5;
fai=volume_ratio;
f_f=.1:.1:.9;
c_d0=35;
%o_p_power=.5*niu*R*T*(c_d0-c_f0)/10^5;
o_p_power=0.5*van_coe*(c_d0-c_f0);
%o_p_energy=van_coe*((1-volume_ratio)*c_d0-volume_ratio*c_f0+(2*volume_ratio-1)*sqrt(c_d0*c_f0));
max_deltaP1=2*o_p_power;
delta_p=1:1:m... |
function [logL, prior]=Lhood(par,mFlag,tC,tEC,chalOut,tR,aR,tObs,VI,E)
%
% [logL, prior]=Lhood(par,mFlag,tC,tEC,chalOuttR,aR,tObs,VI,E)
%
% Matlab function for computing the log likelihood for a model of
% environmental transmission of FMDV, linking viral shedding, viral
% survival and the probability of transmis... |
% This script derives predictions from the ideal observer and show that
% beliefs regarding the position of the change point are more precise in
% the case of the emergence of a deterministic compared to a probabilistic
% regularity.
%
% Copyright (c) 2020 Maxime Maheu
%% GET PREDICTIONS FROM THE IDEAL OBSERVER
% ===... |
close all; clear all; clear
addpath('../solvers'); addpath('../functions'); addpath('../external'); addpath('../simulate');
%seed = round(rand()*1e6);
%% Test Case 1 : no Noise, no missing data
seed = 58597;
rng(seed);
size = [40,40];
noiseStrength = 0.0;
knowledgeRatio = 0.4;
rows = size(1);
cols = size(2);
lights =... |
function [ angVel ] = so3ToVec(ssMatrix)
% angVel = so3ToVec(ssMatrix)
% input - a skew symmetric matrix of so3 group (3 by 3)
% output - retrieves the velocity ( 3 by 1)
% Example usage
% Input - 0 -3 2
% 3 0 -1
% -2 1 0
% Output - [1,2,3]'
% has t... |
function time = runLetterTest()
% function time = runLetterTest()
% Inputs: None
% Outputs: time (reaction time for this test)
rng('shuffle');
leeway = 5;
select = [0 0];
color = [rand() rand() rand()];
plot(0)
set(gca,'Color',color)
grid off
axis([0 100 0 100])
letnum = rand();
if letnum < 0.2
letter = 'F';
... |
function lk_result = linkage_compute_allele(family, ind1, ind2)
% allele level kinship can be reduced to individual level kinship by
% considering their parents
% but need to treat ancestor-offspring relationship as special cases
max_path = 20;
f1 = family(ind1,3);
m1 = family(ind1,4);
f2 = family(ind2,3);
m2 = fam... |
flip = [1 1 1 1 1]
models = {'shark','brain','cup','gun','plane'}
for i=1:5
model = models{i};
fname = sprintf('/home/joschu/Data/grasping/obj_fixed/%s.obj',model);
wobj = read_wobj(fname);
[verts_v3,faces_f3,normals_f3] = wobj_verts_faces(wobj);
[wrenches_f6,cents_f3,] = get_contact_wren... |
function disp_result(Model, Frequency, Result)
%DISP_RESULT zeigt die Ergebnisse der Simulation
% DISP_RESULT(MODEL, DEVICES, TIME, FREQUENCY, RESULT) zeigt die Ergebnisse der
% Simulation (Struktur RESULT) fertig formatiert an.
%
% Diese Funktion wird nicht mehr benötigt - NICHT VERWENDEN IN ZUKÜNFTIGEN
% ... |
%Case 1:
dimx=4;
dimy=3;
dimz=5;
indata = single(rand(dimx,dimy,dimz)).*rand(1);
outdata = tom_norm(indata, 'mean0+1std');
fid = fopen('Input_Norm_1.bin','W');
fwrite(fid,indata,'single');
fclose(fid);
fid = fopen('Output_Norm_1.bin','W');
fwrite(fid,outdata,'single');
fclose(fid);
clear indata;
clear outdata;
%Case ... |
%*******************************************************************************
%* Program: wspeed_check.m
%* Description: Checks to make sure initial guess satisfies shock
%* conditions. We need wfl < wal < wsl < wsr < war < wfr.
%* Author: Andrew Kercher
%* References:
%* [1] Dai, W. and Wo... |
clear all;
clc;
close all;
init;
%% Input signal: random signal
T = 200;
Te = 0.5;
Tend = T-Te;
N = T/Te;
signal = rand(N,1)-0.5;
%% Input Toeplitz matrix
tmp = zeros(size(signal,1),1);
tmp(1,1) = signal(1,1);
input = toeplitz(signal, tmp);
%% Simulation and original impulse response
t = (0:Te:(N-1)*Te)';
simin.s... |
MainPath = 'D:\newc\Results\ResMFCC.mat';
res=load(MainPath,'R');
disp(res) |
classdef membrane
properties
Hydraulic_permeability;
Rejection;
Area;
Price;
end
end |
function c = progprincipalCL(Ne,fun,u0,uderL)
X=feval(@pointmaillage,Ne); %tableau de maillage
% Construction de la matrice M et R
M=sparse(Ne+1,Ne+1);
R=M;
for(k=1:Ne)
for(iloc=1:2)
ig = k+iloc-1;
for(jloc=1:2)
jg = k + jloc-1;
M(ig,jg) = M(ig,jg) + simpson('produitphi',X(... |
function [resCell,param] = vesselInBiasPulsationResult( varargin )
%缓冲罐入口错位,出口顺接的气流脉动计算
% Dbias 偏置管内插入缓冲罐的管径,如果偏置管没有内插如缓冲罐,Dbias为0
% Detailed explanation goes here
% inlet | L1
% l | Lv
% Dbias___|_______________
% | | Dpipe
% |lv1 V lv2|———— L2
% ... |
function [App, Ann, Apn, Anp] = buildGrLR(trpos,trneg)
lambda= 0.05;
% Compute App
X = trpos;
Dict = trpos;
Q = orth(Dict');
A = Dict*Q;
[Z,E] = lrra(X,A,lambda);
App = Q*Z;
% Compute Ann
X = trneg;
Dict = trneg;
Q = orth(Dict');
A = Dict*Q;
[Z,E] = lrra(X,A,lambda);
Ann = Q*Z;
% Compute Apn
X = trpos;
Dict = trn... |
classdef CrossEntropy < nnet.internal.cnn.layer.OutputLayer
% CrossEntropy Cross entropy loss output layer
% Copyright 2015-2016 The MathWorks, Inc.
properties
% LearnableParameters Learnable parameters for the layer
% This layer has no learnable parameters.
Learnab... |
function gca_click(fig)
ax = gca;
if nargin > 0
figure(fig);
ax = gca;
end
gca_hittest_off;
ax.ButtonDownFcn = @button_click;
prev = 0;
function button_click(~,event)
if event.Button == 1
fprintf('%f\t\t%f\n', event.IntersectionPoint(1), event.IntersectionPoint(1)-prev);
... |
function [Ap,res] = Prefilter(A,h)
%
% function [Ap,res] = Prefilter(A,h)
%
%
% prefilter.
%
%
% INPUTS
% ------
%
% A image to process
%
% h prefilter (function handle)
%
%
% OUTPUTS
% -------
%
% Ap filtered image
%
% res residue
%
%
% REFERENCE
% ---------
% You are free... |
function [ mfinal ] = readNumProps( i )
file = strcat('properties/',int2str(i),'/');
basenum = int8(((i-2)*4)+1);
mfinal = [];
for j = 0:3
newfile = strcat(file,int2str(basenum+j),'_number.txt');
m = dlmread(newfile);
[rows,columns] = size(m);
m1 = m(... |
function[outputWaveform] = adjustVoice(sample, increment, fs, fundFreqs, fundMagnitudes, harmonicMagnitudeArray, fourierCoeffRatios)
outputWaveform = [];
for k = 1:increment:(length(inputWaveform)-signalLength)
segment = sample(k:(k+increment));
segment = multipleBandpass(input, fundamentalFreq, numHarmonics, four... |
function y= fcnNormalize0_1(a)
% normalizes matrix between 100 and 0; input, output: matrix
% higheest value = 0; lowest = 100;
% use y= fcnNormalize0_1(-a) for high=100; low=0;
b=[];
for i=1:size(a)
b = [b a(i,:)]; % converts matrix to a vector
end
n=(b-(min(b)))/max(b-min(b)); % normalizes between... |
function [F,M,st,mt,c,ind,binuse]=dynamics(s,m,d,F0,densitydependence,seasonlength_modelB)
% within-season dynamics (directly developing offspring only) when the season length is
% - the length of s if seasonlength_modelB has been left undefined
% - seasonlength_modelB if this has been defined
% s = probability of goi... |
function [ seg ] = getSegSmall( pCube, idConv )
%GETSEGSMALL Get the segmentation matrix for bbox small.
% INPUT pCube: Parameter struct for a local segmentation cube, e.g.
% p.local(1)
% idConv: (Optional) Boolean specifying whether IDs should be
% converted to global indices.
% (Defau... |
function [ new_dist_min ] = disteusq_min( input1, input2, dist_min )
%DISTEUSQ_MIN Summary of this function goes here
% Detailed explanation goes here
new_dist_min = 0;
for i = 1:length(input1)
new_dist_min = new_dist_min + (input1(i) - input2(i))^2;
if (new_dist_min >= dist_min)
new_dist_min = dist_m... |
function model=setup_model(strCondition, bLightLimitingState)
% Load the iJN678 network and configure boundary conditions.
% Usage:
% MODEL=SETUP_MODEL(STATE, LIGHTLIMITINGSTATE)
% where STATE is 'auto', 'mixo' or 'hetero' and LIGHTLIMITINGSTATE is
% either TRUE or FALSE (has no effect for heterotrophic condit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.