Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Array Generation and Indexing: array 1 = [ 0 . 0 0 . 5 2 . 1 - 3 . 5 6 . 0 0

Array Generation and Indexing:
array1=[0.00.52.1-3.56.00.0-1.1-6.62.83.42.10.10.3-0.41.31.15.10.01.1-2.0]
5 of 6 these questions in the command window]
the array above. (Hint: Use arrayl -3.56.0; 0.0dotsdots?? )
v) w nat is the size of array1?(Hint: Use size function in command window.)
c) What is the value of array 1(1,4)?
d) Evaluate the output of max (array1). Describe its function. (Hint: doc max and figure out how to use it and explain in one sentence.)
e) BONUS [DO IT YOURSELF]- Search online and find the solution yourself: How can we find the maximum of the complete array?
Array size: Determine the size and contents of the following arrays (Take a screenshot of each output). Note that the later arrays may depend on the definitions of arrays defined earlier in this exercise. Understand each output well, you will need it in the next lab and following topics.
[Execute these questions in the command window]
a)a=2:3:8; itilizing a variable with linear spacing of 3
b)b=[a'a'a']; %ranspose Example
c)c=zeros(1,3); %@ Automatic initialization
d) Analyze the output of previous question(c). What does zeros function generate? Check 'doc zeros' to gain more information.
Page 4 of 6
Introduction to Programming - Lab Manual
Output Formatting:
Background
num2str: Converts number to string
int2str: Converts string to number
fprintf: Formats data and displays the results on the screen
[Execute these questions in the command window]
Assign 10 to variable value (value =10**. Take a screenshot of each question and evaluate formatting options shown below:
a) 'value =' num value
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is corporate governance? What is dividend policy? Explain .

Answered: 1 week ago