In "if "stetment, I got a problem to write the range of the variable
Info
This question is closed. Reopen it to edit or answer.
Show older comments
if A > 0 && A <= 5;
AT=65.1+rand*(93.8-65.1);
end
I got the following error message:
Operands to the || and && operators must be convertible to logical scalar values.
Error in PVSAT2 (line 130)
if A > 0 && A <= 5;
Answers (1)
Walter Roberson
on 30 Apr 2013
0 votes
Your "A" is a vector or matrix. Do you want the condition to apply if all A are in that range, or if any A is in that range? Or are you thinking that there is one AT per A value and you only want to change the AT value that correspond to the values of A that are in that range ?
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!