フィルターのクリア

error in creating function

2 ビュー (過去 30 日間)
Kayla Garcia
Kayla Garcia 2024 年 2 月 1 日
コメント済み: Steven Lord 2024 年 2 月 1 日
i keep getting an error on this when i try to plot it. not sure what i did wrong
plot(x,hw2_part1d,'k-');grid;hold on
Error in hw2_part1d (line 2)
y = x.^5 + x.^4 - 4*x.^3 - 3*x.^2 + 3*x + 1;
it calls this function:
function y = hw2_part1d(x)
y = x.^5 + x.^4 - 4.*x.^3 - 3.*x.^2 + 3.*x + 1;
end
  1 件のコメント
Steven Lord
Steven Lord 2024 年 2 月 1 日
In the future, when asking for help diagnosing the cause of error and/or warning messages please include the text of the error and/or warning messages (all the text displayed in the Command Window in red and/or orange) in your post. The exact text can help make determining the cause easier and faster.

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

採用された回答

Voss
Voss 2024 年 2 月 1 日
plot(x,hw2_part1d(x),'k-');grid;hold on
% ^^^ call the function with x as input
  2 件のコメント
Kayla Garcia
Kayla Garcia 2024 年 2 月 1 日
omg! lol thank you!
Voss
Voss 2024 年 2 月 1 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by