I defined this;
P = [1 -2 4]
I want to find nth derivative of this poly and I want to do it with while loop for example I try this;
a = 0;
n = 3;
while(a < n)
polyder(P)
a=a+1;
end
The result is
ans =
2 -2
ans =
2 -2
ans =
2 -2
Why does the program take derivative of the poly at first but it does not for the rest of it?

 採用された回答

Torsten
Torsten 2022 年 9 月 1 日
編集済み: Torsten 2022 年 9 月 1 日

0 投票

P = [1 -2 4]
P = 1×3
1 -2 4
a = 0;
n = 3;
while(a < n)
P = polyder(P)
a = a + 1;
end
P = 1×2
2 -2
P = 2
P = 0

その他の回答 (0 件)

カテゴリ

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

質問済み:

2022 年 9 月 1 日

編集済み:

2022 年 9 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by