zoukankan      html  css  js  c++  java
  • MATLAB输入输出语句

    输入语句

        输入数值

            x=input('please input a number:')

            please input a number:22

            x = 22

        输入字符串

            x=input('please input a string:','s')

            please input a string:this is a string

            x = this is a string

    输出语句

        输出显示命令

            自由格式 (disp)

                disp(23+454-29*4)

                361

                disp([11 22 33; 44 55 66; 77 88 99])

                11 22 33

                44 55 66

                77 88 99

                disp('this is a string')

                this is a string

            格式化输出 (fprintf)

                fprintf('The area is %8.5f ', area)

                % 注意输出格式前须有%符号

                % 为跳行符号

                The area is 12.56637 % 输出值为8位数含5位小数

                在这里你如果学过c语言就能很好的理解了。

  • 相关阅读:
    while语句
    闭包
    文件操作
    Python基础九:高级特性
    Python基础八:函数
    Python基础六:字典和集合
    Python基础七:条件判断和循环结构
    Python基础五:列表和元组
    Python基础四:字符串及编码
    Python基础三:数据类型和变量
  • 原文地址:https://www.cnblogs.com/baorantHome/p/7064665.html
Copyright © 2011-2022 走看看