Podcast
Questions and Answers
Which one of the following is a correct way to initialize a variable in MATLAB?
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);
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?
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)