code using if but didn't work?? any help
显示 更早的评论
i want to make a subcod in a simulation as follows 1- choose the lowest numberin
a=[9 5 6 1 -5 0 2] 2- replace this value with 1 and other numbers with zeros to be
newa=[0 0 0 0 1 0 0]
my sub code is
a=[9 5 6 1 -5 0 2]
newa=size(a)
j=min(a)
for i=1:7
if a(1,i)==j; then newa(1,i)==1;
else
newa(1,i)==0;
end
end
But it didnt work ANY HEELP
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Testing Frameworks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!