Skip to main content
7-Bedrock
April 22, 2024
Solved

Vectorizing the solution

  • April 22, 2024
  • 2 replies
  • 1050 views

Ideally when we use the vectors with function it should give solution for individual input. I think I am missing something? 

YY_10946939_0-1713777628939.png

 

Best answer by YY_10946939

I think I found it just needed to vectorize the equation. 

2 replies

YY_109469397-BedrockAuthorAnswer
7-Bedrock
April 22, 2024

I think I found it just needed to vectorize the equation. 

25-Diamond I
April 22, 2024

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.