How Many Months Until It's Today Again?
Given a particular date, calculate how many months must pass before that same day of the month occurs on the same day of the wee...
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
9 years ago
Solved
Sum of the Matrix Elements
Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.
E...
9 years ago
Solved
Angle between two vectors
You have two vectors , determine the angle between these two vectors
For example:
u = [0 0 1];
v = [1 0 0];
The a...
Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector.
For example:
x = [6 10 5 8 9 NaN 23 9 7 3 21 ...
9 years ago
Solved
First N Perfect Squares
*Description*
Return the first N perfect squares
*Example*
input = 4;
output = [ 1 4 9 16 ];
9 years ago
Solved
Times 2 - START HERE
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Examples:...