get data from function
1 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
采纳的回答
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 个评论
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 Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!