Display matrix results with message
Afficher commentaires plus anciens
I'm new to Matlab, and just finishing up a semester of a programming class. This is only the second week of Matlab instruction. I have written a program that takes input from a file with 20 rows and one column of data. It performs calculations on that data, and creates a graph comparing the original data and the calculation, which is also stored in a matrix with one column being the original data, and the second column being the calculation. I can do all of that just fine. I can also print this output in columns to the screen. What I can't figure out is how to loop through the final output and print a message if the calculated data is above a certain value, in this case 125. So I'd like to print each row, and if the calculated data is above 125, also print a message. I had a tough time with looping in C, which was covered during most of this semester, but I figured it out as I progressed. There was a similar requirement on the last assignment which I turned in without having figured it out. Just need some guidance on how to approach this.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!