My MATLAB Assignments

Assignment 1: Simulink Model of a Trapezoidal Signal

This assignment includes a Simulink model that generates a trapezoidal signal. The goal was to simulate, time-shift, and scale the signal.

Download Simulink File

MATLAB Code:

% MATLAB code for trapezoidal signal
t = 0:0.01:10;
y = tripuls(t-5, 5);
plot(t, y);
xlabel('Time (s)');
ylabel('Amplitude');
        

Assignment 2: MATLAB Code for Boolean Expressions

This assignment involves generating Boolean expressions based on user inputs.

Download MATLAB Code

% MATLAB code to generate Boolean expression
inputs = [1 0 1 0];
expr = sprintf('%d AND %d', inputs(1), inputs(2));
disp(['Boolean Expression: ' expr]);