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

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago