Skip to content

Instantly share code, notes, and snippets.

clearvars;
close all;
% Add path to stlTools
% You can download the package for free from:
% https://es.mathworks.com/matlabcentral/fileexchange/51200-stltools
addpath('../stlTools');
% Set the name of the mat file containing all the info of the 3D model
MatFileName = 'SAAB_GRIPEN_MULTI_BODY.mat';
% Define the list of parts which will be part of the rigid aircraft body
rigid_body_list = { 'Body.stl', 'AB_Left.stl', 'AB_Right.stl', 'Canopy_Front.stl', 'Canopy_Rear.stl'};
close all;
clearvars;
% Sample time
dt = 0.01;
% Simulation time
t_end = 40;
% Time vector
t = 0:dt:t_end;
% Generate noise for tubulence
noise = 4 * (1-2*rand(size(t)));
close all;
clearvars;
% Sample time
dt = 0.01;
% Simulation time
t_end = 40;
% Time vector
t = 0:dt:t_end;
% Generate noise for tubulence
noise = 4 * (1-2*rand(size(t)));
close all;
% Sample time
dt = 0.01;
% Simulation time
t_end = 40;
% Time vector
t = 0:dt:t_end;
% Actual time-varying frequency vector
w = 3 * 2* pi * ones(size(t));
w(t >= 5 & t < 10) = 5 * 2* pi;
clearvars;
close all;
% Integration step size
DT = 0.01;
% Simulation time
STOP_TIME = 30;
% Time vector [sec]
t = 0:DT:STOP_TIME;
% Plant model
% --------------------
@Ro3code
Ro3code / corename.sh
Created October 6, 2020 13:24
Get name of app that created a corefile.
# Get name of app that created a corefile.
function corename()
{
for file ; do
echo -n $file : ; gdb --core=$file --batch | head -1
done
}
@Ro3code
Ro3code / ii.sh
Last active October 6, 2020 13:52
Get current host related info
# Define colors
BRed='\e[1;31m' # Bold Red
NC="\e[m" # Color Reset
# Get current host related info
function ii()
{
echo -e "\nYou are logged on ${BRed}$HOST"
echo -e "\n${BRed}Additionnal information:$NC " ; uname -a
echo -e "\n${BRed}Users logged on:$NC " ; w -hs |
@Ro3code
Ro3code / my_ip.sh
Created October 6, 2020 13:19
Get IP adress on ethernet.
# Get IP adress on ethernet.
function my_ip()
{
MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' |
sed -e s/addr://)
echo ${MY_IP:-"Not connected"}
}
function ask() # See 'killps' for example of use.
{
echo -n "$@" '[y/n] ' ; read ans
case "$ans" in y*|Y*) return 0 ;;
*) return 1 ;;
esac
}
function my_ps()
{
# Make your directories and files
# access rights sane.
function sanitize()
{
chmod -R u=rwX,g=rX,o= "$@" ;
}