好吧,我有一个功能,将有作为参数字符串,它会输出一个新的字符串是不具有任何的空间,',"
function rename_file() {
local string_to_change=$1
local length=${#string_to_change}
local i=0
local new_string=" "
local charac
for i in $(seq $length); do
i=$((i-1))
charac="${string_to_change:i:1}"
if [ "$charac" != " " ] && [ "$charac" != "'" ] && [ "$charac" != """ ]; then #Here if the char is not" ", " ' ", or " " ", we will add this char to our current new_string and else, we …Run Code Online (Sandbox Code Playgroud) 我从图像中检索了所有非白色像素:
[ii, jj] = find(BlackOnWhite < 255)
Run Code Online (Sandbox Code Playgroud)
然后我尝试将这些像素坐标索引到矩阵:
image(ii, jj) = 0
Run Code Online (Sandbox Code Playgroud)
但是零没有出现在预期的位置.如何将零只放在由ii和jj([ii(1), jj(1)], [ii(2), jj(2)]等等)对指定的位置?