Title causes error when trying to plot graph

12 次查看(过去 30 天)
For some reason my code won't put a title on the axes. I get the error:
Attempted to access title(104); index out of bounds because
numel(title)=6.
Error in DisplayShift_Fluorescence (line 41)
title('h');
plot(AverageCalibrated(1:32,9),AverageCalibrated(1:32,10))
hold on
plot(AverageNonCalibrated(1:32,9),AverageNonCalibrated(1:32,10),'r')
legend('Calibrated','NonCalibrated')
xlabel('Wavelength')
ylabel('Intensity')
title('h');

采纳的回答

Sean de Wolski
Sean de Wolski 2012-11-8
That means you have a variable named title
which title
whos title
To resolve it clear or rename that variable:
clear title
  6 个评论
Matt Fig
Matt Fig 2012-11-8
Sean and Azzi, you guys are probably correct!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by