HOW TO SOLVE THIS?
Ältere Kommentare anzeigen

8 Kommentare
Image Analyst
am 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
am 1 Jan. 2023
Torsten
am 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
am 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
am 1 Jan. 2023
See guidelines for homework help:
daniel
am 1 Jan. 2023
Walter Roberson
am 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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

