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))
|
1051 Solvers
Who is the smartest MATLAB programmer?
561 Solvers
Find out sum and carry of Binary adder
380 Solvers
390 Solvers
Calculate Amount of Cake Frosting
7541 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!