![]() |
谁帮我纠下错误
str=[' the value of pi ='num2str(pi)];
disp(str) 本人认为是对的为什么不能执行。 |
[QUOTE=pang007;8876]str=[' the value of pi ='num2str(pi)];
disp(str) 本人认为是对的为什么不能执行。[/QUOTE] matlab将字符串中的每个字符作为元素,按照行向量的形式存储字符串,参照行向量的规则进行向量的运算。num2str返回一个新的字符串,将两个字符串相连时,除了使用matlab现有的函数外(具体名字忘了),在运用lz的格式时,应该使用行向量相连的规则,在两个向量间使用空格或“,”分隔开。 以下为正确格式: str=[' the value of pi =' num2str(pi)]; 或 str=[' the value of pi =',num2str(pi)]; |
太谢谢你了
谢谢你的热心帮助
|
所有时间均为北京时间。现在的时间是 12:35。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.