prelab01.spring2024

pdf

School

Florida State University *

*We aren’t endorsed by this school

Course

3002L

Subject

Mechanical Engineering

Date

Feb 20, 2024

Type

pdf

Pages

6

Uploaded by jjtgabc123

Report
Spring 2024 EEL3002L−ECE Engineering Tools Lab Pre-lab Exercise Set #1 Due at 3:00 PM, Wednesday, January 17, 2024 Name: Jae Garland EE CpE X Student ID: FAMU FSU jrg23h Lab TA: Sophia Owais Section: 1 Supervising Professor: Dr. B.W. Kwan Exercise Score Maximum Special Exercise 10 points 1.1 10 points 1.2 10 points 1.3 10 points 1.4 10 points Total score = % 50 points Instructions 1. Use Microsoft Word to prossess and document the exercise solutions. 2. For MATLAB exercises, use the Windows Snipping Tool to capture the commands/statements and thecorresponding results displayed in the Command Window. Then paste them to the Word document. For MATLAB graphic results, use the Export function within the Figure Window to save the figures as png files for use in the solutions document. 3. For Multisim simulation exercises, use the Windows Snipping Tool to capture the electric circuits and thesimulation results to save or paste to the solutions documents. 4. Use this page as the cover sheet for your solutions document.
1 Pre-lab Exercise Set #1 References Lecture Notes #1 and Lab #1 manual. Required textbooks for EEL3003, EEL3111, or EEL3112. Special Exercise As an engineer in the field of eletrical engineering or compter engineering, list the ten (10) committments that you should undertake professionally in accordance with the IEEE Code of Ethics . Exercise 1.1 (10 points) (a) Use MATLAB command help to explain how the MATLAB commands floor , fix , and ceil are executed. Floor, rounds to the nearest value towards negative infinity. It is used by doing floor(x) where x is the desired value or variable. For example, floor(3.5) would equate to 3.00, whereas floor(-3.5) would equate to -4.00. Fix, rounds to the nearest value towards zero. It is used by doing fix(x) where x is the desired value or variable. For example, fix(3.5) would equate to 3.00, whereas fix(-3.5) would equate to -3.00. Ceil, rounds to the nearest value towards plus infinity. It is used by doing ceil(x) where x is the desired value or variable. For example, ceil(3.5) would equate to 4.00, whereas ceil(-3.5) would equate to -3.00. (b) Explain the difference between MATLAB commands rem and mod . Rem provides the remainder after division. Mod provides the modulus after division. The difference between rem and mod is that rem(x,y) and mod(x,y) are equivalent if x and y are the same sign however if x and y are different signs then rem(x,y) and mod(x,y) differ by y. Remainder will have the same sign as the dividend while the modulus will have the same sign as the divisor. (c) Use MATLAB to compute the remainders of the division operations: π/ 4 and − π/ 4. (d) Use MATLAB to compute the operations: π modulo 4 and − π modulo 4. 𝒓?𝒎(𝝅, ?) = ?.???? 𝒓?𝒎(−𝝅, ?) = −?. ???? (d) Use MATLAB to compute the operations: 𝜋 ??𝑑𝑢?? 4 and −𝜋 ??𝑑𝑢?? 4 . 𝒎𝒐?(𝝅,?) = ?. ???? 𝒎𝒐?(−𝝅,?) = ?.𝟖?𝟖? Exercise 1.2 (10 points) (a) Use command linspace to generate a sequence of 10 real numbers x ( n ) over the interval [0 , 2 π ]. Display x ( n ) using the SHORT format and SHORTE format, repectively.
(b) Display y ( n ) = cos ( x ( n ) − π/ 3) using the SHORT format. (c) Display z ( n ) = sin ( x ( n ) − π/ 3) using the BANK format. (d) Exploit the results of Parts (b) and (c) to compute the sequence w ( n ) = tan( x ( n ) − π/ 3) corresponding the sequence x ( n ) generated in Part (a). Use integer values to approximate the sequence w ( n ) as accurately as possible.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
w(n) = tan(?(?) − 𝜋 3 ) = ?(𝑛) ?(𝑛) , thus our approximate sequence using the values from part a and b to calculate tangent. Then using fix to round to the nearest integer towards zero would give us the following approximation: ?(?) = [ −0.87 0.5000 , −0.34 0.9397 , 0.34 0.9397 , 0.87 0.5000 , 0.98 −0.1736 , 0.64 −0.7660 , 0.00 −1.0000 , −0.64 −0.7660 , −0.98 −0.1736 , −0.87 0.5000 ] ≈ [−1.00,0,0,1.00, −5.00,0,0,0,5.00, −1.00] Exercise 1.3 (10 points) (a) Create the text string MSG to represent the message ’EEL3002L is useful!’. (b) Study the MATLAB command int2str . Use the command char to display the character array MSG char corresponding to the numeric values that represent the text string MSG . (c) Study the MATLAB command str2num . Use the command char to display the numeric array MSG num that represents the text string MSG .
(d) Observe the results of Parts (b) and (c); then explain the difference between the array MSG char and the array MSG num . Int2str represents integers as a character array whereas str2num converts a character array to an array of numbers. As we see in part B our string of characters was converted to their respective numerical value with int2str, while still being a character array. On the other hand, in part C, we notice our character array being converted to a numerical array with the use of str2num. Exercise 1.4 (10 points) Exploit the results stemmed from analyzing the respresentation of the text string MSG considered in Exercise 1.3 to address the following questionnaire: (a) What is the integer value that represents the blank space (’ ’) as a character? The integer value that represents (‘ ’) is 32. (b) The text string MSG may be parsed into three parts: s 1 = ’EEL3002L’, s 2 = ’is’, and s 3 = ’useful!’. Construct a numeric matrix S MSG of integer values consisting of three rows that represent the text strings s 1, s 2 and s 3, respectively. ( Caution : The rows must have the same length.) (c) Use the commands disp combined with char to reveal the text strings stored in S MSG.
2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help