Impossible to do an indexing

조회 수: 1 (최근 30일)
Cyril Tordeur
Cyril Tordeur 2021년 9월 23일
답변: Star Strider 2021년 9월 23일
Hi everyone,
I've imported an EMG signal named soleus and I want to find the position of the stimulations (stim and stim_Hz) on that signal.
It's always working except this time were I have this error message: "Array indices must be positive integers or logical values."
soleus 1683210x1 double,
stim 82x1 double,
stim_Hz 82x1 double
>> load('LV+Hreflex.mat')
>> soleus = LV_Hreflex_Ch7.values;
>> stim = LV_Hreflex_Ch10.times;
>> stim_Hz = stim*4000;
>> soleus(stim_Hz)
Array indices must be positive integers or logical values.
Thanks!

답변 (1개)

Star Strider
Star Strider 2021년 9월 23일
I suspect the problem is with:
soleus(stim_Hz)
Here, ‘stim_Hz’ must be either logical, or integers greater than 0. There are a number of ways to convert non-integer numbers to integers (for example ceil, others are linked to in that page), and comparisons to a value will prodice a logical vector.
.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by