フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Question-1: Consider a set of N numbers, myArray, (represented as a row vector) which is not ordered. Write a function myStats which takes myArray and an integer k such that 1≤k≤N and returns the kth largest and kth smallest element in myArray. Your

1 回表示 (過去 30 日間)
mayur saraiya
mayur saraiya 2014 年 6 月 16 日
閉鎖済み: John D'Errico 2014 年 6 月 16 日
Question-1: Consider a set of N numbers, myArray, (represented as a row vector) which is not ordered. Write a function myStats which takes myArray and an integer k such that 1≤k≤N and returns the kth largest and kth smallest element in myArray. Your function should ensure the function is called with valid number of arguments and the validity of the arguments itself. Also note that, you cannot use any built-in functions to order the elements within myArray. You should write your own code to order the data, if necessary. Write a script helpMyStats.m which reads all the elements of myArray and the value k from the user and displays the result by calling myStats function with the appropriate input data.
  1 件のコメント
Geoff Hayes
Geoff Hayes 2014 年 6 月 16 日
Mayur - This seems like a homework question. I especially like the line You should write your own code to order the data. Please make an attempt at solving this problem before a question in this manner.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by