fprintf question about column

x=0:0.168:1.68;
Y=0:0.015:0.15;
nodes=1:1:61;
disp('nodes x-position Y-position temperature ')
fprintf('%2.2f %2.2f %2.2f %4.6f\n',[nodes(:)',x(:)',Y(:)'])
how to make nodes go under nodes and go down in columns and x in x postioin...

回答(1 个)

x=0:0.168:1.68;
Y=0:0.015:0.15;
nodes=1:1:numel(Y);
temp = sqrt(nodes);
fprintf('%9s %15s %15s %15s\n','nodes','x-position','Y-position','temperature')
nodes x-position Y-position temperature
fprintf('%9u %15.2f %15.2f %15.6f\n',[nodes;x;Y;temp])
1 0.00 0.00 1.000000 2 0.17 0.01 1.414214 3 0.34 0.03 1.732051 4 0.50 0.04 2.000000 5 0.67 0.06 2.236068 6 0.84 0.07 2.449490 7 1.01 0.09 2.645751 8 1.18 0.10 2.828427 9 1.34 0.12 3.000000 10 1.51 0.14 3.162278 11 1.68 0.15 3.316625

类别

帮助中心File Exchange 中查找有关 Variables 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by