Nice. What is the difference between this vector and x = linspace(1,10,10)?
Hello Matthew Jones,
Linspace is similar to the colon operator ":", but gives direct control over the number of points.
In x = linspace(1,10,10) you directly enter the number of points and the function generates equally spaced vector but when you use ":" operator, you need to mention step size.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x_correct = [1 2 3 4 5 6 7 8 9 10];
assert(isequal(oneToTen,x_correct))
|
Find the longest sequence of 1's in a binary sequence.
3369 Solvers
Return the largest number that is adjacent to a zero
3749 Solvers
261 Solvers
1096 Solvers
2617 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!