function nodes_write ( node_num, node_xy, output_filename ) %% NODES_WRITE writes the nodes to a file. % % Modified: % % 24 March 2005 % % Author: % % John Burkardt % % Parameters: % % Input, integer NODE_NUM, the number of nodes. % % Input, real NODE_XY(2,NODE_NUM), the X and Y coordinates of nodes. % % Input, character OUTPUT_FILENAME(*), the name of the file % in which the data should be stored. % output_unit = fopen ( output_filename, 'wt'); if ( output_unit < 0 ) fprintf ( 1, '\n' ); fprintf ( 1, 'NODES_WRITE - Warning!\n' ); fprintf ( 1, ' Could not write the nodes file.\n' ); return; end for node = 1 : node_num x = node_xy(1,node); y = node_xy(2,node); fprintf ( output_unit, '%8f %8f\n', x, y ); end fclose ( output_unit );