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))
|
733 Solvers
Get the area codes from a list of phone numbers
532 Solvers
Increment a number, given its digits
562 Solvers
Back to basics 21 - Matrix replicating
1052 Solvers
412 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!