This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clearvars; | |
close all; | |
% Integration step size | |
DT = 0.01; | |
% Simulation time | |
STOP_TIME = 30; | |
% Time vector [sec] | |
t = 0:DT:STOP_TIME; | |
% Plant model | |
% -------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get name of app that created a corefile. | |
function corename() | |
{ | |
for file ; do | |
echo -n $file : ; gdb --core=$file --batch | head -1 | |
done | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make your directories and files | |
# access rights sane. | |
function sanitize() | |
{ | |
chmod -R u=rwX,g=rX,o= "$@" ; | |
} |
NewerOlder