MATLAB Question Paper
14 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of the clear command in MATLAB?

To remove all variables from the workspace.

What is the output of the MATLAB command disp('Hello, World!')?

It displays 'Hello, World!' in the command window.

What is the difference between the plot and plot3 functions in MATLAB?

The plot function creates a 2D plot, while the plot3 function creates a 3D plot.

What is the purpose of the size function in MATLAB?

<p>To return the size of a matrix or array.</p> Signup and view all the answers

What is the difference between the break and continue statements in MATLAB?

<p>The <code>break</code> statement exits the loop, while the <code>continue</code> statement skips to the next iteration.</p> Signup and view all the answers

Write a MATLAB program to find the sum of the first 10 natural numbers.

<p>sum = 0; for i = 1:10, sum = sum + i; end, disp(sum)</p> Signup and view all the answers

Write a MATLAB program to find the area of a circle, given the radius.

<p>r = input('Enter the radius: '); area = pi * r^2; disp(area)</p> Signup and view all the answers

Write a MATLAB program to find the roots of a quadratic equation.

<p>a = input('Enter coefficient a: '); b = input('Enter coefficient b: '); c = input('Enter coefficient c: '); x = (-b + sqrt(b^2 - 4<em>a</em>c)) / (2*a); disp(x)</p> Signup and view all the answers

Write a MATLAB program to find the eigenvalues of a matrix.

<p>A = input('Enter the matrix A: '); eigenvalues = eig(A); disp(eigenvalues)</p> Signup and view all the answers

Write a MATLAB program to find the determinant of a matrix.

<p>A = input('Enter the matrix A: '); det_A = det(A); disp(det_A)</p> Signup and view all the answers

Write a MATLAB program to find the inverse of a matrix.

<p>A = input('Enter the matrix A: '); inv_A = inv(A); disp(inv_A)</p> Signup and view all the answers

Write a MATLAB program to find the solution of a system of linear equations.

<p>A = input('Enter the coefficient matrix A: '); b = input('Enter the constant vector b: '); x = A \ b; disp(x)</p> Signup and view all the answers

Write a MATLAB program to find the Fourier transform of a signal.

<p>x = input('Enter the signal x: '); X = fft(x); disp(X)</p> Signup and view all the answers

Write a MATLAB program to find the convolution of two signals.

<p>x = input('Enter the signal x: '); h = input('Enter the impulse response h: '); y = conv(x, h); disp(y)</p> Signup and view all the answers

More Like This

Basics of MATLAB Programming Tools 2
32 questions
Introduction to MATLAB Programming
12 questions
Introduction to MATLAB Programming
19 questions
Use Quizgecko on...
Browser
Browser