matlab - 在没有 'ans = ' 的命令窗口中打印 matlab?

标签 matlab printf command-window

当我使用 sprintf 时,结果显示如下:

sprintf('number=%d %d %d',a,b,c)
sprintf('or %d',h)  

ans = 

number= 5 4 2

ans =

or 2

如何在不被 ans = 阻碍的情况下显示结果?

最佳答案

您可以使用 fprintf 代替 sprintf。请记住在字符串末尾添加一个换行符 \n

关于matlab - 在没有 'ans = ' 的命令窗口中打印 matlab?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15557309/

相关文章:

json - 在 Golang 中打印解码后的 JSON

c - write vs fprintf - 为什么不同,哪个更好?

python - 如何关闭命令窗口中闪烁的光标?

linux - 如何在 linux 中将 matlab 代码作为脚本文件运行?

matlab - 使用傅立叶变换和 MATLAB 过滤信号噪声

python - 在 matlab 中运行 python 代码?

c - 为什么 ANSI 在第一次调用函数时打印代码并在第二次调用时打印颜色?

vbscript - 如何在执行过程中保持 VBScript 命令窗口打开

arrays - 将各种大小的元胞数组的元胞数组整理成大小为 {1xN} 的元胞数组的元胞数组