- Look at the lines before line 7 in plot_FB_triggers.m. Is there a line that assigns a value to tt? For example:
NEED SOLUTION FOR THE FOLLOWING ERROR
4 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
BhaTTa
on 18 Jul 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?
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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!