Introductory MATLAB Quiz
3 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

Which one of the following is a correct way to initialize a variable in MATLAB?

  • x <- 5;
  • x := 5;
  • x = 5; (correct)
  • int x = 5;

What is the output of the following MATLAB code? x = [1 2 3]; y = x(2:3); disp(y);

  • 3
  • 1 2
  • 2
  • 2 3 (correct)

Which one of the following is a valid MATLAB function to generate a random integer between 1 and 10?

  • randi(10) (correct)
  • rand(1,10)
  • randint(1,10)
  • random(1,10)

More Like This

Use Quizgecko on...
Browser
Browser