Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume you have the following code for the calcCir user - defined function: function circumference = calcCir ( rad ) circumference = 2 * pi

Assume you have the following code for the "calcCir" user-defined function:
function circumference = calcCir(rad)
circumference =2*pi*rad;
end
You also have the following script using the "calcCir" function:
my_vec =(1:6);
c_vec = calcCir(my_vec);
plot(my_vec, c_vec, 'blue*')
title('Circumference of a circle (x) as compared to its radius (y)')
ylabel('radius')
xlabel('circumference')
What is wrong with the function?
I.The function calcCir can only be used for scalars. For use with vectors, * must be changed to .*
II.In the script, 'blue*' must be changed to 'b*'
III.The semicolon in the calcCir function should be deleted
IV.You should specify the title, x label, and y label of a plot before you create it.
V.The x and y axis labels are swapped around

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_2

Step: 3

blur-text-image_3

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago