matlab:字符串数组和string的区别

前言

在用sprintf()格式化输出时,发现formatSpec可以是单引号创建的字符串数组,也可以是string(‘str’)创建的string。所以产生了疑惑,这两者有什么区别,各适用在什么场合

官方文档

Character arrays and string arrays provide storage for text data in MATLAB®.

    A character array is a sequence of characters, just as a numeric array is a sequence of numbers. A typical use is to store short pieces 

你可能感兴趣的:(matlab)