There are a few issues with the code you provided.
First, the function handle declaration should use the anonymous function syntax @(k,c). So, the correct declaration should be:
main.m182 chars2 lines
Second, the power operator in MATLAB is ^
, not **
. Therefore, in the code snippet, you should use ^
instead of **
.
Additionally, you might encounter a problem with the division operator /
in MATLAB. If k
and c
are arrays, you need to use the element-wise division operator ./
instead. However, if k
and c
are scalars, the division operator /
is correct.
Other than these syntax issues, the logic and correctness of the code can only be determined based on the specific problem you are trying to solve.
gistlibby LogSnag