Error: Function definitions are not permitted in this context.
Show older comments
HI,
I already went through the forums and I don't seem to understand the issue. I just switched to a new PC and this script/function was working on my old PC not more than a few hours ago. It's for displaying datestr with the data cursor. I got it from... https://www.mathworks.com/matlabcentral/newsreader/view_thread/265493 at the very bottom and it had worked perfectly. Now I get an error saying it's not permitted.
the saved file....
function txt = myupdatefcn(empt,event_obj)
% Customizes text of data tips
pos = get(event_obj,'Position');
txt = {['time: ',datestr(pos(1))],...
['amplitude: ',num2str(pos(2))]};
Accepted Answer
More Answers (0)
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!