Info
この質問は閉じられています。 編集または回答するには再度開いてください。
fprintf to create a table of numbers
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everyone
so im trying to print a table of numbers here is my code
x = linspace(0,4,10);
y = sinh(x);
z = cosh(x);
g = [x;y;z]
fid = fopen('C:\Users\User\Desktop\myname\Out.txt', 'w');
fprintf('x\t sinh(x)\t cosh(x)\n');
fprintf(fid, '%6.2f %12.8f %12.8f\n', g);
fclose(fid);
if i want to triple the numbers in the outcome how can i do it?
3 件のコメント
Saumya Goel
2019 年 5 月 24 日
I am not sure if you meant by triple the numbers as "Multiply by 3". Then you can simply use multiply.
Please refer to this example: https://www.mathworks.com/matlabcentral/answers/329872-printing-table-susing-fprintf
per isakson
2019 年 5 月 24 日
See the Examples of my tprintf - tprintf writes tabular data to a text file
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!