This commit is contained in:
2025-11-03 11:24:09 +08:00
parent 7d58efea2f
commit 7c647fa9e0
16 changed files with 487 additions and 0 deletions

16
trdec.m Normal file
View File

@@ -0,0 +1,16 @@
function dec=trdec(n,b)
ch1='0123456789ABCDEF';
k=1;
while n~=0
p(k)=rem(n,b);
n=fix(n/b);
k=k+1
end
k=k-1;
strdec='';
while k>=1
kb=p(k);
strdec=strcat(strdec,ch1(kb+1:kb+1));
k=k-1;
end
dec=strdec;