Please help me fix the count for the nested for-loop
显示 更早的评论
function [ result ] = Clockregister01( R,count )
clc
for j = 1:count
for i = 1: size(RN,1)-1
% RN(i,1:size(RN,2)) = addHexNumber(RN(i,1:size(RN,2)),RN(i+1,1:size(RN,2)))
RN(i) = addHexNumber(RN(i),RN(i+1))
end
end
result = RN;
end
采纳的回答
更多回答(1 个)
Dennis
2018-12-5
Your addHexNumber function actually does not work correctly. I think you need to change
if bothSum > 16
to
if bothSum > 15 % or >=16
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!