HOW TO SOLVE THIS?
Show older comments

8 Comments
Image Analyst
on 1 Jan 2023
I can't read that language but the equation goes in MATLAB exactly as it is written there. That is proper syntax.
daniel
on 1 Jan 2023
Torsten
on 1 Jan 2023
function v = velocity(x,y,z,t)
v = sqrt(diff(x).^2+diff(y).^2+diff(z).^2)./diff(t);
end
Done.
daniel
on 1 Jan 2023
Yes, then supply t,x,y and z as vectors of the same length.
Or check their lengths in the function.
Matt J
on 1 Jan 2023
See guidelines for homework help:
daniel
on 1 Jan 2023
Walter Roberson
on 1 Jan 2023
In the case of that error message, the problem is that you had accidentally created a variable named velocity that you are then trying to index. If there is a variable in scope and a function of the same name, MATLAB gives priority to the variable in scope.
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
