Rank_X = 8 ; Rank_N = 1; % for color scale caxis([Rank_N Rank_X]) ; % set full color ranges % Initialize plots xmax = max (x) ; xmin = min (x) ; ymax = max (y) ; ymin = min (y) ; % zmax = max (z) ; zmin = min (z) ; clf % clear graphics % axis ([xmin, xmax, ymin, ymax, zmin, zmax]) % set axes axis ([xmin, xmax, ymin, ymax]) % set axes axis ('square') %% Get view azimuth and elevation %[az, el] = view ; hold on % hold image for plots %xlabel ('X') % add label %ylabel ('Y') % add label xlabel (['X at ', int2str(np),' Nodes']) ylabel (['Y on ', int2str(nt),' Elements']) if ( i_p >= 1 ) title (['FEA Solution Component\_', int2str(i_p), ' (max = ', ... num2str(V_X), ', min = ', num2str(V_N), ')']) %title(['FEA Solution Component\_', int2str(i_p),': ', ... %int2str(nt),' Elements, ', int2str(np),' Nodes']) else % i_p = 0, get root mean sq title (['RMS Value (max = ', ... num2str(V_X), ', min = ', num2str(V_N), ')']) %title(['FEA Solution RMS Value: ', ... %int2str(nt),' Elements, ', int2str(np),' Nodes']) end % if get RMS value % Loop over all elements for it = 1:nt ; % Extract corner connectivity t_nodes = msh_typ_nodes (it, (pre_e+2):(nod_per_el+pre_e+1)); % Extract corner coordinates t_x = x (t_nodes) ; % x at those nodes, only t_y = y (t_nodes) ; % y at those nodes, only t_z = z (t_nodes) ; % z at those nodes, only % Plot this polygon c_x = t_x (loop) ; % x for nod_per_el line polygon c_y = t_y (loop) ; % y for nod_per_el line polygon c_z = t_z (loop) ; V_R = sum (c_z' )/nod_per_el ; Rank = round ((Rank_X * (V_R-V_N) + Rank_N * (V_X-V_R)) / V_XN); % plot3 (c_x, c_y, c_z) % plot nod_per_el lines fill (c_x, c_y, Rank) % plot nod_per_el lines end % for over all elements % plot3(c_x, c_y, c_z), grid % add grid to last one fill (c_x, c_y, Rank), grid % add grid to last one colorbar