Consider to have three variables named a, b, c with values 1, 10, 20 respectively.
Store these variables into a row vector called vec
Set two boundries:
- A lower limit that is low=5
- A upper limit that is up=15
Write a code to to investigate if each component of the vector vec is inside or outside the boundries.
Store the results in the vector variable out_vec with the following scheme:
- out_vec(i)=1 inside the boundry
- out_vec(i)=0 outside the boundry
Use an if-else structure inside a for loop in your code.
a = 1;
b = 10;
c = 20;
vec = [a, b, c];
for i = 5:16
print("Inside the boudries");
print("Outside the boundries");