MATLAB Answers


Creating a matrix of specific size, in which I can input each element value.

Asked by Ricardo Whitaker on 16 Sep 2018
Latest activity Edited by Adam Danz
on 16 Sep 2018
Hello Everyone,
I would like to create a matrix of a Nx1 size where I can input the value of each the "N" elements of the matrix automatically. For example, if I want a 4x1 matrix, I would like to be able to input the first element, second and so forth manually. Thanks for the help and I hope I made myself clear.

  1 Comment

The question isn't clear. Are you asking how to allocate a matrix?
m = nan(18,1);
m = zeros(18,1);
m = ones(18,1);
Are you asking how to put data into a matrix?
m(4,1) = 3.14;

Sign in to comment.

0 Answers