Can anyone create an "if else while or for" from this table?
Show older comments
Create "if elseif, else, while, or for" by using the input function. for example, variable x means resistivity, so the beginning of the script is x = input('Enter a value for Resistivity: '); and the next is a conditional statement (if, elseif, else, while or for)

2 Comments
"urgent"? More urgent than other questions? Do you expect assistance for future questions? Then it would be a good idea to consider the etiquette in the forum.
Please post, what you have tried so far. Reading the table in loud words is almost the correct syntax for the Matlab code.
Steven Lord
on 26 Apr 2021
If this isn't a homework assignment that requires you to use if etc. I recommend using discretize instead.
Answers (1)
Jan
on 26 Apr 2021
x = input('Enter a value for Resistivity: ');
if x < 500
Prop = 'Highly Corrosive';
elseif x < 2000 % No need to check for < 500 a 2nd time
... % Please fill in the rest
end
Categories
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!