フィルターのクリア

max(dg) returns "Subscript indices must either be real positive integers or logicals."

2 ビュー (過去 30 日間)
Rahul Pillai
Rahul Pillai 2017 年 11 月 25 日
回答済み: John D'Errico 2017 年 11 月 25 日
Any reasons why? dg is an n x 1 column vector.

回答 (1 件)

John D'Errico
John D'Errico 2017 年 11 月 25 日
Simple. Don't create a variable named max. How should MATLAB know if you do that, that then when you try to use the FUNCTION named max, what you really want to do? MATLAB assumes that you know what you are doing.
So when you created a variable max, then used the form max(dg), MATLAB assumes that you knew what you were doing, that you did this for a good reason. It then tries to index the variable max, using dg as an index.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by