There may be multiple error, I have noticed one immeditely
You have defined dt1 as
It return the value
Again
You have defined v1 as following, which is scalar
>> v1=4*Q/(pi*dia1^2)
v1 =
0.254647908947033
At the last line (Numerator) calling the v1 as vector
What does it mean? See it becomes v1(2,0+0.05) , which goes to v1(2,0.5)
Here two issue
- As your v1 is scalar based on the data as you have defined, there is no menaing of v1(?,?)
- If v1 is vector, please ensure that v1(r,c), these r and c values always greater that 0 (real positive) within the specified rannge,
If r and c are not real and positive integers than Matlab shows the error
error of Subscript indices must either be real positive integers or logicals
And if the r and c value out of range (dimension), Matlab shows the error-
index exceeds matrix dimension.
Please debug the code step by step and find the issue. Indeed this is easy, hope you can do it.
Good Luck & Hope it Helps!
Best Answer