首页 > 编程知识 正文

matlab中fprintf函数的用法,matlab中length函数的用法

时间:2023-05-06 16:30:59 阅读:205117 作者:1909

%数值的格式化输出str_a=sprintf('%.5f',pi);%字符串的格式化输出str=sprintf('pi = %.5f',pi); %输出类型为charstr1=sprintf(string('pi = %.5f'),pi); %输出类型为stringteam1='Manchester United';team2='Chelsea';str2=sprintf('%s won %s,congratulations',team1,team2);

输出

>>str_astr_a =3.14159>> strstr =pi = 3.14159>> str1str1 = string "pi = 3.14159" >> str2str2 =Manchester United won Chelsea,congratulations


参考链接:https://blog.csdn.net/kaever/article/details/70207380
参考链接:https://zhidao.baidu.com/question/1306539527253145779.html

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。