sambezi
Newbie level 4
In the code below, i am using "for loop" to get values of px for each iteration of i. There should just be one value of px per iteration or loop, but i am getting three values instead. What could be the error in my code?
Code:
clear; clc;
for i = 0:1:4;
for m = 1:1:4;
if i == 0
px = 0.5;
else if i == 2*m-1
px = 2;
else if i == 2*m
px = 3;
end
end
end
px = px
end
a = px
end