Error "Undefined function or variable"
古いコメントを表示
I am receiving one of the following error messages. How can I resolve this issue?
Undefined function or variable 'segment_list'.
Code:
labels = {'cheduepalle';'fame';'chevuoi';'basta'};
segment_counter = 1;
for data_counter=1:num_of_samples
currVideo = data_files(data_counter).Video;
for label_counter = 1: length(currVideo.Labels)
if ismember(currVideo.Labels(label_counter).Name, labels)
s = struct('videoID', data_counter, 'start',currVideo.Labels(label_counter).Begin, 'end', currVideo.Labels(label_counter).End, 'label', currVideo.Labels(label_counter).Name);
segment_list(segment_counter) = s;
segment_counter = segment_counter + 1;
end
end
end
3 件のコメント
Cris LaPierre
2021 年 9 月 18 日
I don't believe you have shared the line of code that is causing the error. Please copy the complete error essage (all the red text) and paste that here.
PaunBGD
2021 年 9 月 18 日
Cris LaPierre
2021 年 9 月 18 日
It looks like segment_list never gets created. This could be because your for loops never end up running, or because your if conditional is never true. See Walter's reply below for more details.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!