What is Matlab: Definition and 1000 Discussions

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. J

    Modify Fibonacci Function to Return nth Number - Matlab Homework

    Homework Statement Modify the function so that instead of returning all n numbers, it only returns the nth number. Homework EquationsThe Attempt at a Solution I'm not sure how to return only the nth number of the fibonacci sequence. Please help.
  2. T

    MATLAB Numerical approximation of the area under curve

    I am very new too Matlab and how it all works but I am having trouble understanding at what axis the numerical integration is occurring from on the graph that I plotted. So I am currently doing an experiment in gamma ray spectroscopy and due to issue with the software we found it hard to...
  3. M

    MATLAB Solving Chromatography PDE with MOL and ode15s

    Hello all I am using the method of lines to solve the following PDE: ## \frac {\partial C} {\partial t} + F\frac {\partial q} {\partial t} + u \frac {dC} {dz} = D_{ax} \frac{\partial^2 C} {\partial z^2} ## ## \frac {\partial q} {\partial t} = k (q^{*}-q) ## With these initial conditions: ##...
  4. ItsTheSebbe

    Finding the bandwidth of a parallel RLC circuit (+MATLAB)

    Homework Statement The attempt at a solution Constructing the total impedance of the circuit as follows, $$\frac{1}{Z_T}=\frac{1}{Z_R}+\frac{1}{Z_C}+\frac{1}{Z_L}$$ where $Z_R=R$, $Z_C=-j\frac{1}{\omega C}$ and $Z_L=j\omega L$. $$\frac{1}{Z_T}=\frac{1}{R}+j\omega C+\frac{1}{j\omega L}$$...
  5. dRic2

    MATLAB Compare MatLab vs Mathematica for CFD | Ric

    I know a little bit of MatLab (for example I can solve simple, well conditioned, systems of 1st and 2nd order ODE), but I know nothing about Mathematica. I don't know whether or not start to learn how to code in Mathematica or keep studying MatLab. For example, for CFD (computational fluid...
  6. yecko

    (Matlab) beam deflection solution using symbolic simultaneous equations

    I have tried to searched for functions online and apply it, but still it does not work well. May I ask how can I solve symbolic simultaneous equations with Matlab? Or is there anything went wrong with my program? Homework Statement Consider a stepped beam shown in below. The beam is...
  7. Wrichik Basu

    MATLAB Matlab toolboxes essential for every physicist

    I was looking forward to buy Matlab student license sometime this year. Anyone who has already bought a license knows that a number of toolboxes are available. Here is the site. I am not buying Simulink at this moment. So, please leave out anything related to Simulink. Other than the basic...
  8. N

    Inertia tensor of cone around its apex

    Im trying to calculate the principals moments of inertia (Ixx Iyy Izz) for the inertia tensor by triple integration using cylindrical coordinates in MATLAB. % Symbolic variables syms r z theta R h M; % R (Radius) h(height) M(Mass) % Ixx unox = int((z^2+(r*sin(theta))^2)*r,z,r,h); % First...
  9. R

    MATLAB Finite Element Analysis (FEA) in MATLAB - Textbook Guide

    Does anyone know of a great text that shows how to set up FEA in MATLAB in detail. I have wrote out the sort of pre pseudo code from John Andersons - Computational Fluid Dynamics now I just need to build it out in code. I am old school with the hand sketches, hopefully this does not get me a...
  10. M

    MATLAB Switched from win10 and MATLAB to ubuntu and python"q"

    Hi, I felt like I have to learn more than one coding language, and wanted to strengthen my coding skills in general. I am good with Relap5 but I want to learn OpenFoam. is what I did logical and going to be worth the pain ? also I only have the Relap5 version of a windows ,is it possible to run...
  11. S

    Dealing with 1000 digit numbers

    Hi, Mostly i work with Octave / Matlab but i am trying to get into python also. Lately i have a couple problems where my numbers can't be represented in binary64 or float64 default format because they exceed the max of 1.8x10^308. Is there a common way people deal with this (without toolkits)...
  12. R

    MATLAB Finite element skeleton code for matlab

    Hello, Does anyone know if a finite element skeleton source code exists. Finite element can be used for structural memebers, gas dynamics, etc. But the over all stepping software is the same and then just input the core equations. My application is for pseudo one dimensional compressible...
  13. S

    Simulink bloc of PMSM (permanent magnet synchronous motor) parameters

    greetings. I designed a system on simulink. it is missing a pmsm. I found a block on simpowersystems in simulink nde matlab. I hope that this engine provides a nominal power of 96kw and maximum of 100kw. so how to test it? to verify that this engine can deliver these two powers? cordially. said.
  14. A

    Converting impedence response to electrical conductivity

    Hi, I have a curve, impedance magnitude vs frequency. i would like to convert this curve to electrical conductivity vs time. how can i do that?
  15. jamalkoiyess

    MATLAB Hardware advice for a MATLAB oriented PC build

    Hello PF, I am considering some options in my upcoming PC build and want to choose the one that performed best in MATLAB. What I mostly do is velocimetry with a big amount of points, image processing, statistical analysis. My options are between 2 CPUs: AMD Ryzen 2700 - for the 8 physical...
  16. E

    MATLAB Evaluating Nested Integral in MATLAB for General K

    Hello, How can I evaluate the following nested integral in MATLAB for a general value of ##K## {\int\limits_{u_1=0}^{\gamma}\int\limits_{u_2=0}^{\gamma-U_1}\cdots \int\limits_{u_{K}=0}^{\gamma-\sum_{k=1}^{K-1}U_k}}f_{U_1}(u_1)f_{U_2}(u_2)\cdots f_{U_{K}}(u_{K})\,du_1du_2\cdots du_{K} where...
  17. F

    MATLAB Translating from Mathematica to Matlab

    Hello everyone. I was wondering if someone could tell me how to write the next line of Mathematica code in Matlab. x = Sum [ Sqrt [ vals[ [ j ] ] ] * vecs [ [ j, All ] ] * z [ [ j ] ] , {j,1,10} vals is a eigenvalues vector, vecs is a eigenvector matrix and z is a vector of random variables...
  18. T

    MATLAB Convert R Code to MATLAB for Detrended Cross Correlation Analysis

    Homework Statement I would like to convert this R code into matlab. This code perform a calculation of beta coefficient based on Detrended cross correlation analysis. Homework Equations require(tseries) require(fracdiff) require(matrixStats)DCCA_beta_avg<-function(y,x,smin,smax,step){...
  19. dRic2

    MATLAB What Does the Final Equation Represent in a Chemical Distillation Column?

    Here's what I have to do: 1) I arbitrary give a first value to the variable ##x_b##. Let's say ##x^{(0)}_b = 0.3## 2) I find ##x_D## by evaluating this integral: $$ln(\frac {52.32} {100}) = \int_{0.5}^{x^{(0)}_b} \frac {dx} {x^{(0)}_D - x}$$ 3) I use the value I got for ## x^{(0)}_D## to...
  20. T

    Natural frequency in stationary and rotating frames....

    Hi, I am trying to gain insight into using stationary vs. rotating coordinate frames for natural frequency calculations. I have seen many FE codes suggest that critical frequencies can be calculated differently in rotating and inertial frames, so i wanted to do a 1D calc to see for myself how...
  21. T

    Solving a set of nonlinear quadratic equations

    I would like to solve this system, which is a sets of non linear quadratic equations, the system needed to be solved can be expressed in general as follow: ϒϒ'C – ϒα = B Where ϒ=(ϒ1,ϒ2,...ϒn)’ is a column vector and ϒ’ its transpose C=(c1,c2,…,cn)’ and B=(b1,b2,…bn)’ are a columns vector And...
  22. C

    MATLAB FFT problem for Fresnel simulation

    Hi all, I'm trying to simulate the Fresnel diffraction by using this expersion : $$ A(x')=\frac{1}{j\lambda z}e^{jk(z+\frac{x'^2}{2z})}F(A^{trans}(x)e^{jk\frac{x^2}{2z}})_{u=\frac{x'}{\lambda z}} $$ So when I use this formula my problem is that I don't know how to take the good frequency, here...
  23. T

    MATLAB Binary bitstream from QPSK with MATLAB?

    Hi , I am trying to extract the binary bitstream from QPSK using MATLAB. Will something like Frames = reshape(B,[],N) work? If not, can someone point me in another direction?
  24. D

    Problem with plotting a function in MATLAB

    Homework Statement Write code for solving the integral ##\int_{0}^{x}e^{-t^2}dx## using simpsons method and then plot the function from ##x = 0## to ##x = 5## with ##0.1## increment. Homework Equations 3. The Attempt at a Solution [/B] I was told that the best way to plot the function is to...
  25. C

    MATLAB Karhunen Loeve Expansion in Matlab

    Hello everyone. I am trying to generate the KL expansion of a stochastic process. I use a Monte Carlo sampling method to generate the process, which involves two random variables and I compare it with it's theoretical mean for 50 values of time and they look quite similar. Then, I calculate the...
  26. lc99

    MATLAB MATLAB: forces acting on an object

    i have a assignment for my MATLAB (first year) class, and I am slightly confused om what exactly i should be coding. im not struggling with the coding part, but what i am suppose to code. im used to coding based on what it is needed. So, for my project, I am suppose to represent the forces...
  27. C

    Calculating Projectile Distance with MATLAB: Physics Homework Help

    Homework Statement I have to write a MATLAB script that calculates the horizontal distance of a projectile fired from a cannon set at 45 degrees by a compressed spring. I know that the spring constant is 6 lb/in, the unstretched length of the spring is 1 foot, the mass of the projectile is 0.1...
  28. quasarLie

    MATLAB Creating a Histogram with Data from a File.dat in MATLAB

    Hello everyone, I'm trying to make a MATLAB program which read a file.dat and then do a histogram This what I did Data2=importdata('Ma.DAT'); R1=Data2.data(:,17) R1(R1>-9.9) L = 0:0.1:8; histc(R1,L) bar(L,histc(R1,L),'histc') xlabel('R1') ylabel('counts') I want to eliminate all the number...
  29. Eswin Paul T

    MATLAB Sovling Bernoulli's differential equation in matlab?

    I have a first order bernoullis differential equation. I need to solve this in matlab. Can anyone help me?
  30. quasarLie

    MATLAB How to Plot Data into Bins in MATLAB: A Step-by-Step Guide

    Hello, I am writing a program in MATLAB that reads a file.dat, I also want to draw by bin of z and degraded the color for example for z between 0 and 1 put the color red, for z between 1 and 2 put blue. But I do not know how to do it Here is my code Data2=importdata('fichier.dat')...
  31. M

    MATLAB Exporting Multiple Variables from Mathematica to MATLAB - Quick and Easy Guide

    Hi PF! I'm trying to export two matrices ##A## and ##B## from Mathematica into MATLAB. I can export one just fine; so far what I write is SetDirectory[NotebookDirectory[]] Export["data.mat", {A}] Do you know how I can export two variables at a time and then how I can export directly into...
  32. C

    MATLAB Coding angular spectrum of waves in a fluid

    Hi, I am trying to code ultrasonic transducer radiation in water using angular spectrum of plane waves. I am having difficulties in the sampling and fft. If anybody has an idea about this can you please help me out? I can paste the code once i get some response. Thanks for your help!
  33. Bloopy

    MATLAB: Verification of Superposition Principle

    Homework Statement Verify Superposition Principle using Matlab, given a DC source of 100V, an AC source of 50V, 60Hz and three resistances, R1=10 ohms, R2=20 ohms and R3=15 ohms. I created the circuit below and ran the program. Result: Homework Equations None, just running the program...
  34. Nikhil N

    MATLAB How can I run Python by getting values from Matlab

    I have a python script for which the input data are coming from Matlab. I have tried to use pymatlab, but it is failing. Can anyone suggest any other method?
  35. grandpa2390

    MatLab Code for Baseball Not Working

    Homework Statement I am trying to create this plot in MatLab I'm starting out doing the simplest one, no drag, no wind. simple kinematics, right? but I can not get my code to run. Homework Equations Kinematic Equations The Attempt at a Solution close all clear all clc %%defining variables...
  36. grandpa2390

    Why won't my Matlab code work?

    Homework Statement I need to write a program in Matlab that accomplishes this graph: I keep getting an error on Line31 Column 161 about unexpected parenthesis. They look balanced to me. If I take one away from either side, I get an error that I am short a parenthesis. I also need to change...
  37. C

    MATLAB How can I create a matrix with two columns in Matlab using a modular operation?

    Hello everyone. I am trying to create a matrix in Matlab with two columns which should look like as follow: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9... 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1... Has anyone programed something like this before?
  38. SemM

    MATLAB Making a short test for self-adjointness

    Hi, I made the following command in MATLAB to test for the following: \begin{equation} \langle T\psi,\phi\rangle=\langle \psi, T\phi\rangle \end{equation} %Self-adjoint test syms x a = (diff(exp(-x^2)))*exp(-2*x^2) b = (diff(exp(-2*x^2)))*exp(-x^2) W = int(a, x) P = int(b, x) O=W-P and it is...
  39. grandpa2390

    MATLAB What is each step of this Matlab program doing?

    So here is the program. I've spent a few hour trying to follow it. I numbered each line and after the code will try to explain what I think is going on in each line. I'm completely new to Matlab, and programming is a great weakness to me. I need help. 01. nuclei=zeros(1,100); 02. t=nuclei...
  40. M

    MATLAB Suggestions for a non-linear fit model in Matlab

    Good afternoon, I have a problem which I haven't solved yet, regarding a non-linear fit to a set of experimental data. I tried to solve it in Matlab, which I handle a little bit. I have a sensor, which has been designed to have 4 different filters in front of it. By making a sweep with the...
  41. R

    MATLAB Fraunhofer diffraction simulation in Matlab

    Hello, below is the screenshot from the book INTRODUCTION TO MODERN DIGITAL HOLOGRAPHY With MATLAB (TING-CHUNG POON, JUNG-PING LIU). This book is free to download. There is a script for Fraunhofer diffraction pattern and equation 1.40 is Fraunhofer diffraction formula in terms of Fourier...
  42. Nikhil N

    Dynamic modeling of a system and transients of the system

    Consider, I have a dynamic system model for air compressor. Which means I have modeled the system by including its physics. Does this means I also included the transients of the system? What I think is, when i modeled any system with equations, I think that includes the transients. Is it...
  43. grandpa2390

    How do I translate this program to matlab?

    Homework Statement Homework EquationsThe Attempt at a Solution I'm taking Computational Physics. And I am trying to learn how to program in matlab. But I don't understand the author's code and what it is in MATLAB code. Can someone help me?
  44. L

    MATLAB Plotting Coordinate Transformations in Matlab

    I was reading this article (https://www.nature.com/articles/srep40083) about designing a panoramic lens with transformation optics, and wanted to try to play around with modifying the coordinate transformations. I contacted one of the authors of the article, and she mentioned that she plotted...
  45. P

    MATLAB Help with MATLAB music code | Signals & Systems

    For my signals and system class were creating music. I am given a structure with three variables, frequency/notes, duration, and pulse. ex: frequency(in note numbers which i then convert to frequencies)[44 45 47 50...]. duration[2 1 1 3 4...] with pulse duration being .25s and pulse[1 3 4 5 8...
  46. Okinawa Rikenata

    How to get x-y coord. from x-z coord. and y-z coord.?

    I have data from tiltmeter. It has 3 components (time, x, and y) and stations. I use Matlab for calculating the data (.csv) until i get some plots. I have two plots, time-x and time-y. Each plot has a trendline. So that means i have two trendlines in two plots. Assume that time is z and x is...
  47. M

    I Relativistic particle in non-uniform magnetic field (math)

    Hi everyone, I am currently working on a project in Physics analyzing the possibility of magnetic fields protecting against radiation particles such as fully ionized nuclei or electrons. I wrote a code in Matlab that simulates a 3-D magnetic field based on a combination of wires and wire loops...
  48. W

    MATLAB Plotting animations (time-evolution)

    Hi all, I have a spatial probability density function that is dependent on ##x##, space and ##t##, time. I am able to make a plot for spatial probability density for each point in time by specifying ##t## values by using the fplot function. However, I want an animation that allows me to see...
  49. M

    MATLAB Numerical Integration with variable limits MATLAB

    Hi PF! Suppose I have two functions ##f(x),\,g(y)## that are numerically defined as vectors (i.e. ##g(y) = [0,1,4,9,16]:y = [0,1,2,3,4]## and say ##f(x) = [0,1,8,27,64]:x = [0,1,2,3,4]##) and am trying to compute $$\int_0^1 f(x) \int_x^1 g(y)\, dydx.$$ How would I do this in MATLAB? I could be...
  50. starstruck_

    MATLAB Using MATLAB outside of the lab

    This is a pretty dumb question, but I honestly just need some advice as to which option to go for. I'm in first year and one of my courses this term is computer science where we will be using matlab. Matlab isn't free- I know that, but my professor said we have two options available for us to...
Back
Top