Title causes error when trying to plot graph

11 vues (au cours des 30 derniers jours)
Ryan
Ryan le 8 Nov 2012
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');

Réponse acceptée

Sean de Wolski
Sean de Wolski le 8 Nov 2012
That means you have a variable named title
which title
whos title
To resolve it clear or rename that variable:
clear title
  6 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 8 Nov 2012
ans =
One of the top 5 user errors....
Matt Fig
Matt Fig le 8 Nov 2012
Sean and Azzi, you guys are probably correct!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Labels and Annotations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by