variable tt is size [1 100] in matlab

To declare a variable tt in MATLAB with a size of [1 100], you can use the following syntax:

main.m
tt = zeros(1, 100); % initializing tt with 100 zeros
53 chars
2 lines

This creates a variable tt as a 1-by-100 array with all elements initialized to zero. You can then assign new values to the elements of tt using normal MATLAB indexing syntax. For example:

main.m
tt(1) = 5; % assigning the value 5 to the first element of tt
tt(50) = 10; % assigning the value 10 to the 50th element of tt
126 chars
3 lines

You can also create a row vector of ones instead of zeros if that is more appropriate for your use case.

gistlibby LogSnag