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!