Write a function file with these parameters
이전 댓글 표시
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
2011년 4월 7일
h(p)
?
댓글 수: 1
Matt Tearle
2011년 4월 7일
That's what I was thinking. I was confused.
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
2011년 4월 10일
Walter Roberson
2011년 4월 10일
You posted this as a separate question (which was the correct thing to do) and it was answered there.
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!