clc; clear; close all;
% ==========================================
% بيانات الطالبة: رسل سعد منعم
% ==========================================
name = 'Rusul Saad Monem';
day = 12;
month = 1;
year = 2006;
height = 160; % الطول الافتراضي بالسنتيمتر
% حساب القيمة العددية للاسم
name_value = sum(double(name));
% ==========================================
% البرنامج الأول: Two Plots
% ==========================================
A1 = mod(day + name_value, 5) + 1;
B1 = mod(month + height, 7) + 1;
t1 = 0:0.1:10;
y1_1 = A1 * t1;
y1_2 = B1 * t1.^2;
figure(1)
plot(t1, y1_1, 'r', 'LineWidth', 2)
hold on
plot(t1, y1_2, 'b', 'LineWidth', 2)
grid on
legend('Linear', 'Quadratic')
title(['Two Plots - ', name])
xlabel('Time')
ylabel('Value')
% ==========================================
% البرنامج الثاني: Three Plots
% ==========================================
A2 = mod(day + name_value, 4) + 1;
B2 = mod(month + height, 5) + 1;
C2 = mod(year + name_value, 6) + 1;
t2 = 0:0.1:10;
y2_1 = A2 * t2;
y2_2 = B2 * t2.^2;
y2_3 = C2 * sin(t2);
colors = ['r', 'g', 'b', 'k', 'm'];
c1 = colors(mod(A2, 5) + 1);
c2 = colors(mod(B2, 5) + 1);
c3 = colors(mod(C2, 5) + 1);
figure(2)
plot(t2, y2_1, 'Color', c1, 'LineWidth', 2)
hold on
plot(t2, y2_2, 'Color', c2, 'LineStyle', '--', 'LineWidth', 2)
plot(t2, y2_3, 'Color', c3, 'LineStyle', ':', 'LineWidth', 2)
grid on
legend('y1', 'y2', 'y3')
title(['Three Plots - ', name])
xlabel('Time')
ylabel('Value')
% ==========================================
% البرنامج الثالث: 3D Surface
% ==========================================
A3 = mod(day + name_value, 3) + 1;
B3 = mod(month + height, 4) + 1;
C3 = mod(year + name_value, 5) + 1;
[x, y] = meshgrid(-5:0.5:5);
z = A3*x.^2 + B3*y.^2 + C3*sin(x);
figure(3)
surf(x, y, z)
grid on
shading interp
colormap jet
title(['3D Surface - ', name])
xlabel('X')
ylabel('Y')
zlabel('Z')
% ==========================================
% عرض النتائج في نافذة الأوامر
% ==========================================
disp(['Student Name: ', name])
disp('--- Results ---')
disp(['Prog 1: A=', num2str(A1), ' B=', num2str(B1)])
disp(['Prog 2: A=', num2str(A2), ' B=', num2str(B2), ' C=', num2str(C2)])
disp(['Prog 3: A=', num2str(A3), ' B=', num2str(B3), ' C=', num2str(C3)])
To embed this program on your website, copy the following code and paste it into your website's HTML: