📄 strrep6.m
字号:
% function s = strrep6(s1)
% 搜寻s1中 '/', '*', '^'并插入'.'
function s = strrep6(s1)
L=length(s1);
I = find(s1 == '*' | s1 == '/' | s1 == '^');
L_I=length(I);
if L_I > 0,
move_ind=zeros(1,1:L);
t1=clock;
for i=2:L_I,
move_ind(I(i-1):I(i)-1)=zeros(1,I(i)-I(i-1))+(i-1);
end
time3=etime(clock,t1);
t2=clock;
move_ind(I(L_I):L)=zeros(1,L-I(L_I)+1)+(L_I);
j=[1:L];
s=blanks(L+L_I);
s(j+move_ind)=s1(j);
dot_ind=I+[0:L_I-1];
s(dot_ind)=setstr(ones(1,length(dot_ind))*46);
time4=etime(clock,t2);
else,
s=s1;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -