Recent content by kreil

  1. kreil

    MATLAB - Gaussian Elimination with Partial Pivoting

    I doubt this question is still active, but I'll post a reply for posterity at least! Conceptually, to construct A you want to create several different matrices with nonzero values in different locations, and then add the matrices together. If the nonzero values are in different locations then...
  2. kreil

    MATLAB Book for Matlab to Solve Differential Equations

    There is a great, free textbook on the MathWorks website written by Cleve Moler: https://www.mathworks.com/moler/chapters.html
  3. kreil

    MATLAB Bilinear spline interpolation MATLAB using MESHGRID and SURF

    Where does u_{ij} come from? Should that be \Omega_{ij}..? Assuming so, here is a program that does most of what you want, but that requires you to check the details: function z = bilinearSpline(xx,yy,A,xq,yq) % --xx and yy are the sample grid points % --A is the image matrix, acting as...
  4. kreil

    How to judge the singularity of a matrix in numerical method?

    I second mfig's reply above NOT to use the determinant to detect singularity in a numerical context. I added info to the det page in MATLAB on this: https://www.mathworks.com/help/matlab/ref/det.html#bubi9tw The reason: Most numerical algorithms calculate the determinant using an LU...
  5. kreil

    MATLAB How to transform a plot to use a logarithmic scale?

    You can change the axis scaling to logarithmic with the XScale/YScale properties of the axes object in the figure: ax = gca; ax.YScale = 'log'; If you do this you wouldn't need to calculate any logs beforehand, the axes will transform to a log scale. More info...
  6. kreil

    MATLAB What is the best book for beginners to learn Matlab from the creator himself?

    My favorite is: https://www.mathworks.com/moler/chapters.html (doesn't get much better than reading the book written by the guy that created MATLAB!)
  7. kreil

    MATLAB How Can I Retain Image Quality While Showing Axes in MATLAB?

    Another option is that you can use interpolation to resize the image to any size and maintain reasonable quality. This is what the imresize function does, but you can also do the actual interpolation yourself if you want with griddedInterpolant...
  8. kreil

    MATLAB Evaluating Nested Integral in MATLAB for General K

    Here's an example that does a 4-D integral \int_0^5 \int_0^5 \int_0^5 \int_0^5 \left( w^2 + x^2 + y^2 + z^2 \right) \mbox{dw} \, \mbox{dx} \,\mbox{dy} \,\mbox{dz} >> syms w x y z >> f = w^2 + x^2 + y^2 + z^2; >> dw = int(f,'w',0,5) dw = 5*x^2 + 5*y^2 + 5*z^2 + 125/3 >> dx = int(dw,'x',0,5)...
  9. kreil

    MATLAB Evaluating Nested Integral in MATLAB for General K

    I'm not familiar with the exact application you have, and you might be able to use properties of the PDF, or knowledge about whether the random variables are independent, to simplify things. That said... Do you have the function values as vectors or matrices? If so you can use trapz and nest...
  10. kreil

    MATLAB System of differential equations

    Try ode113 instead of ode45, as it is a variable order solver that includes the results of several past time steps. It is better than ode45 for problems where high precision is required, such as orbital dynamics problems. Example here...
  11. kreil

    MATLAB How Can I Perform Double Numerical Integration in MATLAB or Mathematica?

    If you want the result in terms of alpha and not a number, then you want to do symbolic integration not numerical integration (the latter uses quadrature methods and produces a number). Check out the int function in Symbolic Math Toolbox. You'll also need to use the expint function to form the...
  12. kreil

    MATLAB Integrating Trisurf for 3D Mesh Comparison in Domain D

    Here is an example on how to do a double numerical integration: http://www.mathworks.com/help/matlab/ref/trapz.html#buakefe-1_1 The idea is that you express the integrand as a matrix of values, then call trapz the first time operating on the rows, then take that result and integrate a second...
  13. kreil

    MATLAB Graphing Matlab Heat Transfer | T_0 Variable

    This topic shows how to solve and plot an ODE symbolically: http://www.mathworks.com/help/symbolic/solve-a-system-of-differential-equations.html
  14. kreil

    MATLAB How to Plot Data into Bins in MATLAB

    The histogram object can bin the data AND plot it. But there are other ways to do this where the calculation is split between binning/plotting functions. If you really want to color the bars differently, then you might need to do with the second method. - histc, histcounts, and discretize are...
  15. kreil

    MATLAB Changing the scale of the y-axis

    If you simply call ax = gca; You get a handle to the axes object in the figure. You can then modify the properties of the object to do almost anything you want. See the documented properties of the object here. YScale can change the scale of the y-axis to log, YTick sets the tick values, etc...
Back
Top