clc;
clear;
close all;
x1 = [1 2 3 4];
x2 = [2 1 0 1];
a = 2;
b = 3;
y1 = 2 * x1;
y2 = 2 * x2;
lhs = 2 * (a*x1 + b*x2);
rhs = a*y1 + b*y2;
disp('LHS = ');
disp(lhs);
disp('RHS = ');
disp(rhs);
if isequal(lhs, rhs)
disp('The system is Linear.');
else
disp('The system is Non-Linear.');
end
To embed this project on your website, copy the following code and paste it into your website's HTML: