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.
In Matlab I am trying to use the composite Simpson's rule to find ##x_l## so that
$$170=\int^{x_l}_0 \sqrt{1+(y')^2} dx = \int^{x_l}_0 \sqrt{1+\left( \frac{x^2}{68000} \right)^2} dx $$
For convenience this can be written as
$$I(x) = 170 - \int^x_0 \sqrt{1 + (\frac{x^2}{68000})} dx$$
The...
I have a a multidimensional array (49x49x49) which has NaN values scattered randomly.
For each NaN, I want to replace the value with the previous non NaN value.
e.g. if i had a 3 x 3 matrix
4 7 9
2 7 NaN
1 2 NaN
should become
4 7 9
2 7 7
1 2 2
I have 3 dimensions [i,j,k], but...
I am trying to write a very basic Matlab code to preform the split-step Fourier method on the nonlinear Schrodinger equation:
$$\frac{\partial A(z,T)}{\partial z} = -i \frac{\beta_2}{2} \frac{\partial^2A}{\partial T^2} + i \gamma |A|^2 A \ \ (1)$$
I want the program to make 3D plots of...
I had a function of 3 variables f'(kx,ky,kz)
and did an ifft
f = ifft(f')
and now i have a function where inside a small polygon the function f = 1, and outside f=0, within a cube space of length L.
how do i plot a scatter graph for this function where there is a point when f =1, and no...
Consider I have a packed column of length L filled with known characteristic adsorbent. I am putting a mixture of N components in it and I am solving for concentration of each component in mobile phase at the outlet of the column. The equations which are to be generalised are as follows: An...
I have a function f(x,y) which i have defined in this way:
a vector x and a vector y
meshgrid[x,y]
z= f(meshgrid[x,y]).
how do i do a 2-d Fourier transform of f(x,y)?
the transform must be done without using operations like fft, and must be done using summations written in the code.
I have a function of 2 variables [f(x,y)] where if there was an ellipse in the x-y plane, all values of the function are 1 inside the ellipse and 0 outside. I can plot this function as a surface in 3d where it looks like an elevated ellipse hovering over an elliptical hole in a sheet.
My...
Homework Statement
Modelling the following equation:
k = Delta Q / t
Homework Equations
Q = T2 - T1 = -40 (fixed)
t = Delta Q / k. I need to find t.
k can be floating so I suppose 0 to 10 minutes with 0.5 increments
The Attempt at a Solution
I don't have MATLAB on me at the moment...
Hi I was wondering if someone could help with creating a track map using lateral accel and speed.
More specifically the steps to the maths needed to plot the coordinates.
I know how to find the curvature radius but not sure what the next step is.
Thanks
I'd appreciate it if someone can give me a little guidance here. I'm slated to be entering a Ph.D. program in the fall where I'll be working on a machine intelligence project under a DARPA grant designed to create autonomous rovers. They want me because of my background in understanding the...
I have a picture which shows the magnitude of some value in terms of color, like this one:
https://www.dropbox.com/s/yoh0n9cqftvrtlz/bar.jpg?dl=0
The higher the magnitude, the more it looks red. However there are only a few points at the edge has very high values and most of the points have...
Homework Statement
Program, without any built in functions (like ODE45), a solution to the Blasius Equation in Matlab that outputs boundary layer profiles for given x values, u values, etc.
Homework Equations
2f''' + f''f = 0
fj = fj-1 + Δη/2 * (gj + gj-1)
gj = [Δη2/4][2gj+1/Δη2 + 2gj-1/Δη2 +...
Homework Statement
Plotting the exponential exp(-cx), 0 ≤ x ≤ 1 with c = 1, 2, 3, 4. Use a for loop.
Homework EquationsThe Attempt at a Solution
for c = 1:1:4;
for x = 0:1;
F = exp(-cx);
end
end
plot(x,F)
I'm not really sure where to start..
Help is appreciated.
Hey guys, I am currently working on a uni MATLAB group project for blast radius, thermal radius etc.
Apparently these formula are the best possible to use:
r_thermal = Y^0.41 * constant_th
r_blast = Y^0.33 * constant_bl
r_radiation = Y^0.19 * constant_rad
But can anybody tell me what...
Hey! I want to do a double integral calculation of this problem##∫∫ xy/(xy^2 +1)^2##
over the region bounded by 2 ≤ x ≤ 3 and 2*sqrt(1+x) ≤ y ≤ 2*sqrt(2+4x)
on MATLAB and i have tried the following syntax:
clc
clear all
fun=@(x,y) x*y./((x*y.^2+1).^2);
ymax=@(x) 2*sqrt(2+4*x)...
Which will be my reference frame while modelling and control - the reference machine in the network or the network bus itself?And if so how do i relate the dfig to this reference frame?
Sorry if i may sound little unclear, english is not my first langue. I I am looking for a way to create a circle that is in a square cut in 8x8 in matlab. I would be glad if someone could give me a hand.
Thanks!
So like the title says, I'm new to Matlab. I took a programming class on Fortran last year before my college changed the requirement so programming is not new to me all together. For a few of my classes we are allowed to use programs such as Matlab and Maple to help us solve problems. Most of...
So i want to calculate an r value 5 different times then find the mean of the 5 calculated values.
I have 2,187 data points. the first line of code generates 100 random points 1-2187.
The code has a bug but my major issue is it calculates r then loops again calculates r, loops again calculates...
I would like to locate the center wavelength of a FBG notch filter in MATLAB, but I'm having trouble getting an answer within 0.01nm of the correct wavelength.
So far I've tried using a quadratic fit with MATLAB, but that is too dependent on the amount of data points to the left and right of...
Homework Statement
The state space model of a nonlinear system is x'_1(t) = 2x^2_2(t) - 50 x'_2(t) = -x_1(t) - 3x_2(t) + u(t) where x_1(t) and x_2(t) are the states, and u(t) is the input. The output of the system is x_2(t).
Find the zero input response (u(t) = 0) of this system linearized at...
Homework Statement
I would like to know a way to design an impulse input in a Matlab Simulink model. I know there are step input and ramp input blocks but there is no impulse input block.
Homework Equations
The Attempt at a Solution
If any working is needed please let me know
Homework Statement
Could someone just quickly check my Step Reponse diagram which I made using Matlab. It does not look like the usual shape for a step response system which is making me a bit worried. I'm a fairly new to Matlab and Control Engineering
Homework Equations
G(s) = 3 / ((s^2) +3)...
Homework Statement
I was asked to draw a Simulink Model for the above (car suspension) system.
m = 250kg
k, spring constant = 70000N/m
c, damping coefficient = 3000N/m/s
Homework Equations
If any equations are needed please let me know
The Attempt at a Solution
The question says to draw...
I have non-uniformly sampled transfer function data (magnitude only) in the range of 100kHz and 200MHz. Using this transfer function, I would like to calculate output from specific input.
Question :
To obtain phase of the transfer function from the magnitude data, I am trying to use Hilbert...
Hi guys,
I have functioning MATLAB code for my solution of the 3D Diffusion equation (using a 3D Fourier transform and Crank-Nicolsen) that runs just from the command window and automatically plots the results. However, it seems like my solution just decays to zero regardless of what initial...
Hello guys, I found this forum using google because I need help with simulating bungee jump model.
I've already done that with zero initial values and it looks good but I want it more realistic :
Let's say L is the length of rope so elasticity force starts acting when y=L so logically time...
I carried out a physics experiment and I wanted to analysis the problem with matlab. I have some code in MATLAB that "works" as in it gives ok result but the numbers used are quite nonsensical, I need help making the reworking the equation with real numbers. I am not sure if this is the correct...
We have this Equation as bioheat equation:
∂T/∂t = α ∇2T + 1/ρc[S+Sp+Sm]
and also this:
Sp=mbcb(Tab-T)
that all α,ρ,c,S,Sm,mb,cb,Tab are constants, now I want to solve this equation in conditions below with pdepe in MATLAB:
There is a Tumor as a sphere with radius 1 cm exactly in center of a...
Hi all
i want to write a MATLAB code by runge kutta solution for hiemenz equation.
F''' + FF'' + 1 - F'^2 = 0
BCs
F(0)=F'(0)=0 and F'(inf)=1
I have programmed for RK Fehlberg, RK4 and RK5 method but the results of these three methods are not matching with actual values.
In the cod I defined...
Homework Statement
So I am trying to model the motion of the Earth around the Sun using ode45. I modeled this using an euler-cromer scheme, but I would like to get familiar with using a solver. I wrote the code for an Euler-cromer and it worked just fine. However, when I try to use the same...
y = [0.053 1.477 1.970 3.279 4.153 4.934 5.178 5.828 6.082 6.484]; % data
coef = polyfit(x,y,3)
X=0:.1:9;
Y=polyval(coef,X);
plot(x,y,'o',X,Y)
that's my code. did i do it right?
hi! here's my question. here's my code. i have no idea what to do now :(
x = 0:9;
y = [0.053 1.477 1.970 3.279 4.153 4.934 5.178 5.828 6.082 6.484]; % data
X = linspace(0,8.5,1);
Y = interp1(x,y,X,'pchip')
Hi Everyone
I am Arman.I am at first grade in Physics and I have trouble to understand Matlab.Now we did Energy Conservation Experiment.I draw x-t and F-t graphs using matlab.Instructor told us we should use spline fit to draw a F-t graph.I don't have a toolbox about it.She told us some code...
I have a Matlab program that reads data file and then create avi. files and tiff pictures. It runs without problem in window OS using R2014a but cannot run in a Linux high performance computer(HPC).
When the Matlab in Linux is started there are two warnings:
Warning: No display specified. You...
If I cut my image into several portions and use the Fast Fourier Transform on each portioned image, will I achieve the same result as if I used Fast Fourier Transform on the whole image?
I have this concern because I need to process a large image using the Fast Fourier Transform, the problem is...
I want to create a Matlab script called hw11.m, which reads in a text file of weather
information, parses it, and writes formatted summary information. The textfile is called
MonthlyHistory.html
I cannot figure out how to write a loop that averages the third set of numbers in the string.
an...
Inexperienced data analyst here with a real-world example,
I have attached a zip-file with screenshots and p-values of the following data. The "reference regions" are Cerebellum White, Cerebellum Gray, and Temporal Cortex. The top-most graphs depict the curves in the indicated region for young...
Homework Statement
I'm using MATLAB to design a truss and the output is suppose to be the deflections caused by the applied loads. But I keep getting "not a number" for my deflections . here is the warnings I get.
Warning: System may be partially constrained.
> In truss3 (line 222)
In...
An exercise in my text requires me to (in MATLAB) generate a numeric solution to a given second order differential equation in three different ways using a forwards, centered and backwards difference matrix. I got reasonable answers for \vec{u} that agreed with each other (approximately) for the...
Homework Statement
I am suppose to build a truss using a MATLAB code given to me. I have to identify the joint coordinates, member assembly, and load matrix. The code is suppose to calculate the deflections like fea. I have put everything in but when the code runs my deflections are "NaN" which...
Homework Statement
I have to make program that a user inputs a matrix and program displays it.Homework EquationsThe Attempt at a Solution
I know the logic as in c++ I am able to display that.
Here,
m=input('Enter rows of matrix'); % Why not double quotes here as in cout of C++?
n=input('Enter...
In my text, it tells me to find the eigenvectors of a 2nd difference matrix and graph the eigenvectors to see how they fall onto sine curves.
imgur link: http://i.imgur.com/oxbkTn6.jpg
My question is simple but general. What does this even mean? How did they produce this graph from the...
Homework Statement
Requirements: http://i.imgur.com/2WKyhto.png
Homework Equations
2(L * W + L * H + W * H)
SA = (2 * pi * radius * height + 2 * pi * radius^2)
height = (volume)/(pi * radius^2)
The Attempt at a Solution
Code link: http://pastebin.com/sKFEGN0C