NEED SOLUTION FOR THE FOLLOWING ERROR

11 vues (au cours des 30 derniers jours)
Pavan Kumar Reddy Yannam
Pavan Kumar Reddy Yannam le 4 Avr 2019
Réponse apportée : BhaTTa le 18 Juil 2025
I'm having this error " Undefined function or variable 'tt'. Error in plot_FB_triggers (line 7) Plot(tt, can.DATDev.FB_Triggers.ctimeu, ... " What should I do If I get this error?

Réponses (1)

BhaTTa
BhaTTa le 18 Juil 2025
Hey @Pavan Kumar Reddy Yannam, the error means MATLAB can't find a variable or function named tt when it tries to execute line 7 of your plot_FB_triggers.m file.
Can you please verify the checklist below:
1. Is tt defined before line 7?
  • Look at the lines before line 7 in plot_FB_triggers.m. Is there a line that assigns a value to tt? For example:
tt = (1:100)'; % Example: create a time vector
% Or, is it loaded from somewhere?
% load('my_data.mat', 'tt');
2. If plot_FB_triggers is a function, is tt passed as an input argument?
function plot_FB_triggers(tt, can) % <--- tt must be an input
% ...
Plot(tt, can.DATDev.FB_Triggers.ctimeu, ...
end
3. Typo? Double-check the spelling of tt. Maybe it's t or time or something else in your code.
Hope it helps.

Catégories

En savoir plus sur MATLAB 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