Develop a matlab program that generates a 10x10 array of random integers and uses appropriate flow-control structures to search the grid and determine the maximum and minimum
46 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Develop a matlab program that generates a 10x10 array of random integers and uses appropriate flow-control structures to search the grid and determine the maximum and minimum value. Furthermore, the program should also output both the original and sorted version of the 10x10 array.
2 comentarios
Steven Lord
el 4 de Abr. de 2024 a las 13:45
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
DGM
el 4 de Abr. de 2024 a las 17:16
It's only mentioned that the array is supposed to be sorted, but it's not clear how it's suppsed to be sorted. Is the result a vector? Is it a 2D array with sorted rows? Sorted columns?
Respuestas (1)
DGM
el 4 de Abr. de 2024 a las 17:40
Editada: DGM
el 4 de Abr. de 2024 a las 17:43
Want to see if your TA can tell you didn't do your own homework? Here's a fair test.
[~,A] = system('od -vAn -N200 -tu2 < /dev/urandom');
A = reshape(sscanf(A,'%d'),1E1,[])
A_sorted = intersect(A,A)
[Amin Amax] = bounds(A_sorted)
I'm going to assume "output" means "dumps to console", and that "appropriate flow control statements" means "none".
0 comentarios
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!