This is a text file, to help you get started in MATLAB. Type each of the lines below into a MATLAB Command Window, and see the result. [If you are working in Mac OS and prefer to work in a terminal, you can probably type somthing like: /Applications/MATLAB_R2023b.app/bin/matlab -nodesktop -nosplash to run MATLAB in a terminal. Undoubtedly there are options under any reasonable operating system.] ----------------------------------------------------------- % This is a comment % Some basic numerical operations 3 + 5 abs(-3) exp(1) sin(1) pi sin(pi/2) 2^10 3.2e1 4.5e100 1e-9 * 1e-12 % variables, arrays 1:6 [1:8] x = [1:3:30] size(x) class(x) x(1) x(5) x(1:5) % help -- a bit limited, but a place to start help sin help for % loops for i=3:7 [i,i^2,i^3] end % Matrix operations A = [ 0 -1 ; 1 0] A^2 A^3 A^0 eye(2) eye(8) zeros([2 2]) zeros([8 2]) s=eye(2) for i=0:10 s = s + A^i/factorial(i) % this gets printed each time... end % Let's add some semicolons... A = [ 0 -1 ; 1 0] s=zeros([2 2]) for i=0:20 s = s + A^i/factorial(i); % semicolons prevent output end s sin(1) cos(1)