truss2d - %truss2d.m reads data from an Excel file called...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 %truss2d.m reads data from an Excel file called 'truss2d_data.xls' % Worksheets in the xls file have the same name same as the data read clear all % The output is written to the file output.txt fid = fopen('output.m','w') Nodes=xlsread('truss2d_data','Nodes') Nelms=xlsread('truss2d_data','Nelms') x=xlsread('truss2d_data','x') NBC=xlsread('truss2d_data','NBC') node=xlsread('truss2d_data','node') props=xlsread('truss2d_data','props') force=xlsread('truss2d_data','force') % Print number of nodes and elements fprintf(fid,'Number of nodes= %3i\n',Nodes) fprintf(fid,'Number of elements= %3i\n',Nelms) %Create array NN containg 1,2,3,. .Nodes NN=[1:1:Nodes] dprint=[NN',x,NBC] fprintf(fid,'Node numbers, their coordinates and BCs are:\n') fprintf(fid,'%3i %12.8f %12.8f %3i %3i\n',dprint') %Create array MM containg 1,2,3,. .Nelms MM=[1:1:Nelms] %Augment [MM], [node] and [props] to form [pprint] pprint=[MM',node,props] fprintf(fid,'Element number, first and second nodes, A and E of elements are:\n')
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

truss2d - %truss2d.m reads data from an Excel file called...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online