Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB Need help with integration and plotting

  1. Apr 2, 2012 #1
    Hi,
    I have been trying to integrate an equation and then plot the result using matlab but haven't figured out how to do it. Say, I have an equation of the form dy = (1/x)dx. I want to integrate the above equation and then plot y as a function of x. So, to integrate I do this:

    syms y x
    LHS = int(1,y);
    RHS = int(1/x,x);

    So, now LHS and RHS contain the corresponding results of the integrals. How do I plot y as a function of x?

    Thanks in advance.

    Sarrvesh
     
  2. jcsd
  3. Apr 2, 2012 #2
    It would be better if you could use the following equation instead of the one written above: (1/y)dy = dx. Now, how do I plot y as a function of x after integrating?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: MATLAB Need help with integration and plotting
  1. Help with MatLab plot (Replies: 0)

  2. MATLAB: Plotting help (Replies: 2)

Loading...