Question

In Matlab: Given the DrawRect function described in the lecture. function DrawRect(a, b, L, W, c)...

In Matlab:

Given the DrawRect function described in the lecture.

function DrawRect(a, b, L, W, c)

x = [a a+L a+L a a];

y = [b b b+W b+W b];

fill(x, y, c);

end

Which of the following function call will draw a black square with size of 10 by 10 with the center at (5, 0)?

a) DrawRect(0, -5, 10, 10, 'b')

b) DrawRect(5, 0, 10, 10, 'b')

c) DrawRect(0, -5, 10, 10, 'k')

d) DrawRect(5, 0, 10, 10, 'k')

Homework Answers

Answer #1

Answer : c)DrawRect(0,-5,10,10,'k')

Explanation :

fill (x,y,c) , creates polygons with given data x and y , Here is 'c' is color. 'k' mean black color.

In given function we are creating x and y using a,b,L,W . Here L and W are length and width . 'a' and 'b' are center of leftmost edge.

After running above function with option c.

output :

***d0 comment for queries and rate me up******

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
. 1 a) Calculate the corresponding cost function, c(w,r,q). ·q=(min(L,3K)).5 ·q=L-1/K b) Draw a representative isoquant...
. 1 a) Calculate the corresponding cost function, c(w,r,q). ·q=(min(L,3K)).5 ·q=L-1/K b) Draw a representative isoquant for q=12 ·Q=min(2L,(2(L+K))/3,2K)
Given an alphabet Σ = {a, b, c, d} Use Lecture definition to construct a nondeterministic...
Given an alphabet Σ = {a, b, c, d} Use Lecture definition to construct a nondeterministic automaton M such that L = {w ∈ Σ ∗ : at least one letter from Σ is missing in w} 1. (5pts) Draw the diagram Just draw the diagram, do not list the components 2. (2pts) Explain shortly why your M is nondeterministic and why it is correct 3. (3pts) Show that (s, accabb) `M ∗ (q, e) by constructing a computation of...
Answer the following question by working the BSOPM by hand: –Assume C L W Inc. does...
Answer the following question by working the BSOPM by hand: –Assume C L W Inc. does not pay dividends. The standard deviation of C L W is 45% per year. The risk-free rate is 5%. C L W stock has a current price of $24. –Using the Black-Scholes formula, what is the price for a ½ year American call option on C L W with a strike price of $30? (Use the normsdist function in excel to determine d1)
In Matlab: Given the script: x = 1; x = fun(x-1); y = x-1 and the...
In Matlab: Given the script: x = 1; x = fun(x-1); y = x-1 and the function: function y = fun(x) x = x-1; y = x-1; end What is the output a) -2 b) -4 c) -3 d) -1
3. Suppose that an individual’s utility function for consumption, C, and leisure, L, is given by...
3. Suppose that an individual’s utility function for consumption, C, and leisure, L, is given by U(C, L) = C 0.5L 0.5 This person is constrained by two equations: (1) an income constraint that shows how consumption can be financed, C = wH + V, where H is hours of work and V is nonlabor income; and (2) a total time constraint (T = 1) L + H = 1 Assume V = 0, then the expenditure-minimization problem is minimize...
MATLAB 2017b Write a program which will: Accept three numbers from the user: a, b and...
MATLAB 2017b Write a program which will: Accept three numbers from the user: a, b and c which can assume any value. Accept Dx and Dy for the calculations of the function Write a function which accept a, b, c, Dx and Dy and will draw the following surface Where x and y vary in the range of -10?x?10 -10?y?10. Allow the user to rerun the program and exit the program upon request.
Given production function: Q=L3/5K1/5. Where L is labor, K is capital, w is wage rate, and...
Given production function: Q=L3/5K1/5. Where L is labor, K is capital, w is wage rate, and r is rental rate. What kinds of returns to scale does your firm face? Find cost minimizing level of L and K, and long run cost function.
Which of the following describes legitimate weighted voting systems? l [q: w(A),w(B),w(C),w(D)] = [16:13,8,6,4] ll [q:...
Which of the following describes legitimate weighted voting systems? l [q: w(A),w(B),w(C),w(D)] = [16:13,8,6,4] ll [q: w(A),w(B),w(C),w(D) = [30:20,17,10,5] a) l only b) ll only c) l and ll d) neither l or ll
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5 3.4 2] a). Plot a scatter plot of the data b). Determine the coefficients of the polynomial ?0 + ?1? + ?2?2 which best fits the data c). Plot this function on the same plot as in part ‘a’. USE MATLAB CODE ONLY! USE MATLAB CODE ONLY! THANK YOU
A sine wave on a string is described by the wave function y (x, t) =...
A sine wave on a string is described by the wave function y (x, t) = 5.50 sin (0.70x-60.00t) where x and y are in meters and t in seconds. The mass per unit length of this rope is 11.00 g / m. Determine (a) the wavelength, (b) the average power transmitted by the wave. a 8.98 m, 95464.29 W b 0.10 m, 212.14 W c 0.10 m, 95464.29 W d 8.98 m, 212.14 W
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT