Info
此问题已关闭。 请重新打开它进行编辑或回答。
??? Subscript indices must either be real positive integers or logicals.
2 次查看(过去 30 天)
显示 更早的评论
hi, i'm using m file in cell mode to solve f(x)=sin (x), where x = 0.8 and i'm getting "??? Subscript indices must either be real positive integers or logicals. " error how it can be solved
1 个评论
Gijs van Oort
2013-5-6
Please tell us the exact code you're using. Is it actually Matlab code? The code you're giving ('solve f(x)=sin(x)' ) is not Matlab compatible.
回答(2 个)
John Doe
2013-5-6
编辑:John Doe
2013-5-6
Is this what you're trying to do?
%%Don't run this part
A = magic(4);
%%Run this part by itself
x = 0.8;
f = sin(x)
%%Not this part
A = rand(4);
What you do is: Place your cursor in the middle section. Then press Ctrl + Enter.
Please watch this video:
7 个评论
Jan
2013-5-6
Please, ghassan, format your code properly. Follow the "? Help" link to learn how to use the forum's interface. Thanks.
It would be helpful, if you post the complete error message and explain, in which line the problem occurres. Then we do not have to guess the details.
It is more complicated to answer to information, which is provided in the comment section. Please collect all required information in the original question, for this reason editing the questions has been introduced in this forum.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!