Output argument "objectivefunction" (and maybe others) not assigned during call to "coba.nila​iobjective​function". How To Solve this error?

조회 수: 2 (최근 30일)
There is a sentence like this "Output argument "objectivefunction" (and maybe others) not assigned during call to "coba.nilaiobjectivefunction".

답변 (1개)

Niranjan Sundararajan
Niranjan Sundararajan 2023년 6월 7일
Hey there,
There are a few possible reasons why you could be getting this error. The most common ones are:
  1. The function "coba.nilaiobjectivefunction" may not be returning a value for the output argument "objectivefunction". In this case, you may need to modify the function to ensure that it is properly computing and returning the desired output value(s).
  2. The function call syntax might be incorrect, leading to the output arguments not being properly assigned. Check that you are correctly specifying the output argument(s) in the function call.
  3. There may be a typo or other error in your code that is preventing the output argument from being assigned correctly.
val_of_func = test_func(1) % correct call
val_of_func = 1
val_of_func = test_func_err(1) % error call
Output argument "out" (and possibly others) not assigned a value in the execution with "solution>test_func_err" function.
A correct example:
function out = test_func(inp)
out = inp;
end
Possible errors:
function out = test_func_err(inp)
% not returning any value with the variable 'out'
out_misspelled = inp; % spelling mistake
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by