Borrar filtros
Borrar filtros

Error "not enough input arguments" in length function

5 visualizaciones (últimos 30 días)
Tanaya Chatterjee
Tanaya Chatterjee el 13 de Mayo de 2020
Comentada: dpb el 21 de Jun. de 2020
I am trying to run a code but receiving an error at the 4th line with 'not enough input' for the length function. What can be inserted in further to remove the error.
function [coef] = ComputeCurve_EDIT (SUBJRAWSubj1S1)
coef = [];
i = 1; % matrix row index
NRrows = Length (SUBJRAWSubj1S1);
while (i <= NRrows) % while not end of matrix
x = []; % initialize to-be-filled vectors
y = [];
xnorm = [];
ynorm = [];
n = i; % keeps track of the number of samples on a given trial
trialNR = SUBJRAWSubj1S1 (i, 1);
while (SUBJRAWSubj1S1 (i, 1) == trialNR) % fill x and y coordinate vectors
x = [x; SUBJRAWSubj1S1 (i, 2)];
y = [y; SUBJRAWSubj1S1 (i, 3)];
i = i + 1;
if (i> NRrows)
break
end
end
  3 comentarios
Tanaya Chatterjee
Tanaya Chatterjee el 21 de Jun. de 2020
hello, thank you for your response.
I have a data with three columns with around 150 rows. trial number, x position and y position.
I want matlab to screen throught the length/ size of the rows in the columns and assign that variable as Nrows. What do you think should be the 'D' in size(x,D) because when i try size(x) it is returning not enough input argument.
Thank you for your help!
dpb
dpb el 21 de Jun. de 2020
As said, if you are concerned about the rows, that's dimension 1 so the 'D' argument to size would be one.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by