- Input
- x = linspace(0, 2*pi, 100); y = sin(x); plot(x, y);
- Method
- Map linspace and sin to NumPy, plot to Matplotlib.
- Formula
- MATLAB line + ordered syntax rule -> Python line + warning note
- Intermediate steps
- Normalize line endings and trim empty wrapper text.
- Apply deterministic rule or template choices only.
- Add warnings for unsupported syntax, semantic assumptions, and verification steps.
- Final result
- Python code includes import numpy as np, import matplotlib.pyplot as plt, np.linspace, np.sin, plt.plot, and plt.show().
- Interpretation
- The result is useful as a migration or documentation aid after human review.
- Limitation
- The helper does not run tests, inspect workspace variables, or guarantee numeric equivalence.