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.
Consider an economy in which the representative consumer preferences are described by U(C, l) = 0.9...
Consider an economy in which the representative consumer preferences are described by U(C, l) = 0.9 ln(C) + 0.1 ln(l). The total number of hours available to the representative consumer is h = 1, and the market real wage is w. The representative firm produces the final consumption good using the technology function Y = zN where N is the labour, and z = 2. Assume the government sets the level of its spending to G = 0.75 which has...
a) Represent the following logic function F(w, x, y, z) on a 4 variable K-map F(w,...
a) Represent the following logic function F(w, x, y, z) on a 4 variable K-map F(w, x, y, z) = Σm(6, 7, 9, 10, 13) + dc(4, 5, 11, 15) b)Write down the list of the function’s prime implicants (PI) and the essential prime implicant(s) (EPI), if any c)Find a minimum expression in a sum-of-products form of the logic function F(w, x, y, z).
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