Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Ideally when we use the vectors with function it should give solution for individual input. I think I am missing something?
Solved! Go to Solution.
I think I found it just needed to vectorize the equation.
I think I found it just needed to vectorize the equation.
The function you define in the picture you posted has an argument q which isn't used at all on the right definition size of your function.
So regardless what you provide as argument when you call that function, the result will be the very same scalar.
Of course if you call the function with a 3-element vector and vectorize the function call, the function is called three times and the result will be a 3-element vector with all the same values. I can't see much sense in doing so, though.