Minggu, 19 Februari 2017

Formating Text in Matlab


Untuk mengontrol output text di matlab, bisa menggunakan function fprintf


clc;clear all;close all;
disp('formating text in matlab')
disp('www.softscients.web.id')
disp('==============================')
disp('i         |sin(i)     |cos(i)')
disp('==============================')
for i =0:30:100
    formatSpec = '%3.0f \t %8.3f \t %8.3f \n';
    fprintf(formatSpec,i,sin(i),cos(i))
end

 

Posting Komentar