invalid use of operator

조회 수: 26 (최근 30일)
Jong Hyun Lee
Jong Hyun Lee 2021년 1월 24일
댓글: Pratikansh 2022년 8월 8일
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
What can I do?

답변 (1개)

Alan Stevens
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
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.
Pratikansh
Pratikansh 2022년 8월 8일
THANK YOU SO MUCCHHH

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by