输⼊语句
输⼊数值
x=input('please input a number:')
please input a number:22x = 22输⼊字符串
x=input('please input a string:','s')
please input a string:this is a stringx = this is a string输出语句
⾃由格式 (disp)
disp(23+4-29*4)
361
disp([11 22 33; 44 55 66; 77 88 99])11 22 3344 55 6677 88 99
disp('this is a string')this is a string格式化输出 (fprintf)
fprintf('The area is %8.5f\\n', area) % 注意输出格式前须有%符号,%跳⾏符号须有\\符号The area is 12.56637%8.5f 输出值为8位数含5位⼩数
错误消息显⽰命令error('this is an error') this is an error
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- kqyc.cn 版权所有 赣ICP备2024042808号-2
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务