NEED SOLUTION FOR THE FOLLOWING ERROR

2 ビュー (過去 30 日間)
Pavan Kumar Reddy Yannam
Pavan Kumar Reddy Yannam 2019 年 4 月 4 日
回答済み: BhaTTa 2025 年 7 月 18 日
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?

回答 (1 件)

BhaTTa
BhaTTa 2025 年 7 月 18 日
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.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by