How can i get the numerical value of a variable?

1 view (last 30 days)
I'm using the ode45 (x,y) for solve an open channel flow problem (plot the surface profiles). It is working, I've already do that but I need the flow depth numerically (y) at the end of my channel (x=xmax). How can I get it?

Accepted Answer

Star Strider
Star Strider on 8 Nov 2014
If you need the very last values of your x and y vectors, use end (or length or size as alternatives), for example:
flow_depth = y(end,:);
or:
flow_depth = y(length(x),:);
  4 Comments
Lorincz
Lorincz on 9 Nov 2014
my fault, it's working now. thank you for your help
Star Strider
Star Strider on 9 Nov 2014
My pleasure!
I’m glad you got the problem sorted out.

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!