Cant figure out why I am getting error message for this integration

조회 수: 1 (최근 30일)
Joe Bennet
Joe Bennet 2021년 3월 21일
댓글: Joe Bennet 2021년 3월 21일
shown below is a peice of code exerpted from a much larger code. For some reason, when it is run on its own (ie, not in the main code) it works fine, but when I try to run the exact same thing in my main code, it doesnt work, giving me the following error message => Error using sym/subsindex (line 864)
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables,
and function body must be sym expression." Can anyone help?
thanks very much!
sas= meanie;
sasmax=max(sas);
sasmin=min(sas);
A1= sasmax-sasmin;
y1= mean(sas);
w1= A1*sin(2*pi*t*freq1)+y1;
syms 't'
a01= int((A1*sin((2*pi*freq1*t))+y1),t,-pi,pi);
  댓글 수: 5
Joe Bennet
Joe Bennet 2021년 3월 21일
as in have i assigned any variable called 'min','max' or 'mean'? no i havent... :(
Joe Bennet
Joe Bennet 2021년 3월 21일
Solved it, had a varibable for an interval time period called 'int', doh!
thanks a lot

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by