Index exceed number of elements when using data from an excel table
Show older comments
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 Comments
KSSV
on 20 Oct 2020
Check size of t....it might be less than you expected.
Finneas Phan
on 20 Oct 2020
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!