newstr.m

来自「采用爬山法求解优化问题」· M 代码 · 共 14 行

M
14
字号
function [ str2 ] = newstr( str, pos )% Function to a new string by flipping a single bit% By Kyriakos Tsourapas% You may contact me through the Mathworks site% University of Essex 2002str2 = str;% FLIP THE POSITIONif str2(pos) == 0    str2(pos) = 1;else    str2(pos) = 0;end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?