text stringlengths 8 6.12M |
|---|
clear
path_fir = '/sb/scratch/yassinebha/database/twins_study/stability_fir_all_sad_blocs/';
files_in.model = '/home/yassinebha/script/models/dominic_dep_group0a4_minus_group11a20.csv';
%sc = 'sci10_scg7_scf7';
sc = 'sci140_scg140_scf147';
path_out = ['/sb/scratch/yassinebha/database/twins_study/glm_fir/' sc '/'];
%% ... |
//
// Screen.m
// MoonHerder
//
// Created by Roger Engelbert on 10/9/12.
// Copyright Done With Computers 2012. All rights reserved.
//
#import "Screen.h"
// Screen implementation
@implementation Screen
@synthesize touchPoint = _touchPoint;
- (void) dealloc {
if(_container != nil) [_container release];
... |
% Clear memory
clear; clc; close all;
% Laod Airfoil Data .txt
[name,path] = uigetfile('*','Select Aitfoil txt file:');
data = load(strcat(path,name));
xdat = data(:,1); % x coordinates
ydat = data(:,2); % y coordinates
zdat = ones(length(xdat),1); % z coordinates of zeroes - 2D
x = xdat - 0.25;
y = ydat;
z =... |
% Modified from https://www.mathworks.com/matlabcentral/fileexchange/15317-zigzag-scan?focused=6119314&tab=function
% Alexey S. Sokolov a.k.a. nICKEL, Moscow, Russia
% June 2007
% alex.nickel@gmail.com
function output = zigzag(in)
h = 1;
v = 1;
vmax = size(in, 1);
hmax = size(in, 2);
i = 1;
% Output matrix.
output =... |
% Split data into training and test set
load('FaceNonFace.mat')
testruns = 1000;
accumulated_accuracy = 0;
for i=1:testruns
part = cvpartition(200, 'HoldOut', 0.20);
test_indices = test(part);
train_indices = training(part);
X_test = X(:, test_indices);
Y_test = Y(test_indices);
X_train = X(:, ... |
% perform gradient and hessian checking on various constraints
clc
clear all
N = 3; %number of wells
T = 5; %number of time steps
%generate a simple setting and randomly set initialization
[x,functionParams,params,l,u] = gen_case_1(N,T);
x = x + rand(length(x),1); %perturb x so that it is not feasible
h = rand(lengt... |
clear paramsAll;
clear params;
params.Gridjob.runLocal = false;
params.Gridjob.requiremf = 2500;
params.Gridjob.jobname = 'ProbtrackXallsubjects';
params.Gridjob.initRandStreamWithJobid = false;
params.Gridjob.continue = false;
params.Gridjob.requiredThreads = '1';
params.Gridjob.queue = 'nbp.q';
params.Gridjob.runOnl... |
clc,clear
im=cell(1,2);
figure;
im{1}=imread('cylinder_dark.jpg');
im{2}=imread('cylinder_light.jpg');
subplot(2,7,1),imshow(im{1})
subplot(2,7,8),imshow(im{2})
quotient_img=cell(1,2);
for number=1:2
temp=im{number};
temp=imresize(temp,[320,280]);
for channel=1:3
temp_res(:,:,channel)=NQI_lbp(temp(... |
function [] = CV_L_LDA(subset, subsize)
% a script to perform Gaussian Process Classification, by Mark Norrish
% see Rasmussen & Williams for algorithms' derivations
% performs cross-validation on a data set, with hyperparameter learning and large dataset approximations
% subset: which method used (see choose_sub... |
function qsm_swi47(path_in, path_out, options)
%QSM_SWI47 Quantitative susceptibility mapping from SWI sequence at 4.7T.
% QSM_SWI47(PATH_IN, PATH_OUT, OPTIONS) reconstructs susceptibility maps.
%
% Re-define the following default settings if necessary
%
% PATH_IN - directory of .fid from ge3d sequence ... |
clear all;
clc;
% Specify tolerance %
tolerance = 5;
Es = 0.5*10^(2-tolerance);
% Flag is used to break from parent while loop %
breakFlag = 0;
% Take input as Augmented Matrix %
A = [ 3 7 13 76
1 5 3 28
12 3 -5 1];
% Will be used later
needsPivoting = 0;
% Split augmented matrix into two matrices, ... |
% Change the filenames if you've saved the files under different names
% On some platforms, the files might be saved as
% train-images.idx3-ubyte / train-labels.idx1-ubyte
images = loadMNISTImages('train-images-idx3-ubyte');
labels = loadMNISTLabels('train-labels-idx1-ubyte');
x = images; %(:,1:1000);
[Xwh, whit... |
function [outimage] = adapt(inimage)
%ADAPT Takes in an image loaded from file and applies an adaptive
%thresholding technique discussed in the labs to convert it into a binary image. The core code format was
%given as a script but has been adjusted slighty to be used as a function.
%
%The constant N was determined bec... |
my_image = imread('peppers.png');
red_channel = my_image(:,:,1);
red_channel2 = red_channel + blue_channel;
blue_channel = my_image(:,:,2);
green_channel = my_image(:,:,3);
difference = red_channel2 - red_channel; |
function [T,I,Y]=naivePerfusionResponsepotent1P2X4revcoop(ton,toff,Ttot)
ode=modelODEpotent1P2X4revcoop(ton,toff);
naive=zeros(21,1);
naive(1)=1;
setAuxiliarypotent1P2X4revcoop(naive);
[T,Y]=ode15s(ode,[0 Ttot],naive,odeset('NonNegative',1:21));
I=getTotalCurrentpotent1P2X4revcoop(Y);
end |
function ret=RAD2DEG
ret=180/pi;
end |
function [Y_F,U] = SimulateFactorsResiduals(Corr_Y_F, volU, J)
%[Y_F,U] = SimulateFactorsResiduals(Corr_Y_F, volU, J)
% Generates simulations of unit normal factors Y_F and residuals U. The
% first two sample joint moments of Y_F are forced to match the given
% inputs and assumptions. Sample covariance of each r... |
function [ Conv_Matrix ] = Cyclic_Convolution_Matrix( min_interval, AIF)
%Convolution_Matrix Creates cyclic convolution matrix of AIF
% The padding is to the size of M+N+1 (M - length of AIF, filter - length of filter kernel)
% ---------------------------------------------
% Piece-wise constant
% --------------------... |
function [cut_struct,ind] = plot_Cuts(obj,energy,direction,varargin)
% View sequence of cuts correspondent to energy transfer and direction provided
% as input and return the structure, usually stored with cut sequence
% inputs:
%
% options = {'-keep_fig'};
%
CutID = [num2str(energy(1)),direction_id(direction)];
[cu... |
%@(#) stege.m 1.3 98/01/07 12:17:11
%
function stege(antal,restsek,specburn,garburn,buntot,staton);
if nargin<6, staton=' ';end
ia=length(antal);
it=length(find(antal>0));
nfig=1;
nr=0;
pos=[0 220 500 660];
m0=min(3,it);
p=m0;
for i=1:ia,
if antal(i)>0,
if antal(i)<3,
disp(['Since there are only ',sp... |
function OverlapDisplay(INPUT_DATA,varargin)
% OverlapDisplay
% Displays the Pair-wise Overlap data from CheckGeneListOverlap
%
%
% OverlapDisplay(INPUT_DATA)
%
%
% OverlapDisplay(INPUT_DATA,'background:type',BKG_DATA)
% Uses the Background Data from random shuffling of the annotation
% ... |
function lasted = pauseUI( time )
if time<=1
pause(time);
else
% t = tic;
tm = round(time);
figure(314159);
title(['Paused, ' num2str(round(tm)) ' sec' ],'FontSize',52);
while(ishandle(314159) && tm>0)
tm = tm-1;
title(['Paused, ' num2str(round(tm)) ' sec' ],'FontSize',52);
... |
clear;
close all
% Setup grids
L = 4.0;
ds = 2*L/17;
x = -L:ds:+L;
y = -L:ds:+L;
% Contour grid
xc = linspace(-L,L,500);
yc = linspace(-L,L,500);
[xxc,yyc] = meshgrid(xc,yc);
% Quiver grid
[xx,yy] = meshgrid(x,y);
[tt,rr] = cart2pol(xx,yy);
% Psi
psi = yyc-4*yyc./(xxc.^2+yyc.^2);
% Velocities
rr = xx.^2+yy.^2;
uu... |
%% SEREEGA Tutorial
if exist('/home/knight/','dir');root_dir='/home/knight/';app_dir=[root_dir 'PRJ_Error_eeg/Apps/'];
elseif exist('/Users/sheilasteiner/','dir'); root_dir='/Users/sheilasteiner/Desktop/Knight_Lab/';app_dir='/Users/sheilasteiner/Downloads/fieldtrip-master/';
else root_dir='/Volumes/hoycw_clust/';app_di... |
function [ini_dir_way] = initial(size)
ini_dir_way=[];
for i = 1:size
if mod(i,2) == 1 && mod((i+1)/2,2)==0
for j = 1:size
if mod(j/2,2)==1
ini_dir_way=[ini_dir_way 3];
elseif mod(j/2,2)==0
ini_dir_way=[ini_dir_way 1];
end
end
e... |
function save_robot_data(bots, handle)
for i = 1:length(bots)
fprintf(handle, '%f,%s,%d,%d,%d\r\n',now, bots(i).name, bots(i).X, bots(i).Y, bots(i).visible);
end |
function r = delayd3fdx2dp(t,fd_cell,p,force)
r = cell(1,1,1,3);
r(:) = {0};
|
function [H]=funcionCaracteristicaDuctos(k, Q, NPSH)
if length(Q)>1
H=k*Q.^2+NPSH;
else
H=k*Q^2+NPSH;
end
end |
function varargout = frequency_control(func,ring,varargin)
%FREQUENCY_CONTROL Private. Handle off-momentum for 6D lattice
%
% VARARGOUT=FREQUENCY_CONTROL(FUNC,RING,VARARGIN)
%
%FUNC Wrapped function, called as FUNC(RING,VARARGIN{:},'is6d',IS6D)
[warningdp6d,varargs]=getoption(varargin,'WarningDp6D');
[is_6d, vara... |
function [ allvValsMat, allHsLog ] = INDEP_Heatmaps( allNVals, maxRuns,dVal, rangV, rangKs )
% This function plots all the heatmaps of H vs c_1 and c_2 (by increasing
% only v_1 or v_2
% The output is a list of structures for each value on containing
% H and values of v.
% Inputs:
% allNVals - all values on n (number ... |
%% Redes de sort
% Intento probar la coevolución de redes de sort a la Hilis
% NO FUNCIONA
%%
redes = population('i',4*ones(1,10));
redes = random(redes,10);
listas = population('i',4);
listas = random(listas,10);
%%
for ciclos=1:20
red = get(redes,r);
lista = get(listas,r);
for i=1:10
for j=1:10
... |
clc; clear; close all;
load('train_data.mat');
load('train_y.mat');
x1 = X(:,1);
x2 = X(:,2);
x3 = X(:,3);
n = size(X,1);
%% Model 1: with one feature only: x_1
X = x1;
w1 = inv(X'*X)*X'*Y; % weights using Moore-Penrose Pseudo-Inverse
Y_pred = X * w1;
SSE1 = sum((Y_pred - Y).^2);
ERR_bits_1 = n*(log(SSE1/n)/log(2));
%... |
%% 三次指数平滑
clc,clear
load('yx.mat') %原始数据以列向量的方式存放
yt=yx; n=length(yt);
alpha=0.9; st1_0=mean(yt(1:3)); st2_0=st1_0; st3_0=st1_0;
st1(1)=alpha*yt(1)+(1-alpha)*st1_0;
st2(1)=alpha*st1(1)+(1-alpha)*st2_0;
st3(1)=alpha*st2(1)+(1-alpha)*st3_0;
for i=2:n
st1(i)=alpha*yt(i)+(1-alpha)*st1(i-1);
st2(i)=alpha*st1(i)+(1-a... |
function b = isintersect(P1, P2)
% function b = isintersect(P1, P2)
%
% Check if two polygons intersect
% INPUTS:
% P1 and P2 are two-row arrays, each column is a vertice, assuming
% ordered along the boundary
% OUTPUT:
% b is true if two polygons intersect
%
% Author: Bruno Luong <brunoluong@yahoo.com... |
programming_5_1_a
programming_5_1_b
[ttt_train_data,ttt_train_label] = preprocessing_ttt('hw1ttt_train.data');
[ttt_valid_data,ttt_valid_label] = preprocessing_ttt('hw1ttt_valid.data');
[ttt_test_data,ttt_test_label] = preprocessing_ttt('hw1ttt_test.data');
%K-NN
disp('KNN Algorithm');
for k= 1:2:15
[knn_valid_a... |
function [z,fix] = BitFlipDecode(channel,y,sll,H)
E = zeros(size(H,1),size(H,2));
if (channel == 2)
for i=1:size(y,2)
if (y(1,i) < 0)
y(1,i) = 1;
else
y(1,i) = 0;
end
end
end
M = y;
for lap=1:sll
for j=1:size(H,1)
for i=1:size(H,2)
if H(j,... |
function C = agentsLoc(a, index)
% Returns the location (with noise) of all the gents at a given time(step)
N = length(a);
C = zeros(2,N);
for n=1:N
C(:,n) = a(n).xn(:,index);
end
end
|
function numRTTrades=calculateNumRTTrades(positionTable)
%numRTTrades=calculateNumRTTrades(positionTable)
positionTable0=backshift(1, positionTable);
positionTable0(1, :)=0;
assert(ndims(positionTable)==2);
assert(ndims(positionTable)==2);
capital=abs(positionTable);
capital0=backshift(1, capital);
capital0(1, :)=0;
c... |
function result = scaleImage(m, x, y)
% Normalize to [0, 1]:
result = min(min(m));
range1 = max(max(m)) - result;
m = (m - result) / range1;
if (nargin == 1)
y = 255;
x = 0;
end
% Then scale to [x,y]:
range2 = y - x;
result = (m*range2) + x;
result = uint8(result);
% dR = diff( m );
% result = zeros(size(m)... |
function ScoreComputationPerUT(j)
tic
load simulated_data_1.mat
toc
n_UT = size(model_agent_combination{1}.agents{1}.all_options,1);
n_models = 3;
R = size(model_agent_combination{1}.agents{1}.choice_data,1); % Repetitions per Unique Trial
% We sent batches of 50 trials to the cluster (High Performance C... |
function plot_qv_fourier(qv,m,n)
figure;
hold;
for i = 1:m*n
for j = 1:m*n
plot3(i,j,qv_fourier(i,j,qv,m,n), '*');
title('Qq vs i & j');
xlabel('i');
ylabel('j');
zlabel('Qq');
end
end
end |
% 打开原图
imOri=imread('lena.jpg');
%缩放、灰度化原图
imOri=imresize(imOri,[512 512]);
imOri=rgb2gray(imOri);
% 打开水印图
imWat=imread('QQ.png');
% 缩放、灰度化水印图
imWat=imresize(imWat,[512 512]);
imWat=rgb2gray(imWat);
% 加水印后的图
imNew=uint8(double(imOri)+0.05*double(imWat));
% 保存加水印后的图
imwrite(imNew,'lena-QQ.png')
% 绘... |
function visualizeSynthesizedParams(obj)
eccDegs = sqrt(sum(obj.synthesizedRFparams.rfCenterPositionDegs.^2,2));
plotParams(201, eccDegs, obj.synthesizedRFparams.visual, 'visual');
plotParams(202, eccDegs, obj.synthesizedRFparams.retinal, 'retinal');
end
function plotParams(figNo, eccDegs, synthPara... |
%DEMO_POLYGONSKELETON One-line description here, please.
%
% output = demo_polygonSkeleton(input)
%
% Example
% demo_polygonSkeleton
%
% See also
%
% ------
% Author: David Legland
% e-mail: david.legland@inrae.fr
% INRAE - BIA Research Unit - BIBS Platform (Nantes)
% Created: 2022-02-18, using Matlab 9.1... |
% Create table
A = [1 2 3 6;1 2 2 5;1 4 1 4;2 2 1 8;2 2 3 1];
T = array2table(A);
T.Properties.VariableNames = {'a', 'b', 'c', 'd'};
index = {'a', 'b'};
B = varfun(@mean, T,'GroupingVariables', index)
% Remove index and group count
B(:,index) = [];
B.GroupCount = [];
B.Properties.RowNames = {}; % Not nec... |
%% this script interpolates the missing data for the irradiance profile and the load profile.
startdate1 = datetime(2018,03,13,15,39,00);
enddate1 = datetime(2018,03,26,08,03,00);
missingperiod1 = startdate1:minutes(1):enddate1;
missingperiod1 = transpose(missingperiod1);
index1 = find(irradianc... |
function b8zs( bitstream )
% B8ZS Bipolar with 8-Zeros Substitution
% sample data:
% d = [ 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 ]
% usage:
% b8zs(d)
% author:
% Anastasios Latsas
% pulse height
pulse = 5;
% assume that current pulse level is a "low" pul... |
clear all;
%%% variables %%%
phi = pi/2;
theta = [0:359]/180*pi;
%%% constants %%%
a=10; % radius
D=.1; % mode shape amplitude
loop = 1;
while loop
str = '\nInput n =';
n=input(str);
str = '\nInput \phi = (ex. pi/2)';
phi_i=input(str);
str = '\nInput \theta = (ex. pi/3)';
theta_i=input(str);
%%% s... |
function [e,mid,x,y]= main(bin,file)
[bwl,N] = bwlabel(bin);
area = regionprops(bwl,'Area');
max_area = -1;
for i= 1:N
if area(i).Area > max_area
max_area = area(i).Area;
index = i;
end
end
bin=bwareaopen(bin,max_area);
bin=imfill(bin,'holes');
[mid] = hand_forearm_seg(bin);
... |
fileID = fopen('Querylevelnorm.txt');
i = 1;
data = [];
line = fgets(fileID);
while(ischar(line))
line = strsplit(line,' ');
line(2) = [];
line = line(1:end-9);
tempList = [];
tempList = [tempList str2double(line{1})];
for i=2:47
temp = line{i};
temp = strsplit(temp,':');
... |
function Output=main(I)
I=double(I);
[M,N]=size(I(:,:,1));
%% detection (kernel regression method)
% step1: calculate the weight for q
% step2: convariance matrix Cp
% step3: SVD to Cp estimation
% step4: rain map
winS=9;
winL=(winS+1)/2; % from window center to window edge
sigD=3;
sigC=9;
k=0.1;
% RGB to luminance
R... |
% Implement TV denoising of SE(3) elements on a cartesian 2D grid
%
% usage: [u,stats]=al_se3(I,options), where
%
% I - an MxNx9 image
% options - an options structure, with the optional fields:
% 'lambda' (defaults to 15) - the strength of the fidelity term
% 'iter_q_1' (defaults to 2) - the number of inner... |
f_opt= 4.81386755;
ASGARD_fc_l1l_news20scale2= importdata('../IPALM/results/DLRCSGR2_LAD_outer_news20scale2tau_62061',' ');
DLRCSGR_eps_l1l_news20scale2= importdata('../IPALM/results/DLRCSGR3_LAD_outer_news20scale2tau_1',' ');
SMART_CD_l1l_news20scale2= importdata('../IPALM/results/PDCD_LAD_outer_news20scale2tau_1',... |
function [cdf_vals, pdf_vals, unqs] = init_data(x)
%desc:
%normalizes the data, calculates pdf, cdf and unique data points
%input:
%x: n x 1 vector of discrete data where n is size of data
%output:
%cdf_vals: m x 1 vector of cdf values at the i^th point where i is a point
%among the m... |
function Dar = DataLoader(filenames,ActCount,Count,chk)
%Function that searches throught the filenames and returns the data for
%a specific country and activity
datafile = filenames(ActCount).name;
[data,txt,raw] = xlsread(datafile);
if nargin<4 | chk ==0
Dar = data(:,Count);
else
... |
function [in_image, distance] = particle_distance_and_out( in_image, S, centroid, particle_size, c_size )
%This function is used to output the cloud of particles and calculate
%the distance of the most distant particle
for i=1:size(S,2)
%We erase first
in_image(abs(S(1,i)-... |
%% Candy store problem
% Optimize out how much candy I can buy for one dollar
%
% Key matlab concepts
% Structs - how to save data in one "variable"
% Optimization - how to iteratively improve on something
% More practice with functions, program flow
clear
clc
clf
% Read in and setup candy
candy = GetCan... |
clear all
close all
% initialize
rosshutdown % to 'close' any previous sessions
rosinit('192.168.0.102'); % initialize Matlab ROS node
tbot = turtlebot % the data structure that allows access to the turtlebot and its sensors
tbot.ColorImage.TopicName = '/usb_cam/image_raw/compressed'; % set netbook webcam as ... |
function sampled_radii = radii_sampled_exponential(chi,diam,no_of_radii)
%% Author: Leena Chennuru Vankadara
% Theory of Machine learning group,
% Max Plank Institute for Intelligent Systems
mu = diam/8*log(chi);
pd = makedist('Exponential','mu',mu);
truncated_pd = truncate(pd,diam/4,diam/2);
s... |
function [trn_u_X_Xf, trn_i_X_Xf, trn_X_Y, tst_u_X_Xf, tst_i_X_Xf, inc_tst_X_Y, exc_tst_X_Y, Y_Yf, inv_prop] = load_shilpa_dataset(dset, frac)
global EXP_DIR RES_DIR;
[X_Xf, X_Y, Y_Yf] = load_dataset(dset);
split = load_split(dset);
trn_u_X_Xf = X_Xf(:,split==0);
trn_X_Y = X_Y(:,split==0);
tst_u_X_Xf = X_Xf(:,s... |
function y = deg2rad(x)
% Convert degree to radian
%
%
y = x * 2 * pi / 360;
|
function [segIds, vxCount] = findMissedSegIds(param, knownSegIds, box)
% [segIds, vxCount] = findMissedSegIds(param, knownSegIds, box)
% Build a list of all segment IDs contained in the bounding box |box|
% which were missed by |knownSegIds| (e.g., nodes.segId). The segment
% IDs are sorted in ord... |
function pa_createmultiplesounds_tmp
%%
close all hidden
clear all hidden
sndid = [100:199;200:299;300:399];
[ntyp,nrep] = size(sndid);
for ii = 1:ntyp
for jj = 1:nrep
close all
%% Default
Fs = 48828.125; % Freq (Hz)
Nramp = round(5/1000*Fs); % 5 ms
Nlevel = round(20/1000*Fs); % 5 ms
eqfile = 'E:\MA... |
function desmat = frames2ev3(infile,outfile,dummytime,normalize,duration)
% converts output of the 1D noise expt to fsl ev3 format
% use: out = frames2ev3(infile,[outfile],[normalize])
% example: frames2ev3('runA292sec','out.txt',3,1,292)
% infile is saved design data from OneDNoise expt
% outfile is the name of the ou... |
function [] = plotfunc_DCORRvec(X,Y,Xname,Yname,titlestring)
addpath('../utils');
%theta = atan(Y/X);
%magnitude = sqrt(X^2+Y^2);
axis([0 1 0 1]);
axis square;
arrow([0 0],[X Y]);
hold;
grid on;
plot(0:0.1:1,0:0.1:1,'--k');
Xstring = sprintf('C_{%s,%s|%s}',Xname,Xname,Yname);
Ystring = sprintf('C_{%s,%s|%s}',Yn... |
function pc=drifting_v7(gfolder,frmrange,frmlim,averange,fitwidth,filesource,progress_bar_param)
%
% function drifting_v7(gfolder,frmrange,frmlim,averange,fitwidth,filesource)
%
% Will use cross correlations to track the drift of a field of view during
% a GLIMPSE sequence.
%
% gfolder == path to the folder e.g.
% ... |
function y=quantize_gaussian2(x,th)
m=mean(x);
sig=sqrt(var(x));
len=length(x);
y=x.*0;
for i=1:len
if sig~=0
if (x(i)-m)/sig>th
y(i)=1;
elseif (x(i)-m)/sig<-th
y(i)=-1;
else
y(i)=0;
end
else
y(i)=0;
end
... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
%
% problem1 - integrator system
%linear
syms t r
x1=heaviside(r)-heaviside(r-2);
x2=heaviside(r)-heaviside(r-3);
a1=2;
a2=3;
z=a1*x1+a2*x2;
y1=int(z,r,-inf,t);
z1=int(x1,r,-inf,t);
z2=... |
clc ;clf; clear all ; close all;
syms f(x) %Create and evaluate functions. Find the value of f at.
f(x) = x^4-2*x^3+6*x^2-2*x+10
%== operater
syms y1 y2
y1= x+3; y2= 3*x
solve(y1==y2)
% < = = operater
syms x
solve(x^4 == 1)
%
assume(x,'real')
assumeAlso(x > 0)
assumptions(x)
%
syms x xo
subs(x^2+1,x,xo-... |
clear variables
%dirname= 'edata_1cell_b230_dt008_d005_tauV0p7_tauN170_Vstar4_230_smooththeta_ol' % This is a 1-BCL simulation generated from the fixed-point IC
%dirname= 'edata_1cell_b230_dt008_d005_tauV0p7_tauN170_Vstar4_1150_smooththeta_ol'
dirname= 'edata_1cell_b230_dt008_d005_tauV0p7_tauN170_Vstar4_920_smootht... |
function [store_power, f] = analysis__raw_power(signals,varargin)
params = struct(...
'within',{{'regions','trialtypes','outcomes','epochs','administration'}}, ...
'takeMean',true ...
);
params = paraminclude('Params__signal_processing',params);
params = parsestruct(params,varargin);
passed_params = stru... |
%--------------------------------------------------------------------------
% para verificar qual dos algoritmos de integraçao tem melhores resultados
% quad, quadl e quadv
%--------------------------------------------------------------------------
clear all
clc
format long
braco_x=0.25;
braco... |
function [output_distance] = Distance_Transformation_3D(input_image,input_scalex,input_scalez)
output_distance=zeros(size(input_image));
for m=1:size(input_image,3)
output_distance(:,:,m)=bwdist(input_image(:,:,m),'euclidean')*input_scalex;
end
reference=output_distance; % a copy of output_... |
% triangle and square:
C=false(7,7);
C(1,2)=true;
C(1,3)=true;
C(2,3)=true;
C(4,5)=true;
C(4,7)=true;
C(4,5)=true;
C(5,6)=true;
C(6,7)=true;
for c1=1:7-1
for c2=c1+1:7
C(c2,c1)=C(c1,c2);
end
end
[labels rts] = graph_connected_components(C); |
function addlinefunc(src,event,data)
% Callback function for "Add Lines" (eh2_lines_add)
% Resume - Respond to uiwait in while loop
uiresume(data.f)
% Open Dialog Box
S.d = dialog('Position',[200 50 700 400],'Name','Add Lines',...
'WindowStyle','normal');
% Initialize table values
tab_data = {false, 0, ... |
% Script to plot flowrate error
% Copyright 2010 MathWorks, Inc.
diff_data = yout(:,1);
ref_data = yout(:,2);
control_signal_data = yout(:,3);
figure(1)
plot(control_signal_data,diff_data./max(ref_data)*100,'LineWidth',3);
title('Flow Rate Error','FontWeight','Bold','FontSize',16);
ylabel('Flow Rate Error (... |
function conv_filter = convolve_filter_cvip( I,M )
% CONVOLVE_FILTER_CVIP - convolves an image with a user specified convolution mask.
%
% Syntax :
% ------
% conv_filter = convolve_filter_cvip(I,M)
%
% Input parameters Include :
% ------------------------
% 'I' Input Image.
% 'M' Serves as ... |
function [dataSegments] = segmentation(signal,windowSize,overlap)
% Find starting points of each segment with the specified window size and
% overlap
startPoints = [1:windowSize-overlap:length(signal)];
% Remove starting points that are larger than the last window due to
% overlapping
startPoints(startPoints>length(... |
function y = find_max_obj(bw)
end |
function result = f_disprof(Y,dis,iter,verb,plt,verb2)
% - dissimilarity profile analysis (DISPROF, SIMPROF)
%
% USAGE: result = f_disprof(Y,'dis',iter,verb,plt);
%
% Y = matrix of response variables (rows = obs, cols = variables)
% dis = dissimilarity measure to apply to Y
% (e.g., dis = 'bc'; see help for ... |
function dnaseq = protein2dnaOptimized(proteinseq)
filename = 'codons.csv';
aa_codon_table = readtable(filename);
aa_codon_cell = table2array(aa_codon_table(:,1:2));
aa_codon_array = cell2mat(aa_codon_cell);
freq_array = table2array(aa_codon_table(:,3));
dnaseq = '';
for ii = 1:3:length(proteinseq)-2
same_codon = ... |
function plotPath(~,map,displayInGridCoordinates,contrastArray)
%this function plots the current position and path of all
%vehicles on the map
%Input: map is the XML map object,
%displayInGridCoordinates is a boolean: true = display grid, false = display normal plot
... |
function [T_TRCM,g_TRCM,g_Data,Para]=TRCM_Spectral(Para,Data)
%% Description :
%
% TRCM_Spectral convolves, in the spectral domain, an impulse function f and a transfer function g computed by a quasi-3D thermal resistance and capacity model.
% TRCM.
%
% Author : Philippe Pasquier (philippe.pasquier@polymtl.ca)
% TRCM_... |
classdef (Enumeration) TYP_VEHICLE_STATE < Simulink.IntEnumType
enumeration
VS_SLEEPING(0)
VS_TECHNICAL_WAKE_UP(1)
VS_CUT_OFF_PENDING(2)
VS_AUTOACC_LEVEL(3)
VS_NOT_USED_4(4)
VS_IGNITION_LEVEL(5)
VS_STARTING_IN_PROGRESS(6)
VS_ENGINE_RUNNING(7)
VS_AUTOSTAR... |
# Problems-section-1.1
Section 1.1
1.)x=10; y=3
a)u=x+y u=13
b)v=xy v=x*y
c)w=x/y
d)z=sinx z=sin(x)
e)r=8siny r=8*sin(y)
s=5sin(2y) s=5*('sin(2y)')
2.) x=2; y=5
a)(y*x^3)/(x-y)
b)(3*x)/(2*y)
c)(3/2)*(x)*(Y)
d)(x^5)*(x^5-1)
3)x=3; y=4
a) (1-1/x^5)^-1
b) 3*(pi)*(x^2)
c)(3)*(y)/(4*(x)-8)
d)4*(y-5)/(3*(x)-6)
4)a) x=2;... |
function F = obj_find_valve_param_table_area_vs_disp_4way(x,Q_r)
% Objective function to find out the required area vs. spool displacement
% relationship.
% Copyright 2010 MathWorks, Inc.
% x - vector of variable parameters. The vector is compiled of ten area
% values a_1 ... a_10, which are the cross-sectional areas... |
report = latexGenerator;
funcText = report.readFile('myTestFunc.m');
Name = {'M','L','R','r'};
helpInd = find(~cellfun(@isempty, regexp(funcText,'^\s*%')));
endInd = find(diff(helpInd)>1,1);
if ~isempty(endInd), helpInd = helpInd(1:endInd); end
helpText = funcText(helpInd);
defRegExp = '\s*%+\s*(\w+)\s*::\s*([\w]+)... |
function [ bc ]= neuralNet_get_bcSuperSet(refData)
bc = refData.bcSuperSet;
end
|
% File Name: rmVerSeam.m
% Author: Wenbo Zhang | University of Pennsylvania
% Date: Oct/18/2018
function [Ix, E] = rmVerSeam(I, Mx, Tbx)
% Input:
% I is the image. Note that I could be color or grayscale image.
% Mx is the cumulative minimum energy map along vertical direction.
% Tbx is the backtrack table along... |
%Mexfile SetBoundaryConditions, OpenNL, 2008.
%
%SetBoundaryConditions(MatrixID,I) removes all the non-zero
% coefficients of the rows and columns given in I, and sets the
% corresponding elements on the diagonal to 1.
%
% I must be a numeric full vector.
%
%B2=SetBoundaryConditions(MatrixID,I,B) does the same t... |
clear all;
close all;
f = input('What file do you want to apply median filter\n');
a = imread(f);
[m,n] = size(a);
msk = input("What is the size of the mask\n");
b=a;
mm = (msk-1)/2;
for i = 1+mm:m-mm
for j = 1+mm:n-mm
c = b(i-mm:i+mm,j-mm:j+mm);
b(i,j) = median(c(:));
end
end
subplot(1,2,... |
%Skrypt ustawiający ścieżki do katalogów i konfigurujący środowisko.
javaclasspath('java\connectivityClustering.jar');
addpath('zAi');
addpath('zArea');
addpath('zDescInterface');
addpath('zDescriptors');
addpath('zMatching');
addpath('zGenerate');
addpath('zGui');
addpath('zIo');
addpath('zNeighbors');
... |
function value = u_d ( u )
%*****************************************************************************80
%
%% U_D evaluates the Dirichlet boundary conditions.
%
% Discussion:
%
% The user must supply the appropriate routine for a given problem
%
% Parameters:
%
% Input, real U(N,M), contains the M-dimension... |
function [ ] = ej24( )
close all;
N = 4;
M = 5;
imoriginal = imread('starbuck.jpg');
im = rgb2gray(imoriginal);
%sobel
ims=edge(im,'sobel');
%Laplacian of a gaussian
Lapl=fspecial('log');
iml=imfilter(im,Lapl);
%Canny
imc1 = edge(im,'canny',0.2,1);
imc2 = edge(im,'canny',0.2,2);
%Prewitt
imp = edge (im,'prewitt',0.0... |
% CS 5810 -- Programming for data analysis
%
% Assignment 3 | Prof. Alberto Paccanaro
%
%
%
% Insert BELOW your code
% marking ID is : 65138
% 1. calcualte the datset for first k values of eigenvector. 2. get dot
% product of Xmu with the calulated daatset and return
function newdataset = projectData(Xmu, U, k)
n... |
function [x,y,z] = fkSCARA(the1,the2, len1, len2)
% forward kinematix
x = len1*cos(the1) + len2*cos(the2+the1);
y = len1*sin(the1) + len2*sin(the2+the1);
z = 0;
end |
function main_biShrink()
close all;
clc;
clear;
[filename, pathname] = uigetfile( ...
{ '*.bmp','BMP files (*.bmp)'; ...
'*.png','PNG files (*.png)'; ...
'*.jpg','JPG files (*.jpg)'; ...
'*.*', 'All Files (*.*)'}, ...
'Pick cleaned image file');
origfilename = fullfile(pathname, filename);... |
clear;
topN=40;
load('C:/PairsWS/inputData_XLEcomponents');
cls_comp=cl;
stocks_comp=stocks;
load('C:/PairsWS/inputData_XLE');
xle=strmatch('XLE', stocks, 'exact');
cls_xle=cl(:, xle);
trainDataLength=250;
testDataLength=250;
trainData=[length(tday)-testDataLength-trainDataLength+1:length(tday)-testDataLength];... |
function [u,er]=ftcs(t0,tf,nt,a,b,nx,ci,cca,ccb,dif,cada,sol)
% método explícito ec difusion
x=linspace(a,b,nx); x=x'; dx=x(2)-x(1);
t=linspace(t0,tf,nt); t=t'; dt=t(2)-t(1);
r=dt/dx^2*dif;
if r>.5 %para la estabilidad
clc
disp('No se cumple el test de estabilidad')
pause
end
di=1-2*r;
cca=i... |
function p = plotBrowser(varargin)
%PLOTBROWSER: GUI tool (similar to Matlab's plotbrowser)
%intended for quick creation of images for PowerPoint animations.
%
%Syntax:
%
% plotBrowser % opens a plotBrowser for the current figure
% plotBrowser(h) % opens a plotBrowser for figure h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.