You can use a for loop in MATLAB to find the summation of numbers greater than 5 from 1 to 10. Here's how you can do it:
main.m366 chars19 lines
The above code will output:
main.m38 chars8 lines
In this example, the for loop iterates through the numbers from 1 to 10. Each number is checked if it's greater than 5, and if so, it is added to the variable sum
. The numbers greater than 5 (6, 7, 8, 9, 10) are also printed individually, and at the end, the total summation is printed.
gistlibby LogSnag