Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

MATLAB BASIC PROGRAMMING. QUESTIONS & CORRECT ANSWERS. ALREADY GRADED A+.

Rating
-
Sold
-
Pages
13
Grade
A+
Uploaded on
14-06-2024
Written in
2023/2024

MATLAB BASIC PROGRAMMING. QUESTIONS & CORRECT ANSWERS. ALREADY GRADED A+.

Institution
Course

Content preview

MATLAB BASIC PROGRAMMING.
QUESTIONS & CORRECTANSWERS.
ALREADY GRADED A+.
- myArray( [3, 4, 5] ) yields the new row array [70, 80, 90]. The indexing array is the
integer array [3, 4, 5].
-myArray( [3:1:5] ) also yields [70, 80, 90]. The double colon operator can be used to
construct the indexing array.
-myArray(3:1:5) yields the same. When constructing a row array using the double colon
operator, the brackets are optional. Omitting the brackets in an assignment statement,
as in myArray = 50:10:90, is discouraged. In contrast, omitting the brackets for the
indexing array is commonplace.
-myArray(3:5) yields the same. The default increment of 1 in the double colon operator
is commonly used when indexing. - ANSFor example, if myArray = [50, 60, 70, 80, 90],
then:

' (transpose operator) - ANSmakes [1,2,3,4] into
[1
2
3
4]

's' - ANSComplete the statement to obtain a string from the user rather than a number.

userName = input('Sally',_____);

" - ANSTwo single quotation marks print a single quotation mark. Note that a single
quotation mark alone would instead indicate the end of the format specification.

( ) parenthesis
~ not
& and
| or
left-to-right - ANSlogical operators order of operation

[0, 0, 1]

& is applied element-wise, yielding [1 & 0, 0 & 0, 1 & 1] = [0, 0, 1] - ANS[1, 0, 1] & [0, 0,
1] yields what new array?

[1, 1, 1, 0] - ANS~[0, 0, 0, 1] yields what new array?

, [3,5;2,4;1,9] - ANSWhat is matrixC after executing the following statement? matrixA =
[ 3, 1, 4; 2, 5, 9 ];
matrixC = reshape( matrixA, 3, 2 )

\\ - ANSTwo backslash characters print one backslash character. Note that a single
backslash character would instead indicate the start of a special character sequence
like \n.

\n - ANSprints a new line

\t - ANSprints a tab

& - ANSboolean &

%-8.2f - ANSFixed-point occupying a minimum of 8 digits, left-aligned, with 2 digits to
the right of the decimal point.

%.4f - ANSFixed-point with 4 digits to the right of the decimal point.

%% - ANSTwo percent characters print one percent character. Note that a single %
character would instead indicate the start of a formatting operator like %f.

%c - ANScharacter

%d - ANSinteger

%e - ANSscientific notation

%E - ANSscientific notation

%f - ANSfixed-point

%G - ANSeither %f or %E whichever is shorter

%g - ANSwither %f or %e whatever is shorter

%i - ANSinteger

%s - ANSstring

| - ANSboolean or

~a or not(a) - ANSNot negates or complements the value of a, returning true if a is false,
and vice versa.

0

Written for

Course

Document information

Uploaded on
June 14, 2024
Number of pages
13
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$15.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
wilfredmburuUS

Get to know the seller

Seller avatar
wilfredmburuUS Johns Hopkins University School Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
8
Member since
2 year
Number of followers
0
Documents
1213
Last sold
1 week ago
Grade A+ Assignments, Exams, Quizzes, and Homework

EXCELLENT ASSIGNMENT AND EXERCISES HELP & TUTORING, ALL KINDS OF QUIZS & EXAMS WITH A GUARANTEED GRADE A. I am an expert on major courses especially; Human Resource Management, Criminal Justice, Criminology, Nursing, Sociology, Data Science, Environmental Science, Management Leadership and Forensics ensuring quality work delivery. I maintain scholarly standards in all my work, ensuring students get the best from me. I assure you a GOOD GRADE if you will use my work.

Read more Read less
0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions