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

    MATLAB Plotting an integral-defined function in MATLAB

    At this exact moment, the proper name of functions defined by: f(x) = ∫0xf(t)dt escapes me, so I apologize for the title maybe not being as clear as possible. What I'd like to know is how to go about defining such a function so that I can plot it. Do I just put the variable x into the upper...
  2. Gradon

    MATLAB Therapy imaging processing in matlab

    do you have imaging processing' document in matlab? can you share with me? Do you have code MATLAB about increase form yellow to red? Thanks your attention
  3. B

    MATLAB Matlab Simulink: How to Access SIMSCAPE for Electrical Simulations

    hello people, I have MATLAB R2014a installed in my system, i would like to do some electrical simulations. Unfortunately I am unable to find SIMSCAPE in my library. Can anyone suggest me how to get it. thanks in advance.
  4. goonking

    Matlab question, just checking If i inputted correctly.

    Homework Statement Homework EquationsThe Attempt at a Solution look at line4, did I enter it correctly? I must have did something wrong because there is no contour at all, all i see are parallel lines.
  5. E

    Phase shift in frequency domain

    Hello, I'using Matlab to simulate phase shift in frequency domain (FD). I have got real and imaginary parts of the signal after FFT. I'd like to use phase shift in FD. This works: Y=fft(y); YY=Y.exp(-i*2*pi*nk/N*samples_delay); result=ifft(YY); But in my DSP I can't use the formula above and...
  6. M

    MATLAB Troubleshooting PDEs in MATLAB: Why is My Function Not Affecting the Plot?

    Hi PF! I am trying to solve a pde in MATLAB and started by using the generic code mathwork supplies and then augmenting for my purpose. After defining the function below and run the script, i can do anything to the ##f## and nothing changes. I can literally delete the line and still I receive...
  7. G

    MATLAB MATLAB and the command fprintf

    Hi guys I'm doing some homeworks for my professor, the homeworks are some MATLAB scripts that consist in creating and running some functions. The professor is requesting that the results obtained must be written in a file using the command fprintf. I have tried to understand the mechanics of the...
  8. G

    MATLAB Exporting data points to Excel with Matlab?

    I have an optimization algorithm running 50 full trials with up to 10,000 iterations each (it breaks off if the error goal is reached before that). I want to export the iteration number and the best function value at each iteration to an excel file, then after each trial completes move to the...
  9. J

    MATLAB Communication between Arduino and Matlab Help

    I am trying to achieve real time plotting of accelerometer data using an arduino, an Xbee, and Matlab. Usually when the Matlab program gets data, it gets something like this: ~ #� ' X: -2 Y: 20 Z: 4080 t: 33232 ~ !� ' X: 4 Y: 2 Z: 4066 t: 33255 b~...
  10. Futurestar33

    MATLAB What is program is better mathematica or matlab?

    If you are a professor is it better to use Mathematica or Matlab when it comes to publishing papers, which program creates the best graphs. I have origin as well.
  11. F

    Matlab: what is the distribution equal to in Matlab code

    Homework Statement A common way of displaying the distribution of a random variable is by a histogram. Consider the interval [a,b) divided into M sub-intervals (bins) of length ΔX. Given a set of N random values of x, call Nj the number of values that fall within the jth interval. Homework...
  12. B

    Matlab: Open file with typed filename and/or uigetfile?

    Hi all 1. Homework Statement I have a function script for doing some analysis of data from a text file and making some plots. My script takes the filename as an input argument - this is very helpful for running the analysis over multiple files and replicating results. However, I have also...
  13. FrancescoMi

    MATLAB [Matlab] Simulation of Stochastic Process

    Hi all, I have this dynamic: is a Mean Reverting process. I want to simulate the sde with MATLAB but I am a beginner and I have some problems. I show you the code that I have created: %% Simulazione prezzo Geometric Ornstein-Ulenbeck clear all clc %Parameters mu = 0.5; sigma = 0.12; eta =...
  14. L

    MATLAB Integrate y=x/(exp(x)-1) in MATLAB

    Hi, I have a problem of integration in Matlab. I want to integrate the following equation: y=x/(exp(x)-1) and x is from 0 to 1. I use int(y,0,1), but it seems that it does not give correct result. Could you help me how to do it in Matlab? Thanks!
  15. E

    MATLAB Implementation of Fresnel Diffraction in MatLab

    I'm trying to simulate the Fresnel Diffraction in MatLab using the Fast Fourier Transform syntax. But I'm not getting really good diffraction patterns. Here is the code: %% Fourier Transform for G(p, q) g = layer.*exp(((1i*pi)/(lambda*z))*(r_obj)); G = fftshift(fft2(g)); %% Fourier Transform...
  16. kreil

    MATLAB 5 Common MATLAB Error Messages and How to Fix Them - Comments

    kreil submitted a new PF Insights post 5 Common MATLAB Error Messages and How to Fix Them Continue reading the Original PF Insights Post.
  17. kostoglotov

    Multiple Integral Challenge Question, no solution in guide

    I have what I think is a valid solution, but I'm not sure, and when I try to check the answer approximately in Matlab, I don't get a verified value, and I'm not sure if my analytic solution or my approximation method in Matlab is at fault. 1. Homework Statement Evaluate the integral...
  18. H

    MATLAB Series of Standing Waves in Matlab

    %PLOTTING TIME DEPENDENT MOTION OF A STANDING WAVE %Define Parameters a_n = 1; k = 5; w_n = 5; x = 0:0.05:4; t = 1:0.05:20; for j=1:length(t) for i=1:length(x) u(i) = a_n*sin(k.* x(i)).* cos(w_n.*t(j)); %Formula for displacement end pause (0.1) plot(u)...
  19. K

    MATLAB How can i solve these equations in Matlab?

    Equation 1: Equation 2: Equation 3: Equation 4: Equation 5: I would like to solve , (not the one with a star) and i want to define values for p, η0, ηr, θ0, θr. i have tried to solve them, but didn't work, can someone please help and show me step by step?
  20. T

    Matlab storing data and checking conditions

    Homework Statement clear all; close all; totalanswers=zeros(100,4); k= ; flag =0; for i =0:25 a=i; if flag ==1 break; end and so forth for a,b,c,d, etc for a finite set of values all have the break values too. x=[ a,b,c,d]; does some math calculationhere is a...
  21. AMMforce

    MATLAB MATLAB program results discrepancy....

    Hi, I'm using MATLAB R2011a in my project, involving matrices of dimensions up to (70 × 20). I had good results, a time ago. Currently, poor results are generated using the very same code -(of good results)- with same parameters settings & relatively smaller matrices (30 × 20) ! I tried...
  22. H

    MATLAB Looking for a suitable command in Matlab

    I have a vector for instance x=1:200; and three functions of this vector as f(x) and g(x) and h(x) numerically. I want to find the values of the constant coefficients c and d in "cf(x)+dg(x)=h(x)". Is there any way in Matlab to calculate these coefficients directly?
  23. N

    MATLAB 3D Finite different method using matlab

    Can anyone show me how to solve the 3D diffusion equation which has been modeled into FDM by using matlab?
  24. D

    How to solve a very large overdetermined system numerically?

    I am doing a project on image processing and I need to solve the following set of equations: nx+nz*( z(x+1,y)-z(x,y) )=0 ny+nz*( z(x+1,y)-z(x,y) )=0 and equations of the boundary (bottom and right side of the image): nx+nz*( z(x,y)-z(x-1,y) )=0 ny+nz*( z(x,y)-z(x,y-1) )=0 nx,ny,nz is the...
  25. A

    MATLAB Roots of Polynomials by loop in matlab

    Dear Friends! I need to find roots of polynomials with variable coefficients, The command I used is w=0:50 A=w^2 B=w^3+2 C=w+2*w^2 D=w E=w./2 ss=[A B C D E] xi=roots(ss) by this I find all the roots of equation, I want to find velocities by setting v1=w/xi(1) v2=w/xi(2) v3=w/xi(3) v4=w/xi(4)...
  26. J

    MATLAB Vector-valued functions in MATLAB

    I'm trying to create a vector field plot of an equation in x and y. Basically, I would like to create a function F(x, y) = p(x, y)i + q(x, y)j that defines a force field, and have the field direction and magnitude plotted at points in the x-y plane, and both components of the vector are...
  27. R

    Algorithm to compute Basis images of an image

    I know from the Fourier Analysis that any signal can be represented as summation of elementary signals i.e. basis functions .Likewise,any image can be represented as summation of Basis images. Is there any available code, or even an algorithm, that would allow me to compute Basis images of an...
  28. S

    MATLAB Can You Solve This Finite Difference Equation Using Matlab?

    hi dear i have a question. i have equation (1/α ) dT/dt =d2T/dr2 +1/r dT/dr +d2T/dz T=T(r,z) T(Ri,z)=Ti T(Ro,z)=To T(r,0)=To dT(r,L)/dz =0 by finite difference method O(h^3) and this question's MATLAB program. is there anyone who can do it ? it is very important for me tnx
  29. A

    MATLAB Matlab: Finding the right angle

    Hi! I have a question about an assignment. It is about throwing a rock which should land 20 meters away from the "shooter". My job is to find the angle "a" which makes the rock land 20 meters away. The motion is given by a multivariable, second order differential equation which I have already...
  30. K

    Solving PDEPE without boundary conditions? heat transfer

    Hi all! I am trying to solve a system of partial differential equations in Matlab, with both derivatives in time and space domains. I am using the pdepe function for that. The system is, to be simple, a sort of solar thermal panel, made of three layers: an absorber plate, a fluid layer of...
  31. R

    Decomposing Images into Harmonic Components Using Fourier Transform

    I am beginer in image processing. Any signal whether it is 1D,2D or any multidimensional signal can be represented using combination of number of sine and cosine wavesforms (harmonics).Similerly any image can be termed as a function of sinusoidal signals.I want to see individual pattern for the...
  32. B

    Unsteady vorticity transport equation: codes available?

    I would like to reproduce results from a much older code to test a new one. I only have the old code's results in the form of plots, not data, but I need data. The older code solves the unsteady vorticity transport equation in 2D with a constant kinematic viscosity term. I'm interested in 2-D...
  33. lonely_nucleus

    MATLAB How long does it take to get good at matlab?

    is learning MATLAB like learning c++ where it takes like a year of programming everyday to get good at or is it a smaller programming language? I just finished learning html at codeacademy.com and it was very easy to learn and I learned it fast, is MATLAB larger than html? If you used MATLAB...
  34. D

    PC Characteristics: Simulation FEM professional purpose

    Dear all, I'm an electric engineer, and I usually work with software as Ansoft Maxwell, Matlab, Ansys, COMSOL... I need a PC for serious professional simulation, and I would like if someone can give me some tips of the characteristics I should ask for this purpose. I don't want to spend more...
  35. H

    MATLAB Set Axis Font Size Independently in Matlab

    To set axis font size I use set(gca,'FontSize',20) but this command also acts on legend font size. How to set axis font size independently?
  36. T

    Matlab code running loops to meet conditions

    Homework Statement This is not homework but I am trying to solve a problem to see to general a set of numbers for the grassmanian equations to use in something else.[/B] I have five variables a,b,c,d,e. a-b,a-c,a-d,a-e,b-a,b-c,...etc so that none of them are the same so it generates all...
  37. Feodalherren

    Efficient Matrix Multiplication with Nested Functions for MATLAB Homework

    Homework Statement Homework Equations [/B] ---------------------- function [C]=mymatmult(A,B) [L1 C1]=size(A); [L2 C2]=size(B); if C1 ~= L2 error('dimension mismatch'); end %if ERROR C=zeros(L1,C2); for i=1:L1 for j=1:C2 C(i,j)=A(i,:)*B(:,j); end %in for end %out for end %function...
  38. M

    MATLAB Solve PDE in MATLAB: Errors & Tips

    Hi all, I'm a newbie at MATLAB and currently trying to model a chromatographic process, I have a PDE to be solved in the form of c*D(C_RH)/Dz = D(f)/Dz + s (see code below for what functions c, f and s are made of) I have defined constant values for each of the individual parameters...
  39. lonely_nucleus

    MATLAB Free MATLAB for HS Students: Can You Use It?

    I am interested in doing some MATLAB programming but I cannot afford to buy the software. Can HS students use MATLAB for free?
  40. S

    Ziegler nichols method (PID control)

    hello there, i just want to ask some questions related to PID controller. currently, i have run zumo robot to detect line by using PID controller approach ziegler nichols method..however, by testing P,PI, and PID, P gives the most accurate when zumo follows the line..which is better actually? P...
  41. Bababarghi

    MATLAB Transfer equations from MathType to Matlab

    Hi, Has anyone tried to paste equations from MathType into Matlab ? I follow every step described here No matter what equation I paste, I get following error in Matlab: | Error: The input character is not valid in MATLAB statements or expressions.
  42. jdawg

    Solve Matlab Eigenvectors Homework

    Homework Statement I think this problem is supposed to be pretty simple, but I have almost no knowledge of how to use matlab. I was told to use this function: [V,D]=eig(A) to give me the eigenvectors (columns of matrix V) and the diagonal matrix with eigenvales in the diagonal ( matrix D). I...
  43. D

    MATLAB Matlab - calculate phase shift using fft

    hello, I have 3 signals in the form of sampled values. When I plot them using plot (t,vPa,t,vPb,t,vPc) where vPa, vPb, vPc contains the values and t contains the sampling istants I get this: when I calculate phase shift using fft I get phase angle = 0. I have tried using my own code ( which...
  44. N

    Matlab Simulink: Simulate the height of ball thrown upward

    Homework Statement Upthrow simulation Conditions: initial velocity v=10m/s, initial height h=0m when t=0. Gravity acceleration g=10m/s2 . Using Simulink to simulate the variation of height with time when t≥0. Homework Equations I figured that the governing equation should be: Height =...
  45. B

    MATLAB How to calculate equation system in Matlab, with some knowns

    It's part of finite elements analysis. All I need is to solve F=Ku,K is [12x12] matrix . Some of the members of u are zeros ,some members of F are known forces . K is all known . How do I solve F=Ku in that way ?? Thanks in advance.
  46. J

    MATLAB Heat Transfer 2D Steady State Explicit

    Hello. I am completely new to MATLAB and programming in general. I never thought I would have to resort to online help, but here I am. I have spent hours googling and haven't been able to get very far. 1. Homework Statement Calculate the distribution of the temperature of the inner part of the...
  47. B

    Matlab User-defined function problem

    Homework Statement Write a user-defined function that calculates grade point average (GPA) on a scale of 0 to 4 ... https://41.media.tumblr.com/4f5e8ee38181d7c584c234138f632714/tumblr_nmnhq9p8jo1usetlso1_1280.png The Attempt at a Solution I'm getting the error that "function definitions are...
  48. W

    MATLAB Converting Excel formulae into Matlab code

    Hi everyone, I will start off by saying that I am a complete novice in Matlab and prefer to use Excel however the data that I have requires more computing power than Excel can provide. I have 16 sets of data with over 70,000 rows and 9 columns. The first column is a time series separated into...
  49. B

    MATLAB [MATLAB] Modeling response of a particle in an anharmonic potential

    I'm trying to model the response of a particle in an anharmonic potential in MATLAB. I know that writing position, x as a function of potential energy U is, where T is the period, m is mass, and E is the energy of the system. How would I get a function for T(E) since it's not independent of...
Back
Top