How differentiate without using any built-in function

I have the equation for displacement ye=sqrt(t.^2-ft.^2) where ft is a constant and ft is an equation containing x with the array [0:0.001:2*pi], how would you find velocity without using and built in functions. I have tried using a loop and the definition of derivative, however this does not seem to work.

回答 (1 件)

KSSV
KSSV 2020 年 3 月 4 日

0 投票

YOu calculate your array by substituing the required values...and use
dy = diff(ye)/dt ; % where dt is step size

4 件のコメント

Ethan Jones
Ethan Jones 2020 年 3 月 4 日
sorry for confusion dt was not meant to be derivative of t, it was representing an equation too large to type in which uses x array to find the size of the line between points d and t. also we cannot use the diff function for the pupose of the queston.
KSSV
KSSV 2020 年 3 月 4 日
diff is nothin but:
for i = 1:n
dye = ye(i+1)-ye(i)
end
Ethan Jones
Ethan Jones 2020 年 3 月 4 日
Ok, thanks for the help ; ).
Steven Lord
Steven Lord 2020 年 3 月 4 日
diff is nothin but:
which would still violate the rules of the assignment, technically, if for no other reason than the - operator is just another name for the minus built-in function.
If the professor wants to prohibit any built-in function there's not that much you can do (without cheating by writing a MEX-file or something similar.) If they want to be more specific and prohibit certain built-in functions that's potentially a fairer question (depending on what they disallow.)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDebugging and Analysis についてさらに検索

製品

質問済み:

2020 年 3 月 4 日

コメント済み:

2020 年 3 月 4 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by