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

    MATLAB Calculating the time taken for an asteroid mission using MATLAB

    Using MATLAB, I am trying to calculate the time taken for a spacecraft to travel from Earth to a near Earth asteroid and then returning back to Earth but so far I have had no luck. Furthermore, I want to plot a Hohmann transfer and calculate the mass of fuel required for this mission. If...
  2. Will26040

    MATLAB MATLAB Plug flow reactor optimisation Problem

    The assignment is to find the optimal operating temperature and maximum product concentration of reactant B, assuming a constant temperature across the PFR length. Please could someone help? thanks the reaction is a series reaction: A → B → C (liquid phase) Here is my current code which is...
  3. tworitdash

    MATLAB How to change the frequency values inside a time domain signal phase

    The problem I am having is simple. I have a Gaussian spectrum initially. Like this, Process 1: S = m0/sqrt(2*pi*sigma^2) * exp(-(vel_axis - mu).^2/(2*sigma^2)); Here, mu is the mean velocity (frequency) and sigma is the standard deviation. vel_axis is the axis on which I am calculating this...
  4. S

    MATLAB How to plot an orbit around the Earth in MATLAB

    Hi. can you help me to plot orbit around Earth with sphere in MATLAB? I wrote the code that plot 3D orbit but without earth. the code: clear all close all clc R=6371e+3; r0=3e+5; p0=[R+r0;0;0;0;10000;0]; [t,p]=ode45(@sattelite,[0,12000],p0); xout=p(:,1); yout=p(:,2); zout=p(:,3); vx=p(:,4)...
  5. S

    MATLAB Question about how solve 2 body problem in orbit using MATLAB ode45

    hi guys, I'm trying to write a program in MATLAB to solve and plot equation of motion of 2 body problem but it errors as i don't know what it says! do you know how to help me? please! The main equation is r(double dot)=-(mu)*r(hat)/r^3 The code that i wrote is: clear all close all clc...
  6. D

    Tetrahedron Simplex Shape Functions in FEA

    Hi, 2 part question trying to get tetrahedron Finite Element shape functions working: 1) How do I properly setup the shape coefficient matrix and 2) How do I build the coefficient quantities in the shape functions properly? ANY tips or corrections may unblock me and would be of much value...
  7. F

    Find Z-bus using Z building algorithm using MATLAB code

    I tried to write to the code, but I got confused in line 46 & 59.Every new added bus increases the dimension of the Z matrix, and since we have 3 busses, the dimension of Z should be [3x3]. I formed a for loop in case of adding a new bus to add a new row and new column (increases the...
  8. A

    Help with Matlab Problem: Commenting Code & Finding Errors

    Hi! I really need help with the following Matlab problem. What does this code do? I need to comment what the important lines of this code do. Also the code contains several errors which i need to find. Here is the program: clear all; close all; clc; Maxi=50; tab=[1 :Maxi] ; tab(1)=0; while...
  9. F

    Write MATLAB code to find Y bus for any bus system

    Here's my work: clc; clear all; % Ybus by step by step method for an any bus system % | From | To | R | X | gsh | B | T|ysh % | Bus | Bus | pu | pu | pu | pu | ph-sh linedata = [1 2 0 -5 0...
  10. Wrichik Basu

    MATLAB Solving transportation problems (LPP) using linprog in MATLAB

    I want to solve transportation problems (TP) in MATLAB. For solving LPPs, MATLAB provides the linprog function in the Optimization Toolbox. According to my book, the following is a TP: ##\mathbf{D_1}## ##\mathbf{D_2}## ##\mathbf{D_3}## ##\mathbf{D_4}## ##\mathbf{O_1}## ##c_{11}##...
  11. R

    MATLAB Plotting Reaction Rate vs Temperature with MATLAB

    I know how to get fusion cross section plots from the exfor website but now I need to plot the reaction rate as a function of temperature. According to the image, I have sigma and E values as x and y data. How do I integrate using MATLAB .
  12. patric44

    Non linear BVP using a shooting algoritm with MATLAB?

    hi guys i was trying to use this shooting algorithm from Xue and Chen Scientific Computing with MATLAB book : to solve this non linear temperature distribution problem : i checked my Matlab function multiple times but i am keep getting a nonsense graph for the temperature , can someone cheak...
  13. T

    Matlab report help please (Finite Difference Method)

    We have to submit a Matlab (my worst module) assignment to show the heat transfer on a plate. However, I have the 2 codes almost done but I am struggling to write the report. To calculate the temperature on a 2D aluminum plate we need to use the Explicit Finite Difference Method. The problem...
  14. cookiemnstr510510

    Matlab for loop indexing confusion

    The test case for the block of code below is: y0=10, f=@(t,y) -0.5*y, [t,y]=euler_method_attempt(f,0,5,y0,10) This code below works and is the correct answer, but I am confused on some parts of it. When indexing the for loop it seems as if the first output for "y" would be y(2), not y(1). And...
  15. patric44

    Temperature Distribution of Current Carrying Wire in Matlab

    hi guys i was trying to solve this non linear ode using the shooting algorithm in Matlab : i am not sure how to solve it using the normal shooting algorithm i have , since no other boundary at x = L/2 was given to check the shooting ?! function dTdx = bar_temp(x,y) k = 72; h = 2000; epsilon =...
  16. F

    Simulate a Chopper of Class A circuit in MATLAB Simulink

    I tried to simulate the circuit but I got unreliable results. Here's what I got when I set the duty cycle to be 20%: Stop Time = 0.02 The efficiency is more than100%. Here's the parameters: Could someone please let me where is my mistake?
  17. J

    Matlab How to plot values from a loop

    %Debeye theory Heat Capacity of Copper %Garcia Problem 10.16 %Find molar heat capacity from 0-1083K (melting point of Cu) k = 1.38064852e-23; %Boltzmann's constant N = 6.02214e23; %Avagadro's number (atoms per mol) T = 0:1083 ; %Initialize Temp at 0K-1083K theta = 309; %Debeye temp of Cu (K)...
  18. patric44

    Using Matlab ode45 to solve a simple 2 body problem

    hi guys i am having some truble solving a simple 2body problem in MATLAB , basicaly i have a table of data that came from a simulation of a satellite orbiting the Earth with 1 min interval between them , i will only take the first inital position and velocity from that table and i sould...
  19. patric44

    Solving the two body problem in Matlab

    hi guys i am trying to code an algorithm for computing the trajectory of a basic two body problem situation according to the equation $$\ddot{r} = \frac{-\mu}{r^3} \vec{r}$$ i am trying to use the Euler method , but the problem is in converting this problem into a 3 separate equations one for...
  20. J

    Matlab coding issue with solving PDEs

    FTCS scheme My Matlab code: %Problem 3 %Solve diffusion problem using Richardson scheme or DuFort-Frankel scheme clear all; scheme = menu('Choose method of solving diffusion equation:', 'Richardson', 'DuFort-Frankel'); tau = input('Enter time step: '); N = input('Enter the number of grid...
  21. WhiteWolf98

    MATLAB How to make a while loop stop when reaching a certain value

    m_1 = 1; C_p1 = 2219; T_1in = 100 + 273.15; T_1out = 75 + 273.15; Q_1 = (m_1)*C_p1*(T_1in-T_1out); while Q_1 ~= 30000 T_1outnew = T_1out + 0.1; Q_1 = (m_1)*C_p1*(T_1in-T_1outnew); T_1out = T_1outnew; end T_1outnew keeps increasing, but the code never stops; and naturally, Q...
  22. binbagsss

    MATLAB Matlab: echo generator question

    The task is to given an input column vector (with values between -1 and 1 representing the digitized data), fs the sampling rate, delay to represent the delay of the echo in seconds, amp specifying the amplification of the echo, to add this echo to the original signal after delay seconds. Other...
  23. J

    A Nonlinear Wave Equation (Nonlinear Helmholtz)

    I am trying to solve a PDE (which I believe can be approximated as an ODE). I have tried to solve it using 4th Order Runge-Kutta in MATLAB, but have struggled with convergence, even at an extremely high number of steps (N=100,000,000). The PDE is: \frac{\partial^2 E(z)}{\partial z^2} +...
  24. person123

    Widgets for Visualizing Engineering

    Hi! First off, I'm just an upcoming junior in Civil Engineering, and I have little teaching experience. I have done well in engineering classes so far though, and I've thought about ways to improve how classes are taught. While there are some widgets for engineering, like those in MATHTAB and...
  25. P

    Babinet's Principle: Effective Aperture Dipoles (Matlab)

    For clarification on "normal incidence" without drawing a picture. I'm going to assume the incoming wave has the electric field in the z-direction, the magnetic B / Auxillary H-field in the x-direction, and the Poynting Vector in the y-direction (i.e. normal to the plane of the aperture). That...
  26. PainterGuy

    MATLAB Matlab command question: length max([x+y-1,x,y])

    Hi, I'm not sure if I should be asking this but I couldn't make sense of the following Matlab command: length max([2+3-1,2,3]). The result is "16". I couldn't the operation of this command and why it produces the result of "16". Could you please help me with?
  27. binbagsss

    MATLAB Matlab help please (generating a plot from this data)

    Hi I have saved data in pdf format, and I wish to generate a plot from this data. The data is iterations of optimising some function. I can't just copy and paste it into the live window obviously and then try to generate a figure, so how can I generate a figure, just as I would have done...
  28. F

    Simulate open circuit and short circuit in MATLAB

    Here's my attempt: The results I got are close to the required answer, but there is a question telling: I tried to solve it, but Isc and Vt (in open circuit) are decreasing with the increase of the field current , so I didn't get the right answer. Could someone let me know where is my...
  29. C

    MATLAB Deconvolving two signals with different sampling rates

    Hi, So i am in a fix now. I have a discrete time signal which is produced by a device with Nyquist frequency as 50MHz and 1088 samples (there is nothing i can do with the device to change the frequency or number of samples). I have an analytical signal which is produced in the frequency domain...
  30. J

    MATLAB Writing a matlab program to solve the Kepler Problem (Universal Vars)

    Introduction: I am writing a Matlab program that solves the Kepler problem for any Elliptical, Hyperbolic, or Circular orbit. Given an initial position vector, velocity vector, find the position vector and velocity vector after some given time. I am not doing this for any class, I have been...
  31. mastermechanic

    Matlab Appdesigner save('xxx.mat') command won't work

    At the start up section I initialize a matrix like: EL = [ ]; save('EL.mat',"EL"); -------------------------------------------------- This part is okay it creates and saves an empty matrix. But later, when a button pushed it should record the values of the edit box like: (This is the...
  32. MathematicalPhysicist

    MATLAB A Lorenz's system of ODEs doesn't get executed in Matlab

    I use the following script and function in MatLab, but get three errors. I shall first write down the code and after that the errors that I get. function yprime = lorenz_de(t,y) %LORENZ_DE Lorenz equations. % yprime = lorenz_de(t,y). yprime = [10*(y(2)-y(1))...
  33. F

    Construct a circuit with single phase asynchronous machine in MATLAB

    Construct the circuit above using the block shown below. The torque was gradually increased in small steps until the load torque reached the rated torque. At each step the torque, current speed, voltage and power factor was measured and the result record in Table (1). Tn = Rated torque = 1 Nm...
  34. Boltzman Oscillation

    MATLAB How can I create an equation in matlab for image processing?

    Here is the documentation for the 2DFFT: https://www.mathworks.com/help/matlab/ref/fft2.html how would I go about creating this formula on MATLAB to apply it on an image? My guess is that I need to create the equation and then multiply it to the image I need such as: $$U = VI$$ where V is my...
  35. F

    Fixed-point Iteration in MATLAB

    I used the same code , but changing the equation ( line 4). In part (D) , I got a complex number , does it mean that the function is divergence ? Here's my code : Part c : Part d : Could someone confirm my answer please ? Any help would be greatly appreciated !
  36. F

    Solve a nonlinear equation using fixed-point iteration in MATLAB

    My attempt is attached below. When I tried to solve it , nothing comes up. However, there are no errors !
  37. A

    Finding the Reaction Scheme for Photocatalytic Oxidation of Phenol

    I researched the solar collectors implemented in practice for water detoxification and I found out that the preferred design is the Compound Parabolic Concentrator. Knowing that I have no information regarding radiation beyond what's taught generally in heat transfer courses in chemical...
  38. E

    Modeling/Analysis of optical fibers

    Hello PF, I need some guide points to help me formulate a project idea on the topic of optical fibers. Namely, the professor suggested I should look for topics on modeling of optical fibers, analysis of different optical fibers, characteristics etc. and to work in a simulator, or perform a...
  39. P

    Plotting the Poynting vector of a radiating electric dipole [matlab]

    I've attached a .txt file of my script for those who want to take a look at it Here's a picture of my vector field at time t = 0 I'm very concerned about this picture because from my understanding the Poynting vector is supposed to point outwards and not loop back around, this looks nothing...
  40. currently

    MATLAB Position-Velocity phase plane portrait in MATLAB?

    For example, how would I graph a Position-Velocity phase portrait of a nodal sink or spiral sink? Given form of mx'' = -cx' - kx + βx^3.
  41. cookiemnstr510510

    Solving MATLAB Meshgrid: A Beginner's Guide

    Hello All, So I know how to solve this problem, but I don't understand it. I first create a vector for length and width: L=[1 3 5] W=[2 4 6 8] I then use meshgrid to make my L and W vectors have the same dimensions. [X,Y]=meshgrid(L,W) Then multiply X and Y together using array multiply (not...
  42. V

    Mathematical Modeling of an evaporator for evaporating water

    I am trying to model an evaporator which evaporates water to steam in Matlab/simulink. Are there any governing equations i need to know and follow when modelling the evaporator mathematically? Please let me know.
  43. dRic2

    MATLAB Switching from MATLAB - Easier Programming Language?

    Hi, as I anticipated, I've been using MATLAB and MATLAB only during all my BS and my MS degree. Since it is very expensive I don't think I will get a new license once my student one expires. I don't really have much time now to learn a completely different programming language because I have a...
  44. M

    Engineering Reconstruct a signal by determining the N Fourier Coefficients

    %My code: %Type of signal: square T = 40; %Period of the signal [s] F=1/T; % fr D = 23; % length of signal(duration) dt=(D/T)*100; N = 50; %Number of coefficientsw0 = 2*pi/T; %signal pulset1= 0:0.002:T; % original signal sampling x1 = square((2*pi*F)*(t1),dt);%initial square signal t2=...
  45. J

    Forward kinematics model using DH parameters in MATLAB

    5 links (thus 6 frames) and corresponding theta, alpha, d and a values are all given. However, I'm not sure how to start coding the DH parameters to derive a forward kinematics model. I know that I'll have to use matrix operators, but do I just put in the values of the 4 factors mentioned above...
  46. A

    MATLAB Bilinear spline interpolation MATLAB using MESHGRID and SURF

    Hello. So, I must provide a solution for an image processing course I am taking (implemented in MATLAB).The task is as follows: 1. I must provide a MATLAB script that takes in a DISCRETE N x N matrix (Greyscale picture) and does Bilinear spline interpolation on it. This is the spline function...
  47. L

    MATLAB Gaussian process and climate model in Matlab

    I'll admit I am very new to Gaussian processes, but from what I know a Gaussian process is completely determined by a mean vector E(Y(θ)) and a covariance function Cov[Y(θ1), Y(θ2)]. E(Y(θ)) is given, and we have the correlation, which is just the covariance divided by Var(θ1)*Var(θ2).The...
  48. whoohm

    Maple Anyone using Maple in 2019 on regular basis?

    I know these software packages were discussed a lot in the past, but I have not seen much input from the last couple years. I have used Matlab for many years, but remember using Maple in University Physics courses many years ago. I'm interested in a software package for symbolic math to use...
  49. Leanne

    Finding the diameter of a wire

    Mentor node: Added code tags From=menu('select:','c', 'g', 'a', 's:'); This is part of my code and I'm not coming up with anything close l=input('input wire length') %current copper=12.5572...
Back
Top