Array indices must be positive integers or logical values
이전 댓글 표시
Array indices must be positive integers or logical values.
Error in untitled (line 49)
pb = logninv ( ((C8 /Tb)+C9+(C10*Tb)+(C11*Tb^2)+(C12*Tb^3)+C13*log(Tb)) ); %"Wexler's Equation for Saturatoin pressure"
Can Anyone help me in this issue!
댓글 수: 4
Ryley Hindman
2022년 4월 12일
What data types are your variables in this equation? Please share your workspace variables.
Walter Roberson
2022년 4월 12일
Check to see if you have a variable named loginv or a variable named log
Muhammad Azhar
2022년 4월 12일
Voss
2022년 4월 12일
Can you upload the file untitled.m (using the button with the paperclip icon)?
답변 (1개)
Voss
2022년 4월 12일
Do you have variables called log or logninv?
If so, MATLAB will treat, e.g., log(Tb) as taking element(s) at index Tb in the array log, rather than calling the log function with argument Tb.
Since there are no other possible indexing operations on that line, it seems likely that log and/or logninv has been used as a variable name. To find out, you can do this right before that line:
whos log*
If there are any variables called log or logninv that show up when you do that, you should rename them in your code to something that doesn't have the same name as a function you want to call.
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!