Matlab Definition and 1000 Threads

MATLAB (an abbreviation of "matrix laboratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.
Although MATLAB is intended primarily for numeric computing, an optional toolbox uses the MuPAD symbolic engine allowing access to symbolic computing abilities. An additional package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic and embedded systems.
As of 2020, MATLAB has more than 4 million users worldwide. MATLAB users come from various backgrounds of engineering, science, and economics.

View More On Wikipedia.org
  1. R

    MATLAB Bisection method and numerical integration

    In Matlab I am trying to use the composite Simpson's rule to find ##x_l## so that $$170=\int^{x_l}_0 \sqrt{1+(y')^2} dx = \int^{x_l}_0 \sqrt{1+\left( \frac{x^2}{68000} \right)^2} dx $$ For convenience this can be written as $$I(x) = 170 - \int^x_0 \sqrt{1 + (\frac{x^2}{68000})} dx$$ The...
  2. Ben Wilson

    MATLAB Replace NaN with next element in Multidimensional Array

    I have a a multidimensional array (49x49x49) which has NaN values scattered randomly. For each NaN, I want to replace the value with the previous non NaN value. e.g. if i had a 3 x 3 matrix 4 7 9 2 7 NaN 1 2 NaN should become 4 7 9 2 7 7 1 2 2 I have 3 dimensions [i,j,k], but...
  3. R

    MATLAB How can I fix the dimensions mismatch in my split-step Fourier method code?

    I am trying to write a very basic Matlab code to preform the split-step Fourier method on the nonlinear Schrodinger equation: $$\frac{\partial A(z,T)}{\partial z} = -i \frac{\beta_2}{2} \frac{\partial^2A}{\partial T^2} + i \gamma |A|^2 A \ \ (1)$$ I want the program to make 3D plots of...
  4. Ben Wilson

    MATLAB Plot 3D Function: Point Where f=1, No Point Where f=0

    I had a function of 3 variables f'(kx,ky,kz) and did an ifft f = ifft(f') and now i have a function where inside a small polygon the function f = 1, and outside f=0, within a cube space of length L. how do i plot a scatter graph for this function where there is a point when f =1, and no...
  5. SimOpera

    MATLAB Pdepe solver for diffusion equation in a packed column

    Consider I have a packed column of length L filled with known characteristic adsorbent. I am putting a mixture of N components in it and I am solving for concentration of each component in mobile phase at the outlet of the column. The equations which are to be generalised are as follows: An...
  6. Ben Wilson

    MATLAB Matlab syntax for 2-d fourier transform

    I have a function f(x,y) which i have defined in this way: a vector x and a vector y meshgrid[x,y] z= f(meshgrid[x,y]). how do i do a 2-d Fourier transform of f(x,y)? the transform must be done without using operations like fft, and must be done using summations written in the code.
  7. Ben Wilson

    MATLAB Fourier transform of a 2D shape

    I have a function of 2 variables [f(x,y)] where if there was an ellipse in the x-y plane, all values of the function are 1 inside the ellipse and 0 outside. I can plot this function as a surface in 3d where it looks like an elevated ellipse hovering over an elliptical hole in a sheet. My...
  8. BubblesAreUs

    How can I model a temperature change using MATLAB?

    Homework Statement Modelling the following equation: k = Delta Q / t Homework Equations Q = T2 - T1 = -40 (fixed) t = Delta Q / k. I need to find t. k can be floating so I suppose 0 to 10 minutes with 0.5 increments The Attempt at a Solution I don't have MATLAB on me at the moment...
  9. R

    MATLAB Create track map using Lateral acceleration & speed in Matlab

    Hi I was wondering if someone could help with creating a track map using lateral accel and speed. More specifically the steps to the maths needed to plot the coordinates. I know how to find the curvature radius but not sure what the next step is. Thanks
  10. DiracPool

    MATLAB Learning Matlab & Python for a DARPA Grant

    I'd appreciate it if someone can give me a little guidance here. I'm slated to be entering a Ph.D. program in the fall where I'll be working on a machine intelligence project under a DARPA grant designed to create autonomous rovers. They want me because of my background in understanding the...
  11. kelvin490

    MATLAB How to use a suitable color bar?

    I have a picture which shows the magnitude of some value in terms of color, like this one: https://www.dropbox.com/s/yoh0n9cqftvrtlz/bar.jpg?dl=0 The higher the magnitude, the more it looks red. However there are only a few points at the edge has very high values and most of the points have...
  12. B

    Blasius Model Solution in Matlab | Boundary Layer Profiles without ODE45

    Homework Statement Program, without any built in functions (like ODE45), a solution to the Blasius Equation in Matlab that outputs boundary layer profiles for given x values, u values, etc. Homework Equations 2f''' + f''f = 0 fj = fj-1 + Δη/2 * (gj + gj-1) gj = [Δη2/4][2gj+1/Δη2 + 2gj-1/Δη2 +...
  13. BubblesAreUs

    Plotting exp(-cx) with MATLAB: Step-by-Step Guide for Homework

    Homework Statement Plotting the exponential exp(-cx), 0 ≤ x ≤ 1 with c = 1, 2, 3, 4. Use a for loop. Homework EquationsThe Attempt at a Solution for c = 1:1:4; for x = 0:1; F = exp(-cx); end end plot(x,F) I'm not really sure where to start.. Help is appreciated.
  14. M

    MATLAB Need help on constants for Matlab nuke sim for uni project

    Hey guys, I am currently working on a uni MATLAB group project for blast radius, thermal radius etc. Apparently these formula are the best possible to use: r_thermal = Y^0.41 * constant_th r_blast = Y^0.33 * constant_bl r_radiation = Y^0.19 * constant_rad But can anybody tell me what...
  15. N

    4th order Runge Kutta Matlab with 2 2nd order ode

    Homework Statement Hi There! MX''=Fn(sin θ - uCos θ ) MZ''=Fn(cos θ + uSin θ ) - Mg Fn,M,θ,u is constant fn/M = 0.866 M = 6000 θ = 30 u = 0.5774 i split my motion equation into 2 individual 1st ode, X' = Vx Z' = Vz Vx'=[fn*(sin θ - uCos θ )]/M Vz'={[fn(cos θ + uSin θ )]/M} - g...
  16. Lucas94

    MATLAB How to do a double integral on matlab?

    Hey! I want to do a double integral calculation of this problem##∫∫ xy/(xy^2 +1)^2## over the region bounded by 2 ≤ x ≤ 3 and 2*sqrt(1+x) ≤ y ≤ 2*sqrt(2+4x) on MATLAB and i have tried the following syntax: clc clear all fun=@(x,y) x*y./((x*y.^2+1).^2); ymax=@(x) 2*sqrt(2+4*x)...
  17. SherLOCKed

    How can I interface a DFIG in a multi machine environment?

    Which will be my reference frame while modelling and control - the reference machine in the network or the network bus itself?And if so how do i relate the dfig to this reference frame?
  18. Lucas94

    Make a circle in square that is split 8x8 parts?

    Sorry if i may sound little unclear, english is not my first langue. I I am looking for a way to create a circle that is in a square cut in 8x8 in matlab. I would be glad if someone could give me a hand. Thanks!
  19. A

    MATLAB New to Matlab, help with vectors

    So like the title says, I'm new to Matlab. I took a programming class on Fortran last year before my college changed the requirement so programming is not new to me all together. For a few of my classes we are allowed to use programs such as Matlab and Maple to help us solve problems. Most of...
  20. Tone L

    MATLAB Solving MATLAB Sum Loop Issue with 2,187 Data Points

    So i want to calculate an r value 5 different times then find the mean of the 5 calculated values. I have 2,187 data points. the first line of code generates 100 random points 1-2187. The code has a bug but my major issue is it calculates r then loops again calculates r, loops again calculates...
  21. S

    MATLAB Center Wavelength of Fiber Bragg Grating Filter

    I would like to locate the center wavelength of a FBG notch filter in MATLAB, but I'm having trouble getting an answer within 0.01nm of the correct wavelength. So far I've tried using a quadratic fit with MATLAB, but that is too dependent on the amount of data points to the left and right of...
  22. S

    Using expm of matlab to plot state responses

    Homework Statement The state space model of a nonlinear system is x'_1(t) = 2x^2_2(t) - 50 x'_2(t) = -x_1(t) - 3x_2(t) + u(t) where x_1(t) and x_2(t) are the states, and u(t) is the input. The output of the system is x_2(t). Find the zero input response (u(t) = 0) of this system linearized at...
  23. A

    How to design an impulse input in Matlab Simulink

    Homework Statement I would like to know a way to design an impulse input in a Matlab Simulink model. I know there are step input and ramp input blocks but there is no impulse input block. Homework Equations The Attempt at a Solution If any working is needed please let me know
  24. A

    Matlab step response. Just need a quick check

    Homework Statement Could someone just quickly check my Step Reponse diagram which I made using Matlab. It does not look like the usual shape for a step response system which is making me a bit worried. I'm a fairly new to Matlab and Control Engineering Homework Equations G(s) = 3 / ((s^2) +3)...
  25. A

    Could someone please check my Simulink Diagram

    Homework Statement I was asked to draw a Simulink Model for the above (car suspension) system. m = 250kg k, spring constant = 70000N/m c, damping coefficient = 3000N/m/s Homework Equations If any equations are needed please let me know The Attempt at a Solution The question says to draw...
  26. B

    Non-uniformly sampled transfer function data

    I have non-uniformly sampled transfer function data (magnitude only) in the range of 100kHz and 200MHz. Using this transfer function, I would like to calculate output from specific input. Question : To obtain phase of the transfer function from the magnitude data, I am trying to use Hilbert...
  27. J

    MATLAB 3D Diffusion Equation in MATLAB

    Hi guys, I have functioning MATLAB code for my solution of the 3D Diffusion equation (using a 3D Fourier transform and Crank-Nicolsen) that runs just from the command window and automatically plots the results. However, it seems like my solution just decays to zero regardless of what initial...
  28. W

    Bungee jump -> differential equation -> simulink simulation

    Hello guys, I found this forum using google because I need help with simulating bungee jump model. I've already done that with zero initial values and it looks good but I want it more realistic : Let's say L is the length of rope so elasticity force starts acting when y=L so logically time...
  29. L

    MATLAB Help with Integral and MATLAB Equation using Real Numbers

    I carried out a physics experiment and I wanted to analysis the problem with matlab. I have some code in MATLAB that "works" as in it gives ok result but the numbers used are quite nonsensical, I need help making the reworking the equation with real numbers. I am not sure if this is the correct...
  30. goonking

    MATLAB How to add normal vectors/quivers to sphere in matlab?

    so I got my sphere, centered at (1,-2,0) with radius 3 how do I put normal vectors/arrows onto my sphere's surface? I tried quiver3(x,y,z)
  31. m.r.fouladi

    MATLAB BioHeat Equation solution in MATLAB using pdepe

    We have this Equation as bioheat equation: ∂T/∂t = α ∇2T + 1/ρc[S+Sp+Sm] and also this: Sp=mbcb(Tab-T) that all α,ρ,c,S,Sm,mb,cb,Tab are constants, now I want to solve this equation in conditions below with pdepe in MATLAB: There is a Tumor as a sphere with radius 1 cm exactly in center of a...
  32. seyfi

    How to Implement the ADI Method for a 2D Heat Equation in Matlab?

    Hi all Do you know how to write code Alternating Direct Implicit(ADI) method in Matlab? I have given 2d heat equation for this. Thank you
  33. seyfi

    4th ODE runge kutta (hiemenz equation)

    Hi all i want to write a MATLAB code by runge kutta solution for hiemenz equation. F''' + FF'' + 1 - F'^2 = 0 BCs F(0)=F'(0)=0 and F'(inf)=1 I have programmed for RK Fehlberg, RK4 and RK5 method but the results of these three methods are not matching with actual values. In the cod I defined...
  34. Junichirol

    Matlab (calculate natural frequencies using eig function)

    Homework Statement Determine the corresponding natural frequencies M = [1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1]; C = [2 0 0 0;0 0 0 0;0 0 0 0; 0 0 0 0]; K = [10 -5 0 0;-5 10 -5 0;0 -5 10 -5;0 0 -5 10]; Homework Equations A = [zeros (4) eye(4); -M/K -M/C] [V,D] = eig(A) The Attempt at a Solution just...
  35. J

    Fourier series of square wave on Matlab?

    Homework Statement How Can i do this on matlap the question in Attached files Homework Equations The Attempt at a Solution i try a lot but i failed
  36. P

    Modeling Motion of Earth with Matlab using ODE45

    Homework Statement So I am trying to model the motion of the Earth around the Sun using ode45. I modeled this using an euler-cromer scheme, but I would like to get familiar with using a solver. I wrote the code for an Euler-cromer and it worked just fine. However, when I try to use the same...
  37. H

    MATLAB Matlab ode solvers - adding a separate convergence criteria

    Hi, is there a way to add a user defined convergence criteria to an ode solver so that the solution is stopped?
  38. I

    MATLAB Polynomials in Matlab - Plotting Results

    y = [0.053 1.477 1.970 3.279 4.153 4.934 5.178 5.828 6.082 6.484]; % data coef = polyfit(x,y,3) X=0:.1:9; Y=polyval(coef,X); plot(x,y,'o',X,Y) that's my code. did i do it right?
  39. I

    MATLAB Linear Interpolation in MATLAB: Troubleshooting and Tips

    hi! here's my question. here's my code. i have no idea what to do now :( x = 0:9; y = [0.053 1.477 1.970 3.279 4.153 4.934 5.178 5.828 6.082 6.484]; % data X = linspace(0,8.5,1); Y = interp1(x,y,X,'pchip')
  40. Arman777

    MATLAB Getting Started with Spline Fit in Matlab

    Hi Everyone I am Arman.I am at first grade in Physics and I have trouble to understand Matlab.Now we did Energy Conservation Experiment.I draw x-t and F-t graphs using matlab.Instructor told us we should use spline fit to draw a F-t graph.I don't have a toolbox about it.She told us some code...
  41. kelvin490

    Problem of plotting picture and video in Linux HPC

    I have a Matlab program that reads data file and then create avi. files and tiff pictures. It runs without problem in window OS using R2014a but cannot run in a Linux high performance computer(HPC). When the Matlab in Linux is started there are two warnings: Warning: No display specified. You...
  42. E

    Using the Fourier Transform on Partitioned Images

    If I cut my image into several portions and use the Fast Fourier Transform on each portioned image, will I achieve the same result as if I used Fast Fourier Transform on the whole image? I have this concern because I need to process a large image using the Fast Fourier Transform, the problem is...
  43. D

    MATLAB How to Calculate the Average of the Third Column in a Text File Using Matlab?

    I want to create a Matlab script called hw11.m, which reads in a text file of weather information, parses it, and writes formatted summary information. The textfile is called MonthlyHistory.html I cannot figure out how to write a loop that averages the third set of numbers in the string. an...
  44. ElijahRockers

    Neurologist: What P-values should I be expecting?

    Inexperienced data analyst here with a real-world example, I have attached a zip-file with screenshots and p-values of the following data. The "reference regions" are Cerebellum White, Cerebellum Gray, and Temporal Cortex. The top-most graphs depict the curves in the indicated region for young...
  45. N

    Why Does MATLAB Show NaN for Truss Deflections?

    Homework Statement I'm using MATLAB to design a truss and the output is suppose to be the deflections caused by the applied loads. But I keep getting "not a number" for my deflections . here is the warnings I get. Warning: System may be partially constrained. > In truss3 (line 222) In...
  46. kostoglotov

    Backwards difference matrix divided by negative delta x?

    An exercise in my text requires me to (in MATLAB) generate a numeric solution to a given second order differential equation in three different ways using a forwards, centered and backwards difference matrix. I got reasonable answers for \vec{u} that agreed with each other (approximately) for the...
  47. N

    Building a truss with matlab -- Need help

    Homework Statement I am suppose to build a truss using a MATLAB code given to me. I have to identify the joint coordinates, member assembly, and load matrix. The code is suppose to calculate the deflections like fea. I have put everything in but when the code runs my deflections are "NaN" which...
  48. R

    How to Input and Display a Matrix in Matlab?

    Homework Statement I have to make program that a user inputs a matrix and program displays it.Homework EquationsThe Attempt at a Solution I know the logic as in c++ I am able to display that. Here, m=input('Enter rows of matrix'); % Why not double quotes here as in cout of C++? n=input('Enter...
  49. kostoglotov

    Graphing Eigenvectors and Sine Curves: Understanding the Relationship

    In my text, it tells me to find the eigenvectors of a 2nd difference matrix and graph the eigenvectors to see how they fall onto sine curves. imgur link: http://i.imgur.com/oxbkTn6.jpg My question is simple but general. What does this even mean? How did they produce this graph from the...
  50. I

    Python Solving 3D Geometry Problems with Python

    Homework Statement Requirements: http://i.imgur.com/2WKyhto.png Homework Equations 2(L * W + L * H + W * H) SA = (2 * pi * radius * height + 2 * pi * radius^2) height = (volume)/(pi * radius^2) The Attempt at a Solution Code link: http://pastebin.com/sKFEGN0C
Back
Top