フィルターのクリア

Write a function file with these parameters

1 回表示 (過去 30 日間)
kenifeh
kenifeh 2011 年 4 月 7 日
Hi Guys
Please can someone write a function for me
Assume we have a random array h=(2 4 6 1 7 5 9 8 9 2 5 7 2 4 6 7)
With a given iteration, p=1:16
The function should be such that can output the given value of h when i input any value of p from 1:16.
Please this is urgent. And i will apprecaite if i can get the answer soonest

回答 (2 件)

Sean de Wolski
Sean de Wolski 2011 年 4 月 7 日
  1 件のコメント
Matt Tearle
Matt Tearle 2011 年 4 月 7 日
That's what I was thinking. I was confused.

サインインしてコメントする。


Fangjun Jiang
Fangjun Jiang 2011 年 4 月 7 日
I think may be this:
h=[2 4 6 1 7 5 9 8 9 2 5 7 2 4 6 7];
for p=1:16
index=input('please enter a number between 1 to 16:');
answer=h(index)
end
  2 件のコメント
kenifeh
kenifeh 2011 年 4 月 10 日
Thanks a million for your response. This is the answer i need. But can someone help me modify this further? Now, i dont want it to request that i input any value of p before displaying the right value of h. I want it to be able to call the following
1. h(2)-h(1), h(3)-h(2), h(4)-h(3), h(5)-(h4), h(6)-h(5)...h(16)-h(15).
2. For the values in 1 above, display the figure(how many?) of digits that are less than 2
I need the answer to develop a specific code...Thanks, in anticipation of an urgent response
Walter Roberson
Walter Roberson 2011 年 4 月 10 日
You posted this as a separate question (which was the correct thing to do) and it was answered there.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by