フィルターのクリア

why i'm getting wrong answers from a simple equation

1 回表示 (過去 30 日間)
firrou bouteflika
firrou bouteflika 2021 年 6 月 24 日
コメント済み: firrou bouteflika 2021 年 6 月 25 日
>> t = [2993;3975.9;5063;6150;6919;8192.7;8862;10240.9;11488;12409.63;13545]
>> f = @(t) (2.2/9500).*((t/9500).^1.2).*exp(-((t/9500).^2.2))
>> g = @(t) 1-exp(-((t/9500).^2.2))
>> f(t)-g(t)
>> ans =
-0.0869 0.32398874
-0.1561 0.39063829
-0.2510 0.31369048
-0.3581 0.31787694
-0.4370 when answers should be ....
-0.5654 ...
-0.6286 ..
-0.7437
-0.8268
-0.8748
-0.9194

回答 (1 件)

Image Analyst
Image Analyst 2021 年 6 月 24 日
My guess is that you've probably misplaced some parentheses. Check them very carefully. And you don't need the @(t) - you can simply do
t = [2993;3975.9;5063;6150;6919;8192.7;8862;10240.9;11488;12409.63;13545]
f = (2.2/9500).* ((t/9500).^1.2).*exp(-((t/9500).^2.2))
g = 1 - exp(-((t/8900).^2.2))
results = f - g
% Plot things below.
plot(t, f, 'b.-', 'LineWidth', 2, 'MarkerSize', 20);
hold on;
plot(t, g, 'r.-', 'LineWidth', 2, 'MarkerSize', 20);
grid on;
legend('f', 'g', 'Location', 'north');
  1 件のコメント
firrou bouteflika
firrou bouteflika 2021 年 6 月 25 日
thank you but i'm soryy i made a stupid mistake the f equation results should be arranged from min to max after that we do results = f - g please help me do that
and also a small mistake that doesnt matter g = 1 - exp(-((t/8900).^2.2)) 8900 should be 9500

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

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2012a

Community Treasure Hunt

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

Start Hunting!

Translated by