Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve it in matlab Creating points Write the function CreatePoints that takes a double precision scalar endValue as input argument and perform the following tasks

image text in transcribedimage text in transcribedsolve it in matlab

Creating points Write the function CreatePoints that takes a double precision scalar endValue as input argument and perform the following tasks Assign linspacePoints a numeric array with ten values spaced evenly from 1 to the double precision scalar endValue. Assign reversePoints that reverses the order of linspacePoints. Assign countPoints with the number of elements in linspacePoints greater than and equal to 5. The function call is: [linspacePoints, reversePoints, countPoints] = CreatePoints(endValue) The input argument endValue is a double precision scalar. The output arguments: . linspacePoints: A 1x10 double precision array containing ten evenly spaced numbers from 1 to endValue. . reversePoints: A 1x10 double precision array containing the numbers in linspacePoints in reverse order. countPoints: A double precision scalar equals to the number of elements in linspacePoints greater than and equal to 5. Restrictions: Do not use loops or if else statements. Example: endValue-10 On calling function, [linspacePoints, reversePoints, countPoints] = CreatePoints(endValue) will produce linspacePoints=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10), ten elements which are evenly spaced from 1 to endValue reversePoints=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], the numbers in linspacePoints in reverse order. countPoints=6, the total number of numbers greater than and equal to 5 in linspacePoints. Test script: endValue=10; [linspacePoints, reversePoints, countPoints] CreatePoints (endValue) Function Template: = CreatePoints(endValue) function [linspacePoints, reversePoints, countPoints] %% Put your code here end

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 Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions