Deniz
Deniz

Reputation: 29

MATLAB does not define vector for a specific function when I use a vector as an input

The code block is the following

V=0:30
Gacc=V.^2/(g*L+Kus*V.^2)
Gyaw=V./(L+Kus*(V.^2/g))

I can perfectly get Gyaw as a vector but for Gacc I only get a scalar for the final input V=30. I tried it in a for loop and saw that it can calculate but somehow I only get the last one. How do I assign them to a vector?

g=9.81, L=2.794 and Kus=0.026294 all constants.

Upvotes: 0

Views: 27

Answers (1)

David Berri
David Berri

Reputation: 40

Considering that the other variables are scalars, and only V is a vector, I think you forgot a dot before the division.

Gacc=(V.^2)./(g*L+Kus*V.^2)

Upvotes: 1

Related Questions