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. 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...
  2. Cassius1n

    MATLAB Does anyone had this plotting problem with MATLAB?

    I have finsihed my work on an orbit propagator in MATLAB and now I'm trying to simulate the orbit with the help of the main script. tspan=[0 :860]; Position and velocity y0(1,1)= 743322.3616 ; y0(2,1)= -6346021.219 ...
  3. C

    MATLAB Help: Convert Matlab to Python code

    I'm working on a convolutional neural network project that classifies histopathological images of breast tumors. All my code is in python. Part of the image preprocessing involves appearance normalisation to account for the variation in histological staining. The only code for the preprocessing...
  4. J

    Compensator Design in system control

    Hello, in my final project for System Control i have been stuck for some time on this following task What i cannot figure out is how to make all these condition work at the same time. When I tried designing a PD controller in sisotool or MATLAB for the i and ii part it worked but i couldn't...
  5. C

    MATLAB function within function handle output

    Homework Statement MATLAB The funciton "rockdynamicstage" outputs a matrix 4 by x, where x is somthing around 300( varies). The funciton "rockdynamicstage" is within the funciton handle "sim" with an input of gama0. (PayMass,Masstages,Massfrac,Thstage,IspStage,ChangeTstage) ar parameters that...
  6. Jayalk97

    Problems designing an FIR band pass filter on MATLAB?

    Homework Statement So I've been tasked with designing and band pass filter for my signals class. We're given the specifications that it needs to go from 200-5000Hz, and we need to use a kaiser window as the window function. Homework Equations There are 2 parameters, beta and N, given by these...
  7. F

    MATLAB Symbolic calculations in MATLAB

    Hello Everyone, I am not sure of when to use symbolic calculation and symbolic function in Matlab. For instance, we can set the domain of a function x=1:10 and plot the function y= x.^3+3 numerically to plot a graph and calculate numerically the derivatives, etc. That said, I am not sure of...
  8. D

    MATLAB Mastering Matlab: Graphing Functions Made Easy

    The MATLAB command plot plots points in a two-dimensional figure and connects them with straight line segments. So, here $y$ is a vector with $n$ entries $(1; y(1)); (2; y(2)); (3; y(3)); : : : ; (n; y(n)):$ So the MATLAB command is given below for an example: y = [1 -3 3 -4]; >> plot(y)...
  9. D

    MATLAB Matlab Sim Code for ODE & Gillespie for Reversible Reaction

    Here is the code you input into matlab. Aini etc, are the initial values of the population densities. A for predator, B for Prey. % example for ODE and Gillespie % one reversible reaction b1 = .033; bo = .00047; a1 = .0022; ao = .00055; Aini = 5168; Bini = 34; %% Basic ODE simulation...
  10. TaylorLL

    MATLAB MATLab: Not enough inputs for nlinfit

    Hello! I'm trying to plot a best fit for some generated EQ data and I'm having issues with nlinfit. My code is as follows and when I try to run it, I get an error referring to the anonymous function ("test"), nlinfit (from Matlab), and not having enough input arguments. %Test function t =...
  11. D

    MATLAB Matlab code for a Gillespie type reaction (model) with wolves and elk.

    Copy and paste if you want to use any of this code. Its a simple iteration of converting biomass of elk into new wolves. % example for ODE and Gillespie % one reversible reaction b1 = .033; bo = .00047; a1 = .0022; ao = .00055; Aini = 5168; Bini = 34; %% Basic ODE simulation dt = 0.01...
  12. PainterGuy

    MATLAB Fixing a Matlab Code: Help Needed for Fourier Transform Calculation"

    Hi Could you please help me to fix the code below? I know that the code is completely wrong but I have tried to write it down so that you can get an idea what I'm trying to do. Thank you. %%file name fourier.m clear all; close all; clc; f = 0; %% 0 Hz to 100 Hz, with 0.1 step...
  13. M

    MATLAB Solving Linear System with Eigenvalues in Matlab

    Hi PF! I am looping through a linear system and each time I do I generate a new matrix, call this matrix ##A##. When finding the eigenvalues of ##A## in Matlab is use [a,sigma2M] = eig(A);% a eigenvector and sigma2M matrix of eigenvalues sigma2(:,ii) = sum(sigma2M);% create matrix with rows of...
  14. C

    MATLAB Graphing Matlab Heat Transfer | T_0 Variable

    I'm working with heat transfer and need to graph theoretical results. I've tried several things and it will either throw something along the lines of "no explicit solution found" or just hang forever. I'm not new to programming, but I am new to the Matlab library. The only variable is T(t). T_0...
  15. M

    MATLAB Understanding Autocorrelation in Matlab: Exploring Functions for Different Lags

    Hello everyone. Iam a little bit confused about the autocorrelation and using Matlab so I hope someone can help me out. As far as understand Matlab computes the sampled autocorrelation where the lag between the samples is given by x(n)* x(n-l). Buy what if the autocorrelation depends on the...
  16. Wrichik Basu

    MATLAB Top Books for Learning Matlab: Beginner to Advanced Level with Java Knowledge

    I've recently started to learn MATLAB (self-study). I first tried to learn by an app on Google Play, and work out the examples on the Matlab app. But the app is very bad, and I can't understand anything after a while. What books can I use for learning Matlab? I have a good knowledge on Java...
  17. N

    MATLAB In MatLab How can we stop/start process during processing?

    I have tried to write MATLAB code for creating animation by using linear transformation, so I want to stop process during processing and then start process during processing. such I have stopped process for 5 seconds after that I start process.I don't know a command that should be used in my...
  18. I

    MATLAB Small matlab code not working. Why ?

    Code is the following : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% xiter=[0.7 20 10]; mubeton=[0.100 0.80 0.70 0.60 0.50 0.25]; muair=[0.05 0.042 0.04 0.032 0.021 0.011]; zl=[5 30 70 100]; fnorm1 = @(d,a0,dmax) (a0*(1-exp(-(0.5*log(d./dmax)).^2))+exp(-(0.5*log(d./dmax)).^2)); fnorm2 = @(d,dmax,DRL)...
  19. S

    MATLAB Separation of variables in MATLAB

    Hello, I haven't found any program that can be used to perform separation of variables on difficult PDEs. Is there such a method somewhere?
  20. M

    MATLAB Efficient Method for Constructing Matrix of Products in MATLAB?

    Suppose we have two vectors ##a = [1,2,3]## and ##b = [4,5]##. I want to construct the matrix of products, i.e. $$ \begin{bmatrix} 1\cdot 4 && 1\cdot 5\\ 2\cdot 4 && 2\cdot 5\\ 3\cdot 4 && 3\cdot 5 \end{bmatrix} = \begin{bmatrix} 4 && 5\\ 8 && 10\\ 12 && 15 \end{bmatrix} $$ Does anyone know an...
  21. kostoglotov

    Nyquist and FM and Signal Mixing....

    In an assignment I have, we are told to implement a Frequency Modulating function without using any of MATLAB's in-built functions, and not to use it's integration function either (use cumsum instead). I've been getting a lot of problems trying to solve these assignment problems without telling...
  22. kelvin490

    MATLAB Solving equation with integration using MATLAB

    I would like to solve an equation below using MATLAB: All the parameters except p are known, so I only need to solve for p. However since I need to consider the sign of the integrand and there is an absolute value sign in it I don't know how to solve it. Could anyone please help? Thank you.
  23. P

    MATLAB Sliding mode observer in Matlab or Simulink

    Hi, I have designed a variable-based observer analytically on paper. Now it's time to implement it in Simulink/matlab. Suppose we have followings in a tire model. The EOM says: J\dot{\omega} = T-R_eF_x m\dot{v}_x = F_x where J is the inertia of the wheel, \omega is the angular velocity , m is...
  24. S

    MATLAB Weighting data points with fitted curve in Matlab

    Hi all, I'm currently in the middle of performing an experiment for the final project of my MSc, and I have a question about how I should go about weighting the data when fitting a curve to it using the MATLAB fitting tool. Firstly, a bit of background about the problem. I am seeing how low...
  25. Abdul Wali

    MATLAB Matlab Derivative block analysis and filter design

    Hi, May someone helps me regarding this!? i have a controller which will control AC motor as attached. in this controller, a stage comes where I need to use a Derivative Block before point 'B' as shown in the attached picture " controller block diagram" [...
  26. A

    Programmes to learn for Nuclear Engineering Masters

    I am about to begin an MSc in Nuclear Engineering. I am competent in MatLab language but wish to practice/learn another in the time before my course starts. Would I be well served in continuing to practice MatLab or to learn another from scratch (C/Java/Labview)? Are there any particular areas...
  27. M

    MATLAB Solving MATLAB to Excel Copy Issues

    Hi PF! I am trying to copy info from MATLAB to Excel via the following code filename = 'testdata.xlsx'; A = [12.7 5.02 -98 63.9 0 -.2 56]; xlswrite(filename,A) but I receive the following warning: Warning: Could not start Excel server for export. XLSWRITE will attempt to write file in CSV...
  28. P

    MATLAB Simulink: designing a 2nd order sliding controller

    Hi, I've had obtained a mathematical model for the slip controller issue. As you see I have the diffequation for the slip. and the input that force the system to zero error is provided as well. Now it's time to implement it in simulink or matlab. I took a look at the example provided on...
  29. Monsterboy

    Elliptical paraboloid surface in matlab using F/D = 0.3

    Homework Statement To generate a elliptical paraboloid antenna surface in MATLAB using the given F/D ratio (= 0.3) F- focal length D- Diameter = 50 m Homework Equations ## \frac {F}{D} =\frac {1}{4tan(\theta/2)} ## ## F = \frac {D^2}{16H} ## H = height of the paraboloid Equation of a...
  30. kelvin490

    MATLAB Matlab -- how to make a smooth contour plot?

    I want to represent data with 2 variables in 2D format. The value is represented by color and the 2 variables as the 2 axis. I am using the contourf function to plot my data: load('data.mat') cMap=jet(256); F2=figure(1); [c,h]=contourf(xrow,ycol,BDmatrix); set(h, 'edgecolor','none'); Both xrow...
  31. Joacim Jacobsen

    I Intersection between line and cylinder

    I have an expression for a "line- to sphere intersection" that works: a = 1 + Ax^2 + Ay^2 b = 2*(-zs + Ax*(Bx-xs) + Ay*(By-ys)) c = zs^2 + (Bx-xs)^2 + (By - ys)^2 - R^2 This is part of a code in Matlab, and works fine. It is derived from substituting (x=Ax*z+Bx, y=Ay*z+By) into...
  32. M

    MATLAB MATLAB and averaging without NaN

    Hi PF! Let's say we have a vector ##x = [1, \,2,\, 3, \,20,\, 4,\, 5,\, 30,\, 6]##. I am trying to loop through and find the magnitude of the derivative of each ##i^{th}## element with unitary spacing, and if that derivative is sufficiently high, I make that element NaN and continue. Example...
  33. J

    MATLAB Books to read for Matlab, C++, and Circuits?

    Hi I am an undergraduate EE student into my 3-4th year. I feel like my fundamentals are not so good at times and I want to improve. I want some recommendations on what books to read to really help improve my fundamentals. I really don't like the textbooks we are reading. They are just too broad...
  34. J

    MATLAB Highlight an object in an image?

    Hi Everybody I'm a new user and hope I have posted in the correct section. I'm a beginner in MATLAB and image processing. Using matlab, I have to highlight in an object in an image. I have an input image where there is a plate with a food. I need to produce an output image where only food is...
  35. D

    Matlab expressions for two types of odd polynomials

    Homework Statement i am trying to find the expressions for the "equiripple" and "maximal flat" polynomials for the equiripple :[/B] for maximal flat: Homework EquationsThe Attempt at a Solution i know that for maximal flat its butterworth polinomials, but for P_3 i don't get the same...
  36. Addez123

    How does image matrix filters work in matlab?

    I got an image called img and I want to sharpen the vertical spatial lines. I created this matrix: hp = [-3 -2 -1 12 -1 -2 -3]; hp= rot90(h_lowp); Then I do this to get the new image: newimg = uint8(conv2(single(hp), single(img))); It SORTA works, but I'm not so sure why it works. I mean all...
  37. N

    MATLAB Why 2 vectors are not the same in matlab?

    I have 2 vectors: a = 1.0e-04*[0.110000000000000 0.140000000000000 0.140000000000000 0.140000000000000]; b = [0.000011000000000 0.000014000000000 0.000014000000000 0.000014000000000]; by look at by eyes, it seems similar; but when I use this command: a == b then I got...
  38. F

    MATLAB Question about representation of data in Matlab

    Hi everybody; I have plotted a matrix with sea surface temperature's correlation with another variable, the size is (360x180x12); using to plot : figure for i=1:12 subplot(4,3,i);imagescnan(loni,lati,squeeze(double(r4_sat(:,:,i)))'),colorbar; end Now, I want to plot over it another matrix of...
  39. jamalkoiyess

    MATLAB How to create distinct circles in Matlab?

    I want to create a plate of distinct circles on Matlab where their radii are generated by randn(1,p) and centers are random. I am currently doing the circles using viscircles, but some of them are overlapping, and since I want approximately 100 ones, this problem only gets worse. How can I make...
  40. N

    What is preventing me from achieving better accuracy for this delay?

    I have 2 PERFECT data of the transmitter and receiver. From 2 data, I can calculate the delay estimation: Fs = 8e6; % sample rate ... for i = 1:2 [cc_correlation,lag] = xcorr(signal2(i), signal1); [cc_maximum, cc_time] = max(abs(cc_correlation)); cc_estimation...
  41. N

    How to calculate standard deviation?

    I have 2 signals: signal1: https://www.dropbox.com/s/zr04pff9skeh8cn/TX.dat?dl=0 signal2: https://www.dropbox.com/s/h436a915dd99hln/RX1.dat?dl=0 signal2 represents for 20 measurements, each measurement combines with signal1 to get time delay estimation using xcorr. So, I will have 20 delays...
  42. N

    MATLAB I with matlab designing a steady state feedback H2 control system

    Hi everyone. I'm designing a steady state feedback H2 control system. Actually, my major is tribology and I have no experience in designing control system. So it is really big problem for me. Anyway, this is my simple model of tribometer which applies normal load on the surface. (is it...
  43. B

    MATLAB Exploring the 2D GrayScott Model with MATLAB

    Dear Community, I was trying to reproduce the 2D GrayScott model given either here: http://blogs.mathworks.com/graphics/2015/03/16/how-the-tiger-got-its-stripes/ or here: http://www.joakimlinde.se/java/ReactionDiffusion/index.php?size=0 The reason was to create a nice screen-saver (so I am...
  44. Arman777

    MATLAB Matlab Power Fit on Graph-Codes

    I have some data and I need power fit.And display it on the graph.But I couldn't find the right codes for it.(I need codes) Here my graph, Here my codes, >> x=BN(:,2); >> B=BN(:,1); >> plot(x,B,'go') >> plot(x,B,'go') >> hold on >> xlabel('Distance (m)','Fontsize',21); >> ylabel('Magnetic...
  45. hilbert2

    Comparison of high-level computer programming languages

    A little question about the appropriateness of a certain research subject... Would it be useful to make a study of the computational effectiveness of equivalent codes written with Matlab, Mathematica, R Code, Julia, Python, etc. in a set of typical computational engineering problems like...
  46. R

    MATLAB Frequency domain filtering in Matlab

    I am trying to implement several filters in Matlab for Fourier domain filtering. They are the cosine, Shepp-Logan, and Hann/Hamming window filters. These filters are defined as multiplying the ramp filter by the cosine function, sinc function, and Hann/Hamming windows respectively. This is how...
  47. F

    Algorithmic differentiation in unsteady heat equation

    Homework Statement Okey her we go I was given a base code called heat_equation_primer. The goal is to implement a optimizer into the program. The two methods that are going to be used is the Quasi-Newton and Steepest descent with search line. So I need gradients. So I tried to differentiate as...
  48. Arman777

    MATLAB Matlab Displaying the Fit Equation On graph.

    I have a lineer data and I want to write the equation of it on the graph. The x-axis is inverse distance (1/m) and I showed as "d" The y-axis is capacitance (C) and I showed it like "C" My data name is d_C Here my codes that I used for now >> d=d_C(:,1); >> C=d_C(:,2); >> plot(d,C,'go'); >>...
  49. M

    MATLAB Eliminate Noise from an Image in MATLAB

    Hi PF! Attached is a binary image I have in MATLAB, where I have drawn an error pointing to some noise. Does anyone know of a systematic way to eliminate all noise below this line (or basically what appears to be the line)? I also uploaded the same image only processed, titled Noise1. This...
  50. N

    How to calculate Time Delay Estimation?

    I have 2 data files, which links are attached below: Transmitted data https://www.dropbox.com/s/0nmhw6mpgh7upmv/TX.dat?dl=0 Received data https://www.dropbox.com/s/xgyo6le3bcmd25r/RX.dat?dl=0 Those binary data are read by this MATLAB code: %% initial values: nsamps = inf; nstart = 0; %% input...
Back
Top