How do I create a function without getting this Error: Function definitions are not permitted in this context?
이전 댓글 표시
I'm trying to create this function, and I am getting an error. I don't know what I am doing wrong...
>> function [y] = myfunc( x, y, z )
y = -9*x - 10*y+ z*(-log(100-x-y)-log(x)-log(y)-log(50-x+y));
end
function [y] = myfunc( x, y, z )
↑
Error: Function definitions are not permitted in this context.
채택된 답변
추가 답변 (1개)
KSSV
2017년 3월 22일
0 개 추천
I guess you have copied this under some already existing code. Copy this in fresh m file and save.
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!