|
| | results (:, 1) |
| |
| | fprintf ('Extracting density min/max at times:[0, 0.2, 0.4, 0.6, 0.8, 1.0]\n\n') |
| |
| if | ~isempty (filename) fprintf('t |
| |
| if | ~isnan (min_val) results(i |
| |
| | fprintf ('min=%.6f, max=%.6f\n', min_val, max_val) |
| |
| else | fprintf ('failed\n') |
| |
| end else | fprintf ('t=%.1f:file not found\n', t) |
| |
| end end Display and save results | display_results (results) |
| |
| | save_and_plot (results) |
| |
| if | ~isempty (files) filename |
| |
| id | i: (i item) |
| |
| if | strcmp (char(data_array.getAttribute('Name')), 'volumic-fraction') data_text |
| |
| if | ~isempty (density_values) min_val |
| |
| | fprintf ('Time\t\tMin Density\tMax Density\n') |
| |
| | fprintf ('----\t\t-----------\t-----------\n') |
| |
| else | fprintf ('%.1f\t\tN/A\t\tN/A\n', results(i, 1)) |
| |
| if | sum (valid_idx) > 0 % Save to CSV writematrix(results |
| |
| | plot (results(valid_idx, 1), results(valid_idx, 2), 'b-o', 'LineWidth', 2) |
| |
| | plot (results(valid_idx, 1), results(valid_idx, 3), 'r-o', 'LineWidth', 2) |
| |
| | xlabel ('Time') |
| |
| | ylabel ('Density') |
| |
| | title ('Density Min/Max Evolution') |
| |
| | legend ('Min', 'Max') |
| |
| | fprintf ('\nResults saved to density_results.csv\n') |
| |