MATLAB Basics set 18

Que.Evaluate the expression:
a=9/1*5/1;  b=a*a/a*a; c=sind(30)+1/2;  d=1-c; e=a+b*c-d

a. 2045
b. 2070
c. Error since sind() is a wrong function
d. 0
Que.What is the syntax to solve simultaneous equations easily?
a. solve[“equation-1”,”equation-2”];
b. sol[“equation-1” “equation-2”];
c. sol[‘equation-1’‘equation-2’];
d. solve[‘equation-1’,‘equation-2’];
Que.An employer has to minimize the number of lines in a program while writing the code for a purpose. If the purpose is to find the root of the following equation, which function is to be used?

a. polyval()
b. solve[]
c. sol[]
d. roots([])
Que.What is the difference between sqrt(10) and sqrt(sym(10))?
a. There is no difference
b. sqrt(sym(10)) is incorrect
c. There is no function as sqrt
d. sqrt(10) returns exact value while sqrt(sym(10)) returns 10^(1/2)
Que.The solve[] command can do which of the following things?
a. Produce the exact solution
b. Produce a symbolic solution
c. Produces exact roots
d. Produces complex roots
Que.What should be the output for the following code?
t=linspace(0,10);fzero(inline('t+t²'), 5);

a. Nan
b. -0.000000000000000000000000117191203927370461282452866337
c. -1.1719e-25
d. fzero is not a function
Que.A student has to find the solution of an equation cos(x)=1/2. She has to write the program such that exact values are shown at output. Which of the following codes would help her?
a. syms x;eqn = cos(x) == 1/2;vpa( solve(eqn,x))
b. syms x;eqn = cos(x) == 1/2;solve(eqn,x)
c. vpa(solve(‘cos(x)=1/2’))
d. syms x;eqn = cos(x) = 1/2;vpa(solve(eqn,x))
Que.Find the error in the following code?
Predicted output: (b + (b² - 4*a*c)(½))/(2*a)
     (b - (b² - 4*a*c)(½))/(2*a)
Code: solve (b*x² + c*x + a == 0)
Present output: -(c + (c² - 4*a*b)(½))/(2*b)
   -(c - (c² - 4*a*b)(½))/(2*b)

a. Predicted output is same as present output after math magic
b. solve(a*x² + b*x + c == 0)
c. vpa(solve(a*x² – b*x + c == 0))
d. solve(a*x² – b*x + c == 0)
Que.Which program can help to solve the following differential equation?
dy/dx=b*y     y(0)=5;

a. syms y(t) a;equn = diff(y,t)==b*y;cnd=y(0)==5;ySol(t)=dsolve(equn,cnd)
b. syms y(t) a;eqn = diff(y,t) == a*y;ySol(t) = dsolve(eqn,(y(0)=5);
c. syms y(t) a;eqn=diff(y,t)=a*y;cond=y(0)==5 sol(t)=dsolve(eqn,cond);
d. sym y(t) a; eqn=diff(y,t)==a*y;cond=y(0)==5;sol(eqn,cond);
Que.What happens if dsolve does not return any numerical solution?
a. The equations have no solution
b. The equations have a trivial solution
c. The equations have infinite no. of solutions
d. The equation has to be solve separately

Leave a Comment