Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Matlab N00b
09-03-2009, 08:58 PM #1
- Join Date
- Nov 2007
- Thanked 0 Times in 0 Posts
Please help me get the basics here..
I have to use Euler's Method to develop a plot and I've come this far:
function y = hw1_8 % Function to determine water level in tank as a function of time % % Inputs: a = Cross-Sectional Surface Area % Q = Flow rate % % Outputs: Water level as a function of time a = 1200; q = 500; y = 0; t = 0; while t <= 10 y = y + [3*q/a*sin(t)^2 - q/a]*(.5); fprintf('time = %3.1f y = %5.2f\n', t, y); t = t+.5; end end
Any help is greatly appreciated, I'd love to be good at Matlab!