a = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10];
b = [1, 2, 3; 4, 5, 6; 7, 8, 9];
c = zeros(3,1);`
d = rand([4 1],'single');
或
d = rand([4 1],'double');
e = transpose(b);
f = pinv(e);
g = e*e;
h = [0:100];
i = [0:100:1000];
使用显示命令或fprintf
显示上述 9 个变量。
您可以将它们添加到临时结构中,然后该结构将在屏幕上打印其字段及其内容:
struct('a', a, 'b', b, 'c', c, 'd', d, 'e', e, 'f', f, 'g', g, 'h', h, 'i', i)
a = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10];
b = [1, 2, 3; 4, 5, 6; 7, 8, 9];
c = zeros(3,1);
d = rand([4 1],'single');
A = cell(4,1) ;
A{1} =a ;
A{2} = b ;
A{3} = c ;
A{4} = d ;