Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 1.1 The following script file is under development to reproduce the tabl

ID: 2084042 • Letter: P

Question

Problem 1.1 The following script file is under development to reproduce the table 1-2 on page 5 of the text (shown below). However the file has not been fully de-bugged. Your homework is to debug the software itemizing the corrections. Submit the corrected code (corrections indicated by color or underlining as part of your homework including its output. %Script file Prob 1 1.m Design sReproduce table 1-2, p.13 Radio Receiver clc clear command window clear all clear workspace Input dBm- (-30 5:10] column vector first column of table $Second column output w 10 (Input dBm/1) First column label Input Title Power Level in dBm 'li Second column label output Title Linea Power Level (W)

Explanation / Answer

Matlab Script:

clc;clear all;
Input_dBm = -30:10:50;
Output_W = 10.^(Input_dBm/10);
Input_Title = ['Power Level in dBm '];
Output_Title = ['Linear Power Level (W)'];
disp(' ');
disp('------------------------------------------------');
disp([Input_Title,Output_Title]);
disp('------------------------------------------------');
for n=1:length(Input_dBm)
InStr = [num2str(Input_dBm(n)),'dBm'];
if n<5
OutStr = [num2str(Output_W(n)),'mW',' = ',num2str((Output_W(n)*1000)),'uW'];
elseif n>=5 && n<7
OutStr = [num2str(Output_W(n)),'mW'];
elseif n==7
OutStr = [num2str(Output_W(n)),'mW',' = ',num2str((Output_W(n)/1000)),'W'];
else
OutStr = [num2str(Output_W(n)/1000),'W'];
end   
L1 = length([InStr]);
L2 = length(OutStr);
str1 = [blanks(10-L1),InStr];
str2 = [blanks(25-L2),OutStr];
disp([str1,str2]);
end
disp('------------------------------------------------');
disp(' ');

command window output:


------------------------------------------------
Power Level in dBm Linear Power Level (W)
------------------------------------------------
-30dBm 0.001mW = 1uW
-20dBm 0.01mW = 10uW
-10dBm 0.1mW = 100uW
0dBm 1mW = 1000uW
10dBm 10mW
20dBm 100mW
30dBm 1000mW = 1W
40dBm 10W
50dBm 100W
------------------------------------------------

>>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote