当单独粘贴到命令行而不使用 for 循环时,这始终有效:
sprintf("Your maximum allowed investment for a period of %g years in the first year equals %g", current_nr_of_years, max_invest_year_zero_vec[current_nr_of_years])
Run Code Online (Sandbox Code Playgroud)
在脚本文件的 for 循环中运行时,不会打印任何输出...:
loop_index_vec
for (current_nr_of_years in loop_index_vec) {
sprintf("Your maximum allowed investment for a period of %g years in the first year equals %g", current_nr_of_years, max_invest_year_zero_vec[current_nr_of_years])
# browser()
}
Run Code Online (Sandbox Code Playgroud) 运行代码,得到旧结果......确实,忘了再次保存一个已编辑的.m文件.什么是一次性保存所有打开的.m文件的键盘快捷键?