Index exceed number of elements when using data from an excel table
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi guys, i'm doing an assignment on using data from an excel table in Matlab. Our task was to input the given data in form of a table. But when i ran the code, this error pops up and i don't really know where it went wrong or how to fix it. Please help!!
Error - Index exceeds the number of array elements (1).
Error in zadanie25 (line 12)
fprintf(' %12s ',t{i})
clc
Name_F='Таблица Турбобуры.xlsx';
Name_L1='Лист1';
[n,t]=xlsread(Name_F,Name_L1,'g1:g17')
[n,p]=xlsread(Name_F,Name_L1,'j1:j17')
k=xlsread(Name_F,Name_L1,'g1:g17')
for i=1:7000
fprintf(' %12s ',t{i})
fprintf(' %15s \n ',p{i})
fprintf(' %3.1i ',k(i))
fprintf(' %16i ',n(i))
end
댓글 수: 2
채택된 답변
KSSV
2020년 10월 20일
for i=1:length(t)
fprintf(' %12s ',t{i})
end
for i=1:length(p)
fprintf(' %15s \n ',p{i})
end
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!