text stringlengths 8 6.12M |
|---|
close all
clear all
%-------------------------------------------------------------------------%
% Isothermal flash calculation using Soave equation of state
% Author: Arnulfo Rosales-Quintero
% Email: arnol122@gmail.com
% Main program calls function Flash_iso01
%It can be used for multicomponent mixture, you... |
%% repackage saved data
% pre-allocate rf data
rf_data = zeros([1792 128 50*100]);
for m=1:100
m
for k=1:50
my_i = (m-1)*50+k;
rf_data(:,:,my_i) = squeeze(chandat2(:,k,:,m));
end
end;
%%
for k=1:1000
imagesc(log10(1+abs(hilbert(rf_data(:,:,k)))));colormap(gray);
pause(0.01);
end;
|
format long;
A = chebop(0,1);
A.op = @(x,u) diff(u,4);
A.lbc = @(u) [u; diff(u)];
A.rbc = @(u) [diff(u,2); diff(u,3)];
lam10 = eigs(A, 10);
lam15 = eigs(A, 15);
lam20 = eigs(A, 20);
lam40 = eigs(A, 40);
display('first eigenvalue for 10, 15, 20, and 40:')
[sqrt(lam10(1)), sqrt(lam15(1)), sqrt(lam20(1)), sqrt(lam40(1))... |
%% Source Code Tugas Akhir Skenario A (Akhmad Faizal Akbar 1103110183)
% Dataset CASIA Menggunakan 850nm tangan kiri
%% Deskripsi Skenario A
% Order = 2 dan Scale = 1 sampai 6
% Plam(Telapak Tangan)
% Perblock(16 block)
%% Inisialisasi
clc;
clear all;
close all;
nData = 100; % jumlah data orang
nPalm = 6; % jumlah ... |
function [m1, m2] = findMatchingFeatures(I1, I2, threshold)
%FINDMATCHINGEATURES Computes matching features between two images
% Input:
% I1 - First image to match
% I2 - Second image to match
% threshold(=1.5) - Distance threshold for keeping matching points
% Output:
% m1 - Matches in th... |
% Reset Simulation
servo_angles = [pi/2; -pi/2; pi/2; -pi/2; pi/2; -pi/2];
for num = 1:6
path = strcat('PlatformAssem/angle',int2str(num));
set_param(path, 'Value', num2str(servo_angles(num)));
end
set_param('PlatformAssem', 'SimulationCommand', 'step');
set_param('PlatformAssem', 'SimulationCommand', 's... |
function [] = extract_tbh_ksamp(m,knum)
% M > N
sc_m=m;
sc_n=sc_m-1;
fft_relax_onoff_factor=1.0;
graphene_setup_supercell;
graphene_setup_supercell_2;
build_supercell_ham;
know=sc_gamma;
graphene_setup_supercell_relax_ver2;
rot_angle = rot_theta/pi*180;
graphene_on... |
%@(#) flowprint.m 1.2 94/02/08 12:31:29
%
%function flowprint7(distfile,printfile)
%
function flowprint7(distfile,printfile)
if nargin<2,
disp('Result is printed on flowprint.lis');
printfile='flowprint.lis';
end
fid=fopen(printfile,'w');
[chflow,mminj,konrod,bb,hy,mz,ks,asytyp,asyref,distlist,...
staton,ma... |
function calibrateLaser()
calibrationPower = 1; % of 255
averagingTime = 15; % sec
stdLimit = 5.5; % For rejecting reflections
nPixThresh = 2;
A = ones(1,8); % Unit vector 8 wide
global trackingParams;
% Don't let the tracking program scan
setScanMirrors(f... |
function [batch_global, batch, gt_D] = GFC_Gen_input_of_D1(active_G, batch_D, gt_D, mask, parm)
active_G = cell2mat(active_G);
len = size(batch_D, 4);
batch_global = single(zeros(parm.patchsize, parm.patchsize, size(active_G, 3), len));
batch_global(:,:,:,1:len/2) = batch_D(:,:,:,1:len/2);
batch_global(:,:,:,len/2+... |
mispracticas;
[t, u]= miab4am3(tinic, tfin, N, x0, fun, par);
misgraficas; |
function [infos] = fcon_get_infos(opt);
% Gets the information needed for the preprocessing of the database files.
%
% [infos] = fcon_get_infos(database,opt)
%
% IN:
% opt:
% Structure containing:
% database:
% Name of the database to use.
% path_databases:
% Path where all the data... |
function [U,UT] = isometric_curve_flow(V,varargin)
% ISOMETRIC_CURVE_FLOW Isometric flow for curves as described by "Robust
% Fairing via Conformal Curvature Flow" by [Crane et al. 2013]
%
% U = isometric_curve_flow(V)
% U = isometric_curve_flow(V,'ParameterName',ParameterValue,...)
%
% Inputs:
% V #... |
function [es,pes] = mc_etasq(y,x,groups)
%add intercept if missing, and adjust groups
if (std(x(:,1)) == 0)
x = [ones(size(x,1),1) x];
groups = [1 groups];
end
m = fitlm(x,y);
u = unique(groups);
for i = 1:numel(u)
x0 = x;
x0(:,groups==u(i)) = [];
m0 = fitlm(x0,y);
sst = sum((y-mean(y)).^2);
... |
%--------------------------------------------------------------------------
% 核密度估计
%--------------------------------------------------------------------------
%*****************************读取文件中数据********************************
% 读取文件examp02_14.xls的第1个工作表中的G2:G52中的数据,即总成绩数据
score ... |
function varargout = FunctionalLocalizer_GUI
% global handles
%% Open a singleton figure
% Is the GUI already open ?
figPtr = findall(0,'Tag',mfilename);
if isempty(figPtr) % Create the figure
clc
% Create a figure
figHandle = figure( ...
'HandleVisibility', 'off',... % close all does ... |
function Iout=movepixels_2d_double(Iin,Tx,Ty,mode)
% This function movepixels, will translate the pixels of an image
% according to x and y translation images (bilinear interpolated).
%
% Iout = movepixels_2d_double(I,Tx,Ty,mode);
%
% Inputs;
% Tx, Ty: The transformation images, describing the
% ... |
function [ X ] = extraitProfils( im, d )
[n, p] = size(im); % recuperation de la taille
nbLignes = floor(d/2); % recuperation du nombre de ligne pour le profil
X = zeros(d,1);
k = floor(n/nbLignes);
% l = floor(p/nbLignes);
% if p<=nbLignes
% l = 1;
% end
% a chaque iterati... |
% Creates a matrix of particles with positions
function positions = ...
InitializeParticlePositions(numberOfParticles, numberOfVariables, xmin, xmax)
particles = zeros(numberOfParticles, numberOfVariables);
for i = 1:numberOfParticles
for j = 1:numberOfVariables
positions(i,j) = xmin + rand * (xmax - ... |
function trans = localToGlobal3d(varargin)
%LOCALTOGLOBAL3D Transformation matrix from local to global coordinate system.
%
% TRANS = localToGlobal3d(CENTER, THETA, PHI, PSI)
% Compute the transformation matrix from a local (or modelling)
% coordinate system to the global (or world) coordinate system.
% T... |
%rot_y
%generates rotation matrix about y axis
%Scott Barnes
%MAe 3184
function R = rot_y(theta)
R = [cos(theta) 0 sin(theta); 0 1 0; -sin(theta) 0 cos(theta)];
end |
function WL_tool(varargin)
% function WL_tool(varargin);
% Window - Level tool for adjusting contrast of a set of images
% interactively. Use with imagesc or imagescn.
%
% Usage: WL_tool;
%
% Author: Daniel Herzka herzkad@nih.gov
% Laboratory of Cardiac Energetics
% National Heart, Lung and Blood Institute, N... |
% Class KC: Known Constants (only contains constant properties)
%
% Sets the values of the constants that are available to the estimator.
%
% Class:
% Recursive Estimation
% Spring 2015
% Programming Exercise 2
%
% --
% ETH Zurich
% Institute for Dynamic Systems and Control
% Mark Mueller
% mwm@ethz.ch
%
classdef KC
... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FUNCTION NAME: motionTrackingCalibration2P
%
% FUNCTION: motionTrackingCalibration2P(tifFileName,redoFilterTF,updateSearchTF,medFiltTF,saveOutputVideoTF,threeStepTF,compiledTifTF,targetAvgNum,micronJumpV... |
%****************************************************************************************************
% Ten test problems for the special issue in Swarm and Evolutionary Computation on many-objective optimization
% Author: Dr. Hui Li, Xi'an Jiaotong University, China
% History of Dates:
% ------ 2017.10.02 ve... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Authors: Hamza Bourbouh, Anastasia Mavridou <anastasia.mavridou@nasa.gov>, Andreas Katis <andreas.katis@nasa.gov>
% Notices:
%
% Copyright @ 2020 United States Government as represented by the
% Administrator of the National Aeronautics and Space Administ... |
% Function Definition for the second differential equation
function f=f2(x,y)
f=2*x.*y-4*x.^2+2*x+2;
end |
function [Q, residual] = multiscaleRieszAnalysis(A, config)
% MULTISCALERIESZANALYSIS perform the forward Riesz-wavelet transform
%
% [Q residual] = multiscaleRieszAnalysis(A, config) perform the forward
% Riesz-wavelet transform for the 3D image A. The transform configuration
% is specified by the RieszConfig obje... |
nlev = 256;
f1 = imread('img10.jpg');
g1 = histeq(f1, nlev);
subplot(2,2,1); imshow(f1); title('img10 before');
subplot(2,2,2); imshow(uint8(g1)); title('img10 after');
subplot(2,2,3); imhist(f1); title('histogram img10 before');
subplot(2,2,4); imhist(g1); title('histogram img10 after');
|
function ros=Connector_ROS(param)
% Connector_ROS(N,dt,topic)
% N : number of rigid body
% dt : sampling time
% num : on_marker_num = 4*N+num
% noise : 1 means active
%ros_param.dt = dt;
ros_param.ROSHostIP = param.HostIP;
ros_param.ROSClinetIP = ;
ros_param.rigid_num = N;
ros_param.sub... |
% Ejemplo
clc; clear; close all
pkg load image
A = imread('files/edificio_china.jpg');
subplot(2, 2, 1)
imshow(A)
title('Imagen Original')
% Calculo de la DFT-2D
A = im2double(A);
F_A = fft2(A);
subplot(2, 2, 2)
imshow(log(1+abs(F_A)),[])
title('DFT-2D')
% Aplicar ffshift a la matriz resultante
... |
% covid19TEXAS.m
% Revised: 2020 05 29
% Mathemtatical model for the spread of the covid19 virus
% Model for TEXAS spread of virus
% Data from https://www.worldometers.info/coronavirus/
% Model specified by the variables in the INPUT SECTION of the Script
% DOING PHYSICS WITH MATLAB:
% http://www.physi... |
function net=cnnsetup(net,width,height)
%该函数的作用是设置卷积神经网络的参数
%net表示需要设置的网络,这里指的是cnn
%size表示二维图像块的大小,默认是28
assert(~isOctave() || compare_versions(OCTAVE_VERSION, '3.8.0', '>='), ...
['Octave 3.8.0 or greater is required for CNNs as there is a bug in convolution in previous versions. See http://savannah.gnu.org/bu... |
function [P] = forward(Q,disp)
q1 = Q(1);q2 = Q(2);q3 = Q(3);q4=Q(4);q5=Q(5);
% base
global xA1;global yA1;global zA1;
% base
global xA2;global yA2;global zA2;
% base
global xA3;global yA3;global zA3;
% base
% Platform
global d_B1B3;global de;
% Platform
% out
global L1;global L2;
% out
% ... |
% Configuration Parameters
global Flight_weight Flight_cg Flight_flapslat Flight_fslever Flight_regime_lh Flight_regime_rh
global Flight_alt Flight_delta_isa Flight_Speed_type Flight_Speed_value Flight_lgdown
global Flight
global Flight_longitude Flight_latitude Flight_GeodHeight
% Weight and Cg
Flight_weight=... |
function dz_dw = forwardstart(w,p,z,param)
%DOTPROD.FORWARDSTART Propagate derivative from weight to weighted input
% Copyright 2012-2015 The MathWorks, Inc.
[S,R] = size(w);
Q = size(p,2);
if isa(w,'gpuArray')
dz_dw = iGPU(p,R,S,Q);
else
dz_dw = iCPU(p,R,S,Q);
end
end
function dz_dw = iCPU(p,R,S,Q... |
clc;
clear;
close all;
addpath('functions_p1');
N=10;
% measuremebt noise
V=diag([1,1]*DEG2RAD).^2;
% x0 ~ (x_est0,inf);
x_est0=[15;23];
invM=diag([0^2,0^2]);
%% simulation
x_true=repmat([20;30],1,N);
Zmea=zeros(2,N);
for i=1:N
Zmea(:,i)=h(x_true(:,i))+sqrt(V)*randn(2,1);
end
%% Newton-Rhapson
x_est=zeros(2,N);
... |
function [sum_rep_dp_dp,sum_att_dp_dp,sum_rep_dp_indp,sum_att_dp_indp,sum_rep_indp_indp,sum_att_indp_indp,sum_rep_sc_sc,sum_att_sc_sc] = contactdetect(protein,ligand,Rcutoff)
m=1;
n=1;
o=1;
p=1;
contact_dp_dpA=[];
contact_dp_dpB=[];
dist_dp_dp=[];
rep_dp_dp=[];
att_dp_dp=[];
sum_rep_dp_dp=[];
sum_att_dp_dp=[];
contac... |
%function comp = edgesegm(img)
function main
if ~exist('img0')
img0 = imread('000061_cropped.jpg');
end
img = double(img0) ./ 255;
[w,h,ch] = size(img);
% compute gradient of the grayscale image
gimg = rgb2gray(img);
d_x = gimg(2:end,2:end) - gimg(1:end-1,2:end);
d_y ... |
function A = testSparseAggregation(n, nz)
%TESTSPARSEAGGREGATION Test the performance of merging nodes in a sparse
%matrix.
% Detailed explanation goes here
% Read input arguments
if (nargin < 1)
n = 100;
end
if (nargin < 2)
nz = 3;
end
A = randomLaplacian(n, nz);
simulateAggregation(A);
e... |
% Calculation of linear MMSE for on-off modulated light
clear all
clc
close all
% Assumptions and modifications
% - calculates steady state linear MMSE
% - works across gamma via k
% Gamma of interest
gamma = [5 10 20 30];
leng = length(gamma);
kset = 1./(100*gamma);
% Set main parameters
beta = 1:0.1:200;
lenb = le... |
function B = shuffle(A)
B = zeros(size(A));
r = randperm(100000);
for i = 1:100000
B(i,:) = A(r(i),:);
end
end |
//foo class...
|
function Vs = invembeddingR6_vecs_tf_par(ps, Vvs)
% Hyunwoo Kim
% 2014/03/05/ 14:16 pm
N = length(ps);
Vs = cell(length(Vvs),1);
parfor i = 1:N
p = ps{i};
Vs{i} = invembeddingR6_vecs(p,Vvs{i});
end
|
classdef CellLabel < handle
properties
Lbl
Msk
T % Time, this should be either empty, or set BEFORE the labels are being added.
Reg % Registration object
filename
saveToFile = false;
positionName
end
properties (Dependent = true)
Re... |
function [row, col, j] = hashreplacement(matrix, quantity, key1, key2, key3)
%%随机置换函数:利用md5函数产生随机的无碰撞的像素选择策略
%%matrix为载体矩阵,quantity为嵌入的信息位数,key1,key2,key3为三个密钥
[X, Y] = size(matrix);
row = zeros([1, quantity]);
col = zeros([1, quantity]);
j = zeros([1,quantity]);
for i = 1:quantity
v = round(i/X);
u = mod(i, X... |
function set(this,propName,varargin)
if ~ischar(propName)
% User sent a integer, it means that he wants to edit drawer
% properties. Forward arg to drawers.
dw_index = propName;
dws = this.Drawers;
n_dw = numel(dws);
if dw_index > n_dw
e... |
load gwc_output;
g0 = 0.067/pi;
%# get derivatives
dw = wss(2)-wss(1);
Nss = length(wss);
ddos = diff(dos)/dw;
ddos(Nss) = ddos(Nss-1);
dwc = wsc(2)-wsc(1);
Nsc = length(wsc);
ddosc = diff(dosc)/dwc;
ddosc(Nsc) = ddosc(Nsc-1);
%# smooth derivatives
width = 0.2; %# in meV
fss = exp(-wss.^2/width^2);
fss /= trapz(wss... |
function A = deblur(B, n, gry, flag)
% Deblurs the image stored in the matrix/tensor B
% and returns the "unblurred" image.
% The image is considered to be grayscale if gry = 1
% and the image is displayed if flag = 1.
% Our initial "guess" to feed into the CG method is the zero image.
A = zeros(size(B));
... |
% PDI - Aula 04/09/2018
% Author: Xie Jiayu
% Equalização do histograma na unha
% Exerc. 4.10
close all;
clear all;
clc;
img = imread('pout.tif');
img_histec = histeq(img,256);
img_unha = (imhist(img))/((size(img,1))*(size(img,2))); % hist normalizada
cdf = cumsum(img_unha); % cumulative distribution function (som... |
clear
clc
close all
%% Question 3 -- Part A
syms rho_L rho_R rho_max v_max real;
syms x t real;
rho = sym('rho(x, t)');
v = v_max*(1 - rho/rho_max);
f = rho*v;
fx = diff(f, x);
%% Question 3 -- Part B
dSdt = ...
(subs(f, rho, rho_R) - subs(f, rho, rho_L)) / ...
(rho_R - rho_L);
dSdt = simplify(dSdt);
%% Ques... |
function [nodes edges values] = createTestGraph01(varargin)
%CREATETESTGRAPH01 One-line description here, please.
%
% output = createTestGraph01(input)
%
% Example
% createTestGraph01
%
% See also
%
%
% ------
% Author: David Legland
% e-mail: david.legland@grignon.inra.fr
% Created: 2011-05-18, ... |
function [mv_mpP]=GetDiametersMDF_preMocoed_BehaviorSeg_002(fname,mv_mpPName,Vessel_Channel,animal,Objective,vessel_ID,varargin)
%this function takes a already motion corrected (and temporally medial
%filtered) image structure (movie) and accompanying .mat file (mv_mpP), and
%extracts the diameters from surface and ... |
function li=createIdEdgeList(obj,tree_id)
li=[obj.nodesNumDataAll{tree_id}(obj.edges{tree_id}(:,1),1) obj.nodesNumDataAll{tree_id}(obj.edges{tree_id}(:,2),1)];
end |
function s = odd_index(A)
s = A(1:2:end,1:2:end)
|
function [ output ] = line_check_search( p, u, grad )
%LINE_CHECK_SEARCH Summary of this function goes here
% Detailed explanation goes here
if get_energy_type() > 0
fk = energy_value(u);
dfk = grad;
ls_alpha = 0.2;
ls_beta = 0.5;
balp = get_feasible_step_size(p, u);
alp = min(1.0, bal... |
function AllObjInf=fun_MoveObjectDetectDP(MaxIndexFrame,MaxValFrame)
%--------------------------------------------------------------------------
[M N]=size(MaxIndexFrame);
maskIndex=zeros(M,N,5);
for ii=1:5
tempIM=MaxIndexFrame;
tempIM(MaxIndexFrame~=ii)=0;
maskIndex(:,:,ii)=tempIM./ii;
%h=figure()... |
% This script shows mean squared error between different alternaive models
% and the subjects measured either on the abruptness of the detection
% dynamics of deterministic rules (pattern-specific) or on the average
% probability of the deterministic rule hypothesis in the fully-random
% parts of sequences
%
% Copyrig... |
% Burgess 2008's oscillatory interference models
% eric zilli - 20110909 - v1.0
%
% Burgess 2008 described a wide chunk of theory relating to oscillatory
% interference grid cell models, both reviewing the previous work on
% these models and pointing out many simple variations on the basic model.
%
% The variations i... |
function XuMgTileUpImages(config)
distance_between_processed_frames_det_in_pixel = config.distance_between_frames_det_in_pixel * config.phaseStepCount;
frame_num = config.StackFrameCount;
%%
data_abp = XuReadRaw(sprintf('%s/absorb-300-512-%d.raw', config.folder_stack, config.StackFrameCount),[300 512 frame_num]);
da... |
%##########################################################################
% File: HoughLine_Shuttle.m
% Purpose: Rotate the shuttle by finding the longest line
% Author: Marcus Hudritsch
% Date: 25-MAY-2013
% Copyright: Marcus Hudritsch, Kirchrain 18, 2572 Sutz
% THIS SOFTWARE IS PROV... |
%@(#) readinfil.m 1.4 06/02/10 10:52:15
%
function [DISTFIL,MASFIL,skbfil,CYCNAM]=readinfil(infil)
MASFIL=[]; % Obsolete
fid=fopen(infil,'r');
rad=fgetl(fid);
ir=find(rad==' ');
id=1;
DISTFIL=rad(1:ir(1)-1);
CYCNAM=remblank(rad(ir(1)+1:length(rad)));
while iss... |
% Computer Integrated Surgery, EN.600.445
% Alperen Degirmenci, Saumya Gurbani
function i = getQuadrant(point, center)
%determine which 3D quadrant point is located in, given that the "origin"
%of the 3D space is given by center. Both are point3Ds or vectors
if(class(point) == 'struct') %point is a point3D... |
% (C) Copyright 2020 CPP visual motion localizer developpers
function diplayDesign(cfg, displayFigs)
%% Visualize the design matrix
if displayFigs
close all;
figure(1);
% Shows blocks (static and motion) and events (motion direction) order
directions = cfg.design.directions;... |
function varargout = rootfinder_option_info(varargin)
%ROOTFINDER_OPTION_INFO Get documentation for a particular option.
%
% char = ROOTFINDER_OPTION_INFO(char name, char op)
%
%
%
%
[varargout{1:nargout}] = casadiMEX(820, varargin{:});
end
|
clear all
load('Figure6.mat');
%% Figure 6C
% Blocks 1 vs 2
% % SS vs CR
Corr_dHP_B12=ClusterInfo.Outbound_dHP_SpaCorr_B12((PlaceField_dHP_B1 & PlaceField_dHP_B3 & ChoiceFieldRatio_dHP_B13) | (PlaceField_dHP_B2 & PlaceField_dHP_B4 & ChoiceFieldRatio_dHP_B24) & Sunflower_dHP);
Corr_iHP_B12=ClusterInfo.Outbound_iH... |
%User-defined function for inventory process (Input is Medicine serial number).
%This function guides the robot to read the medicines type, grasp the medicine
%from conveyor belt, store medicine in the farthest place, and update the storage.
%Also, it will control conveyor belt, robotic arm, and sliding rail moveme... |
%% 1. configuration
[a, error1, condNum, rankA, x_lsqr, xtilde] = myFunction(64, 1.5:1.5:96,
64, 0 ,1e-6);
%% 2. configuration
[a, error2, condNum, rankA, x_lsqr, xtilde] = myFunction(64, 2.5:2.5:160,
64, 0 );
%% 3. configuration
[a, error3, condNum, rankA, x_lsqr, xtilde] = myFunction(64, 0.75:0.75:96,
32, 0... |
function [out] = whichWand(st,field)
out = []; index = [];
if isfield(st,field)
if ischar(st(1).(field))
[cells index] = sort({st.(field)});
else
[cells index] = sort([st.(field)]);
end
for i=1:length(index)
out = [out st(index(i))];
end
else
out = 'Invalid Field Name';
end
end |
%%%%%%%%% B4_ Extracting power with Chronux %%%%%%%%%%%%%%%%%%
%% Preprocessing
% before doing anything we need to apply what we learn on the previous
% scripts.
% First, concatenate and load the files
% Where are the data
[file,path] = uigetfile('*.mat',...
'Select All files that you want to concanenate', ...
... |
%Para la funcion original
exp_fun = inline("exp(-x)");
x_k = 1;
x_k1 = 0;
dif = 100;
n = 0;
while dif > eps
x_k1 = exp_fun(x_k);
x_k = x_k1;
dif = abs(x_k - exp_fun(x_k));
n = n + 1;
end
display("El punto fijo es:");
display(x_k1);
display(n);
%Para la funcion equivalente.
w_0 = 1 / 0.5671;
g = inlin... |
function [] = passVideoToVision()
%{
---------------------------------------------------------------------------
passVideoToVision stream traffic video to the scene and image classifier
STEPS
1. Get trained neural network
2. Connect to traffic scene video
3. Get each frame video and resize to 300x300
4. Perform scene... |
clear all ; close all
% cryocooler => sequence dependent
stimtime = 1.5 ; % stimulus time in seconds
resttime = 0.75 ; % post stimulus time
focustime = 0 ; % minimum focus time (+ 1-2s jitter)
HideCursor
Screen('Preference', 'SkipSyncTests', 1);
AssertOpenGL;
screens=Screen('Screens');
screenNumber=max(s... |
function set_visibility(buttons, value)
for i = 1 : length(buttons)
try
set(buttons(i),'Visible',value);
catch
warning('Invalid button passed to set_visibility()');
end
end
end
|
% MRLGPC.M
% To read slider
% for previous gradient (gp) in mT/m
% Use label gp for prev grad
% Called by mrlrm
% Check for replot turned on ***********
if mrlreplv == 1 ;
set(mrluirepl, 'Visible', 'off') ;
set(mrlreplb, 'Visible', 'off') ;
mrlreplv = 0 ;
end ;
% Proceed *************
mrlgp = 10^(get(mrluigp,'... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2010 - 2015 Moon Express, Inc.
% All Rights Reserved.
%
% PROPRIETARY DATA NOTICE:
% The data herein include Proprietary Data and are restricted under the
% Data Rights provisions of Lunar CATALYST Space Act Agreement
% No. SAAM ID#... |
function Par = pa_fitasin(X,Y,Inipar)
% PA_FITSIN Fit an arcsine through data.
%
% PAR = FITASIN(X,Y) returns parameters of the arcine a*asin(b*X+c)+d,
% in the following order: [a b c d].
%
% See also FMINSEARCH, NORM
% 2011, Marc van Wanrooij
% e-mail: marcvanwanrooij@neural-code.com
X = X(:);
Y ... |
classdef Variable < casadi.PrintableCommon
%VARIABLE
%
% = VARIABLE()
%
%
methods
function varargout = name(self,varargin)
%NAME
%
% char = NAME(self)
%
%
[varargout{1:nargout}] = casadiMEX(959, self, varargin{:});
end
function v = v(self)
v = casa... |
clc
clearvars
rng('shuffle')
addpath('./model/')
n = 10;
m = 10;
all_N = [2:10, 20:10:100];
N_test = 1000;
delta = 1;
radius = 1;
eta = 1;
run_count = 100;
epsilon = [(1:9)*1e-3 (1:9)*1e-2];
param(1:run_count) = struct('W',[],'H',[],'h',[],'C',zeros(1,m),'d',0, ...
'pnorm',... |
function [ Bf ] = inM2loopM( A )
%INM2LOOPM Converts incidence matrix A to loop matrix Bf with only the
% fundamental loops
% Philips Research, Eindhoven, Netherlands
% julia.delos@philps.com
%
Aef=rref(A);
Aef(all(Aef==0,2),:)=[];
[n m] = size(Aef);
ln=[];
U=Aef(:,1:n);
isArranged=0;
if ~(isequal(U,eye(n)... |
%%% Calculate connection factor(Lambda, L_{ijk}) & curvature(R_{ijkl}) in 4D
clear all;
syms t x y z c G M;
q = [t x y z];
%{
g(:,:) = [c^2*(1+G*z/c^2)^2 0 0 0;
%g(:,:) = [ c^2 0 0 0;
0 -1 0 0;
0 0 -1 0;
0 0 0 -1]
%g_ = inv(... |
function u = makeSquareWellSolution(r,V0,r0,E)
if E>0
k1 = sqrt(E-V0);
u = zeros(size(r));
u(r<=r0) = sin(k1*r(r<=r0));
m = k1*cot(k1*r0);
k = sqrt(E);
K = (k*cos(k*r0)-m*sin(k*r0))./(m*cos(k*r0)+k*sin(k*r0));
A = sin(k1*r0)./(sin(k*r0)+K*cos(k*r0));
u(r>r0) = A*(sin(k*r(r>r0))+K*cos(k*... |
function [yt, t] = make_square(T, numperiods, fs)
% Create a sawtooth wave...
% T is the Time period (in s)
% numperiods is the number of periods (choose to be >1)
% fs is sampling frequency (in Hz)
t = [0:fs:numperiods.*T-1];
yt = square(2*pi.*t./T, 50);
|
clear all;
close all;
Dir = pwd;
ascfile=dir([Dir,'\*.asc']);
numFile=length(ascfile);
sampling_rate=10;
numdatalength=6144;%% 3 blcok = 6144, 9 block = 18432
%% GCaMP ascii file import
for z=1:numFile
filename=ascfile(z,1).name;
fid=fopen(filename);
for i=1:10
buffer=fgetl(fid);
... |
function [ X , objval ] = graphPartitioning( f, A, b, correlationMatrix, initialGuess )
% Finds the optimal partitioning of a correlation matrix
%
% Input:
% f - the objective function to maximize
% sum w_uv * x_uv
% A, b - constraints of type Ax <= b
% correlationMatrix
% initialGuess (optinal)
%
% O... |
function [ AC_basal, AC_dip, t_half ] = sim_2D_Golf(mults, targs, species, params, model, Toffset)
nums = [numel(concs{1}), numel(concs{2})] ;
t_half = zeros( nums );
AC_basal = zeros( nums );
AC_dip = zeros( nums );
targ_output = 'ACprimed';
%%
reserv = {}
for k = 1:2;
if strcmp(targs{k}, 'tau_Go... |
% Launch AMS example selector
% Copywrite 2001-2013 The MathWorks, Inc.
cd \ams
example_sel2html('AMS_sel.txt') |
%% 布特沃斯滤波器测试
% staN : 低阶
% endN : 高阶
% fn : 拐角频率
% wn : 拐角频率弧度
% ftype : 滤波类型
clearvars;
scrsz = get(groot,'ScreenSize');
figure('Position',[scrsz(3)/3 scrsz(4)/2 scrsz(3)/2 scrsz(4)/1.5]);
%% 计算巴特沃斯低通滤波器幅频特性和相频特性
staN=10;
endN=20;
fn=15;
wn=fn*... |
function img=fillgaps(img)
[X,Y,Z]=meshgrid(1:size(img,1),1:size(img,2),1:size(img,3));
img=griddata(X(~isnan(img)),Y(~isnan(img)),Z(~isnan(img)),img(~isnan(img)),X,Y,Z,'natural');
end
|
function pool=formation_generator(ball,goal,team_size)
% FORMATION_GENERATOR generates the formation of team regarding size of team.
% BALL is the 1*2 vector of 2D position of ball.
% GOAL is the 1*2 vector of position of the center point of our goal.
% TEAM_SIZE defines the number of all our agents in the field.
% POO... |
% net1 more layers, net2 weight decay = 0.0005, net 3 weight decay = 0.005
for net_id = 2:3
for im_id = 1:10
load(['net' num2str(net_id) '.mat']);
load(['testData/test_' num2str(im_id) '.mat']);
data = [test_ori; test_filtered];
data = double(data);
data = bsxfun(@rdivide, bs... |
% Data Logger Processing Script
% Zachary Lippay
%
clear
clc
close all
%
% File location of HOBO .csv file ---> Need to update for each data logger
hobodata = '/Users/zlipp3032/Desktop/HOBO CSVs/1714_Primary_Aerator.csv';
%
Voltage = 480; % Input voltage to equipment being analyzed
%
% Import and define t... |
%{
Basic Matlab Plotting
9/17/2014 Jake Tully
This Script plats basic funtions and ansewers some lab questions
%}
%part A
clear
clc
close all
B=@(t) 250./(1+56.75*exp(-0.17.*t));
ansewer1=B(1)
ansewer4=B(4)
x=[1 4];
ansewerx=B(x)
figure(1);
fplot(B,[0 40])
xlabel('time in hours')
ylabel('number of ba... |
function bts=btstrp_exp2(nboot,inarg,intervals,tm,tx)
%This is a bootstrap routine that calculates a distribution (of size nboot)
%of fit parameters from fitting a data set of binding intervals, greater
%than a minimum observation time, tm.
%The likelihood function is calculated in the called function:
%'expfalltwo_... |
%%
% CellShapeAnalysis.
% Copyright (C) 2020 J. Stegmaier
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicabl... |
classdef Box < handle
properties
lo_i
hi_i
lo_j
hi_j
dx
values
values_comp
resized_data
resized_data_comp
num_components
end
methods
function box = Box(lo_i, hi_i, lo_j, hi_j, dx, data_comp, num_components)
... |
%% 图像乘法可用来实现灰度级变换
I = imread('moon.tif');
J = immultiply(I,1.2);
K = immultiply(I,2);
subplot(1,3,1),imshow(I);
subplot(1,3,2),imshow(J);
subplot(1,3,3),imshow(K); |
function [minPos] = findMinimumErrorPosition(imgVec, imageDatabase)
MSEs = zeros(1, size(imageDatabase,2));
for col = 1:size(imageDatabase, 2)
MSEs(col) = calcMSE(imgVec, imageDatabase(:,col));
end
[~,minPos]=min(MSEs);
end
|
A = [1 -0.5; -0.75 -.25];
xmin = -1;
xmax = 1;
nx = 21;
ymin = -1;
ymax = 1;
ny = 21;
lw = 2;
clf;
axis equal
axis([xmin xmax ymin ymax])
set(gca,'YTick',[-1 -0.5 0 0.5 1])
set(gca,'fontsize',12)
hold on
%AddNullclines(A)
%AddEigenSolutions0(A)
AddAxes0(A)
axis off
% text(1,-0.06,'1','fontsize',12);
% text(-1,-0... |
% op_005.m
% NUMERICAL ANAYLSIS OF POLARIZED EM WAVES
% +Z direction of propagation
% Electric field E(Ex, Ey) in a XY plane (Ez = 0)
% Ian Cooper
% School of Physics, University of Sydney
% DOING PHYSICS WITH MATLAB: www.physics.usyd.edu.au/teach_res/mp/mphome.htm
% Documentation: www.physics.usyd.edu.au/teach_res... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.