text stringlengths 8 6.12M |
|---|
% (a) Solution by mesh analysis
Zs=j*12; Zm=j*4; VL=100*sqrt(3);
Z= [(Zs-Zm) -(Zs-Zm) 0
0 (Zs-Zm) -(Zs-Zm)
1 1 1 ];
V=[VL*cos(pi/6)+j*VL*sin(pi/6)
VL*cos(-pi/2)+j*VL*sin(-pi/2)
0 ];
Y=inv(Z)
Iabc=Y*V; % Line ... |
% distance
function d = cal_dist(a,b)
d = sum((a-b).^2,2).^0.5;
end |
function [summer,m,n] = peri_sum(A)
[m,n]=size(A);
%to find the sum numbers at perimeter of a matrix
summer=sum(A(1,:))+sum(A(m,:))+ sum(A(:,n))+sum(A(:,1))-(A(1,1)+A(m,n)+A(1,n)+A(m,1));
% take each row and add them
end |
function oimg = blk_orientation_image(img,N)
g = complex_gradient(img);
gblk = blkproc(g.^2,[N N],inline('sum(sum(x))'));
oimg = 0.5*angle(gblk)+pi/2;
%end function blk_orientation_image |
%
%Written by Brady Sheehan
%
function result = padString(string, numOfCharsToPad)
string2 = blanks(numOfCharsToPad);
result = horzcat(string, string2);
end |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2018 Crypto4a Technologies Inc.
%
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the "Software"),
% to deal in the Software without restriction,... |
clc;
clear;
close all;
n_land = 6;
n_pose = 3;
load('Hb_Schur.mat')
disp('Solution of linear system H dx = b');
dx_solution = -H_full\b_full
% setting up data
A = H_full(1:n_pose, 1:n_pose);
B = H_full(1:n_pose, n_pose+1:end);
C = H_full(n_pose+1:end, 1:n_pose);
if ~isequal(C, B')
disp('cazzo');
end
D = H_full(... |
%% MULTIFRAME MOTION COUPLING FOR VIDEO SUPER RESOLUTION
%
%
% Be sure to initialize the submodules and to compile them
% following their instructions
% Total equivalence of forward and backward model, with an easy downsampling procedure.
%
%% Data properties
startFrame = 23;
numFrames = 13;
cslice = ceil(numFrame... |
close all,clear all,clc;
addpath(genpath(pwd));
path='/home/hali/lixiaoyang/dataset/ManipulatorsDataset';
num1=1;%%%reference image
index=1;
for k=1:1:4
num2=k;
sceneName='mixture/';
type='illum/';
method=1;
flagShowCurve=true;
illumTypes={'cube','cubeRoot','square','squareRoot'};
illumType=... |
function options = parse_processing_options(varargin)
% parse inputs
collapse_mode = 'average';
collapse_fields = 'none';
do_trim = true;
pcs = 2;
impute_mode = 'mean';
for i=1:numel(varargin)
arg = varargin{i};
if ischar(arg)
switch arg
case 'CollapseFields'
i = i+1;
... |
function CarMovement
global x y c OrigLargeImage LargeImage
while(1)
for l=1:100
OrigLargeImage=imread('BirdsEye.jpg','jpg');
car=imread('Car.jpg','jpg');
car=imresize(car,.085);
car_temp=imread('template_car.jpg');
car_temp=imresize(car_temp,.085);
car_temp=imrotate(car_temp,160);
car=imrotate(car,160);
[m1,n1,k1]=siz... |
function boundaries = createVoroniCellBoundaries(voronicells)
[edges, edgeCellNum] = createCellEdges(voronicells);
inverseEdges = [edges(:, 2), edges(:, 1)];
tempEdges = [edges; inverseEdges];
[~, uidxa, uidxc] = unique(tempEdges, 'rows');
count = accumarray(uidxc, 1);
innerEdges ... |
%%
% NEPSNE and FRNE
% # of agents
arg.n = 16;
agents = [12,16];
%group size
arg.g = 2;
groups = [4];
%personal payoff
%beta value
beta = 0:0.1:10;
data = [];
%%
%NEPSNE
for n = agents
arg.n = n;
for g = groups
arg.g = g;
if arg.g == 2
rate = [(arg.n-arg.g+1)/(arg.n*arg.... |
classdef LinRegVarselEnsemble < LinReg & ModelEnsemble
properties
end
methods
function model = LinRegVarselEnsemble(varargin)
%
end
end
end
|
function y_p = kriging_predictor(B_o, B_p, y_o, beta, R_p, Q_po, reo)
% If no reoreding of indices
if nargin < 7
reo = 0;
% Calculate right hand side
v = Q_po*(y_o-B_o*beta);
% Predicted values by Kriging estimation, see lecture notes.
y_p = B_p*beta + R_p\(R_p'\v);
else
... |
%TR Transforms a position vector, u, to a new coordinate frame based on the
%homoegenous transformation matrix T.
%
%Inputs:
%-u: The position vector to be transformed.
%-T: The homogeneous transformation matrix.
%Outputs:
%uNew: The new position vector.
%thetaNew: The roll, pitch and yaw angles.
function [uNew] = tr... |
% The ActionShot function helps to create an action shot image by
% finding the pixels from a stack of images
% that are most distant from the median RGB values.
%
% Input: sourceImageArray - A 1xn 1D cell array containing n
% images, where each element is an RGB image
%
% Output: Acti... |
data = importtab('P:\Stealth KeysTest2 (fixed service nodes)\Global.tab');
hopsnoreply = ((data.DHT_Hops_Avg .* data.DHT_MsgRecv_Count)-data.DHT_GetReplyMessage_Count)./(data.DHT_MsgRecv_Count-data.DHT_GetReplyMessage_Count);
f = figure('Position', [200 200 658 420]);
set(f,'defaultaxesfontsize', 14);
count =... |
function [ p ] = hw5p2e( input_args )
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
a=primes(10000);
p=1;
for i=1:1229
p=p*(1-(1/a(i))^2);
end
p
|
function [coeff] = p2coeff(p0,p1,t0,t1)
A1 = [1 0 t0 0; 0 1 0 t0; 1 0 t1 0; 0 1 0 t1];
b1 = [p0; p1];
x1 = A1 \ b1;
coeff = {[x1(1:2) x1(3:4)]}; |
function varargout = jpaBringupNA(varargin)
% function name changed from s21_BiasPwrpPwrs_networkAnalyzer to jpaBringupNA
% [s21] vs [bias], [pump frequency], [pumpPower],with network analyser
%
% <_o_> = jpaBringupNA('jpa',_c&o_,...
% 'startFreq',_f_,'stopFreq',_f_,...
% 'numFreqPts',_i_,'avgcounts',_i_,.... |
% Question 2
% Quang Anh Tran - 40075748
size = 10;
n = 5
Vector1 = zeros(1,size);
Vector1(2) = 1;
Vector1(8) = 1;
Vector2 = ones(1,size);
Vector2(1:n) = 0;
x1 = -5:4;
x2 = 0:9
subplot(2,2,1);
stem(x1,Vector1);
subplot(2,2,2);
stem(x2,Vector1);
subplot(2,2,3);
stem(x1,Vector2);
subplot(2,2,4);
stem(x2,Vector2);
|
% /*
% * MapXYToLatLon
% *
% * Converts x and y coordinates in the Transverse Mercator projection to
% * a latitude/longitude pair. Note that Transverse Mercator is not
% * the same as UTM; a scale factor is required to convert between them.
% *
% * Inputs:
% * x - The easting of the point, in meters.
% * y - The ... |
function [phase,phase2]=pickout(locs,PHA,reso,N)
X_r=locs;
phase=zeros(length(X_r),1);
for ii=1:length(X_r)
phase(ii)=PHA(round(X_r(ii)/reso)+1);
end
phase2=zeros(N,1);
for ii=1:length(X_r)
phase2(ceil(X_r(ii)/reso)+1)=PHA(round(X_r(ii)/reso)+1);
end
end |
function [xc,yc]=Cross(cl,x,y,a)
xs=1;xd=cl+1;
k=tan(a);
b=y(1:end-1,:)-k.*x(1:end-1,:);
cut=size(a,1);
n=size(a,2);
xc=zeros(n,n);yc=zeros(n,n);
for j1=1:n-1
for j2=j1+1:n
for i1=1:cut
for i2=1:cut
xx=-(b(i1,j1)-b(i2,j2))/(k(i1,j1)-k(i2,j2));
yy=-(b(i1,j1)*k(i2,... |
function H = entropy_mm(p)
% mle estimator with miller-maddow correction
c = 0.5 * (sum(p>0)-1)/sum(p); % miller maddow correction
p = p/sum(p); % empirical estimate of the distribution
idx = p~=0;
H = -sum(p(idx).*log2(p(idx))) + c; % plug-in estimator of the entropy with correction |
% ======================================
% Cycle-slip detection in measurement domain
%
% zhen.dai@dlr.de
%
% last modified: 2011.Oct
% ======================================
% Each method will generate its own detection results, including how many
% epochs having been processed, how many cycle-slip being detected and... |
function RoiAllAnalysisRunner
addpath('../');
xmlfile = 'RoiXmlByBoth.xml';
folderAnimal = 'C:\Users\Jackie\Dropbox (Technion Dropbox)\Yara\Layer 5_Analysis\SM04\';
trajpth = 'D:\Layer V\Videos\SM04\2019-08-18_SM04_handreach_behavior\DLC\';
roiListNamesPath = '\\jackie-analysis\e\Shay\SM04\08_18_19_tuft_Final_Versio... |
function [shapes] = shapeFiltering(labeledImg)
W = size(labeledImg,2);
H = size(labeledImg,1);
%
kmin = 1/50;
kmax = 1/20;
tolerance = 2;
%props = regionprops(labeledImg,'Extrema');
props = regionprops(labeledImg,'MajorAxisLength','MinorAxisLength');
labelsToRemove... |
function read_SMAP_arch()
[facts,values] = my_jess_query_multi('ENUMERATION::SMAP-ARCHITECTURE','payload',0);
payload = StringArraytoStringWithSpaces(jess_value(facts{1}.getSlotValue('payload')));
packaging = cell2mat(jess_value(facts{1}.getSlotValue('sat-assignments')));
np = jess_value(facts{1}.getSlotValue('num-plan... |
% SSVEP checkerboard study
clear all;
%clc;
%% Pre-Processing
%load data
[sig, state, parm]= load_data();
Fs= parm.SamplingRate.NumericValue;
numConditions = 20
channels= size(sig,2);
%filter
sig=EEGfilter(sig,Fs,1);
% filter another way.
% use fdatool. export coeficients. use filt filt.
... |
function require_h5_database(conf)
% REQUIRE_H5_DATABASE -- Create the .h5 database file if it does not
% already exist.
%
% IN:
% - `conf` (struct) |OPTIONAL| -- Config file. Defaults to saved
% config file.
if ( nargin < 1 )
conf = dsp2.config.load();
end
h5_dir = conf.PATHS.database;
h5_... |
syms Vx s Cf Cr Jz lf lr m k
%%
A = [ -(Cf+Cr)/(m*Vx) ((Cr*lr-Cf*lf)/(m*Vx))-Vx 0 0
(Cr*lr - Cf*lf)/(Jz*Vx) -(Cf*lf^2 + Cr*lr^2)/(Jz*Vx) 0 0
0 1 0 0
1 0 Vx 0];
B = [ Cf/m 0
Cf*lf/Jz 0
0 -Vx
0 0];
C = [ 0 0 Vx/k 1];
D = 0;
%%
modelTF = C*inv(s*... |
function output = paper_plot(varargin)
output = feval(varargin{:});
function output = init
nodesID = 1:50;
coor = [];
for i = nodesID
x = mod((i - 1), 10) * 8;
y = fix((i - 1) / 10) * 8;
coor = [coor; x, y];
end
% swap 21 and 1
temp = coor(21, :);
coor(21, :) = coor(1, :);
coor(1, :) = temp;
... |
function [] = writeprm(i)
global caseid time_interval init_timeinterval niter
% write prm file for SAM with updated caseid
A = regexp(fileread('DRY/prm'),'\n','split');
if i<1
A{3}=[' caseid =''CRM_test_59h_' caseid '_init' num2str(-i) ''','];
else
A{3}=[' caseid =''CRM_test_59h_' caseid '_' num2str(i) ''','];
end
sw... |
% NOTES
% DATE: 12/03/2018
% AUTHOR: MINHYUK NAM
%% CHP 1-2. Assigning Matrix
A = [1, 2, 3, 4];
B = [1 : 4]; %공차가 1인 range
C = [1 : 2 : 5]; %공차가 2인 (1, 5) range
D = linspace(1, 7, 3); %항이 3개가 되도록 (1, 7) range
E = [1 : 4 ; 5 : 8]; % 2X4 matrix, note that ; change row
% E = [1: 4; 5 : 6] Not valid
F = {'hello... |
function maxima = strict_local_maxima(image, threshold, gaussian_std)
% Probmap är 3D. Det verkar som probmap(:,:,1) är sannolikheten för
% att det INTE finns en cell och probmap(:,:,2) är sannolikheten
% för att det finns en cell. Kan inte tolka det på nåt annat sätt.
... |
function ff= desen2(p,m)
x1=geornd(p,1,m);
N1=histc(x1,0:max(x1));
subplot(1,2,1); hold on; title('Geornd');
bar(0:max(x1),N1/m,'hist','FaceColor','b');
bar(0:max(x1),geopdf(0:max(x1),p),'FaceColor','y');
legend('estimated probabilities','theoretical probabilities');
axis([-0.5 max(x1) 0 max([p,N1/m])])
x2=my... |
function fig1_par_sweep(Fig1ax,linewidth,fontsize)
%This script plots the mean growth part of figure 1
load('large_single_cell_sweep.mat')
max_growth = 25*100/(1+1);
colors = [0 0 0;...
230 159 0;...
86 180 233;...
0 158 115; ...
240 228 66;...
213 94 0;...
204 121 167]/255;
%Plot mean growt... |
function [x y1 y2 y3]=fRK4sis3(n,a,b,x,y1,y2,y3)
h=(b-a)/n;
for k=1:n
x(k+1)=x(k)+h;
K1y1=fy1(x(k), y1(k) , y2(k) , y3(k));
K1y2=fy2(x(k), y1(k) , y2(k) , y3(k));
K1y3=fy3(x(k), y1(k) , y2(k) , y3(k));
K2y1=fy1(x(k), y1(k)+0.5*h*... |
clear all
close all
clc
%%
%% element stiffness matrix for quad element using 4 point integration
%% material data
E=128.5*10^9;%Gpa to pa
v=0.119%0.25;
t=0.210;%m
%% Gauss weights
W1=1
W2=1
int_points=4;
nodes=4
%% gauss points
zi =[-1/sqrt(3) 1/sqrt(3) 1/sqrt(3) -1/sqrt(3)];
eta=[-1/sqrt(3) -1/sqrt(3) 1/sqrt(3) 1/s... |
clear all;
% This file calculates and plots the vector field and sample solutions for
% the system of DEs for problem 3.1.3 in project 3
% Define constants
a = 0.15;
k = 8;
mu_1 = 0.2;
mu_2 = 0.3;
epsilon_0 = 0.002;
S = 0;
% Define DEs
dvdt = @(v,h) k.*v.*(a - v).*(v - 1) - h.*v + S;
dhdt = @(v,h) -(epsilon_0 + (h.... |
function param = compute_controller_base_parameters
% load truck parameters
load('system/parameters_building');
m_VC=building.m_VC;
m_F1=building.m_F1;
m_F2=building.m_F2;
a_Env_VC=building.a_Env_VC;
a_F1_VC=building.a_F1_VC;
a_F2_VC=building.a_F2_VC;
a_F2_F1=building.a_F2_... |
%% 初始化
path = '.\\Apr\\img2\\';
img_files = dir([path '*.jpg']);
seq_len = length(img_files(not([img_files.isdir])));
% 得到图片名
if exist([path num2str(1, '%04d.jpg')], 'file'),
img_files = num2str((1:seq_len)', [path '%04d.jpg']);
else
error('No image files found in the directory.');
end
need_len = 125;
img = ce... |
close all
clear all
%Load Data into cell array
rawdata = mpc_read_multiple_data('C:\Users\mpanagi\Documents\GitHub\Marios-temp\MP007\MP007_LightLeverPress_Acquisition_Day10');
% Matrix location of event and timestamp data in med associates data
eventMatrix = 'A';
tsMatrix = 'B';
%Active lever is in list L; 1 = Le... |
function [R_t_2,R_t_3,Reconst,T,iter]=LinearTFTPoseEstimation(Corresp,CalM)
%LINEARTFTPOSEESTIMATION Pose estimation of 3 views from corresponding
% triplets of points using the linear TriFocal Tensor.
%
% The trifocal tensor is computed with an algebraic minimization of the
% trilinearities using the triplets of c... |
clear;
clc;
%% first you have to use dcm2nii to sort the dicoms by the series
% take the MPRAGE and DWI out, write in the origin and voxel size for further
% experiment
%% change dicoms into nii
% see the IMG2NII function
%% coregister
% for the target image
% coregister the MPRAGE and b0 image and apply t... |
function I = UniformQuantization (I,N)
L = 0:1/N:1;
p = 0.5*(L(1:N)+L(2:N+1));
for x = 1:size(I,1)
for y = 1:size(I,2)
for j = 1:N
if I(x,y) < L(j+1)
I(x,y) = p(j);
break;
end;
end;
end;
end;
% for j=1:N
% index=fi... |
%% K-mean++ algorithm for choosing intelligent initial K-means centers
% Reference:
% D. Arthur and S. Vassilvitskii, "k-means++: The Advantages of
% Careful Seeding", Technical Report 2006-13, Stanford InfoLab, 2006.
%
% Ke Ma & Chris Bodden
%
% Inputs:
% data - N x D matrix of SIFT features for training image... |
function [r] = latencyIIR(myEqualiser)
frameSize = 1024;
fileReader = dsp. AudioFileReader ('speech_wideband_16k.wav', ...
'SamplesPerFrame',frameSize);
fileWriter = dsp. AudioFileWriter ('Filename', 'output.wav', ...
'SampleRate',fileReader.SampleRate);
Ntrials = 1;
playDuration = 2.4;
NFrames = ceil(playD... |
function [I] = Simpson1_3(x, y)
% Numerical evaluation of integral by Simpson's 1/3 Rule
% Inputs
% x = the vector of equally spaced independent variable
% y = the vector of function values with respect to x
% Outputs:
% I = the numerical integral calculated
size = length(x);
if ((size ~= length(y)) || si... |
function uq_SVR_display(SVRModel, outArray, varargin)
%Plots the mean and variance of a Kriging predictor. Only works for 1- and
% 2-D inputs.
%% Internal parameters
% BoundColor = [128,128,128]/255; %gray
BoundColor = [176 196 222]/255; %lightskyblue
% Granularity of the grid in one- and two-D cases in each directioni... |
% ADVISOR data file: PTC_INSIGHT.m
%
% Data source:
% copied from PTC_PAR, engine idle speed from NREL testing
% Data confirmation:
%
% Notes:
% Defines all powertrain control parameters, including gearbox, clutch, hybrid
% and engine controls, for a parallel hybrid using a 5-spd gearbox.
%
% Created on: 5-Jul-20... |
function gamma_table = LinearGammaTable()
gamma_table = repmat((0:255)' / 256, 1, 3);
end |
function [v] = mg(v, f, mask, vsz, opts)
%MG Multigrid for solving Poisson's equation with homogenous Dirichlet BCs.
%
% -Delta u = f, for x in mask
% u(~mask) = 0
%
% [v] = MG(v, f, mask, vsz, [opts]);
%
% Inputs
% ------
% v initial guess (... |
function [ sinoOut, geomOut, truncatedView ] = truncationCorrectionReferenceDetector( sinoIn, geomIn, sinoRefLeft, sinoRefRight, edgeWidth, extendWidth )
% function [ sinoOut, geomOut ] = truncationCorrectionExtendedDetector( sinoIn, geomIn, mu, edgeWidth )
% Water cylinder fitting based truncation correction alogrithm... |
function playRipple_timer_startfcn(obj,event,handles)
%
% setappdata(handles.playRipple,'waitForTrg',1);
% setappdata(handles.playRipple,'nStimPlayed',0);
% nPresent = getappdata(handles.playRipple,'nPresent');
% report_status(handles,sprintf('Waiting for trigger, stim 1 / %d... |
addpath ../caffe/matlab
addpath mnistHelper/
% load mnist dataset
images = loadMNISTImages('mnist/t10k-images-idx3-ubyte');
labels = loadMNISTLabels('mnist/t10k-labels-idx1-ubyte');
labels(labels == 0) = 10; % Remap 0 to 10
caffe_pred = [];
caffe.set_mode_cpu();
% load pretrained model
model = './caffe/lenet_depl... |
function [ best_idx, perform_mat] = TuneParam_impL21...
(param_set, X, Y,X_R,coord,trainIdx,testIdx,vadratio)
%% INPUT
% data: original data
% obj_func_str: 1-parameter optimization algorithms
% param_set: the set of the parameter. array
% eval_func_str: evaluation function:
% signature [performance_... |
function n = materialLibIso(material,Lam)
k = length(Lam);
switch material
case 'air'
n = ones(k,1);
case 'BK7'
oscA = [1.03961212,0.231792344,1.01046945];
oscE = [6000.69867,20017.9144,103560653];
lam2 = Lam.^2;
for m = 1:k
n(m) = sqrt(sum(lam2(m)*... |
function [y1,y2] = adapt_filt(x)
% stima y1
loc_med = colfilt(x, [5 5], 'sliding', @mean);
loc_std = colfilt(x, [5 5], 'sliding', @std);
Cx = loc_std ./ loc_med;
Cu = 1/(2*sqrt(2));
mask = (Cu.^2./Cx.^2) < 1;
Wl = ((1-(Cu.^2./Cx.^2))./(1+Cu.^2));
y1 = (x.*Wl + loc_m... |
function [m,p] = getMandPFromVelocity(coord, speedInAxis)
x2 = coord(1,1) + speedInAxis(1,1);
y2 = coord(1,2) + speedInAxis(1,2);
if (x2 - coord(1,1)) ~= 0
m = (y2 -coord(1,2)) / (x2 - coord(1,1));
else
disp('pente infinie');
m = NaN;
%m = Inf;
end
if isnan(m)
p = 0;
else
p = coord(1,2) - m*coo... |
clear;
clc;
cam = webcam;
im = snapshot(cam);
[side_length, centrepoints] = getInitialData(im);
imshow(im);
hold on;
for i = 1:36
hold on;
scatter(centrepoints(i,1), centrepoints(i,2));
pause(0.5);
end
|
clear all
clc
USING_MATLAB = 0;
nf_subcarriers = 256;
min_nf_errors = 100;
max_iters = 1000;
binary_data = [0, 1];
% Desired data rate in bits/sec
Rd = 10^(6);
% Data rate of each sub carrier
Rs = Rd/nf_subcarriers;
% Symbol duration in sec calc
Tu = 2/Rs ;
% Number of timeslots to observe the si... |
function [cat] = loadkansas(pathname1,catname1)
% This function loads the Kansas Catalog
% Input: currently has no input and catalog name and path are hard coded
% Output: a structure containing normalized catalog data
% cat.name name of catalog
% cat.file name of file contining the catalog
% ... |
function [nvokeGpioStruc] = readNvokeCsv(varargin);
% Select and read in a meta_decode.py exported nVoke CSV file
% (see email with description of exported data from Inscopix, at bottom)
% Clay 2017
%% read data
if nargin == 1
filename = varargin{1};
else
[filename, folder] = uigetfile('.csv', 'Select meta_d... |
% function y = enc_prac(im)clc
clc
clear
im = double((imread('/Users/INNOCENTBOY/Documents/MATLAB/pic/4.2.04.tiff')));
R = im(:,:,1);
G = im(:,:,2);
B = im(:,:,3);
% im = mat_rev_diffussion4(im);
[row,col,dim]=size(R);
Mu = 3.99;
xlog1= 20.1;
ylog1= 22;
zlog1= 19;
k_5 = 34;
k_6 = 40;
k_7 = 36;
pix = 0.1;
N = numel(R... |
function VisualizeMed(Volume, argument, type);
figure;
for i = 1: size(Volume, 3)
imshow(Volume(:,:,i));
hold on;
plot(argument(i,:), 'r');
if(strcmp(type, 'med') == 1)
hold off; title("Middle Line Present On OCT Image");
end
if(strcmp(type, 'rpe') == 1)
hold off; title("RPE Line Pres... |
function matAssembleGlobalStiffMatrixTest( obj )
MatVersionStiffMatrix = zeros( obj.meshUnion.K * obj.meshUnion.cell.Np );
SPNPX = full(obj.NonhydrostaticSolver.SPNPX);
SPNPY = full(obj.NonhydrostaticSolver.SPNPY);
PNPS = full(obj.NonhydrostaticSolver.PNPS);
SPNPS = full(obj.NonhydrostaticSolver.SPNPS);
MSPNPX = ful... |
function TTs2gpt(fid,q,xx,yy,objid)
# risemo trikotnik kot poligon
overlap=0.1;
rgbcol=Tgetrgbcol(q);
fprintf(fid,'set obj %6d polygon from %10g,%10g to %10g,%10g to %10g,%10g to %10g,%10g\n',objid,xx(1),yy(1),xx(2),yy(2),xx(3),yy(3),xx(1),yy(1));
fprintf(fid,'set obj %6d fc rgb "#%s" fillstyle solid ... |
mergeh5_chunks('2019-09-06', 6500) ;
|
clc
clear all;
close all;
[I1]=imgetfile;
[I2]=imgetfile;
[I3]=imgetfile;
i1=im2double(rgb2gray(imread(I1)));
i2=im2double(rgb2gray(imread(I2)));
I3=im2double(rgb2gray(imread(I3)));
[cA1,cH1,cV1,cD1] = dwt2(i1,'sym4');
[cA2,cH2,cV2,cD2] = dwt2(i2,'sym4');
figure, imshow(I3),title('I1');
figure, imshow(i2)... |
function KOR=estimate_channel(Packet,LongPreambleStart)
global ref
global SymbolLength
global GuardInterval
%% Paket Korrelation Kanaleinflüsse
snap = Packet(GuardInterval+LongPreambleStart+(0:SymbolLength-1));
h1 = fftshift(fft(snap)).*ref(:,3);
snap = Packet(GuardInterval+Sy... |
clc
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This program is written to generate airfoil profile using Joukowsky Transform
% The aim of this program is understand how the profile of airfoil changes with change in initial constants
% The program does not have any part on how to generate values of C, r, C_... |
function nlp = AngularMomentumCost(nlp, varargin)
w = varargin{1};
plant = nlp.Plant;
D = plant.Mmat;
q = plant.States.x;
dq = plant.States.dx;
h_t = D(4,:)*dq;
ws = SymVariable('w');
% ndof = nlp.Plant.numState;
% q0s = SymVariable('q0',[ndof,1]);
% ... |
clc
clear
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
labeltsize=35;
fw = 'normal'; %%是否加粗斜体之类
fn='Times New Roman';
linewide1=3;
mkft = 10;
FontSize = 20;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%复合高斯0.1,-5dB%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function C = CellComp4Layer_Coefficients_Full(Coeff,eta_V,eta_F,eta_L,eta_I,sigma_V,xi_T_f,sigma_L_y,sigma_I,Yii, h_F, m)
if strcmpi(Coeff,'A1')
C = (2.*eta_V.*m.*exp(Yii.*eta_I).*(exp(Yii.*eta_V)./2 + ...
exp(-Yii.*eta_V)./2).*(eta_L.*sigma_L_y.*exp(Yii.*eta_V + 2.*eta_F.*h_F) + ...
eta_F.*xi... |
function m = vecMean(v)
m = mean(v);
return |
function data = simple_image_read(filePath)
read_fileID = fopen(filePath,'r');
dim_val = fread(read_fileID,[1,3],'int');
disp(dimval(3));
full_val = [];
for i = [1:dim_val(3)]
new_val = fread(read_fileID,[dim_val(1) dim_val(2)],'int16');
full_val(:,:,i) = new_val;
end
dim... |
function setNextVisibleTime(obj, time)
% SETNEXTVISIBLETIME Sets the time the message to become visible in the queue
% The time is provided as a datetime.
% Copyright 2019 The MathWorks, Inc.
if isdatetime(time)
timeJ = java.util.Date(int64(posixtime(time)*1000));
obj.Handle.setNextVisibleTime(timeJ);
else
... |
%% 基于频谱图还原信号
%% 原始心好
clear
clc
close all
% Fs = 1000; % Sampling frequency
% T = 1/Fs; % Sampling period
% L = 1000; % Length of signal
% t = (0:L-1)*T; % Time vector
% S = 20*cos(100*2*pi*t)+40*cos(50*2*pi*t);%0.2-0.7*cos(2*pi*50*t+20/180*pi) + 0.2*cos(2*pi*100*t+70/180*pi) ;
... |
clc
clear all
Num=[200 6500 5528 116004 110520 32800];
Den=[1 109 925.3 2459.2 2543.3 1900.25 18.75];
Gs=tf(Num,Den);
Gssym=poly2sym(Num)/poly2sym(Den);
Gstay=taylor(Gssym);
n=max(size(Den));
denjw=Den.*(1i).^(n-1:-1:0);
if mod(n,2)==0
Do=denjw(1:2:n)/1i;
De=denjw(2:2:n);
else
Do=denjw(2:2:n)/1... |
function [f,g,H] = linfunmlr(w, t, ax, X, ixf, ixc, Nclass)
% linear function handle for multinomial logistic regression
%
% t : integer representing class label. must start from 1
%
% 2009/06/01 OY Revised
%
% Copyright (c) 2009, Okito Yamashita, ATR CNS, oyamashi@atr.jp.
[Nsamp] = size(X,1);
Z = [];
for c = 1 : N... |
function vars = rib_data(validate_data, visualize_data)
%
% Dataset:
% Rilling & Insel 1999b
%
% Data:
% Extract cross-primate callosal data from Rilling & Insel (1999b)
%
% Figures:
% Figure 1b: brain volume (cm^3) vs. cc area (mm^2)
% Figure 2: grey matter surface area (cm^2) vs. cca (mm^2), white matter volu... |
function [devices internal wireless] = deviceCheck
% [devices internal wireless] = deviceCheck
%
% purpose: find mouse & keyboard IDs for KbCheck
%
% no inputs required
%
% two outputs:
% two struct vars for [internal wireless] devices.
% each var has a keyboard and mouse/trackpad field
%
% this ID number (e.g. inte... |
function [Setting] = DefineSettings
% Settings for Pressure Based Meshing algorithm are defined
%% Limits for Loop optimization
Setting.scale_min=.01; % Scale Factor for Density of nodes on contours lower and upper limit
Setting.scale_max=1;
Setting.maxiter=10; % Maximal number of iteration... |
clear;
nMix=128;
emotion='sad';
trainDir=['../../vc/train/to' emotion '_ar/gmm_jde/' num2str(nMix) '-mix'];
gmmMean=[trainDir '/neutral-' emotion num2str(nMix) '.mean.txt' ];
gmmCov=[trainDir '/neutral-' emotion num2str(nMix) '.cov.txt' ];
gmmWght=[trainDir '/neutral-' emotion num2str(nMix) '.wght.txt' ];
trainFile=[t... |
function handles = run_GUI()
global strct
global bekannteStudien
strct = struct('data',[],'ROI',[],'features',[]);
strct.features = struct('PORTS',[],'radiomics',[],'feature_list',[]);
strct.ROI = struct('directories',[],'names',[],'lMask',[],'sameROIs',0,'info',[]);
strct.ROI.info = 'Fuer jede selektierte Aufnahme gi... |
function [f_detect,f_vote0,f_vote1] = detect_fingerprint(T, gamma,epsilon,rnd_range,secretKey)
%{
obtain the marked database for a service provider (sp_id), secretKey is the
secret key of the database owner
epsilon: mark one of the last significant epsilon bit
gamma: mark every gamma tupple
%}
L = 128;
f_vote0... |
% Approximation of (non-noisy) non linear function using feedforward neural
% networks with gradient descent
clear; clc; close all
addpath export_fig
% Setting up non linear function
x1 = -5:0.1:5; f = x1.^3 + x1.^2 - 1;
p1 = con2seq(x1); t1 = con2seq(f);
% transformation of polynomial function f (target variance too... |
clc;
clear;
close;
%read the four images
Image4=imread('D:\NYU_SEM_2\Computer Vision\dog-png\dog4.png');
Image3=imread('D:\NYU_SEM_2\Computer Vision\dog-png\dog3.png');
Image2=imread('D:\NYU_SEM_2\Computer Vision\dog-png\dog2.png');
Image1=imread('D:\NYU_SEM_2\Computer Vision\dog-png\dog1.png');
Double_img1 = double... |
function [userdata,direction] = zaloha(position,arena,userdata)
function valid = Isfree(y,x)
valid=true;
[m,n]=size(arena);
if y<1||y>m||x<1||x>n
valid=false;
elseif arena(y,x)~=1&&arena(y,x)~=7
valid=false;
end
end
%funkce zjisti zda... |
function Xrec = icwtft(S,varargin)
% ICWTFT Inverse continuous wavelet transform using FFT.
% XREC = ICWTFT(CWTSTRUCT) computes the inverse continuous
% wavelet transform using a Fourier transform based algorithm.
% CWTSTRUCT is a structure computed by CWTFT which contains
% six fields:
% cfs: coeffici... |
function y = difference(original_root, new_root)
diff = new_root/original_root;
diff = diff-1;
diff = diff*100;
y = diff;
end |
function x=randmix(v)
% 矩阵元素的随机置换
% x=randmix(v)将矩阵v的元素随机混合得x
% L.J.Hu 8-17-1999
[m,n]=size(v);
v=v(:);
v=[randperm(m*n)',v];
v=sortrows(v);
x=reshape(v(:,2),m,n);
|
function location = getLocation(ID)
nodeID = dec2hex(ID);
if length(nodeID)<3
location=0;
else
location = [str2num(nodeID(2)) str2num(nodeID(3))];
end |
function [lat, errorS, coordinates] = splitBigCell(startLat, splitInto, numIons, nsym)
% USPEX Version 6.7.2 (rewritten)
% splits the big cell into smaller pieces and fills them with atoms
errorS = 0;
global ORG_STRUC
global POP_STRUC
% manually changed so far, for testing
% split either by fixing cell number or f... |
function [bestA, bestS, errors, time] = uconvdlasu(cI, k0, L, n, m)
%UCDLA - Union of Convolutional Dictionary Learning Simultaneous Update -
% A proof of concept implementation of the UCONVDLA-SU.
%
% [A, S, errors, time] = UCONVDLASU(Y, k0, L, n, m)
%
% Input:
% Y - dataset (p x N)
% k0 - target sparsity: 1 <= k0... |
gui = true;
update = true;
iq2ProbNumSamples = 2e4;
correctf01DelayTime = 0.6e-6;
AENumPi = 31;
gAmpTuneRange = 0.03;
fineTune = false;
% qubitGroups = {{'q1','q4','q7','q10'},...
% {'q2','q5','q8','q11'},...
% {'q3','q6','q9'}};
qubitGroups = {{'q1','q4','q7'},...
... |
function[datos_x, datos_y] = tiro_base_trapecio(datos_x, datos_y, camara)
if camara == '2'
min_y = min(datos_y);
distancia = 150;
filtro = datos_y < min_y + distancia;
datos_x = datos_x(filtro);
datos_y = datos_y(filtro);
end
end
% close all... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.