Search results

  1. M

    MATLAB Setting up Newton Raphson integral with matlab

    Thanks Gib. I figured where i went wrong.. i still have a question that i will post later today
  2. M

    MATLAB Double integrals with matlab

    Now, this is giving me the corrrect answer but not sure if i cheated in a way or not... what do you think: close all clear all x0=0; xt=1; xstep=110; dx=1/(xstep-1); y0=0; yt=1; ystep=110; dy=1/(ystep-1); sum2=0; for i1=1:ystep+1 sum1=0; y=(i1-1)*dy; x2step=floor(y/dx)...
  3. M

    MATLAB Double integrals with matlab

    oh... forgot to say that I am using trapazoidal rule for the integration
  4. M

    MATLAB Double integrals with matlab

    the program that i put together is giving me the integral=24.8427 and the answer is actually 0.316... my program is copied below, what am i doing wrong: x0=0; xt=1; xstep=11; dx=1/(xstep-1); y0=0; yt=1; ystep=11; dy=1/(ystep-1); sum2=0; for i1=1:xstep sum1=0; y=(i1-1)*dy...
  5. M

    MATLAB Double integrals with matlab

    Hi Everyone. I would like to integrate the following using matlab: \int_0^1 ~\int_0^x e^{-x^2} ~dy ~dx looks pretty simple but don't know how to set up the embedded for loops for the integral with in the integral especially that the upper limit of the inner integral is x and not a number...
  6. M

    MATLAB Setting up Newton Raphson integral with matlab

    Hi All. I have an equation that i want to numerically find the root of by using Newton Raphson. However the equation involves an integral which i am using the trapazoidal rule to evaluate. And here is the simplified version of it: 1 = e^{-cy} \int_0^1 e^{-y(1-x)} dx So i am supposed...
  7. M

    Matlab animation - how to from figures

    Compared to the questions out there, my question seems VERY SIMPLE. I have a code that generates a few graphs. Instead of super-imposing the graphs on one figure, I would like matlab to generate an animation of those graphs for me. I tried looking at help and my intution tells me that...
  8. M

    MATLAB Matlab - number format

    Thank you for your reply. i tried the first few before posting my question and could not really figure it out. any advice as to which specific option to use?
  9. M

    MATLAB Matlab - number format

    Hi All Matlab is displaying numbers with 4 decimal places and i hate when it does that for whole numbers. for example i have a matrix C(i) that starts off from 1 down to 150/275. When i multiply it by 275 i get the first entry as 275.0000 and the last as 150.0000 how do i turn that off or...
  10. M

    MATLAB Matlab figure: axis re-labelling

    Just tried it. Worked perfectly. Thanks a lot Chrisas.
  11. M

    MATLAB Matlab figure: axis re-labelling

    this is what i am using plot(y); and it is plotting y vs. t. the plotting itself is not the problem... i simply want the t-axis to be re-labeled... instead of the tick marks showing from 0 to 160, i want the change to be only in the tick marks and want it to show from 0 to 1 with increments of...
  12. M

    MATLAB Matlab figure: axis re-labelling

    I did... and tried this set(gca,'XTick',-pi:pi/2:pi) set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'}) but could not figure out a way for the conversion... here are more specifics... i am running the integration for t=1 and time step dt=.0063 which makes the total number of n around...
  13. M

    MATLAB Matlab figure: axis re-labelling

    Hi all. i am integrating in matlab and plotting the results in a y-verically and t-horizontally. Matlab automatically plots y versus the time step which is great. but what i need to do is re-label the t-axis so the actual time appears instead of the time step- so instead of from 0 to 1200, it...
Top