MATLAB: “Index exceeds matrix dimensions.” error

matrix dimensions

Hi, When I execute this code everything is okey except text line, it gives "Index exceeds matrix dimensions." error in this line. But x limits between 0 and 20, y limits between -4 and 16. I think that I missed out a point. Thanks for your help.
clc;
close all;
clear all;
[num,text,all] = xlsread('Data.xls','C3:C450'); % it takes dates as number
num=num+693960;%Excel Time to Matlab Time
dt=datestr(num);
temperature=xlsread('Data.xls','G3:G450');
ts1 = timeseries(temperature,dt);
plot(ts1)
xlim % 0 20
ylim % -4 16
text(10,10, 'Hello World')

Best Answer

Check in your code: text was used as a variable
It's in the line
[num,text,all] = ...
replace it by
[num,text1,all] =