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...
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...
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');
>>...
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...
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...
Hi,
I'm trying to rotate 2 different plotted circles in matlab, which have the Jet colourmap.
Colormap has the Spinmap function, but when I use it, it only spins the Jet colormap in 1 circle, leaving out the other.
I would like to spin the Jet colormap in2 different circles in opposite...
I have some datas from our physics experimetn and we have to plot them on matlab.Idk how to do them,I don't know how to write codes.Also I have to write of the axises and table names
Hey all,
I've been trying to debug a model I've created of a 4DOF geared system within Simulink by reproducing the results in MATLAB going from a 2DOF upwards to verify the dynamics are acting correctly.
At the moment I am purely trying to model the stiffness between two gears, my equations...
I have a series of data points for X and Y points on a graph. The data is quite random and I am trying to work out a trend line so I can then form an equation for the line. How would I go about working out the equation for the data below using MATLAB?
(0, 580)
(6.7, 495)
(13.4, 445)
(18.7, 365)...
Hi PF!
Attached is an image I generated using the edge function in MATLAB (except the arrows, obviously). I would like to extract just the coordinates of the pixels from the bottom curve, which I've pointed at with arrows, and only in the domain between the red lines.
Does anyone know how to...
I have a series of data points for X and Y points on a graph. The data is quite random and I am trying to work out a trend line so I can then form an equation for the line. How would I go about working out the equation for the data below.
(0, 580)
(6.7, 495)
(13.4, 445)
(18.7, 365)
(22.8, 350)...
I am trying to plot the trajectory of an asteroid in MATLAB using ode23. The only bodies in the system are The Sun, Earth, Mars and Jupiter and their orbital data has been loaded from data files. I have picked arbitrary initial conditions for the asteroid and believe my forces are correct. My...
I am trying to learn Python by translating my MATLAB codes into Python. My translated Python code is giving slightly different result as compared to that of MATLAB. Although difference is very small but it affects largely the results at later stage.
My Python code is
import numpy as np
import...
Hi there,
I am modelling a four degree of freedom system which is the dynamics of two spur gears in mesh, having two rotational and two translation degrees of freedom, respectively, a diagram exhibiting the system can be seen below.
I have derived the equations of motion (EOM) and...
Homework Statement
I have a function :
and I want to draw :
Homework Equations
where T has values : 600, 800, 1000, 1100 And λ:(0,10*^-5] I have to use max function with two values and the solution must not consist of repeating four times of similar snippets of code, one for each curve.The...
Homework Statement
Design a lag-lead compensator for the system of Figure 9.37 so that the system will operate with 20% overshoot and a twofold reduction in settling time. Further, the compensated system will exhibit a tenfold improvement in steady-state error for a ramp input.
Homework...
I am taking a linear algebra class, and it has a required lab associated with it. Here is the following problem that I must solve using Matlab
1. Homework Statement
Write a function using row reduction to find the inverse for any given 2x2 matrix. Name your function your initial + inv(M), the...
Hi everybody.
I am currently doing a metheorological study of Angola's climate. I can draw the country's shape without much trouble.
>> worldmap angola
>> load coastlines
>> plotm(coastlat,coastlon)
But once I have the shape drawn things start to go downhill.
I have a vector with the...
I am working on Lidar systems and measure the back scattered photons using a Multi Channel Scaler(MCS) The data files are of .mcs format. I need to load these .mcs files into MATLAB. How do I do this in matlab? Is there any function to load these file extensions into matlab? Thanks in advance...
I'm trying to plot 5 periodic functions on the same graph in MATLAB and I can't seem to figure out how to do it correctly. The following code will work, except that I still need to change the line style for each line so that they are easy to tell apart.
k = 1; %spring constant
w0 =...
Hello everyone, I would like if someone could help me with a little excersie here.
1. Homework Statement
I am trying to simulate a mechanical system from a differential equations in simulink, but I don't know If I am doing it right.
I've made the model as you can see in the 2nd picture...
From cosmology, the tensor to scalar ratio is ##r=16\epsilon## where ##\epsilon=-\frac{\dot H}{H^2}## is the Hubble slow roll parameter. From warm inflation,
$$\ddot \phi + (3H+\Gamma)\dot \phi + V_\phi = 0 ,\quad H^2 = \frac{1}{3M_p^2} (\frac{1}{2} \dot \phi^2 + V)$$
where ##H## is the Hubble...
I have a set of variables that are always inputs for several functions that I made. Does MatLab have a kind of function that stores these variables into a single matrix (or similar) so that I just need to call this matrix for each function rather than calling them one-by-one as inputs into the...
Is there a function in Matlab that presets the value of a variable as an integer only? For example I will set the variable 'y' as an integer at the very beginning of the code, and whenever the variable gains a new value it automatically returns an integer value.
Thank you in advance.
I have a 3-Axis Digital Compass IC HMC5883L I2C chip, I just want to use it to learn how to talk to sensors via a Matlab to raspberry-pie to I2C chip link. The set up from Matlab to the pi is straight forward and simple, the issue I'm having seems to be the address I'm being returned when...
Hey all,
I need your help writing the meat of a function that I need for a MATLAB script I'm writing.
The jist of it is, starting from 0°, when between 0.0° - 5.0° apply a certain value, when between 5.0° - 15.0° apply another value. However, the relative amount of rotation can be user...
Homework Statement
I want to generate a Ricean channel using MATLAB
Homework Equations
Assuming that Ω = -30 dB.
The Attempt at a Solution
I know how to generate a Rayleigh channel using matlab:
H = 1/sqrt(2) * ( randn(N,M) + j*randn(N,M) )
But I really have no idea how to do that for...
Hello everybody.
I am triying to calculate a band-pass filter using the Fourier transform.
I have a vector with 660 compomponents; one for each month. I am looking for a phenomenon which has a periodicity between 3 and 7 years (it's el niño, on the souhtern pacific ocean). I want to make zero...
Homework Statement
For a following differential equation
d^2y/dx^2-4y=(e^x)/x
Find the solution using numerical methods
Homework Equations
d^2y/dx^2-4y=(e^x)/x
The Attempt at a Solution
%num
dx=0.01;
x=1:dx:3;
l=zeros(1,length(x));
m=zeros(1,length(x));
l(1)=1;
m(1)=0.25;
for...
I want to make a 2D plot of points with different x, y coordinates and have colors depending on a separate variable. I have make column vectors for x and y coordinates and another column containing 1 or -1. I would like to represent the points with 1 as red and -1 as blue points. I have codes as...
I have project code using MatLab and so far I am having difficulties of understanding what it is asking for. May anyone explain for me please.
The file fugue.mat It contains numerical data that encode about
30-seconds worth of Johann Sebastian Bach's Fugue #2 for the Well-Tempered Clavier. You...
Homework Statement
Compute and plot the compressibility factor (y) verses pressure (x) for the (1) Van der Waal’s (2) Redlich-Kwong and (3) Peng-Robinson equations of state.
Compressibility Factor, Z = (P*v)/(R*T); where v is the specific volume (V/v).
Data for n-Butane:
T = 500 K; Tc = 425.2...
Homework Statement
Link: http://i.imgur.com/JSm3Tqt.png
Homework Equations
##\omega=2\pi t##
Fourier: ## Y(f)=\int ^{\infty}_{-\infty}y(t)\mathrm{exp}(-j\omega t)dt##
Linearity Property: ##ay_1(t)+by_2(t)=aY_1(f)+bY_2(f)##, where a and b are constants
Scaling Property...
Hello everyone,
I've written a code using ode45 which describes the motion of a body m around a central one M (e.g a satellite around earth). I've done it with initial values that set the trajectory of the particle to be elliptic.
Clearly, energy and angular momentum need be conserved in this...
Hey
I want to be able to extract the coordinates of different elements in a PDB data file. I have been able to extract the coordinates for all the atoms in 3 arrays in the x, y, z directions. However, I would like to have the x, y, z coordinates for each element separate. So an array for the...
Hello,
1. Homework Statement
I find diffuculties to transform fscanf and to apply the discrete wavelet transform order 2 from matla to python.
Homework Equations
This is the MATLAB code:
D_P=fopen('distance_profil.txt','r');
i=0;
while(feof(D_P)==0)% test for end of file
i=i+1...
Hello! I am really glad to find this forum!
I was wondering if anyone has a MATLAB code to parse the MCNP output file MCTAL? I did some Lattice simulation but it seemed hard to read the MCTAL file directly..
Best regards
Hi PF!
I have a .txt file with spaces and letters, along with numbers. It looks something like this:
12.0 42.0 21.0 32.0
ICF-8-1
23.0 24.0 46.0 600.0
Additionally, the first two sets of numbers each represent a coordinate pair. Then the first coordinate is (12,42) and the second is...
In my problem the linear modal is defined as the first term in the series expansion of \sin(x) so:
\sin(x) = x - \frac{x^{3}}{3!}+\dots
\sin(x) = x is the linear modal.
So with this, I then have to write \frac{d^{2}x}{dt^{2}} = -\sin(x) as a system of x^{\prime} and y^{\prime}, so...
Homework Statement
Express
\frac{d^{2}x}{dt^{2}} + \sin(x) = 0
In a system in terms of x' and y'.
Homework EquationsThe Attempt at a Solution
[/B]
I seen this example:
x^{\prime\prime\prime} = x^{\prime}(t)\cdot x(t) - 2t(x^{\prime\prime}(t))^{2}
Where they then wrote:
x^{\prime} =...
Homework Statement
I want to reproduce the following matrix:
A=
[1 -1 0 0
-1 2 -1 0
0 -1 2 -1
0 0 -1 1 ]
What i want is to reproduce the second and third row with the formula -x(i+1) + 2x(i) -x(i-1) = 0
This is a coupled oscillation system of N masses (hanging in a rope).
The first row...
Homework Statement
(In Matlab) The variables w and z are related by w=cos(n*acos(z)) and z=cos(acos(w)/n) for n = 1,2,3,4 plot w vs z over domain (-1,1).
Homework Equations
w=cos(n*acos(z))
z=cos(acos(w)/n)
The Attempt at a Solution
First I tried to substitute z into w and thought since I...
I have a project and i need some help to understand the concepts, what is it asking for, major tips, and guide me through the process of the project. The program I will be using to program will be...
NumberSix solves problems using mathematics and mathematical software. He has worked on gesture recognition, speech recognition, video compression and several other highly mathematical areas. He has expertise in mathematical modeling, statistics, and linear algebra. He has many years of...
I have created a code in MATLAB that can plot the acceleration graph of the SVAJ diagram for 3 of the SCCA Family of Functions with a theta range from 0 to Beta. I cannot for the life of me, figure out what I am doing wrong, maybe some fresh eyes can help me. Ignore the 'trial', I'm trying to...
Homework Statement
For the plant:
##G(s)=\frac{1}{s(s+2)(0.4s+1)}##
Design a controller in Matlab such that ##K_v=4## , phase margin = ##60^o## and zero steady state error for step input.
Homework Equations
##e_{ss} = Lim_{s->0} \frac{s R(s)}{1+D(s)G(s)}##
Lead/Lag...
Hello,
I have an arduino code for driving a peltier pile to a given set point (TEMP_SP). I am trying to input the set temperature from Matlab GUI (with different protocols, user will enter n temperatures and the time intervals, arduino will implement the PID controller and output the...
Is there any method to extract data from a graph in JPEG/TIFF format, using simple software such as MATLAB? I have a graph as shown below:
I only have this picture but no raw data and I want to plot the black curve in this graph. How to get approximate numerical data of the x and y axis...
Hey,for following code the 3rd loops i need to have 2 variables m and q .Could anyone help?
for t=1:maxiterations
toterror=0;
for j=1:numfeature
totslope=0;
for i=1:m&&q=1:numfeature
z=0;
for jj=1:numfeature...