フィルターのクリア

get data from function

4 ビュー (過去 30 日間)
Elisbeth Brandner
Elisbeth Brandner 2021 年 8 月 26 日
コメント済み: Walter Roberson 2021 年 8 月 29 日
i have my problem to work with functions. do not get any results from it. I know that it work, so the problem is just by my execution of the function.
How can i avoid following error?
>> ref_model(1,2)
Index exceeds the number of array elements (2).
Error in ref_model (line 7)
I=p(2)./(d(:,1)+p(1))+p(3)./(d(:,1)+p(1)).^2+p(4)./(d(:,1)+p(1)).^4;
>> myQ(1)
Index in position 2 exceeds array bounds.
Error in myQ (line 5)
Q=sum(r(:,1).*(ref_model(x,r(:,1))-r(:,2)).^2);

採用された回答

KSSV
KSSV 2021 年 8 月 26 日
From the function r should be a m*2 matrix. It should have two columns. And x should be a 1*4 array.
  7 件のコメント
KSSV
KSSV 2021 年 8 月 29 日
@darova you can accept the answer as well.
Walter Roberson
Walter Roberson 2021 年 8 月 29 日
For the first 10 days, only the person who asked the Question can Accept an Answer.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by