Gistlib Logo

gistlib

explain x=1:100; in matlab

x=1:100; creates a row vector x containing values from 1 to 100 in increments of 1. It is equivalent to the command x=[1 2 3 ... 99 100];, but using the : operator for creating an array of consecutive values is more efficient and less error-prone.

similar matlab code snippets

use the elements of an array as function arguments in matlab
reverse a character array in matlab
insert code to determine the size of the times table in matlab
how to replace each element in a array with the row of another array in matlab
make a random 100-by-100 matrix in matlab
generate tribonacci sequence in matlab
create a matrix with only pi and size 3x3 in matlab
add element to empty cell in matlab
make a matrix in matlab
find the thirteen adjacent digits in the 1000-digit number that have the greatest product. what is the value of this product? in matlab

related categories

matlab
arrays

gistlibby LogSnag