Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a function (in a function m-file) that has one input. No outputs will be returned. The input will be a vector. The function should

image text in transcribed
Create a function (in a function m-file) that has one input. No outputs will be returned. The input will be a vector. The function should compute the square of each element of the input vector. First, this function should print the input numbers and their squares to the Command Window in two columns, with the input numbers in the first column and the squares in the second column. All numbers should be printed as integers. (In other words, no decimal points should be printed.) Both columns should have right justification. (In other words, the least significant digits should line up vertically) Second, the function should plot the squares as a function of the input vector. For instance, if the first value was 0.5, first point of the plot should be (0.5.0.25). The plot should be made with smooth lines. Prepare a script. This script should create a vector of integers, starting at 1 and ending at 10 in increments of 1. Call your function with this vector as input

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago