a) Choose the correct answer: 1. What is the size of i after the following code is run in MATLAB, for i=8:3; i-i+3; end a) No output c) 1*1 What will be the output for the following code? b) 0*0 d) Error 2. k=0; i=0; while(k<1 && i<1), k=k+l; i=i+l; i=i-k; end a) i-0, k=1 c) i-1, k=0 3. What is the output of the following code, A=['a', 100; q, w']; b)i-0, k=0 d)i=1, k-1 a) A 2*2 cell array c) A 2*2 character array b) Error d) A 2*2 numeric array

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Q1)
a) Choose the correct answer:
1. What is the size of i after the following code is run in MATLAB, for i=8:3; i=i+3; end
a) No output
c) 1*1
What will be the output for the following code?
b) 0*0
d) Error
2.
k=0; i=0; while(k<1 && i<1), k=k+1; i-i+1; i=i-k; end
b)i-0, k=0
d) i=1, k=1
3. What is the output of the following code, A=['a', 100; 'q', w']:
a) i=0, k-1
c) i=1, k=0
a) A 2*2 cell array
c) A 2*2 character array
b) Error
d) A 2*2 numeric array
4. Which of the following is the output of cat=strcat('Fire','work')?
a) Fire work
c) FireWork
b) Fire&work
d) Firework
5. Create a 4-by-2 array of ones and compute the sum along its row.
b) A = ones(2,4); S = sum(A,2)
d) A = ones(4,2); S = sum(A,2)
6. What is the basic difference between M-files and MAT-files?
a) A = ones(4); S = sum(A,2)
c) A = ones(4,2); S = sum(A,1)
a) There is no difference
b) MAT files are binary data files while M
files are ASCII text files
c) M files are binary data files while
d) There is no such thing as MAT files
MAT files are ASCII text files
7. What will be the output of the following code, x-pi : pi; y=cos(x); plot(x,y)
a) No output
c) A broken cosine curve
b) A perfect cosine curve
d) Cannot be determined
8. Which functions help you to save variables?
a) >> save Variables [x,y]
b) >> save Variables {x y}
d) >> save Variables x y
9. What is the difference between the two code lines?
c) >> save Variables "x.y"
Ci > P=[91,'pi']:
C2 >Q-[91, pi]:
a) Code Cl initializes P as a character array while code C2 initializes Q as an integer array
b) Both P and Q will be integer arrays
c) Code C2 initializes P as a character array while code C1 initializes Q as an integer array
d) Both P and Q will be character arrays
1
Transcribed Image Text:Q1) a) Choose the correct answer: 1. What is the size of i after the following code is run in MATLAB, for i=8:3; i=i+3; end a) No output c) 1*1 What will be the output for the following code? b) 0*0 d) Error 2. k=0; i=0; while(k<1 && i<1), k=k+1; i-i+1; i=i-k; end b)i-0, k=0 d) i=1, k=1 3. What is the output of the following code, A=['a', 100; 'q', w']: a) i=0, k-1 c) i=1, k=0 a) A 2*2 cell array c) A 2*2 character array b) Error d) A 2*2 numeric array 4. Which of the following is the output of cat=strcat('Fire','work')? a) Fire work c) FireWork b) Fire&work d) Firework 5. Create a 4-by-2 array of ones and compute the sum along its row. b) A = ones(2,4); S = sum(A,2) d) A = ones(4,2); S = sum(A,2) 6. What is the basic difference between M-files and MAT-files? a) A = ones(4); S = sum(A,2) c) A = ones(4,2); S = sum(A,1) a) There is no difference b) MAT files are binary data files while M files are ASCII text files c) M files are binary data files while d) There is no such thing as MAT files MAT files are ASCII text files 7. What will be the output of the following code, x-pi : pi; y=cos(x); plot(x,y) a) No output c) A broken cosine curve b) A perfect cosine curve d) Cannot be determined 8. Which functions help you to save variables? a) >> save Variables [x,y] b) >> save Variables {x y} d) >> save Variables x y 9. What is the difference between the two code lines? c) >> save Variables "x.y" Ci > P=[91,'pi']: C2 >Q-[91, pi]: a) Code Cl initializes P as a character array while code C2 initializes Q as an integer array b) Both P and Q will be integer arrays c) Code C2 initializes P as a character array while code C1 initializes Q as an integer array d) Both P and Q will be character arrays 1
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Structure chart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education