answer has been figured out
Mostrar comentarios más antiguos

I am a bit confused what to do for this task, i have figured out how to find the lowest number in the array but i do not know how to show the lowest number with the lowest change with out first input and display the element location , like shown in the example. Any ideas on what to do?
3 comentarios
per isakson
el 15 de Sept. de 2017
Editada: per isakson
el 15 de Sept. de 2017
"[...] like shown in the example" What example?
@James Neilson: it is not appreciated when you edit away the text of your question. Imagine if everyone did that, then this entire forum would be useless for anyone else as it would only consist of thousands of threads all reading "got it". Would you find that useful?
By deleting your question you unilaterally decided that Jan Simons' volunteered time helping you shall not be useful to anyone else. Does Jan Simon get a say in this decision? Do you think this is why we volunteers come here and write our advice and comments?
If you want a consulting service then you will find plenty of them on them internet. This is a community forum with answers provided by volunteers.
Rena Berman
el 18 de Sept. de 2017
(Answers Dev) Restored edit
Respuestas (1)
Jan
el 15 de Sept. de 2017
The question is not clear. "find the lowest number in the array" is not part of the problem. What does "with out first input and display the element location" mean? It might be more clear, if you post your current code.
Note that the forum is not thought to solve your homework. The solution needs 2 lines of code only and it is hard not to post a complete solution in consequence. Let my try to give a hint:
You need the distance between a number and the elements of the vector:
dist = abs(number - vector)
Then you can find the minimal distance by the min() command and use dist == minimal_distance to get the indices of the elements with this distance. Try to implement this and post your code if you have further questions.
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!