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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!