invalid use of operator
2 ビュー (過去 30 日間)
古いコメントを表示
ro=10;
ri=30;
t=0:0.1:1500;
ci=0.5
c_L=(ci*ri)/ro.*(1-exp(1).^((-ro.*t/.((ri-ro).*t+1500))));
plot(t,c_L)
MATLAB said it is [Error: File: test.m Line: 5 Column: 37
Invalid use of operator.]
I was trying to express equation ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/498512/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/498512/image.png)
What can I do?
0 件のコメント
回答 (1 件)
Alan Stevens
2021 年 1 月 24 日
c_L=(ci*ri)/ro.*(1-exp(1).^((-ro.*t/.((ri-ro).*t+1500))));
should be
c_L=(ci*ri)/ro.*(1-exp(1).^((-ro.*t./((ri-ro).*t+1500))));
| You have /. instead of ./
3 件のコメント
John D'Errico
2021 年 1 月 24 日
In fact, MATLAB TRIED to tell you exactly where the problem lies.
c_L=(ci*ri)/ro.*(1-exp(1).^((-ro.*t/.((ri-ro).*t+1500))));
↑
Error: Invalid use of operator.
See that the red arrow points to the . in that line. It found something that made no sense. The error messages in MATLAB do try to be helpful where that is possible.
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!