Code covered by the BSD License  

Highlights from
Hydromat

from Hydromat by Baharuddin Ali
Plot the body plan of ship 2D-3D & hydrostatic

Bdplan(file)
function Bdplan(file)

file    = uigetfile('D:\MatlabProg\Hydromat\*.txt');
fid     = fopen(file,'r');
title   = fgetl(fid);                               
[ukuranutama]   = fscanf(fid,'%f ',[1,5]);          
[jst]           = fscanf(fid,'%f ',[1,1]);          
for i=1:jst
   [NOST]   = fscanf(fid,'%f ',[1,1]);              
   [jumdat] = fscanf(fid,'%f ',[1,1]);              
   [ttdat]  = fscanf(fid,'%f %f\n',[2,jumdat]);     
   ttk      = ttdat';
   Gbrbdy(ttk(:,2),ttk(:,1),NOST(:,1));
end
fclose(fid);
axis equal;
clear;

Contact us at files@mathworks.com