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.
Homework Statement
You have two functions in Matlab (represented as column vectors). Compute their convolution using the fast Fourier transform.
Homework Equations
The Attempt at a Solution
I am having trouble finding a book with this topic. I would like to know where the...
I'm doing this in Matlab but it's not restricted to any particular software.
I have a bunch of geographical points (x,y coordinates for each) and I want to take all the points that are 50 km or closer to the reference point. I took the great-circle equation to convert geographical longitude...
Hello everyone!
In Simulink , I use the Embedded MATLAB Function
function out = fcn(meas)
if meas>10
out = 4;
elseif meas<=0
out=2;
end
And I get this message:
Output argument 'out' is not assigned on some execution paths.
I would like the variable 'out' to change its...
I have been trying the following to reposition my GUI (within the OpeningFcn):
h=get(handles.figure1,'Position');
set(0,'Units','normalized')
S = get(0,'screensize');
width = h(3);
height=h(4);
x = (S(3) - width)/2;
y = (S(4) - height)/2...
I have been trying the following to reposition my GUI (within the OpeningFcn):
h=get(handles.figure1,'Position');
set(0,'Units','normalized')
S = get(0,'screensize');
width = h(3);
height=h(4);
x = (S(3) - width)/2;
y = (S(4) - height)/2...
I'm trying to make a MATLAB plot with two types of data, i.e. temperature and air flow rate. Since the temperature and air flow rate are on different scales I wanted two y-scales and since there are quite some data sets, I wanted to make the two air flow rates bold.
I tried this, but it doesn't...
hi,everyone. How to do Abel inversion using Matlab? what is the algorithm? I read something in wiki,but I have no idea how to perform it! anything helpful would be highly appreciated.
I'm trying to design a program that can accurately detect the frequency of a real, periodic audio signal, such as several guitar notes in sequence.
I have the skeleton of the program working. It does, at times, accurately detect the frequency. However, it is very noisy, and I'm not too sure how...
So I have a list of variables, defined in my workspace, and I'm trying to access them each in turn to compare them to a larger matrix A. The eval function calls each variable in turn, stores it under temporary matrix B, then compares it to matrix A, does the necessary calculation, and stores it...
Dear users
I have some points with coordinate x and y
forexample :
x=[1 2 3 4]
and y=[2 4 6 8]
and then I want to fit these 4 pair of points with some function
for example
y=a*x+b
(here I know that the answer is a=2 and b=0)
what should I...
Hello,
I have a MATLAB code that contains a lot of for loops, and hence it is very slow, and takes hours and hours to get just initial results, which is very inefficient. I know writing the program in terms of vectors will fasten the process, however, I do not know how to write my program...
hello remember not speak English and use a translator on line,
together some pictures to show some errors,from a simple integral or easy to those who are not as oscillatory integrals, when I worked and ask oscillatory integrals or approximate numerical answers, also when try plot a complex...
I am trying to learn MATLAB with MIT OCW and I am running into some trouble.
It says as an assignment:
c. cMat = a 10x10 matrix where the vector 1:100 runs down the columns (use reshape).
so
1 11 21...91
2....92
. .....
10...100
is the matrix I am trying to make and another...
Hello all,
i have frustrating task in my lab...
i have to generate a code in MATLAB that will get the focal length and the object distance from the lens, i.e image (1000X1000 pixels).
transfer it through the lens and, for the output it should be the result of it...
Hello,
I am hoping someone can give me some advice. I need to zero out the DC component of an FFT I have done, so I can get a better look at the rest of the frequency components, so how would one go about doing that?
I am not looking the code, just some advice ...I have just really started...
Hello,
I am working on MATLAB and I want to plot a function in 3D. However, I want the markers to be a letter instead of the markers provided by MATLAB. Is there a way I can do this?
Thanks
Hello, I have an image which gets displayed and has the x and y-axis ranging from 0-812 and 0-607 respectively. This is because these are the pixel sizes for my image. I would like to change the x-axis to show -3.85, 3.85 and for the y-axis to show -2.9,2.9. However, when I load my image into...
i have tried for an hour but have been constantly getting an error saying "The expression to the left of the equals sign is not a valid target for an assignment".what should i do?
i need the expression
E=[Z*(r-1/D)+exp(Z*(r-1/D))-1].*exp(-r.*Z).*1/(r-1/D).^2 ;
please reply asap
Hi guys, so I've never used MATLAB before, and i need to make a plot that changes constantly.
Let's say that i have Sin(x) from 0 to 3pi
Then i need it to change to a Cos(x) from 0 to 3pi
then to a Tan(x).
I could do it in other languaje like Php or c, but in MATLAB i have no idea. I...
How to do integration for a 2D matrix using MATLAB?
That is to say, suppose I have a bunch of data points over a rectangular region in xy plane, how to find the integral over this plane?
More explicitly, suppose I want to integrate over a square region, [0,4]x[0,4]
my data is
2 4 5...
I want to learn some basics of Computational Fluid Dynamics.But most of the books that I found dealt mostly with the theory of it with very less examples or problems to be solved numerically. I know Matlab and am pretty good at coding too.So, I am searching for a book from which I can learn CFD...
I need help implementing this bit of code into matlab. I have a known matrix lest call it Z. and I have another unknown matrix called H. The matrices are related by the following relationship.
Z = HTH
How do I solve for H in matlab? If it is relevant Z is a make up of other known matrices and...
They give me this problem in my last exam, I did not get it right - its a very convoluted and I think poorly worded problem. Rants aside, how am I supposed to be able to answer a problem like this on the next exam? What sort of mindset will help me deal with recursion problems of this form? How...
I have posted a question on here before regarding the generation of a number sequence. I followed up that question with an answer. However, as I have developed my code more I need to use an equation instead of a lookup table.
Note: I'm using MATLAB
Given a matrix A of size r x c where r >=...
Hi all,
I need to rearrange my data. I have an excel file with 12 columns and 2045 rows, which I transformed that into a .mat.
I need to query my data rearranged as follows (cf. example matrix below):
1-sum all values of Col 3 if:
a-they belong to a given value of Col 1 and to a...
Hi PF,
I would like to simulate N th order markov chain (not by means of hidden markov models, but ordinary markov chain) using Matlab. If n-th order is a heavy thing atleast 2nd or 3rd order will do.
TIA
Hi friends,
I wanted a help in Matlab programming. I have some vectors as below :
d4=cos(2*pi*293.665*(0:1/44100:.25));
f4=cos(2*pi*349.228*(0:1/44100:.25));
e4=cos(2*pi*329.628*(0:1/44100:.25));
g4=cos(2*pi*391.995*(0:1/44100:.25));
c5=cos(2*pi*523.251*(0:1/44100:.25))...
Homework Statement
I am trying to solve and plot the function, x'(t) = 1 + t*sin(t*x) where x(0) = 0 and t_final = 1, in order to compare this exact solution to the approximations of Euler's and Improved Euler's Method. Can anyone help me with the code in order to solve this problem, and then...
Hi everyone,
I am trying to solve and plot the function, x'(t) = 1 + t*sin(t*x) where x(0) = 0 and t_final = 1, in order to compare this exact solution to the approximations of Euler's and Improved Euler's Method. Can anyone help me with the code in order to solve this problem, and then plot...
Hi,
How can I set Matlab to display all the calculation results?
I am solving the system of ODEs with large spatial variable and time step distribution. If I set total time to 100 with time step of 1 only the results starting from t=50 are displayed.
How to fix it?:frown:
Thanks.
I'm translating some code from Fortran77 to Matlab and I'm struggling due to the sentence GO TO is not valid in Matlab.
Usually using sentences while I can solve the problem but in a particular case I don't know how to face it.
To put in situation, i.e:
code
line 1
line 2
...
128...
Homework Statement
Create an animation of the following:
Let x vary from -2pi to 2pi
Let y = sin(x)
Let z = sin(x-theta) * cos(y-theta)
Let theta be the animation variable
remember, you will need to mesh x and y to create a two-dimensional
matrices: use the resulting arrays to find...
Homework Statement
Consider the problem
$$-u''\left(x\right) = 1, \;\; 0 < x < 3, \;\; u \left(0\right) = 0, \; -u' \left(3\right) = u\left(3\right)+1.$$
Formulate a MATLAB code to produce the solution and plot the solution from 0 to 3.
Homework Equations
The Attempt at a Solution
Multiply by...
please help i have to write a MATLAB code for DETECTION OF THE LOCATION AND SIZE OF A CRACK IN STEPPED CANTILEVER BEAMS BASED ON
MEASUREMENTS OF NATURAL FREQUENCIES
the reference paper is
DETECTION OF THE LOCATION AND SIZE OF A
CRACK IN STEPPED CANTILEVER BEAMS BASED ON
MEASUREMENTS OF...
Hello!
I am having trouble using the SimPowerSystems library from simulink to simulate circuits (with the powergui solver).
On all the circuits I have simulated so far either of the following happens:
- Adding the initial current/voltage directly at the RLC branch block culminates into...
Hi all, I have a simple question about 3D plotting.
Consider this simple loop, which provides y and O for any x. and I am able to plot y vs O for given x.
for Omega=0:.01:5
y(i)=(x*Omega^2);
O(i)=Omega;
i=i+1;
end
now consider I want to change the value of x, for x=0:.1:3...
Homework Statement
A Super Loki rocket (http://en.wikipedia.org/wiki/Loki_(rocket )) is used to launch a small
payload to above 100 km altitude in a sub orbital flight. Ignoring atmospheric resistance, find the
apogee using both numerical and analytic techniques (solve the differential...
hi people,
I've just recently started using MATLAB (last week) and 've already got plenty of problems. Could anyone help me with this for example [??]:
1)
3=∫(0,inf) (sqrt(ε)/exp[(ε-μ)/(8*T)] dε
so this is the equation. I would like to solve in a way that μ=... , and then plot the...
Problem Statement
We are asked to use the following divide and conquer algorithm to get the solution for the multiplication of some matrix A and some matrix B. (See below)
Consider the matrix sizes. Comment the total computational time used on the following three algorithms, when different...
Homework Statement
I am trying to make a plot of the magnification factor of an underdamped vibrating system versus the frequency ratio using MATLAB. However, my MATLAB skills are very basic and I keep getting an error message.
Basically I am trying to plot:
MF=1/√((1-r^2)^2+(2ζr)^2)...
Hello,
I'm currently modeling the profile of a droplet (sessile drop, axisymmetric) in matlab. I've coded differential equations, applied the solver, and I get a reasonable result, except that it spirals continuously.
The ODE's in question are:
\frac{dx}{ds}=cos(\theta)...
Hello,
I am trying to solve an equation and then execute it in matlab. It is dx/dt=I(S*A*x). so I am trying to see the evolution of x with time.
The variables are all in an excel spreadsheet in different columns and the name of the columns are the name of the variables.
'I' is in an...
Hi all,
I hope my post is in the right section. I need some help with decoding a Playfair code.
I only have the ciphertext which is 22 lines long. What's the best way to do this? I red that I have to do some frequency analysis of the English bigrams which I did. There's one combination which...
Hello, I am trying to hook up MATLAB to my arduino. I am trying to write a number to the serial port in the arduino IDE and retrieving the same number in the MATLAB IDE. My arduino code is:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}...
Hello, guys
I am struggling with attaining stability values for u in solving the diffusion equation. The stability of u depends on the value of r from :
D=1000;
r0=1000;
std=1.0;
tau=1.0;
IP=2500; %initial pressure
%
% Radial grid and inhomogeneous term
nr=51;
dr=r0/(nr-1)...