Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Write a for loop that counts from 1 to 10.
Think about what variable you want to iterate.
What does the command for k = 3:7 imply?
What does the loop start with?
What is the primary function of a for loop in MATLAB?
Think about the repetition aspect of programming.
True or False: Indentation in a for loop is mandatory in MATLAB.
Can you code without indentation?
Create a MATLAB script that generates a factorial of numbers from 1 to 10 using a for loop.
Think about how you can multiply the numbers together.
Write a MATLAB script that uses a for loop to plot the sine waves for angles from 0 to 360 degrees in 10-degree increments.
How can you use `plot` function with the values you have computed?
5 more questions in this section. Enroll free to practise them all.
Enroll free