**21.The?following?lines?show?collections?of?characters?(e.g.,?_xm,?m3)??that?either?can?or?can?not?be?valid?names?of?MATLAB?variables.?Which?line?contains?EXCLUSIVELY?valid?names????**

a.?_xm?m3,?abc,?a_B????(wrong,?but?accepted?in?Quiz?1?->?“?_?“?not?allowed?as?1st?char?of?var.?name)?

b.? m3,?3_m,?m_3,?aB??

c.? AA,?for,?a-b,?ab?

d.? AA,?BB,?m3,?a-B?

e.? none?of?above? Ans: a

**22.?Which?of?the?following?statements?is?correct??**

a.? Function?“clear”?clears?only?the?scalar?variables,?but?does?not?clear?arrays?

b.? Function?“clc”?clears?all?variables?

c.? Function?“clc”?clears?only?constants?

d.? Function?“clear?a”?clears?all?variables?of?the?type?“array”?

e.? None?of?the?above?

Ans: e

?

**23.?Executing?in?the?Command?Window?the?following?code?**

**? A?=?eye(1,10)?;??size(A(2,2))?**

**? returns??**

a.? 1?

b.? 0?

c.? error?message?

d.? 1????1?

e.? none?of?the?above?

Ans: c

**24.?Executing?in?the?Command?Window?the?following?code?**

**? A?=?[1:1:5;;2:1:6]?;??size(A)?**

**? returns??**

a.? 2????5?

b.? 5????2?

c.? error?message?

d.? 3????5?

e.? none?of?the?above? Ans: a

**25.?Executing?the?command?iskeyword sin returns 0,?i.e.,?sin?is?not?a?MATLAB?keyword. Given?this?information,?which?of?the?following?statements?shows?the?result?of?executing,?in?the?Command?Window,?of?the?line???**

**sqrt(sin(-pi/2))??;??sin?=?size(1:5)?**

a.? wrong?result?(i.e.,?at?least?one?of?the?commands?should?not?be?used)?

b.? 1?

c.? 1????5?

d.? i?

e.? none?of?above?

Ans: c

**26.?Which?of?the?following?statements?is?correct??**

a.? Function?“who”?returns?the?name?of?the?currently?logged?user?

b.? Function?“who”?returns?the?name?of?the?system?administrator?

c.? Function?“whos”?displays?the?user?IDs?for?all?accounts?on?the?computer?

d.? Function?“who”?displays?the?web?address?of?the?system?administrator?

e.? None?of?the?above?

Ans: e

**27.?After?executing?the?following?script?file?in?MATLAB??**

**x?=?[2:4?;?-1:1?;?1?2?3];?**

**y=x(2,:);?**

**size(y')?**

**the?displayed?result?is??**

a.? 2????2??

b.? 3????1?

c.? 2????1?

d.? 1????3?

e.? none?of?above? Ans: b

**28.?After?executing?the?following?script?file?in?MATLAB?**

**x?=?3i;?**

**y?=?x/2*sqrt(-1);?**

**z?=?x?+?y?**

**the?displayed?result?is?**

a.? 1.5?+?3?i?

b.? error?message??

c.? 3?+?1.5?i?

d.? -1.5?+?3?i?

e.? none?of?above?

Ans: d

**29.?After?executing?the?following?script?file?in?MATLAB??**

**x?=?-i;?**

**y?=?x*sqrt(-1);?**

**x?+?y?**

**the?displayed?result?is?**

a.? error?message?

b.? -i??

c.? ?i?

d.? 1?-?1?i?

e.? none?of?above??

Ans: d

**30.?Executing?in?the?Command?Window?the?following?code?**

**? ??y?=?a?+?b?,?a?=?2?;?b?=?sqrt(-4)?;?**

**? returns?**

**?**

a.? 2?+?2?i?

b.? 2?-?2?i?

c.? error?message?

d.? NaN?

e.? none?of?the?above?

Ans: c

## No comments:

## Post a Comment