Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Write a line that assigns the value 10 to x, and then assigns the value of 5 + x to y.
Use a semicolon to separate the two assignments.
Enter a command that sets a=2, then displays the value of 3*a.
Don't forget to include the semicolon after the assignment!
What is the result of a=7; b=cos(a), c=cosh(a)?
Remember what the comma does in terms of output.
True or False: Using a semicolon at the end of a line in MATLAB will result in output being displayed.
Think about the purpose of the semicolon.
Write a line of code that combines the commands to define two variables, x=8 and then calculate the square of x and assign to squared, showing the value of squared in output.
Use a comma to display the calculated value of `squared`.
Combine the commands to set two angles in degrees, theta1=30 and theta2=45, and then calculate their sine values suppressing their outputs in one line.
What punctuation will you use to avoid displaying intermediates?
6 more questions in this section. Enroll free to practise them all.
Enroll free