text stringlengths 8 6.12M |
|---|
function DrawRobot(HFigure, XYRobot)
% This function draws a robot field
% Inputs:
% HFigure: A handle to the figure used for drawing
% XYRobot:A 1x2 vector that represents the X, Y coordinates of the
% robot.
% Set the current figure to the given figure
set(0,'CurrentFigure', HFigure);
% Hol... |
function [S] = sprung_mass_segway(Zul, Zuld, Zsl, Zsld, Zur, Zurd, Zsr, Zsrd, Mlatf, Marbf, SIM, hcm)
d = 0;
if (SIM.front_rear == 0)
d = 2;
end
sprung_vel = [(Zsld - Zuld)*hcm.MR(1 + d); (Zsrd - Zurd)*hcm.MR(2 + d)];
sprung_disp = [(Zsl - Zul)*hcm.MR(1 + d); (Zsr - Zur)*hcm.MR... |
function handles = display3D(hObject, handles, dataReduce)
% Display 3D image for plotting
if handles.backgroundOn
% field subtraction
image3d = subtractField(handles.confocalStack(:, :, :, get(handles.FGselect, 'Value')), ...
handles.confocalStack(:, :, :, get(handles.BGselect, 'Value')), handles.ver)... |
%-----------------------------------------------------------------------------------------
%
% quat_ahrs_paper.m
%
% quat_ahrs_paper.m is a simulation of an Attitude Heading Reference
% System (AHRS) mechanized using quaternions. Aiding for the
% AHRS is in the form of periodic attitud... |
%% Affine Transformation
clear; close all; clc;
ct = load('coordinates/centroids_CT.mat');
ct = ct.centroids_CT;
mri = load('coordinates/centroids_MRI.mat');
mri = mri.centroids3;
%Train
ctx = ct(1:2:end,1);
cty = ct(1:2:end,2);
ctz = ct(1:2:end,3);
ctt = [ctx,cty,ctz];
mrix = mri(1:2:end,1);
mriy = mri(1:2:end... |
function Tic_Tac_Toe_UI
global isfirstmove;
isfirstmove = 1;
global winr;
winr =0;
global board;
board=zeros(3)
dbclear in Tic_Tac_Toe_UI % reset breakpoints in this file
figure('color', 'black','MenuBar','none','Name','Make a Move','Position',[200,300,285,300]);
%restart button
uicontrol('Style','pushbutton',...
... |
function [opt,OO] = myoptimopts(opt)
% myoptimoptions Set up Optim Tbx options.
%
% Backend IRIS function.
% No help provided.
% -IRIS Macroeconomic Modeling Toolbox.
% -Copyright (c) 2007-2017 IRIS Solutions Team.
%--------------------------------------------------------------------------
try
solve... |
function mybarplot(Si,Sti)
efast_var_hor={'$\alpha$','$\beta$','$\gamma_1$','$\gamma_2$','$\gamma_3$','$\gamma_4$','$\zeta$','$\kappa$','$\lambda_1$','$\lambda_2$',...
'$\mu$','$\rho$','$\sigma$','$\omega$','$V_0$','dum'};
l = size(Si,1);
x = 1:l;
for j = 1:size(Si,2)
figure
y1 = Si(:,j);
y2... |
classdef TEBase<handle
% TEBase 做为TradeList, EntrustList 的基类,实质上是一维的
% 属于稀疏矩阵一维化后的list
% 都是T*p矩阵,纵向时间,横向属性
% ----------------------------------
% 潘其超,20140618,V1.0
% 潘其超,20140725,V2.0:将eval表达式简化
% 潘其超,20140806,V3.0
% 1. 将vecNames修改为 headers。
% 2. 将extendTEB, addTEB, pruneTEB修改为 extend, add, prune. 相应的
% Trad... |
function clips = GetClips(start_times, stop_times, varargin)
%function clips = GetClips(start_times, stop_times, file, channel)
%function clips = GetClips(start_times, stop_times, data)
%
%e.g.
%Pulses.IPICull.x = GetClips(Pulses.IPICull.w0, Pulses.IPICull.w1, '../data/augusto.daq', 3);
%Sines.LengthCull.clips = GetCli... |
function [output] = get_VOI_spcase(B, all_mods, q, pr_prob, c1, c2, Start_m1)
% TYPE: function
% DATE: 2/06/2015
% AUTHORS: Payal Bal
% DESCRIPTION: Calculates all VOI metrics (EVPI, EVSI for all monitoring
% strategies) for BERINGA CASE STUDY (special case)
% Output is a [length(B) x 19] matrix including:
% ou... |
function [result] = track(tracker, sequence, region, varargin)
% TRACK performs a tracking run on a given sequence with a specified
% tracker. The tracker should be a string <tracker> such that the functions
% tracker_<tracker>_initialize and tracker_<tracker>_update are available
% in the path.
%
% Additional argument... |
function adj = cell2adj (nodes, E)
% converts a partial order model in cell array form to an adjacency matrix suitable for MR
if nargin==1
E={};
end
if ~iscell(E)
E={E};
end
n=numel(nodes);
adj=zeros(n,n);
if ~isempty (E)
for i=1:numel(E)
if ~isempty(E{i})
u = nchoosek(E{i}... |
% marchdecayWithSource.m
% Improved Euler Method with source (rin)
% dy/dt=-a*(y(t+1)-y(t))/2 + rin
% y(0)=b
%
% Author: Mojolagbe Jamiu
%% set parameters
a=1;
b=9; %initial height of the tank
rin=5;
Nt=300;
Tf=10; % final time
%% initialize
t=linspace(0, Tf, Nt);
deltat=t(2)-t(1);
y=... |
function [ output_args ] = demo( input_args )
%DEMO Summary of this function goes here
% Detailed explanation goes here
disp('²Î¼û PositionArray.demo');
end
|
function data = getCSIFeatures(path, speakerIdx, flag)
data = [];
receiver = [];
if flag == 1 % get train data
receiver = [1,2,3,4,5];
else % get test data
receiver = 6;
end
for gestureIdx = 1:5
for i = 1:length(receiver)
filePath = strcat(path, '\user', num2str(speakerIdx), '-6-5-5-', num... |
function main
task1;
%task2;
|
function Xt = RuidoRosa(T)
% ...
% Xt = RuidoRosa :: La funcion crea la generacion de un ruido rosa a traves de una serie de
% valores:
% Fs [Hz] -- Frecuencia de muestreo
% Nx -- Cantidad de muestras
% A y B coeficientes del filtro
% Funcion con argumento de entrada:
% T[... |
%Linmodel9 - script descibing and testing a linear model of spectral integration in ILDAlone RS
clear;
Model = 'Linmodel9_{LR}';
%set parameters
bird_number = 899;
begin_cells = 1;
end_cells = 24;
pca_weights = 0;
temporal_flag = 1;
%Graphics parameters
cmap = jet;
linecolor = 'white';
bkgndcolor = [0.8... |
function LRi = LR( i )
% Find LR image
LRi = -2*mod(i, 2)+1;
end |
function [coords2] = project_coords(coords)
%PROJECT_COORDS Project coords to the plane by SVD
coords = coords';
n = size(coords,1);
c = mean(coords);
for j=1:n
coords(j,:) = coords(j,:) - c;
end
s = svd(coords);
[U,S,V] = svd(coords);
S(3,3) = 0;
coords2 = (U*S);
coords2 = coords2(:,1:2);
coords2 = co... |
function [] = write_gif( im_stack,filename )
for i = 1:size(im_stack,4)
im = im_stack(:,:,:,i);
[A,map] = rgb2ind(im,256);
if i == 1;
imwrite(A,map,filename,'gif','LoopCount',Inf,'DelayTime',0.1);
else
imwrite(A,map,filename,'gif','WriteMode','append','DelayTime',0.1);
end
end
end
|
clear all; close all;
% Radar settings for data set "one_ped_walking"
path_get_frame = 'Radar_frame_samples/three_ped_walking_in_circle/';
% Radar Frame Structure Details for Radar Cube
nFrames = 300;
nADCsamples = 128;
nTx = 2;
nRx = 4;
nVirtualAntenna = nTx*nRx;
nChirps = 128;
nChirpsAllantenna = nChirps*nTx;
% Da... |
function damped_oscillator(u0,ut0,damp)
numberOfPDE = 1;
model = createpde(numberOfPDE);
geometryFromEdges(model,@squareg);
%pdegplot(model, 'EdgeLabels', 'on');
a = 0;
f = 0;
beta = 200.*eye(725);
c = 1;
d = @(region,state)dcoeffunction(region,state);
cCoef = 1;% c^2./sqrt(1+state.ux.^2 + state.uy.^2);
specifyCoeff... |
function Sub_State = Creat_Sub_State(States,Visible_TF_Effect_Index,Data_Type,index,state_num)
switch Data_Type
case 'D'
Sub_State = States(index,Visible_TF_Effect_Index.D(state_num).Output_index);
case 'DO'
Sub_State = States(index,Visible_TF_Effect_Index.DO(state_num).Outp... |
% ECE408 - Wireless Communications
% Jongoh (Andy) Jeong
% Project: MIMO, OFDM, OFDM-MIMO
% Date: April 29, 2020
clear all; close all; clc;
warning ('off','all');
% Reference:
% Stuber et al. $Broadband\;OFDM-MIMO\;Wireless\;Communications$
%% Part 1: MIMO
% model a 2x2 MIMO link with flat fading gains ... |
%% This file reads the coincidence data and extracts the visibilities and stores both sets in a a .matfile
%% The data is stored as an array -> row == V_n (n=1,3,...2nmax-1)
%% The files are names as nSPP_n_#n_frac_0.5_int_#m. Here #n is n=1,3,5.... while #m is the interger part of #n/2
FolderDir='20200824';%pare... |
classdef BookHedger < BookMonitor
% BookHedger 首先是一个Monitor
% 在Monitor的基础上,有柜台,有Hedge的规则.
% hedgers 是HedgerAssetElement的序列,每个element包含hedge标的和hedge规则。
properties
counter_ = [];
quoteS_;
vol_surf_;
r_ = 0.05;
hedgers_@HedgeAssetElementArray; %考虑是否将正向和反向的Hedger分开。
... |
function [ sigma ] = Nye2Tensor( s )
%Nye2Tensor converts a stress vector in Nye notation to tensor notation
%Input:
% <s> stress vector in Nye notation [sx,sy,sz,(sxy,sxz,syz)]
%Output:
% <sigma> stress tensor [sx,sxy,sxz;sxy,sy,syz;sxz,syz,sz]
%CL
sigma = [s(1),s(4),s(5);
s(4),s(2),s(6);... |
function varargout = plot_pattern_diagram_markers(X,Y,option)
%PLOT_PATTERN_DIAGRAM_MARKERS Plots color markers on a pattern diagram.
%
% [HP, HT] = PLOT_PATTERN_DIAGRAM_MARKERS(X,Y,OPTION)
% Plots color markers on a target diagram according their (X,Y)
% locations. The symbols and colors are chosen automaticall... |
function [PRC1,PRC2,prc_T1,prc_T2]= getprc(t)
dt = 1e-6;
step = 15;
I = zeros(size(t));
V = hh(t,I,20);
refindex=find(findspike(V));
prc_N = refindex(end-1)-refindex(end-2);
prc_T1 = prc_N*dt;
PRC1 = zeros(1,prc_N);
for i=1:step:prc_N
I = zeros(size(t));
I(i+prc_N) = 2500;
V = hh(t,I,20);
shiftindex=fin... |
%%%%%%%%This code solves voriticity-streamfunction formulation %%%%%%%%%%%%%%%%%
%of the 2D Navier Stokes equation in a box by implementing a pseudo spectral algorithm%%%%%%
%%%%%%%%with RK3-IMEX scheme in time integration : implicit for linear%%%%%%
%%%%%%%%%%%%%and explicit for non-linear terms%%%%%%%%%%%%%%%%%%%%%%%... |
%
% 2520 is the smallest number that can be divided by each of the numbers
% from 1 to 10 without any remainder.
%
% What is the smallest positive number that is evenly divisible by all of
% the numbers from 1 to 20?
% Ans: 232792560
maxFactor = 20;
% The number we seek needs to divide all the primes less than or... |
%{
# my newest table
# add primary key here
-----
# add additional attributes
%}
classdef WaterAdministration < dj.Manual
end |
addpath(genpath('\Users\addri\Documents\MATLAB\bsmart\'))
%%
|
function [ cbr_case ] = retrieve( cbr, new_case )
%inserts case to cluster and updates similarities
%set threshold
t = 0.9;
%set k
k = 5;
topK = [];
top_size = cbr.initial_tier_size;
%start at the top tier
level = 0;
%similarity function
sim = @(c) (compute_si... |
function data=read_data(varargin)
% Data input function for ELRIS
% Last revision 21.06.2014
% Able to read general array format
global pathname
if nargin==0
if isempty(pathname)
pathname=pwd;
end
[filename, pathname] =uigetfile({'*.dat','Data Files';...
'*.*','All Files' },'... |
for i = 1:50
for j = 4:9
if j == 4
alloc_info(i,j) = left_road(alloc_info(i,j-3),1);
elseif j== 5
alloc_info(i,j) = stright_road(alloc_info(i,j-3),1);
elseif j == 6
alloc_info(i,j) = right_road(alloc_info(i,j-3),1);
elseif j == 7
alloc_... |
% Filtro de média
clear all
close all
clc
I = imread('characters_test_pattern.tif');
imshow(I)
H = fspecial('average',11)
If = imfilter(I,H);
figure
imshow(If) |
%% gen pure tone stim with ITD
fs = 195312.50;
dur = 200*1e-3; % 200ms sound
nSamp = round(fs*dur);
MAX = 0.8; % constrain each wave to be within [-0.8,0.8] to allow some modulation of amplitude, either increase or decrease of amplitude
% load following calibration data from 03012016
% amplitude difference betwee... |
close all;
clear all;
deltat = 0.05;
phaseangle = pi/2;
q1_cycle = -pi/2;
q1_init = 0;
q2_init = 0;
q0_init = 20*pi/180;%45*pi/180;
q0_end = 75*pi/180;
precision = .07; %how close to an integer number of periods is acceptable (unitless)
k_test = linspace(.5,10,400);%linspace(0,pi/3,50);
w_test = 1;%linspace(1... |
function [L] = lscale(X)
%L-Scale calculations
% L-scale is a calculation based on l-moments (second l-moment). Useful
% because it is less effected by outliers then other data features. In
% this code data can be a two dimensional matrix where each row is the
% data of each trial.
[rows, col] = size(X... |
function [ghead, gdata] = readl2std(fn, iQA);
% function [ghead, gdata] = readl2std(fn, iQA);
% OBSOLETE; use "readl2std_qa.m" & "readl2std_list.m" instead.
%
% Reads an AIRS level 2 Standard retrieval granule file and returns
% an RTP-like structure of retrieved profiles.
%
% Input:
% fn = (string) Name of an AIRS... |
function [ output_args ] = payoff_gddt2( input_args )
%PAYOFF_GDDT2 ¹â´ó¶¦Ì©2ºÅ
% Detailed explanation goes here
end
|
function airs_l1bcm_download(sdate, edate, asldataairs)
% function airs_l1bcm_download(sdate, edate, asldataairs)
%
% Downloads AIRS L1bCM data tha fits in the requested date range.
%
% sdate, edate - start/end dates (matlab format)
% asldataairs = '/asl/data/airs/' (data location)
%
% This routine also produ... |
%calculate forward kinematics
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ pr1,pr2 , pr3,P1,P2,P3,ACTUALX,ACTUALY,ACTUALZ,TIP ] = Forkin(returnPacket,L1,L2,L3 )
pr1 = TictoRadian(returnPacket(1));
pr2 = TictoRadian(returnPacket(4));
pr3 = TictoRadian(returnPacket(7)... |
function map = colormap_custom(varargin)
%% defaults
grad1 = 0;
gradmax = 0.3;
step = 40;
maxcolor = [1 1 1]; % white
color_reference = {'y',[1 1 0];'m',[1 0 1];'c',[0 1 1];'r',[1 0 0];'g',[0 1 0];'b',[0 0 1];'w',[1 1 1];'k',[0 0 0]};
color = 'r';
vararginProcessor
%% calculate variables
colorselect = color_reference{... |
classdef SystemUtils
properties(Static=true)
HOME_DIR = '/u/vvasuki/';
LIBRARIES_PATH = '/public/linux/graft/';
LIBRARIES_PATH_MATLAB = '/public/linux/graft/matlabToolboxes';
JAVA_LIB_PATH = [system.SystemUtils.HOME_DIR 'vishvas/work/software/javaPackage/'];
end
methods(Static=true)
function enableMult... |
function rmdir2(dir, varargin)
% A version of rmdir that raises errors on failure
[ok,msg] = rmdir(dir, varargin{:});
if ~ok
error('rmdir of "%s" failed: %s', dir, msg);
end
end |
function xtickfontsize(sz)
xrule = get(gca,'XAxis');
xrule.FontSize = sz;
return
end |
% Base class for uncertainties associated with initial pose error
%
% Author : Jonathan EDEN
% Created : 2017
% Description :
% Base class for uncertainties on the initial pose
classdef (Abstract) InitialPoseUncertaintyBase < PreUpdateUncertaintyBase
properties
fk_solver ... |
function raicar_generateIndex (totalComp, indexNm, compPerPage)
if ~isa (totalComp, 'numeric') || mod (totalComp, 1) ~= 0
error ('generateIndex: the first input, totalComp, is not integer');
end
if exist (strcat (indexNm, '1.html'), 'file')
error ('generateIndex: the target file exist!');
end
[~, fil... |
function sm = makestructarray(varargin)
%MAKESTRUCTARRAY Merges similar (but not identical) structures into an array
% sm = makestructarray(a,b,c,...)
% Merges a,b,c, etc. into a structure array, with sm(1) being a, sm(2) being b,
% and so forth. It assumes field names mostly overlap.
%
% Option 'skipempty' defi... |
% Example 3.4
clf reset
figure(gcf)
setfsize(300,300)
echo on
%NEWP — 建立一个感知器
%INIT — 初始化感知器神经元
%SIM — 对感知器神经网络进行仿真
%TRAIN — 训练感知器神经网络
pause % 键入任意键继续
clc
P = [-0.5 -0.5 +0.3 -0.1 -80;
-0.5 +0.5 -0.5 +1.0 100];
T = [1 1 0 0 1];
pause %敲任意键继续
clc
plotpv(P,T);
pause
clc
net=newp([-100 1;-1 100],1);
net.iw{1,1} = [-0... |
function end_y_grad = end_y_grad(in1)
%END_Y_GRAD
% END_Y_GRAD = END_Y_GRAD(IN1)
% This function was generated by the Symbolic Math Toolbox version 8.5.
% 24-Apr-2020 12:32:12
q1 = in1(:,1);
q2 = in1(:,2);
q3 = in1(:,3);
q4 = in1(:,4);
q5 = in1(:,5);
t2 = q1+q2;
t3 = cos(t2);
t4 = q3+q4+t2;
t5... |
% only good for 3 size chord
% i would use a for loop and eval() for dynamic sizing
function out = getChordname(chords,itr,index)
switch index
case 1
out = chords(itr,index).p1{1};
case 2
out = chords(itr,index).p2{1};
case 3
out = chords(itr,index).p3{1}... |
%% Clear all
clc;
clear all;
%% Initialize values
% Samplefrequency
Ts = 0.1;
% Onewheel
M = 750*10^(-3); %[kg]
L = 72*10^(-3); %[m]
Iyy_g = 2049081*10^(-9); %[kg*m^2]
Ixx_g = 810407*10^(-9); %[kg*m^2]
m_w = 54*10^(-3); %[kg]
R_w = 0.04; %[m]
I_w = (1/2)*m_w*(0.02^2+0.04^2); %[kg*m^2]
% Motor
R = 38; %[Ohm]
K_phi ... |
function [ hFig ] = plot_absrela_smitermsurf_oripoint(obj, abs_rela, smitermsurf, oripoint, hFig, varargin)
%Import
% 绝对|相对|绝对相对 smiles|terms|surf 有原始点|无原始点
% abs_rela: absolute relative
% smitermsurf: smiles terms surf
% oripoint: origi原始点 fit拟合点 origifit原始拟合点
% hFig 作图的figure句柄的输入
%DEMO
% qms_.put_surf_.plot_absrela_... |
function [edge_list, nedges] = vid2adj_edges_buffer(vid,v2hv,sibhvs,edge_list)
[edge_list, nedges] = vid2adj_edges(vid,v2hv,sibhvs,edge_list); |
Pyy = Y.*conj(Y)/251;
f = 1000/251*(0:127);
plot(f,Pyy(1:128))
title('Power spectral density')
xlabel('Frequency (Hz)') |
% Vinay Ramakrishnaiah
% all sub-urban area
% n = 36 antennas
% Threshold = -85 dBW
% distance = 1 km
clear
close all
%% Plot the percentage of angles above a certain threashold
Pt = [0,1,2,3,4,5,6,7,8,9,10,11];
PT = [0,0.7391,1.4783,2.2174,2.9565,3.6956,4.4348,5.1739,5.9130,6.6521,7.3913,8.1304,8.8695,9.6087,10.345... |
%% Case description
%- Flow data type: Synthetic Vortex cellular flow
%- Noise dist type: Homogeneous Gaussian white noise with 0.01*Vmax standard deviation(STD)
%- Outlier Ratio: 0-60% Scattered outlier + 0 cluster + 0 missing data
%
%To assess the performance of the method respecting to scatter outliers p... |
classdef (ConstructOnLoad=false) plotcodfreeobj < handle
% This file defines the plotcodfreeobj class to construct plotting options and then generate plots
% via the use of specific member functions thereof. This allows seperating the plotting from the
% control synthesis. Due to the nature of how the plots are to be... |
% answers for matlab problem 2
%% load image
close all;
utk = imread('figures/Fig4.41(a).jpg');
t = imread('figures/Fig4.41(b).jpg');
% plot padded utk and t
utkpad = padarray(utk, size(t),'post');
tpad = padarray(t, size(utk),'post');
%% freq domain correlation
close all;
figure('Name', 'Frequency domain filte... |
function [mask, maxpt] = fourierMaskTempMatch(im, temp)
% Padding temp with zeros
temp1 = zeros([size(im,1),size(im,2)]);
temp1(1:size(temp,1),1:size(temp,2)) = temp(:,:,1);
% temp1 = imdilate(temp1,strel('disk',3));
S1 = fftshift(fft2(im(:,:,1)));
S2 = fftshift(fft2(temp1));
co... |
function ntss
% NTSS - Creates a New Today Script Section inside of the current today script.
% This function creates a new section inside of today's working script that is titled with the time of creation. It
% also automatically initializes some commonly used variables at the top of the section for convenience.
%... |
global map enabled_ddl
map = get_memmapfile();
enabled_ddl = [1 1 0 0 0 0];
init_commfile();
motorID = uint8(2);
fileID = fopen('../TMCMBinaryFiles/hamza4.bin');
DATA = fread(fileID);
Datagrams = uint8(zeros(size(DATA,1)/8+3,9));
% Enter download Mode
Datagrams(1,1) = motorID+1;
Datagrams(1,2) = 132;
Datagrams(1,9) =... |
function [M,K,f,g]=build_pwld_local_matrices(poly,vert)
% vertices are entered anti-clockwise
% poly=[1 2 3]
% vert=[0 0; 1 0; 0 1]
global verbose
% centroid
C=mean(vert);
% alpha coef
nv=length(poly);
alpha=1/nv;
% mass and stiffness matrices for the entire polygon
M=zeros(nv,nv); % mass mat
K=zeros(nv,nv); % s... |
function [out cost_flag] = distance(in)
% Distance criterion for estimation
global pdfdata adjtype %#ok<NUSED>
lbar = in(1);
alpha = in(2);
ksi = in(3);
rho = in(4);
stdMC = in(5);
version = 3;
gridSpread = 0.1; % extra spread for price grid as a share of (... |
clear all; close all;
populationSize = 50;
numberOfHiddenNeurons = 7;
numberOfGenerations = 5000;
tournamentSelectionProbability = 0.8;
tournamentSize = 5;
crossoverProbability = 0.7;
numberOfElitismCopies = 0;
startVariableRange = 5;
fullVariableRange = 10;
mutationProbability = 0.03;
population = InitializePopulat... |
function N=GetContourNormals2D(P)
% This function calculates the normals, of the contour points
% using the neighbouring points of each contour point
%
% N=GetContourNormals2D(P)
%
% inputs,
% P : List with contour coordinates M x 2
%
% outputs,
% N : List with contour normals M x 2
%
% Function is writt... |
function exemplo_de_funcao(path_imagem_original, graus)
%{
* Este script rotaciona uma imagem RBG.
Input
:path_imagem_original: string - caminho para a imagem a ser rotacionada
:graus: int - grau de rotação
%}
% dados
fprintf('Imagem: %s\n', path_imagem_original);
fprintf('Graus: %d\n', graus);
... |
clear
clc
format compact
%% Some Helpful Functions
Rxd = @ (theta) [1 0 0 ; 0 cosd(theta) -sind(theta); 0 sind(theta) cosd(theta)];
Ryd = @ (theta) [cosd(theta) 0 sind(theta); 0 1 0 ; -sind(theta) 0 cosd(theta)];
Rzd = @ (theta) [cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0; 0 0 1];
Rx = @ (theta) [1 0 0 ; 0 c... |
function [x_new,y_new] = mapxy(x,y)
%MAPXY maps x_n,y_n -> x_n+1,y_n+1 according to map defined here https://www.ifm.liu.se/courses/tfya36/kaos18inl4.pdf
% The map uses global variables alpha and b because im lazy
global alpha;
global b;
y_new = mod(3*x+2*y.^alpha,1);
x_new = mod(y_new -b*(x+y),1);
end
|
params = struct();
params.g = 9.81;
params.mr = 0.25;
params.ir = 0.0001;
params.d = 0.1;
params.r = 0.02;
% 1. Learn how to use the symbolic toolbox in MATLAB
% you will need the state variables, and control input to be declared as symbolic
syms th phi dth dphi u
X = [th phi dth dphi];
% 2. call your... |
%
% controllaPosizione
% Data una posizione x,y
% esso ritorna la posizione dall'"altro lato"
%
% Input
% x,y : posizione
% n : grandezza matrice
%
% Output
% xp,yp : nuova posizione
%
function [ xp , yp ] = controllaPosizione(x,y,n)
xp = x;
yp = y;
if x < 1
xp = x + n;
yp = y + (4 - mod((n + ... |
%% make_positionFunctions
% ~15Deg/s RIGHTWARD Motion either Grating or bar:
PANELS_FRAME_RATE = 200; %Hz
POSITION_FUNCTION_LENGTH = 10000; % this how many frames long these normally are... set by panels
numOfPanelsAcross = 12;%
numOfPanelsVertically = 2;%
LEDdotsPerPanel = 8; % this shouldn't change! LEDs are alwa... |
% Parameters
params.numeDirector = './m_covers_0000/';
params.tipImagine = 'jpg';
params.imagineQuery = 'query8.jpg';
params.directorQuery = './test_set/';
params.numarMaximImagini = 10000;
params.numeFisierDB = 'scores_m';
params.numeFisierText = 'scores_m_matlab.txt';
params.topQuery = 5;
% Setup MatConvNet.
run vl_... |
% ***** QUESTION 3-1 Linear SVM ***********************
function main(path)
path = strcat(path,'\HW2data.mat')
load(path)
% Shuffling indices of P and B in the first dimension
randP = Ps(randperm(size(Ps,1)),:);
randB = Bs(randperm(size(Bs,1)),:);
trainSizeP = floor(size(Ps,1)*0.7);
trainSizeB = floor(size(Bs,1)*0.... |
if ~size(whos('args'),1)
construct_tract;
args.final_theta = final_theta;
args.shape = shape;
make_tract_normalised(args);
end
set_info('progress-bar-state',false);
args.shape = shape;
args.final_theta = final_theta;
alpha = .25;
beta = .2;
% full range 25:68
for midi_note = 25:68
midi_note
target_freq = m... |
function [ x_hat,sup,success,grs ] = Struct_OMP_test(A,y,BB,c,s,n,ng,ng_perm)
BB_backup = BB;
F = []; % Will store the current block
x_hat = zeros(n,1); % Recovered signal
comp = 0; % Current total complexity
sup = []; % Support
BB2 = BB; % Temporary block set
corr = []; % ... |
function [ F ] = EightPointAlgorithm( points1, points2)
% getting Essential matrix by 8 pont algorithm
points1=points1(1:8,:);
points2=points2(1:8,:);
[normPoints1,T1] = Normalization( points1);
[normPoints2,T2] = Normalization( points2);
X1= normPoints1(:,1);
Y1= normPoints1(:,2);
X2= normPoints2(:,1);
Y2= no... |
Tmax = 120;
I = LMO.inertia;
P = 2*max(diag(I))/Tmax;
K = P^2/min(diag(I));
%%
damping_ratios = zeta(P,K,I);
time_constants = tau(P,I);
%%
controller = Controller(K, P, LMO, @(craft,t) 's');
data = int.Integrate(LMO.X0(), controller, 500);
%%
data.plot("sigma")
X15 = data.Xt(15);
sigma15 = X15(1:3);
X100 = data.Xt(1... |
function res = bit_not(mask)
N = length(RBES_get_parameter('instrument_list'));
a = de2bi(mask,N);
c = ~a;
res = bi2de(c);
end |
%{
REDUCED EULER YONTEMI
y(n+1)=y(n)+h*(df(n)+df(n+1))/2
%}
%{
Ex1: y'=x-y, x0=1,y0=2
df = x-y
Ex2: y'=e^(3x)-y, x0=1,y0=2
df = exp(3*x(i-1))+3*y(i-1);
%}
close all ; clear all ; clc ;
x = [1];
y = [2];
h = 0.2;
for i=2:10
x(i)=x(i-1)+h;
%df = x(i-1)-y(i-1);% ex1
df = exp(3*x(... |
function x = projectSphere(X)
x = zeros(size(X));
for i = 1:size(x,1)
x(i,:) = X(i,:)/norm(X(i,:));
end |
function [inputMatrix, coords] = cropMatrix(inputMatrix,varargin)
% Crops a matrix either by removing rows or adding NaNs to where data was previously.
% Biafra Ahanonu
% 2014.01.23 [16:06:01]
% inputs
% inputMatrix - a [m n p] matrix of any class type
% outputs
% inputMatrix - cropped or NaN'd matrix, same na... |
% These MATLAB programs implement the Spatially Directional Predictive Coding
% for Block-based Compressive Sensing as described in paper:
%
% J. Zhang, D. Zhao, F. Jiang, "Spatially Directional Predictive Coding for
% Block-based Compressive Sensing of Natural Images" in IEEE International on
% I... |
function cohort = load_lungradiomics(rootdir, varargin)
% Parse the NSCLC-Radiomics data files for subsequent loading.
% Source: http://doi.org/10.7937/K9/TCIA.2015.L4FRET6Z
%
% Returns an array of patient structs, each with 3 fields: patientID, image
% (path to CT dicom folder), roi (path to single roi dicom fil... |
clear all
%% Calculates the spatial location overlap of variants within states, between states, and across subjects
%
% This script loads uniqueID maps for split-halves of rest and task data
% and calculates the spatial location overlap for variants within states
% (rest vs. rest and task vs. task), between states (r... |
classdef tinySensorDataHandle < imuDataHandle
methods
function obj = tinySensorDataHandle(varargin)
obj = obj@imuDataHandle(varargin{1},varargin{2},varargin{3});
end
end
methods (Access=protected)
function obj = loadHeader(obj)
xDoc =... |
function [samplepoints]=generate_poisson_2d(sz,min_dist,newpointscount)
cellsize=min_dist/sqrt(2);
grid=cell(ceil(sz(1)/cellsize),ceil(sz(2)/cellsize));
proclist=[];
samplepoints=[];
firstpoint=ceil(sz.*rand(1,2));
proclist=[proclist; firstpoint];
samplepoints=[samplepoints; firstpoint];
gridpoint=i... |
%% Robotics project
% This project is based on a 3 degree of freedom planar robot.
clear;
clc;
% Defining the robot link & setting link lenghts.
L1 = Link('revolute', 'd', 0, 'a', 9, 'alpha', 0);
L2 = Link('revolute', 'd', 0, 'a', 6, 'alpha', 0);
L3 = Link('revolute', 'd', 0, 'a', 1.5, 'alpha', 0);
% Robot... |
function printSolu(thisSolution)
%printSolu 输出解 包含每条路径信息和总路径信息
% 输入
% thisSolution 打印完整的解(在Vehicle.Cost_***中)
nVeh = length(thisSolution.instance.Vehicle.Capacity);
wff = thisSolution.instance.Veh_Cus.wff;
if ~isCompletedWff(wff), warning('警告: 解不完整'); end
usedVehIdx = find(sum(wff,2)>0);
r = {}; %每条路... |
% Framework, notation and equations are from the book
% Ultrashort Laser Pulse Phenomena by Diels and Rudolph
clear;
lambda0=0.795; % reference wavelength in [micron]
% apex_dist=800; % OO' distance in [mm]
travel_dist_vec=100:20:1000; % BB' distance in [mm]
N=length(travel_dist_vec);
% apex_angle=56.3504; % a... |
function remdemo(f);
% 300 <= f < 15000
% f = 300 => n = 344;
% f = 15000 => n = 15;
Fs = 44100;
selected_frq= f;
%df=df_erb(f)
df = df_zwick(f)
% 3 dB corner frequency x=1.6746 passband
mp = 1;
rp = 0.5;
fp = 1.6746/4*df
% 50 dB corner frequency x=1.6746 stopband
ms = 0;
rs = 50;
... |
function pred = znormPredictionError(T,m_idx)
if nargin < 2
m_idx = 1:length(T.F);
end
i = 1;
Exd = cov(T.D.X_dot',1);
for m = m_idx
X_dot_pred = evaluateModel(T.F{m},T.D,T.idx{m});
err = T.D.X_dot-X_dot_pred;
dist{m} = sqrt(sum(err.* (Exd^-1 * err),1));
i = i+1;
end
%pred.Exd... |
% sample calculation of a level network ajustment
% vectorized version
% (c) Zoltan Siki 2019 siki.zoltan at epito.bme.hu
% point numbers are the ordinal number for simplicity
% 1 o------o 2
% |\ /|
% | \ / |
% | \/ |
% | /\ |
% | / \ |
% |/ \|
% 4 o------o 3
% a priori standard deviation of uni... |
function [v,Dn,c]=AscentVelocityApproximation(VolumeIn,delta_gamma,mu,nu,eta)
c=((9*VolumeIn*mu)/(16*delta_gamma*(1-nu)))^(1/4);
Dn=VolumeIn/(pi*c^2);
v=((Dn^2)/(12*eta))*delta_gamma;
end
|
function [gc, dt] = get_position(Zs, Zu, Zr, loc, Zs0)
gc = -Zs + Zs0(loc) - Zr;
dt = Zs - Zu;
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.