Borrar filtros
Borrar filtros

How to plug in one value a time from a matrix into a function (WaitSecs)

1 visualización (últimos 30 días)
Dear community members:
I am trying to plug in one value a time from a 5x1 matrix (A) to WaitSecs, which is a psychtoolbox 3 function that pauses for a given amount of time.
The following is my attemp:
A matrix contain values such as:
0.9277
1.2880
1.0043
1.2888
1.1997
for k = A
WaitSecs(A(:,i))
end
but ended up with the error : "Subscript indices must either be real positive integers or logicals."
thanks in advance

Respuesta aceptada

Birdman
Birdman el 23 de Mzo. de 2020
It should look something like this:
for k=1:numel(A)
WaitSecs(A(k))
end
.
.
.
  1 comentario
Yu Takahashi
Yu Takahashi el 24 de Mzo. de 2020
Not expecting to get such a swift response, thanks a lot for the help! Works perfectly

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Installation and Operational Settings en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by