I´m trying to do a script that orders an array of numbers, and then goes into a cycle that asks a number and returns if it´s there and it´s position. I´m new to the program but I´m currently using “sort” function to arrange the numbers and “while” for the cycle. I appreciate your help!

 채택된 답변

John D'Errico
John D'Errico 2016년 4월 4일
편집: John D'Errico 2016년 4월 4일

0 개 추천

Why do something complicated? Learn to use MATLAB, as it is designed to be used.
find(V == n)

댓글 수: 1

I appreciate the truthful comment and I couldn't agree more. Still, I want to get the bases of the program correct and know the functions of both a cycle like while and the binary search. Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by