写作Math 9 留学生作业、 写作Matlab语言作业

写作Canvas留学生作业、 写作Matlab语言作业、 辅导Matlab程序设计作业
Math 9 Homework 3
Winter 2020
Write the following functions files in Matlab, create a zip file containing these files and upload this zip
file to Canvas. To receive full credit, you must use the exact function names given below, and you must
not have extra terms getting printed to the screen. Make sure your file name is the same as your function
name. The name of your zip file should be homework3.zip
You are only allowed to use the following built-in terms/commands/functions: for, while if/elseif/else,
true, false, length. You can also use symbols such as *, ==, [], +, :, basically anything that does not
require writing out in words. You may build your own functions which mimics pre-existing functions and
use them.
1. Write a function custom min(v) which takes as input a vector v and as output returns the smallest
element of v. For example custom min([1 2 -3 -2]) will return -3. (Dont use min())
2. Write a function remove elt(v,n) that takes as input a vector v and a number n and as output returns
a vector that is the same as v but with the single value of n removed. For example, remove elt([-2 1 3
1 5], 1), then the output should be either [-2 3 1 5] or [-2 1 3 5].
3. Write a function custom sort(v) that takes as input a vector v and as output returns the vector v sorted
into increasing order.
4. Write a function is sorted(v) that returns true if v is sorted in increasing order and returns false
otherwise.
5. Write a function backwards sort(v) that takes as input a vector v and as output returns the vector v
sorted into decreasing order.
1

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导