Gistlib Logo

gistlib

{x(1),x(2)} meaning in matlab

{x(1),x(2)} is not valid syntax in MATLAB. To create an array that contains the values of x at indices 1 and 2, you can use square brackets like this:

main.m
[x(1), x(2)]
13 chars
2 lines

This will create a 1x2 array containing the values of x(1) and x(2).

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