diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/Lec9_Ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/Lec9_Ex1.m new file mode 100644 index 0000000..752003f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/Lec9_Ex1.m @@ -0,0 +1,20 @@ +% Write a code for computing energy and power of x(t) = exp(-t)*unit_step(t) +% and decide whether x(t) is energy/power signal or not. + +clear all; close all; clc; +% syms t T +% % x = exp(-t).*unit_step(t); +% x = exp(-t).*heaviside(t); +% E = int(abs(x).^2,-inf,inf) +% P = limit((1/T)*int(abs(x)^2,0,T),T,inf) +fprinf(''); + +% Write a code for computing energy and power of x(t) = 0.25^n.*unit_step(t) +% and decide whether x(t) is energy/power signal or not. + +clear all; close all; clc; +syms n T +x = 0.25^n.*heaviside(n); +E =double( int(abs(x).^2,-inf,inf)) +P = limit((1/T)*int(abs(x)^2,0,T),T,inf) +fprinf(''); \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/Lec9_Ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/Lec9_Ex2.m new file mode 100644 index 0000000..e99d73e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/Lec9_Ex2.m @@ -0,0 +1,16 @@ +% Generate and plot the pdf of uniform variables +clear all; close all; clc; + +% Generate 10^6 datas with uniform distribution from 0 to 1 +x = 2*rand(1,10^6)-1; +% x = (b-a)*rand(1,L) + a; % Generate L uniform distributed variables from the range [a, b]; +% Use histogram to get the plot of distribution +nbins = 100; +histogram(x,nbins) +[h, x_axis_vec] = hist(x,nbins); +area = trapz(x_axis_vec,h); +% 2/nbins*sum(h) +pdf = h/area; +figure +bar(x_axis_vec,pdf) +ylim([0 0.6]); xlim([-1.2,1.2]) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/ramp.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/ramp.m new file mode 100644 index 0000000..bb850f5 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/ramp.m @@ -0,0 +1,6 @@ +% This sub-function code is to represent the ramp function +% ramp(t) is t if t >=0 and, otherwise, is 0. +function result = ramp(t) + result = t.*(t>=0); +% result = t.*unit_step(t); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/rect.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/rect.m new file mode 100644 index 0000000..557a2d5 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/rect.m @@ -0,0 +1,5 @@ +% This sub-function code is to represent the rectangular function +% rect(t) is 1/T if -T/2 <= t <= T/2 and, otherwise, is 0. +function result = rect(t,T) + result = 1/T*((t>=-T/2)&(t <= T/2)); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/unit_step.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/unit_step.m new file mode 100644 index 0000000..8f11601 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture10_Example Codes/unit_step.m @@ -0,0 +1,5 @@ +% This sub-function code is to represent the unit-step function +% u(t) is 1 if t >=0 and, otherwise, is 0. +function result = unit_step(t) + result = 1.*(t>=0); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex1.m new file mode 100644 index 0000000..6952385 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex1.m @@ -0,0 +1,8 @@ +% This code is to compute 1+2+...+n +clc; clear all; close all; +n = 5; +x = 0; +for i = 1:n + i + x = x+i; +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex2.m new file mode 100644 index 0000000..a0ce6b6 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex2.m @@ -0,0 +1,7 @@ +% Input the value and display the value +clc; clear all; close all; + +x = input('Enter the value of x = '); +disp('The value of x is: '); +disp(x); + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex3.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex3.m new file mode 100644 index 0000000..126d294 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture1_Example_Code/Ex3.m @@ -0,0 +1,20 @@ +% Array and Matrices +clc; clear all; close all; + +% Dealing with complex vector +z = [i; 1+2i; 1-i] +z' % transpose with conjugate for complex numbers +z.' % transpose without conjugate for complex numbers +conj(z) % not transpose but conjugate for complex numbers + +% Take or replace elements from matrices +x = zeros(2,3) +x = ones(2,3) + +x = 1:2:20 +x(1:2:length(x)) +fliplr(x) +x([1, 5]) + + + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex1.m new file mode 100644 index 0000000..43815cc --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex1.m @@ -0,0 +1,4 @@ +clc; clear all; close all; + +x = -4:4; +[r, m] = func_ex_1(x) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex2.m new file mode 100644 index 0000000..b5fb0b5 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex2.m @@ -0,0 +1,19 @@ +% Test the convergence +clc; clear all; close all; +% Code the RHS +N_vec = 1:15; f_N_vec = zeros(1,length(N_vec)); +for ind = 1:length(N_vec) + N = N_vec(ind); + f_N = lec4_func_ex2(N); + f_N_vec(ind) = f_N; +end +% Code the LHS +y_LHS = pi*ones(1,length(N_vec)); +% Plot +figure +plot(N_vec, f_N_vec) +hold on; grid on; +plot(N_vec, y_LHS,'x'); + + + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex3.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex3.m new file mode 100644 index 0000000..40d8d52 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex3.m @@ -0,0 +1,17 @@ +% Redo Example 2 with the cumsum in sub-function +clc; clear all; close all; +% RHS +N = 10; +y_RHS = lec4_func_ex3(N); +% LHS +y_LHS = pi*ones(1,length(y_RHS)); + +% Plot +x_axis_vec = 0:N; +figure +plot(x_axis_vec, y_RHS) +hold on; grid on; +plot(x_axis_vec, y_LHS,'x'); + + + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex4.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex4.m new file mode 100644 index 0000000..f85b770 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/Lec4_Ex4.m @@ -0,0 +1,13 @@ +% Do the example 4 in Lecture 4. +clc; clear all; close all; +x_vec = 0:0.01:4; +N=10; +k= 0:N; + +f_x_vec = zeros(1,length(x_vec)); +for ind = 1:length(x_vec) + x = x_vec(ind); + f_x = (4./pi)*sum(sin(x.*(2.*k+1))./(2.*k+1)); + f_x_vec(ind) = f_x; +end +plot(x_vec,f_x_vec) diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/fib.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/fib.m new file mode 100644 index 0000000..3408baa --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/fib.m @@ -0,0 +1,13 @@ +% Recursive Functions of Fibonacci: f(n)=f(n-1)+f(n-2) + +function y = fib(n) + if n == 1 + y = 0; % Create first initial value of Fib + end + if n == 2 + y = 1; % Create second initial value of Fib + end + if n > 2 + y = fib(n-1) + fib(n-2); + end +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/func_ex_1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/func_ex_1.m new file mode 100644 index 0000000..accb23a --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/func_ex_1.m @@ -0,0 +1,7 @@ +% Write a sub-function to calculate the +% RMS value and the mean-absolute value + +function [rms_val, mean_val] = func_ex_1(x) + rms_val = sqrt(sum(abs(x).^2)/length(x)); + mean_val = sum(abs(x))/length(x); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_Ex5.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_Ex5.m new file mode 100644 index 0000000..0c724e9 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_Ex5.m @@ -0,0 +1,7 @@ +clc; clear all; close all; + +y = []; +for n = 1:10 + y = [y fib(n)]; +end +y \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_func_ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_func_ex2.m new file mode 100644 index 0000000..31867b7 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_func_ex2.m @@ -0,0 +1,5 @@ +function result = lec4_func_ex2(N) + k_vec = 0:N; + x_vec = ((-1/3).^k_vec)./(2*k_vec+1); + result = 2*sqrt(3)*sum(x_vec); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_func_ex3.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_func_ex3.m new file mode 100644 index 0000000..43410cd --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture4_Example Codes/lec4_func_ex3.m @@ -0,0 +1,5 @@ +function result = lec4_func_ex3(N) + k_vec = 0:N; + x_vec = ((-1/3).^k_vec)./(2*k_vec+1); + result = 2*sqrt(3)*cumsum(x_vec); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/indi_func.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/indi_func.m new file mode 100644 index 0000000..3423f83 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/indi_func.m @@ -0,0 +1,3 @@ +function result = indi_func(x_vec,a,b) + result = (x_vec >= a)&(x_vec < b); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/lec5_ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/lec5_ex1.m new file mode 100644 index 0000000..27e7806 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/lec5_ex1.m @@ -0,0 +1,34 @@ +% Practice to use indicator functions +clc; clear all; close all; + +% Method 1 +% x_vec = -2:0.001:2; +% unit_step_vec = [] +% for ind = 1:length(x_vec) +% x = x_vec(ind); +% if x >= 0 +% unit_step = 1; +% else +% unit_step = 0; +% end +% unit_step_vec = [unit_step_vec unit_step] ; +% end +% figure +% plot(x_vec, unit_step_vec,'x-b') + +% Method 2 +% x_vec = -2:0.001:2; +% unit_step_vec = (x_vec >= 0); +% figure +% plot(x_vec, unit_step_vec,'x-b') + +% Method 3 +% unit_step = @(x) (x >=0 ); +% fplot(unit_step) + +% For indicator functions +x_vec = -2:0.001:6; +a = 2; b =4; +indicator_vec = (x_vec >= a)&(x_vec < b); +figure +plot(x_vec, indicator_vec,'x-b') diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/lec5_ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/lec5_ex2.m new file mode 100644 index 0000000..0b3e112 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture5_Example Codes/lec5_ex2.m @@ -0,0 +1,23 @@ +% Use indicator functions to represent a general function +clc; clear all; close all; + +% Figure 1 +x_vec = -2:0.001:4; +% fx_vec = 2*x_vec.*((x_vec >= 0)&(x_vec < 0.5)) + 1*((x_vec >= 0.5)&(x_vec < 1.5))+ (4-2*x_vec).*((x_vec >= 1.5)&(x_vec < 2)); +fx_vec = 2*x_vec.*indi_func(x_vec,0,0.5)+indi_func(x_vec,0.5,1.5)+(4-2*x_vec).*indi_func(x_vec,1.5,2); + +% Figure 2 +fx_scaled = 2*fx_vec; + +figure +subplot(1,2,1) % For Figure 1 +plot(x_vec, fx_vec,'-b','linewidth',2) +grid on +xlabel('x'); ylabel('f(x)') +title('f(x) versus x') +ylim([0 2]) +subplot(1,2,2) % For Figure 2 +plot(x_vec, fx_scaled,'-r','linewidth',2) +grid on +xlabel('x'); ylabel('2*f(x)') +title('2*f(x) versus x') \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex1.m new file mode 100644 index 0000000..31a5271 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex1.m @@ -0,0 +1,15 @@ +clear all; close all; clc; + +% Slide 7 in Lecture 6. +% k1 = [1; 0; -2]; +% k2 = [0; 3; 1]; +% x = []; +% for k = [k1,k2] +% x = [x, 3.0 + 0.1*k]; +% end + +% Slide 8 in Lecture 6 +for k = [3, 7, 10] + x(k) = 3 + 0.1*k; + disp(x); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex2.m new file mode 100644 index 0000000..2eae5b5 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex2.m @@ -0,0 +1,19 @@ +% Some methods to compute S = 1 + 1/2^2 + 1/3^2 +... +clear all; close all; clc; + +% Cumsum function +N=1:1000; S1 = cumsum(1./(N.^2)); S1(1000) + +% While-Loops +N=1000; k=1; S2=0; +while k<=N; + S2=S2+1/k^2; k=k+1; +end +disp(S2) + +% For-Loops +n=1000; S3 = 0; +for k=1:n + S3=S3+1/k^2; +end +disp(S3) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex3.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex3.m new file mode 100644 index 0000000..678bf5d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex3.m @@ -0,0 +1,23 @@ +% Generate a random matrix and compute the squared norm of the matrix +% x = [x11 x12; x21 x22] and ||x||^2 = x11^2 + x12^2 + x21^2 + x22^2 + +clear all; close all; clc; + +n = input('Number of row is ') +m = input('Number of column is ') +% Generate a random matrix n x m +A = randn(n,m); + +% Compute the squared norm of the matrix +% Double-Loop +norm1 = 0; +for i=1:n + for j=1:m + norm1 = norm1 + abs(A(i,j))^2; + end +end +norm1 + +% Matrix-based Method +norm2 = sum(sum(abs(A).^2)) + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex4.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex4.m new file mode 100644 index 0000000..86db541 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex4.m @@ -0,0 +1,16 @@ +% Compute infinte sum S(n) = 1/1^2 + 1/2^2 +... + 1/n^2 when n goes to infinity +% with the relative error |S(n) - S(n-1)|/|S(n-1)| < 10^(-10) +% Notice that S(n) - S(n-1) = 1/n^2 + +clear all; close all; clc; +S = 0; n = 1; +while n > 0 + error = (1/n^2)/S; + if error < 10^(-10) + break; + else + S = S + 1/n^2; + n = n + 1; + end +end +S \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex5.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex5.m new file mode 100644 index 0000000..0762c28 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex5.m @@ -0,0 +1,21 @@ +% S(n) = sum of (-1/3)^k/(2k+1) for k=0,1,2,..,n. +% with the relative error |S(n) - S(n-1)|/|S(n-1)| < 10^(-10) +% Notice that S(n) - S(n-1) = (-1/3)^n/(2n+1) +% Plot S(n) versus n + +clear all; close all; clc; +S_vec = []; +S = 0; k = 0; +while k > -1 + error = abs((-1/3)^k/(2*k+1))/abs(S); + if error < 10^(-5) + break; + else + S = S + (-1/3)^k/(2*k+1); + S_vec = [S_vec S]; + k = k + 1; + end +end +n_vec = 0:length(S_vec)-1; +plot(n_vec,S_vec) +xlabel('n'); ylabel('S(n)') \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex6.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex6.m new file mode 100644 index 0000000..478fdb8 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/Lec6_Ex6.m @@ -0,0 +1,18 @@ +% This code is to compute the square-root algorithm +% The requirement is to get all values of sequences +% such as the error |x(n)-x(n-1)|/|x(n-1)| < 10^(-6) +% Hint: get x_vec = [x(1),....,x(n)] and use while-loop + +clear all; close all; clc; +a = 20; +n = 2; x_vec = [20]; +while n > 0 + x_vec = [x_vec sub_func_Ex6(n,a)]; + error = abs(sub_func_Ex6(n,a) - sub_func_Ex6(n-1,a))/abs(sub_func_Ex6(n-1,a)); + if error < 10^(-10) + break; + else + n = n + 1; + end +end +plot(1:length(x_vec), x_vec) diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/sub_func_Ex6.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/sub_func_Ex6.m new file mode 100644 index 0000000..c9896c3 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture6_Example Codes/sub_func_Ex6.m @@ -0,0 +1,7 @@ +function result = sub_func_Ex6(n,a) + if n == 1 + result = 20; + else + result = 0.5*(sub_func_Ex6(n-1,a)+a/sub_func_Ex6(n-1,a)); + end +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part1_Prob1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part1_Prob1.m new file mode 100644 index 0000000..5901cf0 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part1_Prob1.m @@ -0,0 +1,9 @@ +clear all; close all; clc; + +A=[1 2 3;4 5 6;7 8 9] +B=A(:,2:3) %question a +C=A(1:2,:) %question b +D=B*C %question c +E = max(D) %question d +[F, ind] = min(D,[],2) %question e +E*F \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part1_Prob3.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part1_Prob3.m new file mode 100644 index 0000000..83d5a40 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part1_Prob3.m @@ -0,0 +1,8 @@ +clear all; close all; clc; + +for i=1:4 + for j=1:6 + b(i,j) = 2.*i-3.*j; + end +end +b diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part2_Prob1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part2_Prob1.m new file mode 100644 index 0000000..a15f039 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part2_Prob1.m @@ -0,0 +1,28 @@ +clear all; close all; clc; + +% Cumsum Method +N=100; n=1:N; +S_vec1 = cumsum((-1).^(n+1)./factorial(2.*n - 1)); +plot(n,S_vec1) + +% For-loops +n_vec = 1:100; +S_vec2 = zeros(1,length(n_vec)); +for ind = 1:length(n_vec) + n = n_vec(ind); + f_n = (-1)^(n+1)/(factorial(2*n-1)) ; + S_vec2(ind) = f_n; +end +plot(n_vec, S_vec2,'linewidth',1.5) + +% While-loops +S_vec3=[]; S = 0; +while n<=N + S = S + ((-1)^(n+1)/factorial(2*n-1)); + S_vec3 = [S_vec3 S]; + n = n+1; +end +n_vec = 1:N; +plot(n_vec, S_vec3,'b') +xlabel('n'); ylabel('S') + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part2_Prob2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part2_Prob2.m new file mode 100644 index 0000000..ead1549 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part2_Prob2.m @@ -0,0 +1,16 @@ +clear all; close all; clc; + +x = input('Input value of x: '); +n = 0; +RHS_vec=[]; RHS=0; +while n > -1 + RHS = RHS + (x^n/factorial(n)); + RHS_vec = [RHS_vec RHS]; + if abs(RHS-exp(x)) < 10^(-6) + break; + else + n=n+1; + end +end +n_vec = 1:length(RHS_vec); +plot(n_vec,RHS_vec,'b') diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob1.m new file mode 100644 index 0000000..3c719d9 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob1.m @@ -0,0 +1,18 @@ +clear all; close all; clc; + +% Use FOR-LOOPS +x=-10:0.01:20; +for i=1:length(x) + y(i)= sub_Part3_Prob1(x(i)); +% if x(i) > -5 +% y(i) = x(i)^2+8; +% else +% y(i) = (-x(i)^3)+2; +% end +end +plot(x,y) + +% USE Indicator function +x = -10:0.01:20; +fx = ((x.^2+8).*(x>-5))+((-x.^3+2).*(x<=-5)); +plot(x,fx) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob2.m new file mode 100644 index 0000000..4a6c8e3 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob2.m @@ -0,0 +1,13 @@ +clear all; close all; clc; + +% FOR-LOOPS +x = -10:0.01:10; +for i = 1:length(x) + y(i) = sub_Part3_Prob2(x(i)); +end +plot(x,y) + +% INDICATOR FUNCTIONS +x = -10:0.01:10; +fx=(3.*x.^2-x).*(x<-6)+(sqrt(7-x)).*((x>=-6)&(x<=5))+(8*x-3).*(x>5); +plot(x,fx) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob4.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob4.m new file mode 100644 index 0000000..70d0576 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part3_Prob4.m @@ -0,0 +1,23 @@ +clear all; close all; clc; + +% INDICATOR FUNCTIONS +x = -10:0.01:10; +y = (-x/3-2).*((x>=-6)&(x<-3)) + 1.*((x>=-3)&(x<0)) + ((-x/3)+1).*((x>=0)&(x<3)); +figure +plot(x,y,'-b'); ylim([-2 2]) +xlabel('t'); ylabel('x(t)'); + +% FOR-LOOPS +x = -10:0.01:10; +for i=1:length(x) + if ((x(i)>=-6)&(x(i)<-3)) + f(i)=-x(i)/3 -2; + elseif ((x(i)>=-3)&(x(i)<0)) + f(i)=1; + elseif ((x(i)>=0)&(x(i)<3)) + f(i)=-x(i)/3+1; + else + f(i)= 0; + end +end +plot(x,f) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part4_Prob3.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part4_Prob3.m new file mode 100644 index 0000000..df20513 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part4_Prob3.m @@ -0,0 +1,18 @@ +clear all; close all; clc + +x = input('Type the value of x (different from 0): ') +a = input('Type the value of a (different from 0): ') +S = 1; % Khoi tao S(0) +n=1; +S(n)= S + (log(a))^n*x^n/factorial(n); +while 1 + n = n + 1; + S(n) = S(n-1) + (log(a))^n*x^n/factorial(n); + error = abs(S(n) - S(n-1))/abs(S(n-1)); + if error < 10^(-6) + break; + end +end + +fprintf('The value of a^x is %10.5f \n',S(n)) +plot(1:n, S) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part4_Prob4.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part4_Prob4.m new file mode 100644 index 0000000..e6e2c06 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/Part4_Prob4.m @@ -0,0 +1,21 @@ +clc; clear all; close all +n = 0; S = 0; +while n > -1 + n = n + 1; + S = S + n; % Compute S = 1+2+3+...+n + if (S>100)&(S<1000) % Condition on 100 < S < 1000 + tram = floor(S/100); % chu so phan tram + chuc = floor((S-tram*100)/10); % chu so phan chuc + dvi = S-tram*100-chuc*10; % chu so don vi + if (tram == chuc)&(tram == dvi) + disp(n) + disp(S) + end + else + if S <= 100 + continue; + else + break; + end + end +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/sub_Part3_Prob1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/sub_Part3_Prob1.m new file mode 100644 index 0000000..63cdc3d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/sub_Part3_Prob1.m @@ -0,0 +1,7 @@ +function result = sub_Part3_Prob1(x) + if x>-5 + result=x^2+8; + else + result=-x^3+2; + end +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/sub_Part3_Prob2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/sub_Part3_Prob2.m new file mode 100644 index 0000000..17071dd --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture7_Review on Midterm/sub_Part3_Prob2.m @@ -0,0 +1,8 @@ +function s = sub_Part3_Prob2(x) +if x<-6 + s = 3*(x^2)-x; +elseif -6 <= x <= 5 + s = sqrt(7-x); +else + s = 8*x - 3; +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex1.m new file mode 100644 index 0000000..72d8a2b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex1.m @@ -0,0 +1,17 @@ +clear all; close all; clc; +% Equation System 1 +A1 = [2 1 0; 1 5 -1; 1 -2 4]; +b1 = [4;8;9]; +x1 = A1\b1; +% Equation System 2 +A2 = [4 3 0; 2 2 -2; 5 3 1]; +B2 = [4 0 -2]'; +x2 = A2\B2 +% Equation System 3 +A3 = [1 -2 -3; 3 2 -1; 0 3 -1]; +b3 = [0 0 0]; +x3 = A3\b3 +% Equation System 4 +A4=[16 16 17;-14 17 -3;-5 -11 -18]; +b4=[10;75;43]; +x4=A4\b4 \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex2.gif b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex2.gif new file mode 100644 index 0000000..9a38fb3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex2.gif differ diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex2.m new file mode 100644 index 0000000..07a6d9f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture8_Example Codes/Ex2.m @@ -0,0 +1,11 @@ +clear all; close all; clc; + +clc; clear all; close all; +% Cach 1 +A = [1 -1 -1;4 6 0; 4 0 12] +B = [0; 12; 12] +ketqua = A\B +% Cach 2 +A_1 = [4 6 0; 4 0 12; 4+(6*12)/(6+12) 0 0 ] +B_2 = [12; 12; 12] +ketqua = A_1\B_2 \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex1.m new file mode 100644 index 0000000..0371cd8 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex1.m @@ -0,0 +1,12 @@ +% Compute the integral of exp(-x) from 0 to 1 +clear all; close all; clc; +% Symbolic +syms x +fun = exp(-x); +q = int(fun,[0 1]) +% Generated Data with Trapezoid method +del_x = 0.0001; +x_vec = 0:del_x:1; +func = exp(-x_vec); +q_Int = del_x*sum(func) +q_Int = trapz(x_vec,func) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex2.m new file mode 100644 index 0000000..080c7dc --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex2.m @@ -0,0 +1,14 @@ +% Compute the integral of x*exp(-x) from 0 to 1 +clear all; close all; clc; +% Symbolic Method +syms x; +a = x*exp(-x); +f = double(int(a,0,1)) +% Trapezoid Method +del_x = 0.0001; +x_vec = 0:del_x:1; +func = x_vec.*exp(-x_vec); +q_Int = trapz(x_vec,func) + + + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex3.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex3.m new file mode 100644 index 0000000..4645875 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex3.m @@ -0,0 +1,20 @@ +clear all; close all; clc; +M = 2; +xi = [1, 3, 4, 6, 9]; +yi = [4, 4, 7, 11, 19]; + +% Find coefficients in polynomial form +p = polyfit(xi,yi,M); +y = polyval(p,xi); +figure +plot(xi,yi,'ok') +hold on; grid on; +plot(xi,y,'-b') + +% Use these coefficients with other datas rather than xi +x_new = linspace(0,10,101); +y_new = polyval(p,x_new); +figure +plot(xi,yi,'ok') +hold on; grid on; +plot(x_new,y_new,'-b') \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex4.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex4.m new file mode 100644 index 0000000..e68f284 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex4.m @@ -0,0 +1,21 @@ +clear all; close all; clc; + +M = 18; +ti = [1:21]; +Hi = [13 27 26 44 30 39 40 34 45 44 24 32 44 39 29 44 38 47 34 40 50]; + +% Find coefficients in polynomial form +p = polyfit(ti,Hi,M); +H = polyval(p,ti); +figure +plot(ti,Hi,'ok') +hold on; grid on; +plot(ti,H,'-b') + +% Use these coefficients with other datas rather than xi +ti_new = linspace(1,21,150); +H_new = polyval(p,ti_new); +figure +plot(ti,Hi,'ok') +hold on; grid on; +plot(ti_new,H_new,'-b') \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex5.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex5.m new file mode 100644 index 0000000..0a115b1 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/Lecture9_Example Codes/Lec9_Ex5.m @@ -0,0 +1,13 @@ +% Compute the indefined integral of a*x^2+bx+c +% the user can type the values of a, b and c. +% and compute the above integral with limit [0, 1] + +clc; clear all; close all; +a = input ('Type a: '); +b = input ('Type b: '); +c = input ('Type c: '); + +syms x +A = a*x.^2+b*x+c; +F_x = int(A) +G_x = int(A, 0,1) \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex1.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex1.m new file mode 100644 index 0000000..4555962 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex1.m @@ -0,0 +1,10 @@ +% Prove 1/2 + 1/2^2 + ...+ 1/2^n = 1- 1/2^n +clc; clear all; close all; + +n = input('The value of n is '); +x_vec = 1:n; +LHS = sum(0.5.^x_vec); +RHS = 1-0.5^n; +fprintf('The LHS is %4.2f \n', LHS) +fprintf('The RHS is %4.2f \n', RHS) + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex2.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex2.m new file mode 100644 index 0000000..59285c8 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex2.m @@ -0,0 +1,14 @@ +% Symbolic Function & Generating Datas +clc; clear all; close all; +% Symbolic +syms x; +f_x = exp(-0.5.*x).*sin(5.*x); +% Generating Datas +x_vec = -5:0.01:5; +fx_vec = exp(-0.6*x_vec).*sin(5.*x_vec); + +figure +fplot(x,f_x) +hold on +plot(x_vec,fx_vec) + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex3_With_Sub_Func.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex3_With_Sub_Func.m new file mode 100644 index 0000000..b6b7367 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex3_With_Sub_Func.m @@ -0,0 +1,16 @@ +% Writing a sub-function +clc; clear all; close all + +% Symbolic +syms x +f_x = func_example(x); + +% Generating Datas +x_vec = -5:0.01:5; +fx_vec = func_example(x_vec); + +figure +fplot(x,f_x) +hold on +plot(x_vec,fx_vec,'x') + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex4.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex4.m new file mode 100644 index 0000000..172f24b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex4.m @@ -0,0 +1,19 @@ +% Let users type the value of a and b +% Use Sub-functions and draw one Figure with +% two plots of symbolic and generated functions + +% Symbolic +syms x +a = input('The value of a is '); +b = input('The value of b is '); +f_x = func_example(x); + +% Generating Datas +x_vec = -5:0.01:5; +fx_vec = func_example(x_vec) + +figure +fplot(x,f_x) +hold on +plot(x_vec,fx_vec,'x') + diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex5.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex5.m new file mode 100644 index 0000000..aecdeff --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex5.m @@ -0,0 +1,14 @@ +clc; clear all; close all; +x_vec = 0:0.1:2; +fx_vec1 = exp(-0.5*x_vec).*sin(5.*x_vec); +fx_vec2 = sin(5.*x_vec); + +figure +plot(x_vec,fx_vec1,':bd','LineWidth',2,'MarkerSize',5) +hold on +grid on +plot(x_vec,fx_vec2,'-.r','LineWidth',2,'MarkerSize',2) +xlabel('x') +ylabel('f(x)') +title('Plot f_1(x) and f_2(x)') +legend('f_1(x)','f_2(x)') \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex6.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex6.m new file mode 100644 index 0000000..5828e0e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/Ex6.m @@ -0,0 +1,3 @@ +clc; clear all; close all; +f = @(x) exp(-0.5*x).*sin(5*x); +fplot(f,[-10,5]); \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/func_example.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/func_example.m new file mode 100644 index 0000000..4340929 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/func_example.m @@ -0,0 +1,3 @@ +function result = func_example(x) + result = exp(-0.5*x).*sin(5*x); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/func_example4.m b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/func_example4.m new file mode 100644 index 0000000..c16996d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/2021_Summer_Example Codes/lecture3_Example Codes/func_example4.m @@ -0,0 +1,3 @@ +function result = func_example4(x) + result = exp(-a*x).*sin(b*x); +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/Books/Get Started with MATLAB.pdf b/Introduction to Computer for Engineers_Minh/Books/Get Started with MATLAB.pdf new file mode 100644 index 0000000..c5bb810 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Books/Get Started with MATLAB.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Books/MATLAB TUTORIALS.pdf b/Introduction to Computer for Engineers_Minh/Books/MATLAB TUTORIALS.pdf new file mode 100644 index 0000000..49634a2 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Books/MATLAB TUTORIALS.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Books/MATLAB_Exercise_Book2.pdf b/Introduction to Computer for Engineers_Minh/Books/MATLAB_Exercise_Book2.pdf new file mode 100644 index 0000000..7f3964b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Books/MATLAB_Exercise_Book2.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Books/introduction-to-matlab.pdf b/Introduction to Computer for Engineers_Minh/Books/introduction-to-matlab.pdf new file mode 100644 index 0000000..d0a543d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Books/introduction-to-matlab.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_func1.m b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_func1.m new file mode 100644 index 0000000..b44a214 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_func1.m @@ -0,0 +1,5 @@ +clc +function out=f1(x) +out=log2(x+1)./(factorial(x)); +end +f1(1) diff --git a/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_func2.m b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_func2.m new file mode 100644 index 0000000..acc71bf --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_func2.m @@ -0,0 +1,8 @@ +clc +function out=f(x) + out=[0; 0]; + out(1)=f1(x); + out(2)=exp(2*x)./(3*x+2); + +end +f(1) diff --git a/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_script1a.m b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_script1a.m new file mode 100644 index 0000000..c71646b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_script1a.m @@ -0,0 +1,8 @@ +clear all +close all +clc + + n=0:2:50; + disp('sum of square of 50 first even numbers') +S=sum(n.^2) +disp("Nguyễn Đào Anh KHôi") diff --git a/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_script2.m b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_script2.m new file mode 100644 index 0000000..33b1dc2 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/NguyenDaoAnhKhoi_EEEEIU22067_script2.m @@ -0,0 +1,11 @@ +clc +%Nguyen Dao Anh Khoi +%ID number= EEEEIU22067 +%Question number 2.3 +fano=@(x)(exp(2*x)./(3*x+2)); +fano(1) +%Question 2.4 +x=1:9; +f1(x) +f(x) +fano(x) diff --git a/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067.zip b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067.zip new file mode 100644 index 0000000..97139b3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067.zip differ diff --git a/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question1.m b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question1.m new file mode 100644 index 0000000..a2c6f8a --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question1.m @@ -0,0 +1,46 @@ +clear all +close all +clc + +%plot function + +x= 0:0.01:10; +% define function f(x) +fx= @(x) (x.*sin(x)+6.*e.^(-x)); +interval =[0,10]; +y =fx(x); +%define horizontal - x axis +y0=zeros(1,length(x)); + +%we divide the interval into N slice +N=1000; +increment=(10-0)/N; +xx=0:increment:10; +Sreal=log(11/12)-log(3/4); +printf("Intergration exact value is %4f2 \n",Sreal) +%define error comparing to rela value +error = 0.0001 +%integration calculation +S=0; +for k=1:1:N + S=S+0.5*increment*(fx(xx(k))+fx(xx(k+1))); + if abs(S-Sreal) < error + printf("Intergration Value within 0.0001 error is %4f2 \n",error,S); + printf("Algorithm stop at %d\n",k); + break + endif +end +fprintf("Intergration value is %d \n",S) +plot(x,y,'b-',"linewidth",2) +hold on +plot(x,y0,'r-',"linewidth",2) +%plot the slice\ +for k=1:1:length(xx) +hold on +plot([xx(k) xx(k)],[0 fx(xx(k))],'r--',"linewidth",2); +end +axis([2 10]) +grid on +title('Nguyen Dao Anh Khoi - Function {tsin(t)+6*e^(-x)}') +ylabel('Function f_1(x)'); +xlabel('x axis (unit 0.01 increment)'); diff --git a/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question2.m b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question2.m new file mode 100644 index 0000000..382dd31 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question2.m @@ -0,0 +1,51 @@ +clear all +close all +clc +% Step 1: Input the data points x and y +x = [0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 2.0000]; +y = [8.1017 7.5913 7.5611 7.6671 7.1013 6.6660 6.5322 6.2011 6.4503 6.1714]; + +% Step 2: Plot the data points +figure; +plot(x, y, 'x--'); % Plot with red cross symbols +title('Curve fitting - Case choosing best fitting function'); +xlabel('x values'); +ylabel('y values'); +grid on; +% Commenting the code +% This section computes linear and exponential fitting values for the given data points, +% calculates the sum of squared errors for each fitting, and plots the fitting functions on the same figure. + +% Question 2.2: Linear fitting +% Step 1: Compute coefficients a11, a01 and save result into vector a1 +a1 = polyfit(x, y, 1); + +% Step 2: Computing fitting error +y_linear = a1(1)*x + a1(2); +soe1 = sum((y - y_linear).^2); + +% Plotting linear fitting function +hold on; +plot(x, y_linear, '--b', 'LineWidth', 2); + +% Question 2.3: Exponential fitting +% Step 1: Compute coefficients a12, a02 and save result into vector a2 +a2 = polyfit(x, log(y), 1); +a2(1) = exp(a2(1)); % Update a12 as it's the coefficient of exponential term + +% Step 2: Computing fitting error +y_exponential = a2(1) * exp(a2(2)*x); +soe2 = sum((y - y_exponential).^2); + +% Plotting exponential fitting function +plot(x, y_exponential, 'r', 'LineWidth', 2); + +% Question 2.4: Print sum of squared errors +fprintf('Sum of Squared Errors for Linear Fitting: %.4f\n', soe1); +fprintf('Sum of Squared Errors for Exponential Fitting: %.4f\n', soe2); + +% Commenting on choice of best fitting function +% Based on the comparison of sum of squared errors, the fitting function with the lower value +% is typically chosen as the best fitting function. The choice may also depend on the application +% and the context of the data. + diff --git a/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question3.m b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question3.m new file mode 100644 index 0000000..4139da0 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/final/NguyenDaoAnhKhoi_EEEEIU22067_Question3.m @@ -0,0 +1,48 @@ +clear all +close all +clc; + +%input matrix A +A= [35 1 6 26 19 24;3 32 7 21 23 25;31 9 2 22 27 20;8 28 33 17 10 15;30 5 34 12 14 16;4 36 29 13 20 11]; +b=[6;2;2;9;0;5]; +%create an augment for +M=[A b] +%get the dimension +% nrow - number of rows +% mcol - number of columns +[nrow, mcol]=size (M); +%forward step +for i=1:nrow + for j=i:nrow + printf("substep %d and %d-th row operation \n \r",i,j) + %this is substep i - j-th row operation + % detect the pivot row j=i + %apply row op with pivot row + if (j==i) + printf("substep %d - pivot row %d - pivot element %4f\n\r",i,j,M(i,j)) + %check pivot element is different to zeros + if (M(i,j) !=0)\ + %if pivot is diffent to zeros + %apply the row op with pivot row + M(j,:) = M(j,:)/M(j,j); + else + printf("Infinite or no solution \r\n") + %we stop + break; + endif + else + %case j!=1 - it is not pivot row + %we eliminate element below pivot element + M(j,:) = M(j,:) - M(j,i)*M(i,:); + endif + endfor +endfor +%back substitution step +%initialize solution x +x=zeros(nrow,1); +%last element of x +x(nrow,1)= M(nrow,mcol); +for i=(nrow-1):-1:1 + x(i,1) = M(i,mcol)- sum(M(i,(i+1):nrow).*x((i+1):nrow,1)'); +endfor +x diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 1/anonymous.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 1/anonymous.m new file mode 100644 index 0000000..c09e653 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 1/anonymous.m @@ -0,0 +1,7 @@ +clc; +fano1 = @(a,b,c) (10^a + exp(b / c)); +disp("anonymous function fano1"); +fano1(2,10,10) +disp("private function"); +lec3_func1(2,10,10) +disp("Nguyễn Đào Anh Khôi"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 1/lec3.func2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 1/lec3.func2.m new file mode 100644 index 0000000..8a1b2d2 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 1/lec3.func2.m @@ -0,0 +1,18 @@ +clear all; %clear all var in workspace +close all; %close all figures +clc; + +%% Variable declaration +% scalar - Octave does not distinguish between +%integer +var_int =10 +%binary +var_bin =0 +% real +var_real = 10.2 + +% array (vector) vs. scalar +vec1_row = [10.2 2.1] +vec2_col = [1;2;3;4;5] + +disp("Nguyễn Đào Anh Khôi"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 1/lec3_func1.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 1/lec3_func1.m new file mode 100644 index 0000000..0451cf5 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 1/lec3_func1.m @@ -0,0 +1,5 @@ +clc +function out = lec3_func1(a,b,c) + out= 10 .^ a + exp(b ./ c); +end +lec3_func1(5,10,10) diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 2/script1.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 2/script1.m new file mode 100644 index 0000000..dd246c9 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 2/script1.m @@ -0,0 +1,11 @@ +% demo - my first script +clear all; %clear all var in workspace +close all; %close all figures +clc; %clear the content of cmd window + +%output to cmd window - hello string +disp("Hello - my first script") +disp("Call a function in a script") +function out = mysecondfunc(a,b) + out = (a*b+1); +end diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/anonymous.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/anonymous.m new file mode 100644 index 0000000..47d4994 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/anonymous.m @@ -0,0 +1,11 @@ + +%how to define an anymous function +%function_name = @(args) (content of the function) + +fanol = @(a,b,c) (10^a + exp (b/c)); +% testing anonymous function +disp("anonymous function fanol"); +fano1(2,10,10) +disp("private function "); +lec3_func1(2,10,10) +disp("Nguyễn Đào Anh Khôi"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func1.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func1.m new file mode 100644 index 0000000..d4bfdf7 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func1.m @@ -0,0 +1,8 @@ +clc +clear all + +disp("Nguyễn Đào Anh Khôi") +disp("call a function in a script") +function out = lec3_func1(a,b,c) + out = a^10+ exp(b/c); +end diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func2.m new file mode 100644 index 0000000..2374fe2 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func2.m @@ -0,0 +1,21 @@ +% demo - my first script +clear all; %clear all var in workspace +close all; %close all figures +clc; %clear the content of cmd window + +%% Variable declaration +% scalar - Ocatave does not distinguish between integer +% they just asign with varible name +%integer +var_int =10; +%binary +var_bin =0; +% real +var_real = 10.2; + +% array (vector) vs. scalar +% vector - assign row and col vector into variable +vec1_row = [10.2 2.1] +vec2_col = [1;2;3;4;5] + +disp("Nguyễn Đào Anh Khôi"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func3.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func3.m new file mode 100644 index 0000000..2020232 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func3.m @@ -0,0 +1,52 @@ +% demo - my first script +clear all; %clear all var in workspace +close all; %close all figures +clc; %clear the content of cmd window + +%% Variable declaration +% scalar - Ocatave does not distinguish between integer +% they just asign with varible name +%integer +##var_int =10; +##%binary +##var_bin =0; +##% real +##var_real = 10.2; + +% array (vector) vs. scalar +% vector - assign row and col vector into variable +##vec1_row = [10.2 2.1] +##vec2_col = [1;2;3;4;5] +##disp("my assignment"); +##size(vec1_row) +##size(vec2_col) +## +##length(vec1_row) +##length(vec2_col) +## disp("Nguyễn Đào Anh Khôi"); +## +## disp(" operation transpose"); +## vec2_col' +## size(vec2_col') +disp(" COnventional Math, Operation"); + vec3 = [1 2 3]; + vec4 = [4 5 6]; + %compute the sum of two vector and assign + %its value into a new vector + disp('addition, sub& assignment') + vec5= vec3 + vec4 + vec6= vec4 - vec3 + disp('product dot, cross& assignment') +%since dot product will return a scalar. then +%var_dot is a scalar variable +var_dot = dot(vec3, vec4) +%cross product will return a vector - assign to +vec7 = cross(vec3,vec4) + disp("Nguyễn Đào Anh Khôi"); + + + + + + + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func4.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func4.m new file mode 100644 index 0000000..af8d9f1 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func4.m @@ -0,0 +1,17 @@ +clc +clear all + +disp(" UnCOnventional Math, Operation"); +vec3 = [1 2 3]; +vec4 = [4 5 6]; +%element-wise operation +vec3.^2 +[3 3 3].^vec3 +3.^vec3 +(2.2-3.^vec3)./3 + + %element wise addtion + vec3 + [ 1 1 1] + vec3 + ones(1,3) + vec3 + 1 + disp("Nguyễn Đình Ngọc Huy"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func5.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func5.m new file mode 100644 index 0000000..673538b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func5.m @@ -0,0 +1,30 @@ +clc +clear all + +disp(" UnCOnventional Math, Operation"); +vec3 = [1 2 3]; +vec4 = [4 5 6]; +%element-wise operation +vec3.^2 +[3 3 3].^vec3 +3.^vec3 +(2.2-3.^vec3)./3 + + %element wise addtion + vec3 + [ 1 1 1] + vec3 + ones(1,3) + vec3 + 1 + %element wise multiplication + vec3.*vec4 + %element wise division + %left division + disp('left') + vec4 + vec3 + vec4.\vec3 + %right division + disp('right') + vec4 + vec3 + vec4./vec3 + disp("Nguyễn Đình Ngọc Huy"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func6.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func6.m new file mode 100644 index 0000000..80e0768 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func6.m @@ -0,0 +1,15 @@ +clc +clear all + +disp(" UnCOnventional Math, Operation"); +vec3 = [1 2 3]; +vec4 = [4 5 6]; +% vector modulus +disp('modulus of vec3') +sqrt(1^2+2^2+3^2) +norm(vec3) +% sum of vector +vec3 +disp('sum of element in vec3') +sum(vec3) + disp("Nguyễn Đình Ngọc Huy"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func7.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func7.m new file mode 100644 index 0000000..8ef90ef --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 3/lec3_func7.m @@ -0,0 +1,6 @@ +clc +clear all +disp("Application Unconventional Math. Operation") +sum(-5:1:100) +sum(100:-1:-5) + disp("Nguyễn Đình Ngọc Huy"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/EEEEIU22067_Quiz2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/EEEEIU22067_Quiz2.m new file mode 100644 index 0000000..ffafc73 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/EEEEIU22067_Quiz2.m @@ -0,0 +1,24 @@ +clear all +close all +clc +x = 0.5; +eps = 0.0002; + +S = 0; +term = x; +k = 1; + +while abs(term) > eps + S = S + term; + k = k + 1; + term = (-1)^(k+1) * (x^k) / k; +end + +approximation = S; + +real_value = log(x); +error = abs(real_value - approximation); + +fprintf('Approximation: %.4f\n', approximation); +fprintf('Real Value: %.4f\n', real_value); +fprintf('Error: %.4f\n', error); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/EEEEIU22067_Quiz3_A.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/EEEEIU22067_Quiz3_A.m new file mode 100644 index 0000000..168defe --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/EEEEIU22067_Quiz3_A.m @@ -0,0 +1,9 @@ +clear all +close all +clc + + n = 1:25; + n_squared = n.^2; +sum_of_squares = sum(n_squared); +disp(sum_of_squares); + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/conditionalstatement.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/conditionalstatement.m new file mode 100644 index 0000000..baf0c86 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/conditionalstatement.m @@ -0,0 +1,24 @@ +close all +clear all +clc + + +##if rem(a,2)==0 +##disp("a is even"); +##else disp("a is odd"); +##end +a=1 +b=-4 +c=3 +delta = b^2 -4*a*c +if delta<0 + disp("no root"); +elseif delta==0 + x=-b/2*a + disp(x); +else + x1=((-b)+ sqrt(delta)) ./ 2*a + x2=((-b)- sqrt(delta)) ./ 2*a + + end +disp("Nguyễn Đào Anh Khôi") diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/khoi.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/khoi.m new file mode 100644 index 0000000..54a9ea2 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/khoi.m @@ -0,0 +1,7 @@ + +fano1 = @(a, b) (b / a); +disp("anonymous function fanol"); +fano1(10,5) +[a,b]= swapValues(10,5) +disp("Nguyễn Đào Anh Khôi"); + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/lec4_loop.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/lec4_loop.m new file mode 100644 index 0000000..60f67ce --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/lec4_loop.m @@ -0,0 +1,66 @@ +close all +clear all +clc + +##for k=[1,2,3,4,5] +## s1=0.1 + 3*k; +##end +##printf('s1= %d', s1) +## +##for k=1:1:5 +## s2= 0.1 + 3*k; +## end +##printf('s2= %d\n', s2) +## +##for k=1:5 +## s3= 0.1 + 3*k; +## end +##printf('s3= %d \n', s3) + +##clear x; +## for k=[3,7,10] +## x(k) = 3 + 0.1*k; +## disp(x) +##end +##x = zeros(1,10); +## for k=[3,7,10] +## x(k) = 3 + 0.1*k; +## disp(x) +## end + +##N=1000; +##S=0; +##for k= 1:N; +## S=S+ 1/k^2; +## +##end +##printf('S= %d \n', S) +##row=4; +##col=3; +##for j=1:row +## for i=1:col +## A(j,i)=i+j; +## end +## end +## +## disp(A) +##N=100; +##k=1; +##S=0; +##while(1) +##S = S + 1/k^2; +##if k>N +## break; +##end +##k=k+1; +##end +##printf('S= %d \n', S) +##disp("Nguyễn Đào Anh Khôi"); +for col = 1:5 + for row = col:5 + fprintf('%d\t', col * row); + end + fprintf('\n'); +end + + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/lec4_sincos.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/lec4_sincos.m new file mode 100644 index 0000000..656ef8b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/lec4_sincos.m @@ -0,0 +1,16 @@ +% Taylor Series +% Date +% Calculate the expansion Taylor series ofcos(x) by using Vectorization met + +close all +clear all +clc + +N= 100; +n= 0:1:100; + +##S = sum((-1).^n.*(pi/3).^(2*n+1)./factorial(2*n+1)) +##S = sum((pi/3).^(n)./factorial(n)) +S = sum((-1).^n.*(pi/3).^(2*n)./factorial(2*n+1)) +disp("Nguyễn Đào Anh Khôi"); + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/new_swapValues.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/new_swapValues.m new file mode 100644 index 0000000..1377dfa --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/new_swapValues.m @@ -0,0 +1,6 @@ +a= 5; +b= 10; +fprintf("Before swapping: a = %d, b = %d\n", a, b); +[a, b] = swapValues(a, b); +fprintf("After swapping: a = %d, b = %d\n", a, b); +disp("Nguyễn Đào Anh Khôi"); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/quizzz2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/quizzz2.m new file mode 100644 index 0000000..ffafc73 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/quizzz2.m @@ -0,0 +1,24 @@ +clear all +close all +clc +x = 0.5; +eps = 0.0002; + +S = 0; +term = x; +k = 1; + +while abs(term) > eps + S = S + term; + k = k + 1; + term = (-1)^(k+1) * (x^k) / k; +end + +approximation = S; + +real_value = log(x); +error = abs(real_value - approximation); + +fprintf('Approximation: %.4f\n', approximation); +fprintf('Real Value: %.4f\n', real_value); +fprintf('Error: %.4f\n', error); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 4/swapValues.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/swapValues.m new file mode 100644 index 0000000..212bd02 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 4/swapValues.m @@ -0,0 +1,9 @@ +clear all; +close all; +clc; + +function [a, b] = swapValues(a, b) + temp = a; + a = b; + b = temp; +end diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_fano.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_fano.m new file mode 100644 index 0000000..656845f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_fano.m @@ -0,0 +1,6 @@ +clear all +close all +clc +fanol=@(x)(x^3 +x); +fanol(5) + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_func1.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_func1.m new file mode 100644 index 0000000..a4cfcd4 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_func1.m @@ -0,0 +1,6 @@ +clear all +close all +clc +x=5; +f1=8*x.^4+4*x.^3+3*x+1; +disp(f1) diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_func2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_func2.m new file mode 100644 index 0000000..2c2bd4d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_func2.m @@ -0,0 +1,9 @@ +clear all +close all +clc +x=5; +f1=8*x^4+4*x^3+3*x+1; +f2=x^3 +x; +f=[f1,f2] + + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_quiz3.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_quiz3.m new file mode 100644 index 0000000..0fdcbd7 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/EEEEIU22067_quiz3.m @@ -0,0 +1,8 @@ +clear all +close all +clc + +x=1:10; +NguyenDaoAnhKhoi_EEEEIU22067_func1(x) +NguyenDaoAnhKhoi_EEEEIU22067_func2(x) +fanol(x) diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/NguyenDaoAnhKhoi_EEEEIU22067_func2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/NguyenDaoAnhKhoi_EEEEIU22067_func2.m new file mode 100644 index 0000000..2c2bd4d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/NguyenDaoAnhKhoi_EEEEIU22067_func2.m @@ -0,0 +1,9 @@ +clear all +close all +clc +x=5; +f1=8*x^4+4*x^3+3*x+1; +f2=x^3 +x; +f=[f1,f2] + + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/Plot.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/Plot.m new file mode 100644 index 0000000..2717890 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/Plot.m @@ -0,0 +1,28 @@ +clear all +close all +clc + +##%plot based on the record +##% x = 3, y = 4 +##plot([3 3],[4 3],'-',"Markersize",20,"linewidth",5) +##hold on +##plot([5 4],[5 2],'-.s',"Markersize",20,"linewidth",5) +##%change the range of display +##%xmin xmax ymin ymax +##axis([0 5 0 5]) +## +##grid on +##title('My first plotting {x_2^3}') +##ylabel("y axis (unit)") +##xlabel("x axox (unit)") +% Define the coordinates of the star vertices +x = [0, 0.3, 0.5, 0.7, 1, 0.7, 0.5, 0.3, 0, 0.5]; +y = [1, 0.3, 0, 0.3, 1, 0.7, 0.3, 0, 0.3, 1]; + +% Plot the star +plot(x, y, '-o'); +axis equal; % Set equal axis scaling for a more accurate representation +title('Star Plot'); + + + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/Quiz1.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/Quiz1.m new file mode 100644 index 0000000..8e62776 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/Quiz1.m @@ -0,0 +1,24 @@ +clear all +close all +clc + + +##S = 1; % Initialize S_0 +##T = 1; % Initialize T_0 +##n = 1; % Initialize n +## +##while abs(T) >= 1e-14 +## T = (-1)^n / (2 * n + 1)^(3 * n); +## S = S + T; +## n = n + 1; +##end + +for i = 1:5 + fprintf('%4d',i*[1:i]) + fprintf('\n') +end + +##N=100; +##n=0:1:100; +## +##S= sum((-1).^n./factorial((2*n+1)*(3.^n.))) diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/plot function.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/plot function.m new file mode 100644 index 0000000..22e2181 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/plot function.m @@ -0,0 +1,20 @@ +clear all +close all +clc + +%plot function +x= -2:0.01:2; +% define function +fano = @(x) (x.^3-3*x+1)); +y =fano(x); +a=-2; +b=2; + +%plotting +plot(x,y,'r--',"linewidth",6) +axis([-2 2 -2 6]) +grid on +title('Nguyen Dao Anh Khoi - Function {f_1(x) =x^3-3*x+1}') +ylabel("y axis (unit)") +xlabel("x axox (unit)") + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/privatefunction1.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/privatefunction1.m new file mode 100644 index 0000000..795c922 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/privatefunction1.m @@ -0,0 +1,2 @@ + +privatefunction1=x.^3 +x diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/privatefunction2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/privatefunction2.m new file mode 100644 index 0000000..62acd91 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/privatefunction2.m @@ -0,0 +1,2 @@ +privatefunction2=8*x.^4+4*x.^3+3*x+1 + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 5/test.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/test.m new file mode 100644 index 0000000..422321e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 5/test.m @@ -0,0 +1,38 @@ +clear all +close all +clc +fano = @(x) (cos(x)-x.*exp(x/10)); +y =fano(x); +a=-5; +b=5; +fano = @(x) (cos(x)-x.*exp(x/10)); +y =fano(x); +for x=1:1:100; + +if fano(a)*fano(b)<=0 + c=(a+b)/2; + if fano(a)*fano(c)<=0 + b=c; + endif + if fano(c)*fano(b)<=0 + a=c; + endif + if abs(f(c))<0.01 + root find =1; + break + endif + endif + end +if (root_find =1) + sprintf("Root is at x=%4f2\n\r",c) +elseif + sprintf("there is not root \n\r") +endif +%plotting +plot(x,y,'r--'."linewidth",6) +if (root_find =1) + hold on + plot(c,fano(c),'gd',"markersize",20) + hold on + plot(c*ones(1,length(-8:0.001:4)) + end diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_fano.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_fano.m new file mode 100644 index 0000000..5cd4aed --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_fano.m @@ -0,0 +1,4 @@ +clc +fano =@(x)(x.^3 +x); +fano (5) + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_func1.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_func1.m new file mode 100644 index 0000000..d8f35ca --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_func1.m @@ -0,0 +1,5 @@ +clc +function result= NguyenDaoAnhKhoi_EEEEIU22067_func1(x) + result = 8 * x.^4 + 4 * x.^3 + 3 * x + 1; + end +NguyenDaoAnhKhoi_EEEEIU22067_func1(2) diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_func2.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_func2.m new file mode 100644 index 0000000..a705bd2 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_func2.m @@ -0,0 +1,4 @@ +function result = NguyenDaoAnhKhoi_EEEEIU22067_func2(x) + result = [NguyenDaoAnhKhoi_EEEEIU22067_func1(x), x.^3 + x]; +end +NguyenDaoAnhKhoi_EEEEIU22067_func2(5) diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_quiz3.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_quiz3.m new file mode 100644 index 0000000..4198b01 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/NguyenDaoAnhKhoi_EEEEIU22067_quiz3.m @@ -0,0 +1,21 @@ +clc; +x_values = 0:10; + +% Evaluate functions using yourName_YourID_func1 +result_f1 = NguyenDaoAnhKhoi_EEEEIU22067_func1(x_values); + +% Evaluate functions using yourName_YourID_func2 +result_f2 = NguyenDaoAnhKhoi_EEEEIU22067_func2(x_values); + +% Evaluate function using yourName_YourID_fano +result_fano = fano(x_values); + +% Display the results +disp('Results for f1(x):') +disp(result_f1) + +disp('Results for f2(x):') +disp(result_f2) + +disp('Results for fano(x):'); +disp(result_fano) diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/b.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/b.m new file mode 100644 index 0000000..8685ccc --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/b.m @@ -0,0 +1,20 @@ +clc + +% Define the function +function y = f(x) + y = x.^3 - 3*x + 1; +end + +% Generate x values within the interval +x_values = linspace(-2, 2, 1000); + +% Calculate corresponding y values +y_values = f(x_values); + +% Plot the function +plot(x_values, y_values, 'LineWidth', 2); +grid on; +title('Nguyễn Đào Anh Khôi f(x) = x^3 - 3x + 1'); +xlabel('x'); +ylabel('f(x)'); + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/c.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/c.m new file mode 100644 index 0000000..3348066 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/c.m @@ -0,0 +1,54 @@ +clear all +close all +clc + +%plot function +x= -2:0.01:2; +% define function f(x) +fx= @(x) (x.^3-3*x+1); +y =fx(x); +% define function f(x) +df = @(x) (3*x.^2-3); +%calculate value fx on the interval [-2,2] +y =fx(x); +%define 1000 steps to iterate +N=1000; +%define a varible to check the roots condition +isroot = 0; +%define error +err=0.001; +%define interval [a,b] +a=-2; +b=2; +x0=2; +%check the necessary condition +if fx(a)*fx(b) <= 0 +%loop start here with N steps +for k=1:N + if abs(fx(x0))<= err; + isroot = 1; + rootis = x0; + break; + endif + if df(x0)==0 + x0=rand; + endif + x1=x0-fx(x0)/df(x0); + x0=x1; +end +endif +%plotting +plot(x,y,'r-',"linewidth",2) +if isroot == 1 + fprintf("Root Found %f\n", x0); + hold on; + plot(x0, fx(x0), 'db', 'Markersize', 20); + hold on; + plot([x0, x0], [-2, 6], '--o', 'LineWidth', 2); +end +axis([-2 2 -2 6]) +grid on +title('Nguyen Dao Anh Khoi - Function {f_1(x) =x^3-3*x+1}') +ylabel('Function f_1(x)'); +xlabel('x axis (unit 0.01 increment)'); + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/intro tocomp.zip b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/intro tocomp.zip new file mode 100644 index 0000000..01661be Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/intro tocomp.zip differ diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 6/privatefunction.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/privatefunction.m new file mode 100644 index 0000000..c060029 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 6/privatefunction.m @@ -0,0 +1,27 @@ +## Copyright (C) 2023 Admin +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . + +## -*- texinfo -*- +## @deftypefn {} {@var{retval} =} privatefunction (@var{input1}, @var{input2}) +## +## @seealso{} +## @end deftypefn + +## Author: Admin +## Created: 2023-11-13 + +function retval = privatefunction (input1, input2) + +endfunction diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 7/a.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 7/a.m new file mode 100644 index 0000000..f6bbb97 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 7/a.m @@ -0,0 +1,36 @@ +clear all +close all +clc + +%plot function +x= -2:0.01:5; +% define function f(x) +%fx= @(x) (3.*x-2); +fx= @(x) (x.^2-x-2); +y =fx(x); +%define horizontal - x axis +y0=zeros(1,length(x)); + +%we divide the interval into N slice +N=100; +increment=(abs(-2)+5)/N; +xx=-2:increment:5; +%integration calculation +S=0; +for k=1:1:N + S=S+0.5*increment*(fx(xx(k))+fx(xx(k+1))); +end +fprintf("Intergration value is %d",S) +plot(x,y,'b-',"linewidth",2) +hold on +plot(x,y0,'r-',"linewidth",2) +%plot the slice\ +for k=1:1:length(xx) +hold on +plot([xx(k) xx(k)],[0 fx(xx(k))],'r--',"linewidth",2); +end +axis([-2 5 -10 fx(5)]) +grid on +title('Nguyen Dao Anh Khoi - Function {f_1(x) =x.^2-x-2}') +ylabel('Function f_1(x)'); +xlabel('x axis (unit 0.01 increment)'); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 7/b.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 7/b.m new file mode 100644 index 0000000..c0fdb78 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 7/b.m @@ -0,0 +1,47 @@ +clear all +close all +clc + +%plot function + +x= 2:0.01:10; +% define function f(x) +%fx= @(x) (3.*x-2); +fx= @(x) (1./((x+1).*(x+2))); +interval =[2,10]; +y =fx(x); +%define horizontal - x axis +y0=zeros(1,length(x)); + +%we divide the interval into N slice +N=1000; +increment=(10-2)/N; +xx=2:increment:10; +Sreal=log(11/12)-log(3/4); +printf("Intergration exact value is %4f2 \n",Sreal) +%define error comparing to rela value +error = 0.0001 +%integration calculation +S=0; +for k=1:1:N + S=S+0.5*increment*(fx(xx(k))+fx(xx(k+1))); + if abs(S-Sreal) < error + printf("Intergration Value within 0.0001 error is %4f2 \n",error,S); + printf("Algorithm stop at %d\n",k); + break + endif +end +fprintf("Intergration value is %d \n",S) +plot(x,y,'b-',"linewidth",2) +hold on +plot(x,y0,'r-',"linewidth",2) +%plot the slice\ +for k=1:1:length(xx) +hold on +plot([xx(k) xx(k)],[0 fx(xx(k))],'r--',"linewidth",2); +end +axis([2 10]) +grid on +title('Nguyen Dao Anh Khoi - Function {f_1(x) =1/(x+a)(x+b)}') +ylabel('Function f_1(x)'); +xlabel('x axis (unit 0.01 increment)'); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 7/c.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 7/c.m new file mode 100644 index 0000000..d7eb4e4 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 7/c.m @@ -0,0 +1,49 @@ +clear all; +close all; +clc; + +%input matrix A +A = [2 1 3;2 6 8;6 8 18] +%Nguyễn Đào Anh Khôi +%input col vector b +b=[1;3;5] +%create an augment matrix [A|b] +M=[A b] +%demo some matrix operation +%get the first row of matrix A +A(1,:) +%get the diagnal element of any rows, says first row +A(1,1) +%A(2,2) +% apply row elementary operations on the 1st column +%says row1 =row 1/diagonal element of row 1 +A(1,:) = A(1,:)/A(1,1) +%Gausian Elimination +%forward step +%pivot come to 1 +M(1,:)= M(1,:)/ M(1,1); +%make other number come to zero +M(2,:)= M(2,:)-M(1,:).*M(2,1); +M(3,:)= M(3,:)-M(1,:).*M(3,1); + +%step 2: make 2rd pivot to zero +M(2,:)= M(2,:)/ M(2,2); +%keep make other number come to zero: 2rd time +M(3,:)= M(3,:) - M(2,:).*M(3,2); + + +%step 3: make 3rd pivot to zero +M(3,:)= M(3,:)/ M(3,3); + +%%Back- substition +x= zeros(3,1); +%Substep 1 +x(3,1)= M(3,4) / M(3,3) +%Substep 2 +x(2,1)= 2/5 - x(3,1) +%Substep 3 +x(1,1)= 1/2-1/2*x(2,1)-3/2*x(3,1) + + +printf(' solution is \n '); + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 8/a.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 8/a.m new file mode 100644 index 0000000..247d237 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 8/a.m @@ -0,0 +1,12 @@ +clear all +close all +clc +N=3; +sequence = []; +for i=1:N; + for j=i:N; + sequence = [sequence; i j]; + end + endfor + %DIsplay the squences + disp(sequence); diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 8/b.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 8/b.m new file mode 100644 index 0000000..c617afa --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 8/b.m @@ -0,0 +1,50 @@ +clear all +close all +clc; + +%input matrix A +A= [3 2 1 1;1 -1 4 -1;-2 -2 -3 1;1 5 -1 2]; +%input col vector b +b=[-2;-1;9;4] +%create an augment for +M=[A b] + +%get the dimension +% nrow - number of rows +% mcol - number of columns +[nrow, mcol]=size (M); +%forward step +for i=1:nrow + for j=i:nrow + printf("substep %d and %d-th row operation \n \r",i,j) + %this is substep i - j-th row operation + % detect the pivot row j=i + %apply row op with pivot row + if (j==i) + printf("substep %d - pivot row %d - pivot element %4f\n\r",i,j,M(i,j)) + %check pivot element is different to zeros + if (M(i,j) !=0)\ + %if pivot is diffent to zeros + %apply the row op with pivot row + M(j,:) = M(j,:)/M(j,j); + else + printf("Infinite or no solution \r\n") + %we stop + break; + endif + else + %case j!=1 - it is not pivot row + %we eliminate element below pivot element + M(j,:) = M(j,:) - M(j,i)*M(i,:); + endif + endfor +endfor +%back substitution step +%initialize solution x +x=zeros(nrow,1); +%last element of x +x(nrow,1)= M(nrow,mcol); +for i=(nrow-1):-1:1 + x(i,1) = M(i,mcol)- sum(M(i,(i+1):nrow).*x((i+1):nrow,1)'); +endfor +x diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 9/a.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 9/a.m new file mode 100644 index 0000000..3a43347 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 9/a.m @@ -0,0 +1,36 @@ +clear all +close all +clc; + +x1 = 0 :pi/40:2*pi; +x = 0 :pi/4:2*pi; +%we measure 8 points + +v = sin(x); +v1 = sin(x1); + +plot(x,v,'-'); +hold on +plot(x1,v1,'o-'); + + %we want to interpolate the value + %at + xq1 = pi/8:pi/4:2*pi; + vq1= interp1(x,v,xq1,'linear'); +%SPline interpolation + + vq2 = interp1(x,v,xq1,'spline'); + +% Plot xq1 and xq2 +plot(xq1, vq1, 'kv', 'MarkerSize', 10); +plot(xq1, vq2, 'r^', 'MarkerSize', 10); + +xlim([0 2*pi]); +title('(Default) Linear Interpolation', 'FontSize', 16); +grid on +xlim([0 2*pi]); +title('(Default) Linear Interpolation-Nguyen Dao Anh Khoi', 'FontSize', 16); +grid on + + + diff --git a/Introduction to Computer for Engineers_Minh/Documents/lecture 9/b.m b/Introduction to Computer for Engineers_Minh/Documents/lecture 9/b.m new file mode 100644 index 0000000..0595c8c --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/lecture 9/b.m @@ -0,0 +1,35 @@ +clear all +close all +clc; + +%we measure 6 points +%x - voltage (Volts) +x = [0 5 10 15 20 25]; +%y - current (Ampe) +y = [0.001 0.881 2.1637 3.1827 0 4.961]; +%matrix A +A= [ length(x) sum(x); + sum(x) sum(x.^2)] +b= [sum(y); sum(x.*y)] +a = inv(A)*b +% calculate first order polynomial +%line that fit the dataset +yest = a(2,1)*x + a(1,1); + +%sum of square of error +sum((y-yest).^2) + +%use polyfit - hypothesis first order +apoly = polyfit(x,y,1) +%use polyfit - hypothesis second order +apoly2= polyfit(x,y,2) +yest2 = apoly2(1,3).*x.^2 + apoly2(1,2).*x + apoly2(1,1) +%plot dataset +plot(x,y,'ro','MarkerSize',6) +%plot first order polynomial that best +%to the dataset +hold on +plot(x,yest, 'b-','linewidth',2) +xlim([0 25]); +title('(Default) Linear Interpolation', 'FontSize', 16); +grid on diff --git a/Introduction to Computer for Engineers_Minh/Documents/quiz/a.m b/Introduction to Computer for Engineers_Minh/Documents/quiz/a.m new file mode 100644 index 0000000..06e3e07 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Documents/quiz/a.m @@ -0,0 +1,53 @@ +clear all +close all +clc + +%plot function +x= 1:0.01:3; +% define function f(x) +fx= @(x) (x.^2-x-2); +y =fx(x); +% define function f(x) +df = @(x) (2*x-1); +%calculate value fx on the interval [-2,2] +y =fx(x); +%define 1000 steps to iterate +N=1000; +%define a varible to check the roots condition +isroot = 0; +%define error +err=0.001; +%define interval [a,b] +a=1; +b=3; +x0=2; +%check the necessary condition +if fx(a)*fx(b) <= 0 +%loop start here with N steps +for k=1:N + if abs(fx(x0))<= err; + isroot = 1; + rootis = x0; + break; + endif + if df(x0)==0 + x0=rand; + endif + x1=x0-fx(x0)/df(x0); + x0=x1; +end +endif +%plotting +plot(x,y,'r-',"linewidth",2) +if isroot == 1 + fprintf("Root Found %f\n", x0); + hold on; + plot(x0, fx(x0), 'db', 'Markersize', 20); + hold on; + plot([x0, x0], [-3, 3], '--o', 'LineWidth', 2); +end +axis([1 3 -3 3]) +grid on +title('Nguyen Dao Anh Khoi - Function {f_1(x) =x^2-x-2}') +ylabel('Function f_1(x)'); +xlabel('x axis (unit 0.01 increment)'); diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex1.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex1.m new file mode 100644 index 0000000..000ba97 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex1.m @@ -0,0 +1,4 @@ +%Ex1. First Octave program +a = 3; +b = 5; +c = a + b diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex2.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex2.m new file mode 100644 index 0000000..3fee62a --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex2.m @@ -0,0 +1,4 @@ +%Ex2. The meaning of "a=b" +a = 3; +b = a; +b diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex3.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex3.m new file mode 100644 index 0000000..2a589f1 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex3.m @@ -0,0 +1,4 @@ +%Ex.3 The meaning of "a=b", continued +a = 3; +a = a + 1; +a diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex4.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex4.m new file mode 100644 index 0000000..a5e6d8f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex4.m @@ -0,0 +1,4 @@ +%Ex.4 Basic math operations +a = 3; +b = 9; +c = 2*a + b^2 - a*b + b/a - 10 diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex5.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex5.m new file mode 100644 index 0000000..cec4175 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex5.m @@ -0,0 +1,2 @@ +%Ex.5 Formatted output +fprintf('Hello') diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex6.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex6.m new file mode 100644 index 0000000..2ab4e7d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 1/Ex6.m @@ -0,0 +1,8 @@ +%Ex.6 Formatted output +a = 3; +b = a*a; +c = a*a*a; +d = sqrt(a); +printf('%2u square equals to %2u \n', a, b) +printf('%2u cube equals to %2u \n', a, c) +printf('The square root of %2u is %2u \n', a, d) diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 2/Matrices.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 2/Matrices.m new file mode 100644 index 0000000..f3cbc34 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 2/Matrices.m @@ -0,0 +1,2 @@ +a = [1 2 3 4] + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/DOMINHDUY_ITITSB22029.zip b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/DOMINHDUY_ITITSB22029.zip new file mode 100644 index 0000000..1e9f20a Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/DOMINHDUY_ITITSB22029.zip differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/New folder/F_to_C.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/New folder/F_to_C.m new file mode 100644 index 0000000..8d2ccde --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/New folder/F_to_C.m @@ -0,0 +1,5 @@ +%Ex3_2 Convert from Fahrenheit to Celsius +function celsius = F_to_C(fahr) + % This function converts Fahrenheit to Celsius. + celsius = (fahr - 32) * 5 / 9; +end diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/New folder/swap.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/New folder/swap.m new file mode 100644 index 0000000..9b2568d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/New folder/swap.m @@ -0,0 +1,7 @@ +%Ex3_1 Swap two values +function [ a , b ] = swap ( a , b ) +% The function swap receives two values, swaps them + temp = a; + a = b; + b = temp; +end diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/F_to_C_temp.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/F_to_C_temp.m new file mode 100644 index 0000000..8941f4e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/F_to_C_temp.m @@ -0,0 +1,4 @@ + +function ctemp = F_to_C_temp (ftemp) +ctemp = (5/9)*(ftemp-32); +endfunction diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/basicStat.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/basicStat.m new file mode 100644 index 0000000..9806fea --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/basicStat.m @@ -0,0 +1,12 @@ +function [mymean , myvar , mystd] = basicStat (darray) + N = length(darray); + + mymean = sum(darray) / N; + myvar = 0; + + for i=1:N + myvar = myvar + (darray(i)-mymean)^2; + endfor + myvar = myvar / N; + mystd = sqrt(myvar); +endfunction diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/inclass.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/inclass.m new file mode 100644 index 0000000..1fab518 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/inclass.m @@ -0,0 +1,29 @@ +clc, clear,close all +ftemp = 50; +ctemp = F_to_C_temp (ftemp); +fprintf("%d C equals to %d F", ctemp, ftemp) + + +scrad = [30 , 40 , 50]; +for i=1:length(scrad) + +[vol,area] = mathSphere (scrad(i)); +fprintf("\n\n For radius: %d", scrad(i)) +fprintf("\n For vol: %d", vol) +fprintf("\n For area: %d", area) +end + + +darray = randn(10e4 , 1); +[mymean , myvar , mystd] = basicStat (darray); +fprintf("\n\n Mean of array: %d", mymean) +fprintf("\n Variance of array: %d", myvar) +fprintf("\n Stadard deviation of array: %d", mystd) + + +initial_height = 100; +initial_velocity = 20; +time_hit_ground = objhitground (initial_height , initial_velocity); +fprintf("Time to hit ground: %d ", time_hit_ground) + + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/mathSphere.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/mathSphere.m new file mode 100644 index 0000000..7bc1fe7 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/mathSphere/mathSphere.m @@ -0,0 +1,7 @@ + +function [vol,area] = mathSphere (scrad) + + vol = (4/3) * pi * scrad^3; + area = 4*pi*scrad^2; + +endfunction diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/DOMINHDUY_ITITSB22029.pdf b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/DOMINHDUY_ITITSB22029.pdf new file mode 100644 index 0000000..92d139b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/DOMINHDUY_ITITSB22029.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/objhitground.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/objhitground.m new file mode 100644 index 0000000..3bcb172 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/objhitground.m @@ -0,0 +1,3 @@ +function time_hit_ground = objhitground (initial_height , initial_velocity) + time_hit_ground = (-initial_velocity - sqrt(initial_velocity^2 - 2 * (-9.8) * initial_height)) / (-9.8); +endfunction diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/quizz1.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/quizz1.m new file mode 100644 index 0000000..72568d4 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 3/objhitground/quizz1.m @@ -0,0 +1,5 @@ + +initial_height = 100; +initial_velocity = 20; +time_hit_ground = objhitground (initial_height , initial_velocity); +fprintf("Time to hit ground: %d ", time_hit_ground) diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/Screenshot 2024-04-14 144757.png b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/Screenshot 2024-04-14 144757.png new file mode 100644 index 0000000..dc7d662 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/Screenshot 2024-04-14 144757.png differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/calc_grade.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/calc_grade.m new file mode 100644 index 0000000..8ff636a --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/calc_grade.m @@ -0,0 +1,14 @@ + +function [ave_grade] = calc_grade(grades) + N_exams = length(grades); + ave_grade = sum(grades) / N_exams; + disp('The average of grade is: '); + disp(ave_grade); + + if (ave_grade < 50) + disp('The student did not pass the course!'); + else + disp('The student passed the course!'); + endif + +endfunction diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/calc_tip.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/calc_tip.m new file mode 100644 index 0000000..d537805 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/calc_tip.m @@ -0,0 +1,16 @@ + +function tip = calc_tip (bill) + + if (bill <= 10) + tip = 1.80; + elseif (bill <= 60) + tip = bill * 0.15; + else + tip = bill * 0.20; + endif + + disp('Tip amount is: '); + disp(tip); +endfunction + + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/switchTest.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/switchTest.m new file mode 100644 index 0000000..7cb3c43 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 4/switchTest.m @@ -0,0 +1,17 @@ +grade = input('Enter your grade: ', 's'); + + switch (grade) + case {'A' 'a'} + fprintf('Excellent\n'); + case 'B' + fprintf('Well done\n'); + case 'C' + fprintf('Good\n'); + case 'D' + fprintf('You passed\n'); + case 'F' + fprintf('Better try again\n'); + otherwise + fprintf('Invalid\n'); + endswitch + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex1.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex1.m new file mode 100644 index 0000000..41f1700 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex1.m @@ -0,0 +1,36 @@ +% Given vector +V = [17 8 12 15 6 11 9 18 16 10 13 19]; + +% a. Calculate length, sizes, number of rows, and number of columns +vector_length = length(V); +vector_size = size(V); + +num_rows = size(V, 1); +num_cols = size(V, 2); +% [num_rows, num_cols] = size(V) + +% b. Calculate sum of vector elements +sum_of_elements = sum(V); + +% c. Calculate average of vector +average = mean(V); + +% e. Calculate differences between adjacent elements +differences = diff(V); + +% d. Calculate the standard deviation of this vector +sum_squared_diff = sum((V - average).^2); +N = numel(V); +std_dev = sqrt(sum_squared_diff / (N - 1)); + +% Display results +disp(['Length of vector: ' num2str(vector_length)]); +disp(['Size of vector: ' num2str(vector_size)]); +disp(['Number of rows: ' num2str(num_rows)]); +disp(['Number of columns: ' num2str(num_cols)]); +disp(['Sum of vector elements: ' num2str(sum_of_elements)]); +disp(['Average of vector: ' num2str(average)]); +disp(['Standard deviation of the vector: ' num2str(std_dev)]); +disp('Differences between adjacent elements:'); +disp(differences); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex2.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex2.m new file mode 100644 index 0000000..49e8fb8 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex2.m @@ -0,0 +1,28 @@ +% Set display format +format short g; + +% a. Create a vector t with 51 equidistant elements from -25 to 25 +t = linspace(-25, 25, 51)'; +disp('Vector t:'); +disp(t); + +% b. Calculate the vector x = t^2 +x = t.^2; +disp('Vector x = t^2:'); +disp(x); + +% c. Calculate the vector y = t^3 in reverse order +y = flip(t.^3); +disp('Vector y = t^3 in reverse order:'); +disp(y); + +% d. Calculate the sum of all even values in vector x +even_values_x = x(mod(x, 2) == 0); +sum_even_x = sum(even_values_x); +disp(['Sum of even values in vector x: ' num2str(sum_even_x)]); + +% e. Calculate the sum of all positive values in vector y +positive_values_y = y(y > 0); +sum_positive_y = sum(positive_values_y); +disp(['Sum of positive values in vector y: ' num2str(sum_positive_y)]); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex3.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex3.m new file mode 100644 index 0000000..29dfe0d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex3.m @@ -0,0 +1,22 @@ +% a. Create a column vector t with elements from 1 to 10 with spacing of 0.5 +t = (1:0.5:10)'; +disp('Vector t:'); +disp(t); + +% b. Create a matrix A with columns t, t^2, t^3, and t^4 +A = [t t.^2 t.^3 t.^4]; +disp('Matrix A:'); +disp(A); + +% c. Add one more column to the right with 1 if t > 5 and 0 otherwise +column_c = (t > 5); +A = [A column_c]; +disp('Matrix A with additional column based on t > 5:'); +disp(A); + +% d. Add one more column to the right with 5 if t is an integer and 0 otherwise +column_d = (mod(t, 1) == 0) * 5; +A = [A column_d]; +disp('Matrix A with additional column based on integer values of t:'); +disp(A); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex4.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex4.m new file mode 100644 index 0000000..427761f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex4.m @@ -0,0 +1,10 @@ +% Define three integers +a = 10; +b = 5; +c = 8; + +% Find the minimum +min_value = min([a, b, c]); + +disp(['The minimum value is: ', num2str(min_value)]); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex5.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex5.m new file mode 100644 index 0000000..640e7be --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex5.m @@ -0,0 +1,8 @@ +% Define a vector +vector = [3, 7, 1, 9, 4]; + +% Find the maximum +max_value = max(vector); + +disp(['The maximum value in the vector is: ', num2str(max_value)]); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex6.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex6.m new file mode 100644 index 0000000..4661be6 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Ex6.m @@ -0,0 +1,20 @@ +% Initialize counters +even_count = 0; +odd_count = 0; + +% Read 10 integers +for i = 1:10 + integer = input(['Enter integer ', num2str(i), ': ']); + + % Check if the integer is even or odd + if mod(integer, 2) == 0 + even_count = even_count + 1; + else + odd_count = odd_count + 1; + end +end + +% Display the counts +disp(['Number of even integers: ', num2str(even_count)]); +disp(['Number of odd integers: ', num2str(odd_count)]); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Exercises MATLAB 1.pdf b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Exercises MATLAB 1.pdf new file mode 100644 index 0000000..6bc6f83 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Exercises MATLAB 1.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Screenshot 2024-04-14 161159.png b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Screenshot 2024-04-14 161159.png new file mode 100644 index 0000000..ab1381f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 5/Screenshot 2024-04-14 161159.png differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_a.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_a.m new file mode 100644 index 0000000..20584d2 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_a.m @@ -0,0 +1,17 @@ +% Prompt the user to input the value of T +T = input('Enter the value of T: '); + +% Calculate h(T) based on the conditions +if T > 0 + h = T - 10; +elseif T >= 100 + h = 0.45*T + 900; +else + % Print "Invalid" and stop script + fprintf('Invalid\n'); + return; +end + +% Display the result +fprintf('h(%d) = %d\n', T, h); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_b.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_b.m new file mode 100644 index 0000000..e9b3bb7 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_b.m @@ -0,0 +1,13 @@ +% Generate a random integer vector with 1,000,000 elements +vector_length = 1000000; +random_vector = randi([-1000, 1000], 1, vector_length); + +% Calculate the sum of the squares of the elements using a for loop +sum_of_squares = 0; +for i = 1:length(random_vector) + sum_of_squares = sum_of_squares + random_vector(i)^2; +end + +% Display the sum of the squares +fprintf('Sum of the squares of the elements: %d\n', sum_of_squares); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_c.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_c.m new file mode 100644 index 0000000..2af853a --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_c.m @@ -0,0 +1,28 @@ +% Initial balance +a = input('Enter the initial balance: '); + +% Target balance +target_balance = 2 * a; + +% Annual interest rate +annual_interest_rate = 0.10; + +% Initialize variables +accumulated_amount = a; +years = 0; + +% Loop until accumulated amount doubles initial balance +while accumulated_amount < target_balance + % Calculate interest for the current year + interest = annual_interest_rate * accumulated_amount; + + % Update accumulated amount + accumulated_amount = accumulated_amount + interest; + + % Increment years + years = years + 1; +end + +% Display the number of years +fprintf('It takes %d years for the accumulated amount to double the initial balance.\n', years); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_d.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_d.m new file mode 100644 index 0000000..7ce4888 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex1/Ex1_d.m @@ -0,0 +1,19 @@ +% Initialize variables +sum = 0; +n = 0; + +% Loop until the sum exceeds 1000 +while sum < 1000 + % Increment n + n = n + 1; + + % Add the square of n to the sum + sum = sum + n^2; +end + +% Since the loop breaks when sum exceeds 1000, decrement n by 1 to get the maximum value +n = n - 1; + +% Display the maximum value of n +fprintf('The maximum value of n such that the expression is less than 1000 is: %d\n', n); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex2/Ex2_a.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex2/Ex2_a.m new file mode 100644 index 0000000..b15739f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex2/Ex2_a.m @@ -0,0 +1,22 @@ +% Display initial greeting +disp('Hello, what are you saying?'); + +% Start conversation loop +while true + % Prompt user for input + user_input = input('You: ', 's'); + + % Break the loop if user enters 'bye' + if strcmpi(user_input, 'bye') + disp('Chat Bot: Goodbye!'); + break; + end + + % Extract the last word from the user input + words = strsplit(user_input); + last_word = words{end}; + + % Display response + disp(['Chat Bot: Really, ' last_word '?']); +end + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex2/Ex2_b.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex2/Ex2_b.m new file mode 100644 index 0000000..600443a --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex2/Ex2_b.m @@ -0,0 +1,25 @@ +% Example string +example_string = 'an hours sitting with a lazy dog and with the flowers'; + +% Convert the string to lowercase +example_string = lower(example_string); + +% Split the string into words +words = regexp(example_string, '\w+', 'match'); + +% Define articles to be excluded +articles = {'a', 'an', 'the'}; + +% Initialize word count +word_count = 0; + +% Count words excluding articles +for i = 1:length(words) + if ~ismember(words{i}, articles) + word_count = word_count + 1; + end +end + +% Display the word count +fprintf('Number of words excluding articles: %d\n', word_count); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_a.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_a.m new file mode 100644 index 0000000..d3a610f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_a.m @@ -0,0 +1,17 @@ +% Define the range for x +x = linspace(0, 2*pi, 1000); % 1000 points between 0 and 2*pi + +% Calculate y = sin(x) +y = sin(x); + +% Plot the graph +plot(x, y); + +% Label the axes and title +xlabel('x'); +ylabel('y = sin(x)'); +title('Plot of y = sin(x)'); + +% Add grid +grid on; + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_b.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_b.m new file mode 100644 index 0000000..66e3c5e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_b.m @@ -0,0 +1,17 @@ +% Define the range for x +x = linspace(-pi, pi, 1000); % 1000 points between -pi and pi + +% Calculate y = tan(sin(x)) - sin(tan(x)) +y = tan(sin(x)) - sin(tan(x)); + +% Plot the graph +plot(x, y); + +% Label the axes and title +xlabel('x'); +ylabel('y = tan(sin(x)) - sin(tan(x))'); +title('Plot of y = tan(sin(x)) - sin(tan(x))'); + +% Add grid +grid on; + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_c.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_c.m new file mode 100644 index 0000000..e0af9ec --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/Ex3/Ex3_c.m @@ -0,0 +1,41 @@ +% Define the range for t +t = linspace(0, pi, 1000); % 1000 points between 0 and pi + +% Calculate x and y using meshgrid +[x, y] = meshgrid(t); + +% Calculate the functions +func1 = -sin(t); +func2 = sin(x) + cos(y); +func3 = sin(x) .* cos(y); +func4 = sin(x).^2 - cos(y).^2; + +% Plot all four graphs in the same figure +figure; +subplot(2, 2, 1); +plot(t, func1); +title('-sin(t)'); +xlabel('t'); +ylabel('Function value'); + +subplot(2, 2, 2); +plot(t, func2); +title('sin(x) + cos(y)'); +xlabel('x'); +ylabel('Function value'); + +subplot(2, 2, 3); +plot(t, func3); +title('sin(x) * cos(y)'); +xlabel('x'); +ylabel('Function value'); + +subplot(2, 2, 4); +plot(t, func4); +title('sin^2(x) - cos^2(y)'); +xlabel('x'); +ylabel('Function value'); + +% Adjust the layout +sgtitle('Plot of Four Functions'); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/In-class Exercise 02.pdf b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/In-class Exercise 02.pdf new file mode 100644 index 0000000..d200101 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/In-class Exercise 02.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/In-class Exercise 02.rar b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/In-class Exercise 02.rar new file mode 100644 index 0000000..5a65814 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 6/In-class Exercise 02.rar differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex1.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex1.m new file mode 100644 index 0000000..6368a45 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex1.m @@ -0,0 +1 @@ +B = [1:7 ; 9:-2:-3; 4 8 16 32 64 128 256] diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex2.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex2.m new file mode 100644 index 0000000..cd3d66b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex2.m @@ -0,0 +1,58 @@ +u1 = [1 ; 2 ; 3]; +u2 = [-5 ; 2 ; 1]; +u3 = [-1 ; -3 ; 7]; + +A = [2 3 4; 7 6 5; 2 8 7]; + +disp('PART 1'); +disp('(b) Result:'); +disp(u1 + 3*u2 - u3/5) + +disp('(c) Dot product between u1 and u2:'); +disp(dot(u1, u2)) + +disp('(d) Product of A and u1:'); +disp(A * u1) + +disp('PART 2'); +% Calculate |u1|_2 +norm_u1_2 = norm(u1); % Euclidean norm + +% Calculate |u2|_1 +norm_u2_1 = norm(u2, 1); % L1 norm + +% Calculate |u3|_∞ +norm_u3_inf = norm(u3, Inf); % Infinity norm + +disp('(a) Norms:'); +disp(['|u1|_2: ' num2str(norm_u1_2)]); +disp(['|u2|_1: ' num2str(norm_u2_1)]); +disp(['|u3|_∞: ' num2str(norm_u3_inf)]); + +% Dimensions of matrix A +[m, n] = size(A); + +disp('(b) Dimensions of matrix A:'); +disp(['Number of rows: ' num2str(m)]); +disp(['Number of columns: ' num2str(n)]); + +% Determinant of A +det_A = det(A); + +% Inverse of A +inv_A = inv(A); + +disp('(c) Determinant and Inverse of matrix A:'); +disp(['Determinant of A: ' num2str(det_A)]); +disp('Inverse of A:'); +disp(inv_A); + +disp('PART 3'); +x1 = A \ u1; +disp('Solution to Ax = u1 using matrix left division (\):'); +disp(x1); + +x2 = inv(A) * u1; +disp('Solution to Ax = u1 using explicit matrix inversion:'); +disp(x2); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex3.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex3.m new file mode 100644 index 0000000..b8eed65 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex3.m @@ -0,0 +1,15 @@ +disp('(a) Result:'); + +A = [1; 1; 1]; + +B = [1 2 3 4 5]; + +A*B + +disp('(b) Result:'); +A = [0; 1; 2; 3; 4]; + +B = ones(1,3); + +A*B + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex4.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex4.m new file mode 100644 index 0000000..0936782 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex4.m @@ -0,0 +1,9 @@ +% Define the sentence +sentence = 'Write a script/function that splits following sentence into individual words'; + +% Split the sentence into words using the space delimiter +words = strsplit(sentence); + +% Display the words +disp(words); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex6.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex6.m new file mode 100644 index 0000000..4089696 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/Ex6.m @@ -0,0 +1,21 @@ +% Prompt the user to enter the length and the unit +lengthValue = input('Enter the length value: '); +unit = input('Enter the unit (mm, cm, in, or inch): ', 's'); + +% Convert length to millimeters based on the input unit +if strcmpi(unit, 'mm') + convertedLength = lengthValue; + unitString = 'millimeters'; +elseif strcmpi(unit, 'cm') + convertedLength = lengthValue * 10; + unitString = 'millimeters'; +elseif strcmpi(unit, 'in') || strcmpi(unit, 'inch') + convertedLength = lengthValue * 25.4; + unitString = 'millimeters'; +else + error('Invalid unit specified.'); +end + +% Display conversion result +fprintf('Converted %.2f %s to %.2f %s.\n', lengthValue, unit, convertedLength, unitString); + diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/In-class Exercise 03.docx b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/In-class Exercise 03.docx new file mode 100644 index 0000000..67eebe6 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/In-class Exercise 03.docx differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/In-class Exercise 03.rar b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/In-class Exercise 03.rar new file mode 100644 index 0000000..1139fed Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/In-class Exercise 03.rar differ diff --git a/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/tokenizer.m b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/tokenizer.m new file mode 100644 index 0000000..310db16 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Exercises/Exercises 7/tokenizer.m @@ -0,0 +1,40 @@ +function tokenizer() + % Read text input and separator from the user + str = input('Enter the text: ', 's'); + sep = input('Enter the separator: ', 's'); + + % Split the input text into individual parts based on the separator + parts = strsplit(str, sep); + + % Initialize variables to store individual words and their vowel counts + words = cell(1, numel(parts)); + vowel_counts = zeros(1, numel(parts)); + + % Iterate over each part + for i = 1:numel(parts) + % Store the individual part + words{i} = parts{i}; + + % Count the number of vowels in the individual part + vowel_counts(i) = countVowels(parts{i}); + end + + % Display the individual words and their vowel counts + disp('Individual Words | Vowel Counts'); + disp('--------------------------------'); + for i = 1:numel(parts) + fprintf('%-16s | %d\n', words{i}, vowel_counts(i)); + end +end + +function count = countVowels(word) + % Define vowels + vowels = 'aeiou'; + + % Convert the word to lowercase + word = lower(word); + + % Count the number of vowels in the word + count = sum(ismember(word, vowels)); +end + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro 2/Ohm_laws.m b/Introduction to Computer for Engineers_Minh/Final Intro 2/Ohm_laws.m new file mode 100644 index 0000000..feddc0e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro 2/Ohm_laws.m @@ -0,0 +1,11 @@ +% Do not include data point V=20 +xdata = [0 5 10 15 25]; +ydata = [0.001 0.881 2.1637 3.1827 4.961]; +degree = 1; +% Linear relationship +coef = polyfit(xdata, ydata, degree); +xx = -5 : 0.5 : 30; +% Range for plotting +yy = polyval(coef, xx); +plot(xdata, ydata, 'o', xx, yy); +resistance = 1 / coef(1) % Output the answe diff --git a/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_2.m b/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_2.m new file mode 100644 index 0000000..bdee76c --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_2.m @@ -0,0 +1,9 @@ +% 1b +clc, clear + +syms x +a = 5; +o = 1; +u = 0; +y = 1 / (sqrt(2*pi*o^2) * exp(-(x-u)^2)/(2*o^2)) +double (int(y,-a,a)) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_3.m b/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_3.m new file mode 100644 index 0000000..2d0e83c --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_3.m @@ -0,0 +1,9 @@ +% 1c +clc, clear + +syms x +a = 5, b = 7 + +y = a^x + b^(1-x) +d = int(y,0,1) + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_4.m b/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_4.m new file mode 100644 index 0000000..cd15a63 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro 2/phuongtrinh_4.m @@ -0,0 +1,25 @@ +%2 + +clc, clear, close all + +h = [0 1.7 1.95 2.60 2.92 4.04 5.24]; +F = [0 2.6 3.6 4.03 6.45 11.22 30.61]; + +%a +p = polyfit(h,F,2) + +%b +hold off +hold on +plot(h, F, 'o'); +xi = linspace(0,12,100); +yi = polyval(p, xi); +plot (xi,yi); + +%c +Ffit = polyval(p, h); +Error = sum((F-Ffit).^2) + +F7m = polyval(p, 7) +F10m = polyval(p, 10) +F12m = polyval(p, 12) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro 2/tesstttttttt.m b/Introduction to Computer for Engineers_Minh/Final Intro 2/tesstttttttt.m new file mode 100644 index 0000000..e217ece --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro 2/tesstttttttt.m @@ -0,0 +1,13 @@ +xdata = [0 0.3000 1.0000 2.3000 3.5000 5.6000 7.5000 8.2000 9.7000]; +ydata = [4.9838 49.0727 31.0883 74.4117 107.8540 127.0157 371.8902 542.5732 863.1195]; + +for degree = 1:6 +coef{dgree} = polyfit(xdata, ydata, degree); +xx = 0:0.1:10; +yy = polyval(coef{degree}, xx); +figure(degree) +plot(xdata, ydata, 'o', xx, yy); +drawnow; +yfit=polyval(coef{degree},xdata); +Error_fit(degree)=sum((ydata-yfit).^2); +end diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_1.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_1.m new file mode 100644 index 0000000..4613ff6 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_1.m @@ -0,0 +1,13 @@ +% 1a. Solving a system equation +% solve system of linear equations of three variables + +clc, clear, close all + +syms x y z w; +eq1 = x+z+2*w == 6; +eq2 = y-2*z == -3; +eq3 = x+2*y - z == -2; +eq4 = -2*w + 2*x + y + 3*z == 0; + +% The output should be: x, y, z, w. +[x y z w] = solve(eq1,eq2,eq3,eq4) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_2.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_2.m new file mode 100644 index 0000000..2b18520 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_2.m @@ -0,0 +1,13 @@ +% 1b. Consider the following Normal +% Distribution and write a script to +% solve the corresponding integral +clc, clear, close all + +syms x +a = 5; +o = 1; +u = 0; +y = (1 / (sqrt(2*pi*o^2))) * exp((-(x-u)^2) / (2*o^2)) + +% Convert the result to double +d = double(int(y,-a,a)) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_3.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_3.m new file mode 100644 index 0000000..bdd774e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_3.m @@ -0,0 +1,11 @@ +% 1c, likely +clc, clear, close all + +syms x +a = 5; +b = 7; + +% Calculate the integral +y = a^x + b^(1-x) +d = int(y,0,1) + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_4.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_4.m new file mode 100644 index 0000000..a7ee90e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_4.m @@ -0,0 +1,37 @@ +% 2. Calculate the flow of water through a culvert +% is difficult. The reason is the flow channel is not +% uniform. + +clc, clear, close all + +h = [0 1.7 1.95 2.60 2.92 4.04 5.24]; +F = [0 2.6 3.6 4.03 6.45 11.22 30.61]; + +% a. Compute the best fit for 2nd degree polyminal +% (quadratic) for the above data. +% Print out the coefficient of polynomials. The +% output on command windows should be: +p = polyfit(h,F,2) + + +% b. Plot actual data and all fit polynomials +% (1st, 2nd, 3rd) on the same graph. Clearly indicate +% the degrees on the labels +hold off +hold on +plot(h, F, 'o'); +xi = linspace(0,12,100); +yi = polyval(p, xi); +plot (xi,yi); +title('DoMinhDuy-ITITSB22029 Problem 2.b'); + + +% c. Calculate the sum of the squares of the erros of +% this model. Calculate the flow rate for following +% hights of level of water +Ffit = polyval(p, h); +Error = sum((F-Ffit).^2) + +F7m = polyval(p, 7) +F10m = polyval(p, 10) +F12m = polyval(p, 12) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_5.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_5.m new file mode 100644 index 0000000..2c989a9 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_5.m @@ -0,0 +1,19 @@ +% 3 + +clc, clear, close all +syms x +y1 = x +y2 = (1/6)*x^2 + +% a. Plot 2 line +title('DoMinhDuy-ITITSB22029 Problem 3.a'); +hold off +hold on +ezplot(x,y1) +ezplot(x,y2) + +% b. Calculate the area of the region +% bounded by the y1 and y2 +y3 = (1/6)*x^2 - x +root = solve(y3) +Area = int ((y1 - y2), root(1), root(2)) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_6.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_6.m new file mode 100644 index 0000000..753430f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_6.m @@ -0,0 +1,18 @@ +% Code 3 Q_1 + +clc, clear, close all + +x = -2:0.01:4; +f_x = []; + +for q= 1:length(x) + if x(q) < 0 + f_x = [f_x -x(q)]; % -x + elseif x(q) <= 3 + f_x = [f_x 1]; % 1 + else + f_x = [f_x 2*x(q)]; % 2*x + endif +end + +plot (x, f_x , 'g', 'linewidth', 2,'markersize', 1 ) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_7.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_7.m new file mode 100644 index 0000000..c29db79 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_7.m @@ -0,0 +1,16 @@ +% Code 3 Q_2 for-loop + +clc, clear, close all + +n = input('Enter n: '); +F_n = 0; +f_n = []; + +for i=1:n + F_n = F_n + 1./((i+1).*i); + f_n = [f_n F_n]; +end + +plot (f_n, '-.r', 'linewidth', 2, 'markersize', 1) + + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_8.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_8.m new file mode 100644 index 0000000..f894cf8 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_8.m @@ -0,0 +1,17 @@ +% Code 3 Q_2 while-loop + +clc, clear, close all + +n = input('Enter n: '); +F_n = 0; +f_n = []; +i=1; + +while i < n+1 + F_n = F_n + 1./((i+1).*i); + f_n = [f_n F_n]; + i = i+1; +end +plot (f_n, '-.r', 'linewidth', 2, 'markersize', 1) + + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_9.m b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_9.m new file mode 100644 index 0000000..4943e59 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/BaiTapOn_9.m @@ -0,0 +1,22 @@ +% Code 3 Q_4 + +clc , clear, close all + +a = input('Enter a: '); +b = input('Enter b: '); +c = input('Enter c: '); + +alpha = input('Enter alpha: '); +beta = input('Enter beta: '); + +syms x +f_x = a*x^2 + b*x + c; +in1 = int(f_x,alpha,beta) +fprintf('Solution for integral using symbolic is: %.3f', double(in1)); + +subplot(2,1,1) +fplot(x1,double(subs(f_x,x1)), 'c--', 'linewidth', 1.25) +grid on +xlabel('x') +ylabel('f_x') +whitebg('black') diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/Bai_1.m b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_1.m new file mode 100644 index 0000000..c44971b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_1.m @@ -0,0 +1,35 @@ +% Bai_1 + +% a using symbolic. +clear, clc, close all +syms x2 y2 z2 w2 + + +one = x2 + y2 + z2 + w2 == 13; +two = 2*x2 + 3*y2 - w2 == -1; +three = -3*x2 + 4*y2 + z2 + 2*w2 == 10; +four = x2 + 2*y2 - z2 + w2 == 1; + +[x2 y2 z2 w2] = solve(one,two,three,four); + +% b using matrices. +A=[1 1 1 1; 2 3 0 -1; -3 4 1 2; 1 2 -1 1]; +B=[13; -1; 10; 1]; +C=inv(A)*B; + +fprintf('By using matrices \r') +fprintf('x1= %4.2f \r',C(1)) +fprintf('y1= %4.2f \r',C(2)) +fprintf('z1= %4.2f \r',C(3)) +fprintf('w1= %4.2f \r',C(4)) +fprintf('By using sympolic \r') +fprintf('x2= %4.2f \r',double(y2)) +fprintf('y2= %4.2f \r',double(z2)) +fprintf('z2= %4.2f \r',double(w2)) +fprintf('w2= %4.2f \r',double(x2)) + + + + + + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/Bai_2.m b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_2.m new file mode 100644 index 0000000..604faee --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_2.m @@ -0,0 +1,14 @@ +% Bai_2 +clc, clear, close all + +syms x +f = -6*x^2 + x + 120; +g = -x^3 + 7*x^2 - 10*x + 5; +hold on + +% a. Plotting symbolic function +ezplot(f) +ezplot(g) + +% b. Find the area +Area = int(f-g,-1,2) diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/Bai_3.m b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_3.m new file mode 100644 index 0000000..09711c5 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_3.m @@ -0,0 +1,21 @@ +% Bai_3 +clc, clear, close all + +v=1; +u=0; +syms x + +d=(1/(sqrt(2*pi*v))*exp(-((x-u)^2)/2*1)); + +% a. Find integration d +da=int(d,x) + +% b. Ploting symbolic function +ezplot(da,[-5 5]) +title('DoMinhDuy-ITITSB22029 Problem 3.b') + +% c. What is the value of +% d when a and b equal to -30 and 50, respectively +dxx=int(d,x,-30,50); +dc=double(dxx) + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/Bai_4.m b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_4.m new file mode 100644 index 0000000..67397a1 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_4.m @@ -0,0 +1,16 @@ +% Bai_4 + +clear all +clc +count=0; + +[name HW1 HW2 HW3 HW4 HW5 HW6 HW7 Mid Final]=textread('grade.txt','%s %f %f %f %f %f %f %f %f %f'); + +for i=1:length(HW1) + total_grade(i)=mean([HW1(i),HW2(i),HW3(i),HW4(i),HW5(i),HW6(i),HW7(i)])*0.3+Mid(i)*0.3+Final(i)*0.4; + if total_grade (i)<50 + count=count+1; + end +end +count + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/Bai_5.m b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_5.m new file mode 100644 index 0000000..3338021 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/Bai_5.m @@ -0,0 +1,31 @@ +% Bai_5 +clc +clear +close all + +h=[0 1.7 1.9 2.6 2.9 4 5.2]; +F=[0 2.6 3.6 4.3 6.2 11.5 30.6]; + +% a. Compute the best fit for 2nd degree +% polynomial (quadratic) for the above data. +p=polyfit(h,F,2) + +% b. Plot actual data and fit mode +hold off +hold on +plot(h,F,'o'); +xi = linspace(0,14,100); +yi = polyval(p, xi); +title('DoMinhDuy-ITITSB22029 Problem 2.b') +plot(xi,yi); + +% c. Calculate the sum of the squares of the +% errors of this model. Calculate the +% flow rate for following heights of level of water +Ffit=polyval(p, h); +Error =sum((F-Ffit).^2) + +F8m=polyval(p,8) +F10m=polyval(p,10) +F14m=polyval(p,14) + diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/Ohm_laws.m b/Introduction to Computer for Engineers_Minh/Final Intro/Ohm_laws.m new file mode 100644 index 0000000..feddc0e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/Ohm_laws.m @@ -0,0 +1,11 @@ +% Do not include data point V=20 +xdata = [0 5 10 15 25]; +ydata = [0.001 0.881 2.1637 3.1827 4.961]; +degree = 1; +% Linear relationship +coef = polyfit(xdata, ydata, degree); +xx = -5 : 0.5 : 30; +% Range for plotting +yy = polyval(coef, xx); +plot(xdata, ydata, 'o', xx, yy); +resistance = 1 / coef(1) % Output the answe diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/Sample Final.docx b/Introduction to Computer for Engineers_Minh/Final Intro/Sample Final.docx new file mode 100644 index 0000000..57f80b7 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Final Intro/Sample Final.docx differ diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/grade.txt b/Introduction to Computer for Engineers_Minh/Final Intro/grade.txt new file mode 100644 index 0000000..e720df6 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/grade.txt @@ -0,0 +1,20 @@ +Walcott 67.5 100.0 79.0 100.0 82.5 83.5 9.0 92.5 83.5 +Mustafi 77.0 83.5 69.5 97.0 98.5 71.0 8.0 91.0 79.5 +Pablo 83.5 70.5 96.0 98.5 100.0 63.0 8.0 87.5 81.5 +Harry 79.0 60.0 100.0 84.0 92.0 64.5 7.0 91.0 86.0 +Fernando 69.5 99.0 83.5 1.5 72.5 69.0 9.0 10.0 52.5 +Kerber 96.0 96.0 98.5 99.5 83.5 100.0 6.0 83.5 91.0 +Nathan 100.0 100.0 100.0 100.0 79.5 82.0 5.0 97.5 97.0 +Daniel 83.5 77.0 92.0 77.0 99.0 92.0 9.0 100.0 84.0 +Boruc 71.0 66.0 72.5 66.0 94.5 85.5 8.0 77.0 97.0 +Gareth 60.0 77.0 66.0 77.0 69.5 69.0 9.0 66.0 87.5 +Leo 98.5 93.5 95.0 100.0 97.0 100.0 7.0 98.0 100.0 +Sergio 69.0 79.0 97.5 79.0 92.0 77.0 9.0 91.0 91.0 +Sparrow 98.5 0.0 94.5 69.5 84.5 66.0 5.0 3.5 1.5 +Bradley 83.5 96.0 92.0 83.5 88.0 77.0 7.0 91.0 91.0 +Angelina 92.0 100.0 83.5 92.0 87.5 83.5 6.0 87.5 82.0 +Opera 84.5 83.5 20.5 84.5 0.0 82.0 9.0 21.0 5.5 +Liam 88.0 98.5 74.0 88.0 96.0 72.5 8.0 82.0 69.0 +Williams 87.5 97.0 87.5 87.5 88.0 69.0 7.0 90.5 100.0 +Ilicic 100.0 92.0 89.0 100.0 91.0 95.5 8.0 97.0 98.5 +Rafael 97.0 86.0 27.0 10.0 34.5 75.0 6.0 40.5 34.0 \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/Final Intro/tesstttttttt.m b/Introduction to Computer for Engineers_Minh/Final Intro/tesstttttttt.m new file mode 100644 index 0000000..e217ece --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Final Intro/tesstttttttt.m @@ -0,0 +1,13 @@ +xdata = [0 0.3000 1.0000 2.3000 3.5000 5.6000 7.5000 8.2000 9.7000]; +ydata = [4.9838 49.0727 31.0883 74.4117 107.8540 127.0157 371.8902 542.5732 863.1195]; + +for degree = 1:6 +coef{dgree} = polyfit(xdata, ydata, degree); +xx = 0:0.1:10; +yy = polyval(coef{degree}, xx); +figure(degree) +plot(xdata, ydata, 'o', xx, yy); +drawnow; +yfit=polyval(coef{degree},xdata); +Error_fit(degree)=sum((ydata-yfit).^2); +end diff --git a/Introduction to Computer for Engineers_Minh/HW/HW1/DoMinhDuy_HW1.m b/Introduction to Computer for Engineers_Minh/HW/HW1/DoMinhDuy_HW1.m new file mode 100644 index 0000000..1be63f9 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/HW/HW1/DoMinhDuy_HW1.m @@ -0,0 +1,14 @@ +%HW1 - using a script file +vo = 25; +x = 25 +v = 0; +g = 9.8; + +%a. What is the maximum height the ball rise from the release point? +h = ((vo)^2)/(2*g) + +%b.How long does it take to reach the highest point? +t = (v-vo)/(-g) + +%c. At what time(s) will it be 25m above the release point? +t = sqrt((2*x)/g) diff --git a/Introduction to Computer for Engineers_Minh/HW/HW2/DoMinhDuy_HW2.m b/Introduction to Computer for Engineers_Minh/HW/HW2/DoMinhDuy_HW2.m new file mode 100644 index 0000000..bf227f2 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/HW/HW2/DoMinhDuy_HW2.m @@ -0,0 +1,9 @@ +% Example of Matrix Operations +mass = [2 4 5 10 20 50]; +force = [12.5 23.2 30 61 116 294]; +mu = force ./ ( 9.81 * mass) +mu_ave = mean(mu) + +% Example of Matrix Operations: Evaluation of Function +z = [1:2:15] +y = (z.^3 + 5*z) ./ (4*z.^2 - 10) diff --git a/Introduction to Computer for Engineers_Minh/HW/HW3/DOMINHDUY_HW3_LOOP.m b/Introduction to Computer for Engineers_Minh/HW/HW3/DOMINHDUY_HW3_LOOP.m new file mode 100644 index 0000000..6b24ddd --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/HW/HW3/DOMINHDUY_HW3_LOOP.m @@ -0,0 +1,24 @@ +% calculate the area and circumference of 10 circles +% print it out if the area is greater than 20 + +N = 0; + +for i = 1:10 + radius = input('\n Enter radius: '); + radius = abs(radius); + + area = radius * radius * pi; + circumference = 2 * radius * pi; + + if area > 20 + fprintf('\n Radius = %f units', radius); + fprintf('\n Area = %f units', area); + fprintf('\n Circumference = %f units', circumference); + else + N = N + 1; + fprintf('This circle with area less than 20'); + endif + end + + fprintf('\n %f circles with area less than 20', N); + diff --git a/Introduction to Computer for Engineers_Minh/HW/HW3/DOMINHDUY_HW3_WHILE.m b/Introduction to Computer for Engineers_Minh/HW/HW3/DOMINHDUY_HW3_WHILE.m new file mode 100644 index 0000000..8b2039b --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/HW/HW3/DOMINHDUY_HW3_WHILE.m @@ -0,0 +1,28 @@ +% calculate the area and circumference of circles +% print results if the area is greater than 20; print the +% number of circules with area less than 20; terminate on area<=0 + +N = 0; + +radius = input('\nPlease enter a radius: '); +while radius > 0 + area = pi * radius^2; + circumference = 2 * pi * radius; + + if area > 20 + fprintf('\nRadius = %f units', radius); + fprintf('\nArea = %f units', area); + fprintf('\nCircumference = %f units', circumference); + else + N = N + 1; + fprintf('\nThis circle with area less than 20'); + end + + radius = input('\nPlease enter a radius: '); +end + +fprintf('\n%d circles with area less than 20', N); + + + + diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 1.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 1.pdf new file mode 100644 index 0000000..2a991c2 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 1.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 2.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 2.pdf new file mode 100644 index 0000000..6c2142c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 2.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 3.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 3.pdf new file mode 100644 index 0000000..c9eb328 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 3.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 4.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 4.pdf new file mode 100644 index 0000000..fbebf75 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 4.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 5.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 5.pdf new file mode 100644 index 0000000..d93d82e Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 5.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 6.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 6.pdf new file mode 100644 index 0000000..ad803fb Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 6.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 7_Review on Midterm.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 7_Review on Midterm.pdf new file mode 100644 index 0000000..aac553f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 7_Review on Midterm.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 8.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 8.pdf new file mode 100644 index 0000000..aaad694 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 8.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 9.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 9.pdf new file mode 100644 index 0000000..6475a8a Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/Lecture/Lecture 9.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/PRACTICE SET/PRACTICE SET.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/PRACTICE SET/PRACTICE SET.pdf new file mode 100644 index 0000000..a11b0a2 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...TQH/PRACTICE SET/PRACTICE SET.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture1.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture1.pdf new file mode 100644 index 0000000..78f804d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture1.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture10_Teaching.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture10_Teaching.pdf new file mode 100644 index 0000000..6fad49c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture10_Teaching.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture2.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture2.pdf new file mode 100644 index 0000000..9981526 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture2.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture3.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture3.pdf new file mode 100644 index 0000000..8bf171b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture3.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture4.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture4.pdf new file mode 100644 index 0000000..f0d7b5c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture4.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture5.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture5.pdf new file mode 100644 index 0000000..566ea3b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture5.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture6_7.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture6_7.pdf new file mode 100644 index 0000000..e72bbc1 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture6_7.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture8.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture8.pdf new file mode 100644 index 0000000..4052e9b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture8.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture9_Interpolation.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture9_Interpolation.pdf new file mode 100644 index 0000000..6ce7cb9 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/EE050IU_Lecture/EE050IU_Lecture9_Interpolation.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/Practice_ApplicationOfIf_statement/Practice_ApplicationOfIf_statement.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/Practice_ApplicationOfIf_statement/Practice_ApplicationOfIf_statement.pdf new file mode 100644 index 0000000..ce2be7f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/Practice_ApplicationOfIf_statement/Practice_ApplicationOfIf_statement.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/hw_function/hw1_func.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/hw_function/hw1_func.pdf new file mode 100644 index 0000000..31a5661 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/hw_function/hw1_func.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/hw_function/hw_function_script.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/hw_function/hw_function_script.pdf new file mode 100644 index 0000000..8c40faa Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/hw_function/hw_function_script.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/single-page-integral-table/single-page-integral-table.pdf b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/single-page-integral-table/single-page-integral-table.pdf new file mode 100644 index 0000000..6e2c79c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Intro to Computer...VTP/single-page-integral-table/single-page-integral-table.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Midterm Exam/Darve_cme102_matlab.pdf b/Introduction to Computer for Engineers_Minh/Midterm Exam/Darve_cme102_matlab.pdf new file mode 100644 index 0000000..9eff205 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Midterm Exam/Darve_cme102_matlab.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Midterm Exam/Introduction to Computer for Engineers_Minh NOTE.docx b/Introduction to Computer for Engineers_Minh/Midterm Exam/Introduction to Computer for Engineers_Minh NOTE.docx new file mode 100644 index 0000000..9c5b815 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Midterm Exam/Introduction to Computer for Engineers_Minh NOTE.docx differ diff --git a/Introduction to Computer for Engineers_Minh/Midterm Exam/MATLAB Practice - 60 Exercises.pdf b/Introduction to Computer for Engineers_Minh/Midterm Exam/MATLAB Practice - 60 Exercises.pdf new file mode 100644 index 0000000..6391c20 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Midterm Exam/MATLAB Practice - 60 Exercises.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Midterm Exam/Mat Lab Midterm Summary-1-1.pdf b/Introduction to Computer for Engineers_Minh/Midterm Exam/Mat Lab Midterm Summary-1-1.pdf new file mode 100644 index 0000000..c1ddda3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Midterm Exam/Mat Lab Midterm Summary-1-1.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Midterm Exam/Midterm exam 2023-2024.pdf b/Introduction to Computer for Engineers_Minh/Midterm Exam/Midterm exam 2023-2024.pdf new file mode 100644 index 0000000..ded0e8f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Midterm Exam/Midterm exam 2023-2024.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Midterm Exam/Student Introto Computing Mid withsigned.pdf b/Introduction to Computer for Engineers_Minh/Midterm Exam/Student Introto Computing Mid withsigned.pdf new file mode 100644 index 0000000..0e8ebe0 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Midterm Exam/Student Introto Computing Mid withsigned.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Midterm Exam/hph_matlab_basic2013_1.pdf b/Introduction to Computer for Engineers_Minh/Midterm Exam/hph_matlab_basic2013_1.pdf new file mode 100644 index 0000000..92f8e58 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Midterm Exam/hph_matlab_basic2013_1.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1538.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1538.HEIC new file mode 100644 index 0000000..c451165 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1538.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1544.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1544.HEIC new file mode 100644 index 0000000..3ca7c87 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1544.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1545.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1545.HEIC new file mode 100644 index 0000000..8529011 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1545.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1548.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1548.HEIC new file mode 100644 index 0000000..2d24747 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1548.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1551.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1551.HEIC new file mode 100644 index 0000000..b5b269a Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1551.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1552.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1552.HEIC new file mode 100644 index 0000000..16d1c79 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1552.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1553.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1553.HEIC new file mode 100644 index 0000000..2bcd933 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1553.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1555.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1555.HEIC new file mode 100644 index 0000000..605ac6c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1555.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1557.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1557.HEIC new file mode 100644 index 0000000..3a61c34 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1557.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1558.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1558.HEIC new file mode 100644 index 0000000..8686378 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1558.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1559.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1559.HEIC new file mode 100644 index 0000000..f881141 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1559.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1560.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1560.HEIC new file mode 100644 index 0000000..d3d6eab Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1560.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1561.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1561.HEIC new file mode 100644 index 0000000..f38b9f4 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1561.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1562.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1562.HEIC new file mode 100644 index 0000000..304ed38 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1562.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1564.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1564.HEIC new file mode 100644 index 0000000..d8f0e2e Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1564.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1566.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1566.HEIC new file mode 100644 index 0000000..1a20966 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1566.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1567.HEIC b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1567.HEIC new file mode 100644 index 0000000..110c214 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Note Final Images/IMG_1567.HEIC differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/10C.png b/Introduction to Computer for Engineers_Minh/PNG/10C.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/10C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/10D.png b/Introduction to Computer for Engineers_Minh/PNG/10D.png new file mode 100644 index 0000000..a9de67e Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/10D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/10H.png b/Introduction to Computer for Engineers_Minh/PNG/10H.png new file mode 100644 index 0000000..df551b0 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/10H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/10S.png b/Introduction to Computer for Engineers_Minh/PNG/10S.png new file mode 100644 index 0000000..22141df Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/10S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/2C.png b/Introduction to Computer for Engineers_Minh/PNG/2C.png new file mode 100644 index 0000000..413b0da Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/2C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/2D.png b/Introduction to Computer for Engineers_Minh/PNG/2D.png new file mode 100644 index 0000000..f966e48 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/2D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/2H.png b/Introduction to Computer for Engineers_Minh/PNG/2H.png new file mode 100644 index 0000000..345744e Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/2H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/2S.png b/Introduction to Computer for Engineers_Minh/PNG/2S.png new file mode 100644 index 0000000..a0de145 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/2S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/3C.png b/Introduction to Computer for Engineers_Minh/PNG/3C.png new file mode 100644 index 0000000..f8b8183 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/3C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/3D.png b/Introduction to Computer for Engineers_Minh/PNG/3D.png new file mode 100644 index 0000000..cee21f3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/3D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/3H.png b/Introduction to Computer for Engineers_Minh/PNG/3H.png new file mode 100644 index 0000000..8494e1c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/3H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/3S.png b/Introduction to Computer for Engineers_Minh/PNG/3S.png new file mode 100644 index 0000000..78e3b20 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/3S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/4C.png b/Introduction to Computer for Engineers_Minh/PNG/4C.png new file mode 100644 index 0000000..8938459 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/4C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/4D.png b/Introduction to Computer for Engineers_Minh/PNG/4D.png new file mode 100644 index 0000000..d9ae5be Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/4D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/4H.png b/Introduction to Computer for Engineers_Minh/PNG/4H.png new file mode 100644 index 0000000..41a4488 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/4H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/4S.png b/Introduction to Computer for Engineers_Minh/PNG/4S.png new file mode 100644 index 0000000..70bc9cc Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/4S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/5C.png b/Introduction to Computer for Engineers_Minh/PNG/5C.png new file mode 100644 index 0000000..a7f49be Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/5C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/5D.png b/Introduction to Computer for Engineers_Minh/PNG/5D.png new file mode 100644 index 0000000..cff0617 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/5D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/5H.png b/Introduction to Computer for Engineers_Minh/PNG/5H.png new file mode 100644 index 0000000..1efcbf3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/5H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/5S.png b/Introduction to Computer for Engineers_Minh/PNG/5S.png new file mode 100644 index 0000000..e708806 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/5S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/6C.png b/Introduction to Computer for Engineers_Minh/PNG/6C.png new file mode 100644 index 0000000..d8382d3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/6C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/6D.png b/Introduction to Computer for Engineers_Minh/PNG/6D.png new file mode 100644 index 0000000..7ba40e9 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/6D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/6H.png b/Introduction to Computer for Engineers_Minh/PNG/6H.png new file mode 100644 index 0000000..93a84f8 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/6H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/6S.png b/Introduction to Computer for Engineers_Minh/PNG/6S.png new file mode 100644 index 0000000..874162b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/6S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/7C.png b/Introduction to Computer for Engineers_Minh/PNG/7C.png new file mode 100644 index 0000000..f6a9653 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/7C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/7D.png b/Introduction to Computer for Engineers_Minh/PNG/7D.png new file mode 100644 index 0000000..6c4393d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/7D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/7H.png b/Introduction to Computer for Engineers_Minh/PNG/7H.png new file mode 100644 index 0000000..d4a59ff Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/7H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/7S.png b/Introduction to Computer for Engineers_Minh/PNG/7S.png new file mode 100644 index 0000000..895f85c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/7S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/8C.png b/Introduction to Computer for Engineers_Minh/PNG/8C.png new file mode 100644 index 0000000..bc87bf0 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/8C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/8D.png b/Introduction to Computer for Engineers_Minh/PNG/8D.png new file mode 100644 index 0000000..38c5695 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/8D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/8H.png b/Introduction to Computer for Engineers_Minh/PNG/8H.png new file mode 100644 index 0000000..c2812aa Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/8H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/8S.png b/Introduction to Computer for Engineers_Minh/PNG/8S.png new file mode 100644 index 0000000..0277cc6 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/8S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/9C.png b/Introduction to Computer for Engineers_Minh/PNG/9C.png new file mode 100644 index 0000000..d81b2f2 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/9C.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/9D.png b/Introduction to Computer for Engineers_Minh/PNG/9D.png new file mode 100644 index 0000000..e0d3d05 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/9D.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/9H.png b/Introduction to Computer for Engineers_Minh/PNG/9H.png new file mode 100644 index 0000000..7b679e1 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/9H.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/9S.png b/Introduction to Computer for Engineers_Minh/PNG/9S.png new file mode 100644 index 0000000..f58493e Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/9S.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/AC.png b/Introduction to Computer for Engineers_Minh/PNG/AC.png new file mode 100644 index 0000000..396c158 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/AC.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/AD.png b/Introduction to Computer for Engineers_Minh/PNG/AD.png new file mode 100644 index 0000000..d702a39 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/AD.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/AH.png b/Introduction to Computer for Engineers_Minh/PNG/AH.png new file mode 100644 index 0000000..435fc14 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/AH.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/AS.png b/Introduction to Computer for Engineers_Minh/PNG/AS.png new file mode 100644 index 0000000..f07f67d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/AS.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/Beautiful in white.mp3 b/Introduction to Computer for Engineers_Minh/PNG/Beautiful in white.mp3 new file mode 100644 index 0000000..2c91a27 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/Beautiful in white.mp3 differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/JC.png b/Introduction to Computer for Engineers_Minh/PNG/JC.png new file mode 100644 index 0000000..16418e4 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/JC.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/JD.png b/Introduction to Computer for Engineers_Minh/PNG/JD.png new file mode 100644 index 0000000..05b0389 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/JD.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/JH.png b/Introduction to Computer for Engineers_Minh/PNG/JH.png new file mode 100644 index 0000000..259421c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/JH.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/JS.png b/Introduction to Computer for Engineers_Minh/PNG/JS.png new file mode 100644 index 0000000..6e0554d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/JS.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/KC.png b/Introduction to Computer for Engineers_Minh/PNG/KC.png new file mode 100644 index 0000000..70c4ee5 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/KC.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/KD.png b/Introduction to Computer for Engineers_Minh/PNG/KD.png new file mode 100644 index 0000000..95a3b8f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/KD.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/KH.png b/Introduction to Computer for Engineers_Minh/PNG/KH.png new file mode 100644 index 0000000..0defcbb Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/KH.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/KS.png b/Introduction to Computer for Engineers_Minh/PNG/KS.png new file mode 100644 index 0000000..43b8e19 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/KS.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/QC.png b/Introduction to Computer for Engineers_Minh/PNG/QC.png new file mode 100644 index 0000000..6f74177 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/QC.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/QD.png b/Introduction to Computer for Engineers_Minh/PNG/QD.png new file mode 100644 index 0000000..85c443f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/QD.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/QH.png b/Introduction to Computer for Engineers_Minh/PNG/QH.png new file mode 100644 index 0000000..ba8e1e4 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/QH.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/QS.png b/Introduction to Computer for Engineers_Minh/PNG/QS.png new file mode 100644 index 0000000..a6ef69f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/QS.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/aces.png b/Introduction to Computer for Engineers_Minh/PNG/aces.png new file mode 100644 index 0000000..58d0e46 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/aces.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/back_cards-07.png b/Introduction to Computer for Engineers_Minh/PNG/back_cards-07.png new file mode 100644 index 0000000..031bb85 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/back_cards-07.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/blue_back.png b/Introduction to Computer for Engineers_Minh/PNG/blue_back.png new file mode 100644 index 0000000..24fcfb7 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/blue_back.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/card.mp3 b/Introduction to Computer for Engineers_Minh/PNG/card.mp3 new file mode 100644 index 0000000..59984e7 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/card.mp3 differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/card_flick_with_finger.mp3 b/Introduction to Computer for Engineers_Minh/PNG/card_flick_with_finger.mp3 new file mode 100644 index 0000000..156935b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/card_flick_with_finger.mp3 differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/gray_back.png b/Introduction to Computer for Engineers_Minh/PNG/gray_back.png new file mode 100644 index 0000000..0b40ae3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/gray_back.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/green_back.png b/Introduction to Computer for Engineers_Minh/PNG/green_back.png new file mode 100644 index 0000000..79b7d8c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/green_back.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/honor_clubs.png b/Introduction to Computer for Engineers_Minh/PNG/honor_clubs.png new file mode 100644 index 0000000..f25a8dc Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/honor_clubs.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/honor_diamond.png b/Introduction to Computer for Engineers_Minh/PNG/honor_diamond.png new file mode 100644 index 0000000..bc2c534 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/honor_diamond.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/honor_heart-14.png b/Introduction to Computer for Engineers_Minh/PNG/honor_heart-14.png new file mode 100644 index 0000000..e336a23 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/honor_heart-14.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/honors_spade-14.png b/Introduction to Computer for Engineers_Minh/PNG/honors_spade-14.png new file mode 100644 index 0000000..b932169 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/honors_spade-14.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/purple_back.png b/Introduction to Computer for Engineers_Minh/PNG/purple_back.png new file mode 100644 index 0000000..ac96728 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/purple_back.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/red_back.png b/Introduction to Computer for Engineers_Minh/PNG/red_back.png new file mode 100644 index 0000000..759383d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/red_back.png differ diff --git a/Introduction to Computer for Engineers_Minh/PNG/yellow_back.png b/Introduction to Computer for Engineers_Minh/PNG/yellow_back.png new file mode 100644 index 0000000..11d29c9 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PNG/yellow_back.png differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.fig b/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.fig new file mode 100644 index 0000000..47e763d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.fig differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.m b/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.m new file mode 100644 index 0000000..4d2a61d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.m @@ -0,0 +1,117 @@ +function varargout = PROJECT(varargin) +% PROJECT MATLAB code for PROJECT.fig +% PROJECT, by itself, creates a new PROJECT or raises the existing +% singleton*. +% +% H = PROJECT returns the handle to a new PROJECT or the handle to +% the existing singleton*. +% +% PROJECT('CALLBACK',hObject,eventData,handles,...) calls the local +% function named CALLBACK in PROJECT.M with the given input arguments. +% +% PROJECT('Property','Value',...) creates a new PROJECT or raises the +% existing singleton*. Starting from the left, property value pairs are +% applied to the GUI before PROJECT_OpeningFcn gets called. An +% unrecognized property name or invalid value makes property application +% stop. All inputs are passed to PROJECT_OpeningFcn via varargin. +% +% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one +% instance to run (singleton)". +% +% See also: GUIDE, GUIDATA, GUIHANDLES + +% Edit the above text to modify the response to help PROJECT + +% Last Modified by GUIDE v2.5 13-Jun-2024 20:38:32 + +% Begin initialization code - DO NOT EDIT +gui_Singleton = 1; +gui_State = struct('gui_Name', mfilename, ... + 'gui_Singleton', gui_Singleton, ... + 'gui_OpeningFcn', @PROJECT_OpeningFcn, ... + 'gui_OutputFcn', @PROJECT_OutputFcn, ... + 'gui_LayoutFcn', [] , ... + 'gui_Callback', []); +if nargin && ischar(varargin{1}) + gui_State.gui_Callback = str2func(varargin{1}); +end + +if nargout + [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); +else + gui_mainfcn(gui_State, varargin{:}); +end +% End initialization code - DO NOT EDIT + + +% --- Executes just before PROJECT is made visible. +function PROJECT_OpeningFcn(hObject, eventdata, handles, varargin) +% This function has no output args, see OutputFcn. +% hObject handle to figure +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) +% varargin command line arguments to PROJECT (see VARARGIN) + +% Choose default command line output for PROJECT +handles.output = hObject; + +% Update handles structure +guidata(hObject, handles); + +% UIWAIT makes PROJECT wait for user response (see UIRESUME) +% uiwait(handles.figure1); + + +% --- Outputs from this function are returned to the command line. +function varargout = PROJECT_OutputFcn(hObject, eventdata, handles) +% varargout cell array for returning output args (see VARARGOUT); +% hObject handle to figure +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +% Get default command line output from handles structure +varargout{1} = handles.output; + + +% --- Executes on button press in pushbutton1. +function pushbutton1_Callback(hObject, eventdata, handles) +% hObject handle to pushbutton1 (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles structure with handles and user data (see GUIDATA) + +try + % Choose the image file + [filename, pathname] = uigetfile({'*.png;*.jpg', 'Image Files (*.png, *.jpg)'}, 'Select Image File'); + + % Check if a file is selected + if isequal(filename, 0) + % User canceled the operation + set(handles.resultTextBox, 'String', 'No file selected'); + return; + end + + % Display the file path in the text box + set(handles.directoryTextBox, 'String', fullfile(pathname, filename)); + + % Read the image + imagePath = fullfile(pathname, filename); + I = imread(imagePath); + + % Convert the image to grayscale if it is not already + if size(I, 3) == 3 + I = rgb2gray(I); + end + + % Display the image + axes(handles.imageAxes); + imshow(I); + + % Run OCR on the image + results = ocr(I); + + % Display the OCR result in the text box + set(handles.resultTextBox, 'String', results.Text); +catch ME + % Display error message in the result text box + set(handles.resultTextBox, 'String', ['Error: ' ME.message]); +end diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.rar b/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.rar new file mode 100644 index 0000000..2ea0908 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/PROJECT.rar differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/Project-9.pptx b/Introduction to Computer for Engineers_Minh/PROJECT/Project-9.pptx new file mode 100644 index 0000000..6d32ab7 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/Project-9.pptx differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/Project9Report_EE050IU.pdf b/Introduction to Computer for Engineers_Minh/PROJECT/Project9Report_EE050IU.pdf new file mode 100644 index 0000000..3ba41eb Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/Project9Report_EE050IU.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/R (2).jpg b/Introduction to Computer for Engineers_Minh/PROJECT/R (2).jpg new file mode 100644 index 0000000..e43761c Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/R (2).jpg differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/R.jpg b/Introduction to Computer for Engineers_Minh/PROJECT/R.jpg new file mode 100644 index 0000000..896cfc7 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/R.jpg differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/Test-Proj2.m b/Introduction to Computer for Engineers_Minh/PROJECT/Test-Proj2.m new file mode 100644 index 0000000..157a20e --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/PROJECT/Test-Proj2.m @@ -0,0 +1,75 @@ +imagen=imread('C:\Users\domin\name.png'); + +figure(1) + +imshow(imagen); + +title('INPUT IMAGE WITH NOISE') + +%%Convert to gray scale + +if size(imagen,3)==3 % RGB image + + imagen=rgb2gray(imagen); + +end + +%%Convert to binary image + +threshold = graythresh(imagen); + +imagen =~im2bw(imagen,threshold); + +%%Remove all object containing fewer than 30 pixels + +imagen = bwareaopen(imagen,30); + +pause(1) + +%%Show image binary image + +figure(2) + +imshow(~imagen); + +title('INPUT IMAGE WITHOUT NOISE') + +%%Label connected components + +[L Ne]=bwlabel(imagen); + +%%Measure properties of image regions + +propied=regionprops(L,'BoundingBox'); + +hold on + +%%Plot Bounding Box + +for n=1:size(propied,1) + + rectangle('Position',propied(n).BoundingBox,'EdgeColor','g','LineWidth',2) + +end + +hold off + +pause (1) + +%%Objects extraction + +figure + +for n=1:Ne + + [r,c] = find(L==n); + + n1=imagen(min(r):max(r),min(c):max(c)); + + imshow(~n1); + + figure + + pause(0.5) + +end \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/Test-again-Proj2.m b/Introduction to Computer for Engineers_Minh/PROJECT/Test-again-Proj2.m new file mode 100644 index 0000000..28491f8 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/PROJECT/Test-again-Proj2.m @@ -0,0 +1,10 @@ +I = imread("C:\Users\domin\name.png"); +I = im2gray(I); + +figure +imshow(I) + +% Run OCR on the image +results = ocr(I); + +results.Text \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/minhhoa.png b/Introduction to Computer for Engineers_Minh/PROJECT/minhhoa.png new file mode 100644 index 0000000..157ba5d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/minhhoa.png differ diff --git a/Introduction to Computer for Engineers_Minh/PROJECT/name.png b/Introduction to Computer for Engineers_Minh/PROJECT/name.png new file mode 100644 index 0000000..4777622 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/PROJECT/name.png differ diff --git a/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q1.m b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q1.m new file mode 100644 index 0000000..d4508e9 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q1.m @@ -0,0 +1,40 @@ +% Question 1 +% a. A random integer number from 1 to 20 +randi(20); + +% b. A random odd integer number from 11 to 99 +11 + 2*randi([0 44]); +1 + 2*randi([5 49]); + +% c. A random even integer number from -50 to 50 +-50 + 2*randi([0 50]); +2*randi([-25 25]); + +% d. A random integer number from 10 to 99 and divisible by 3 +3*randi([4 33]); + +% e. A random float number from 6.3 to 36.6 +sprintf('%1.1f', 6.3 + 30.3*rand(1)); + +% f. A random float number from -18.9 to 66.3 +sprintf('%1.1f', -18.9 + 85.2*randi(1)); + +% g. A row vector with 10 random integer elements from 23 to 78 +randi([23 78], 1, 10); + +% h. A column vector with 15 random float elements from 1.1 to 9.9 +1.1 + 8.8*rand(15,1); + +% i. A matrix 3x4 with random integer elements from -25 to 25 and divisible by 5 +5*randi([-5 5], 3, 4); + +% j. A matrix 6x6 with first three columns are random integers from 3 to 30, last three columns are random floats from 2.4 to 6.9 +J = zeros(6); +for i = 1 : 6 + for j = 1 : 3 + J(i,j) = randi([3 30]); + end + for j = 4 : 6 + J(i,j) = 2.4 + 4.5*rand(1); + end +end diff --git a/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q2.m b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q2.m new file mode 100644 index 0000000..d97927d --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q2.m @@ -0,0 +1,14 @@ +% Question 2 +% a. Create a row vector that goes equal steps from -5 to 5 containing 50 components +a = linspace(-5,5,50); + +% b. Create a row vector spanning the range from 0 to 2π, containing 100 equally spaced components, +% so that the first value is 0, and the last value is 2π +b = linspace(0, 2*pi, 100); + +% c. Create a column vector with 50 values which are sine of equally spaced components ranging from 0 to π +c = sin(linspace(0, pi, 50))'; + +% d. Create a 10x10 matrix, so that the odd columns should contain values 3, and the even columns, values 0 +d = zeros(10); +d(:, 1:2:end) = 3; diff --git a/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q3.m b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q3.m new file mode 100644 index 0000000..5f1d483 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q3.m @@ -0,0 +1,11 @@ +% Question 3 +clear all; +clc; +N = input('Enter an integer number: '); + +for i = 1 : N + for j = 1 : (N+1) + A(i,j) = i^(j-1); + end +end +disp(A); \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q4.m b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q4.m new file mode 100644 index 0000000..618765f --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Q4.m @@ -0,0 +1,11 @@ +% Question 4 +function Q4() +% function to calculate the approximation of pi + clc; + N = input('Enter an integer: '); + sum_pi = 0; + for n = 0 : N + sum_pi = sum_pi + 16^(-n)*(4/(8*n+1) - 2/(8*n+4) - 1/(8*n+5) - 1/(8*n+6)); + end + fprintf('Value of pi with N = %d: %.20f\n', N, sum_pi); +end diff --git a/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Sample Exam.pdf b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Sample Exam.pdf new file mode 100644 index 0000000..6484bd4 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Sample Midterm Exam MINH/Sample Exam.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_1.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_1.pdf new file mode 100644 index 0000000..6fbf6a4 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_1.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_10.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_10.pdf new file mode 100644 index 0000000..5cb3efe Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_10.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_2.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_2.pdf new file mode 100644 index 0000000..0dc34a9 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_2.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_3.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_3.pdf new file mode 100644 index 0000000..07d3ace Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_3.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_4.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_4.pdf new file mode 100644 index 0000000..bcbbde8 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_4.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_5.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_5.pdf new file mode 100644 index 0000000..a9e646f Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_5.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_6.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_6.pdf new file mode 100644 index 0000000..61e988d Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_6.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_7 and 8.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_7 and 8.pdf new file mode 100644 index 0000000..47e07d6 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_7 and 8.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Slides/LECTURE_9.pdf b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_9.pdf new file mode 100644 index 0000000..f1a84c3 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Slides/LECTURE_9.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/Tips PNG/Properties of Matrix operations.png b/Introduction to Computer for Engineers_Minh/Tips PNG/Properties of Matrix operations.png new file mode 100644 index 0000000..675480a Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Tips PNG/Properties of Matrix operations.png differ diff --git a/Introduction to Computer for Engineers_Minh/Tips PNG/Some Useful Notes about Variables.png b/Introduction to Computer for Engineers_Minh/Tips PNG/Some Useful Notes about Variables.png new file mode 100644 index 0000000..aee308b Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/Tips PNG/Some Useful Notes about Variables.png differ diff --git a/Introduction to Computer for Engineers_Minh/matlab-basic-functions-reference.pdf b/Introduction to Computer for Engineers_Minh/matlab-basic-functions-reference.pdf new file mode 100644 index 0000000..59b50c2 Binary files /dev/null and b/Introduction to Computer for Engineers_Minh/matlab-basic-functions-reference.pdf differ diff --git a/Introduction to Computer for Engineers_Minh/names.txt b/Introduction to Computer for Engineers_Minh/names.txt new file mode 100644 index 0000000..e0332ef --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/names.txt @@ -0,0 +1,5 @@ +Jones +Smith +Collins +Portis +James \ No newline at end of file diff --git a/Introduction to Computer for Engineers_Minh/phones.txt b/Introduction to Computer for Engineers_Minh/phones.txt new file mode 100644 index 0000000..3fe1f56 --- /dev/null +++ b/Introduction to Computer for Engineers_Minh/phones.txt @@ -0,0 +1,8 @@ +Varol Akman Prof 1538 +Selim Aksoy AsstProf 3405 +Erol Arkun Prof 2249 +Cevdet Aykanat Prof 1625 +Mehmet Baray Prof 1208 +Cengiz Çelik Instructor 2613 +Ilyas Çiçekli AsstProf 1589 +David Davenport AsstProf 1248 \ No newline at end of file