Call function written in the same script using F9
4 次查看(过去 30 天)
显示 更早的评论
Hello,
let assume this simple code with a custom routine at the end of the code:
a = 0:0.01:100;
b = sin(0:0.01:100);
RMSE_results = Routine_RMSE(a, b);
function [RMSE]=Routine_RMSE(y, yhat)
RMSE = sqrt(mean((y - yhat).^2)); % Root Mean Squared Error
end
If I run it using the RUN button, it works properly.
If I try to run it line by line executing it using F9 the function into the code appears as "undefined", however if I define the routine into an external file, then it works. The function is working also if I execute the entire "section", but is not recognized using F9.
How can call the function written in the same code using F9 ?
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!