Matlab基本函数-disp函数

1、disp函数:显示文本或数组

2、用法说明:disp(X) 函数显示指定的文本或数组。如果参量是数组,则显示数组的内容;如果参量是字符串,则显示字符串文本的内容

3、实例

(1)参量是字符串

>> x = 'Hello,World!'

x =

Hello,World!

>> disp(x)
Hello,World!
(2)参量是数组或矩阵
>> x = rand(8,8)

x =

    0.8147    0.9575    0.4218    0.6787    0.2769    0.4387    0.7094    0.9597
    0.9058    0.9649    0.9157    0.7577    0.0462    0.3816    0.7547    0.3404
    0.1270    0.1576    0.7922    0.7431    0.0971    0.7655    0.2760    0.5853
    0.9134    0.9706    0.9595    0.3922    0.8235    0.7952    0.6797    0.2238
    0.6324    0.9572    0.6557    0.6555    0.6948    0.1869    0.6551    0.7513
    0.0975    0.4854    0.0357    0.1712    0.3171    0.4898    0.1626    0.2551
    0.2785    0.8003    0.8491    0.7060    0.9502    0.4456    0.1190    0.5060
    0.5469    0.1419    0.9340    0.0318    0.0344    0.6463    0.4984    0.6991

>> disp(x)
    0.8147    0.9575    0.4218    0.6787    0.2769    0.4387    0.7094    0.9597
    0.9058    0.9649    0.9157    0.7577    0.0462    0.3816    0.7547    0.3404
    0.1270    0.1576    0.7922    0.7431    0.0971    0.7655    0.2760    0.5853
    0.9134    0.9706    0.9595    0.3922    0.8235    0.7952    0.6797    0.2238
    0.6324    0.9572    0.6557    0.6555    0.6948    0.1869    0.6551    0.7513
    0.0975    0.4854    0.0357    0.1712    0.3171    0.4898    0.1626    0.2551
    0.2785    0.8003    0.8491    0.7060    0.9502    0.4456    0.1190    0.5060
    0.5469    0.1419    0.9340    0.0318    0.0344    0.6463    0.4984    0.6991



你可能感兴趣的:(字符串,数组,matlab,基本函数,disp)