horizontal matrix of ones in matlab

To create a horizontal matrix of ones, you can make use of the ones() function in MATLAB along with specifying the size of the matrix. Here is an example:

main.m
% creating a horizontal matrix of ones
ones_matrix = ones(1, 5)

% output: 
% [1 1 1 1 1]
90 chars
6 lines

In the above example, we have created a horizontal matrix of ones with 1 row and 5 columns. The output of the code will be a horizontal row vector of ones.

Hope this helps!

related categories

gistlibby LogSnag