Homework Statement
The volume V of a liquid in a partially filled ellipsoid shaped tank is given by
V = (pi/3)*(3*a-h)*(((b^2)*(h^2))/(a^2))
Develop an M-file to create a plot of volume versus depth. Here are the first few lines:
function myellipsoid(a,b,plot_title)
% Volume of horizontal...
When I write 1.516*10^-5 in Matlab it gives 1.516000000000000e-05 but I do not want to use e symbol. So which format should I use. I could use format bank but it has only two digits. I need more digits. Would you like to help me.
Thank you.
Can we use Greek symbols on Matlab workspace? If so, how can we use them?
I have made a search, most of the replies on the net was that Greek symbols cannot be used on workspace.
Thank you.
Hi, When I using Matlab 2008, the symbols and numbers were big enough to see but now I use Matlab 2013 but symbols and numbers or what I write is too little. How can I make them bigger?
Thank you.
Homework Statement
I'm a little lost on how to plot this data and function. I included the homework question and my attempt at plotting in the attached picture. I'm pretty sure what I have is completely wrong and I honestly don't have much of an understanding of matlab, so the more you dumb it...
Hello everyone
help please
I need to fit experimental data with a theoretical model using the MATLAB software what is the best way to do it?
thx for advance
hi all...am trying to generate sinusoidal pulse width modulation using arduino-simulink for my inverter board...I simulated the SPWM logic in simulink, then installed the required support package for arduino-simulink...but i am facing some problems...I started from basic...like linking arduino...
Let A be a random n×n matrix, x = (1,1,...,1)⊤ be an n-vector of ones and b = Ax be the right-hand side vector. As in class, let z = (zj) ∈ Rn be the result of solving the system Ax = b in finite precision using the backslash command. To measure the error between x and z, we let
δ= max |xj−zj|...
I have the code which solves the Sel'kov reaction-diffusion in MATLAB with a Crank-Nicholson scheme.
I would love to modify or write a 2D Crank-Nicolson scheme which solves the equations:
##u_t = D_u(u_{xx}+u_{yy})-u+a*v+u^2*v##
##v_y = D_v(v_{xx}+v_{yy}) +b-av-u^2v##
Where ##D_u, D_v## are...
I'm trying to numerically solve the time dependent Schrödinger equation and I've been told that the best approach is to numerically integrate using a finite difference method, however I don't understand why I couldn't just use ode45 to solve it?! Is the finite difference (interpolation) method...
I used a function called ind2patch to make a big 3D block which contains a number of smaller blocks in 3 dimensions. Each small block has a value which the magnitude is represented by a color.One example is shown below:
However, most of the boxes have very low or zero value and I don't need to...
Hi all,
i need help solving the following integral using Matlab:
* tetam is a parameter and the integration is by alpha.
the answer should be function of tetam
* K33, K11 are constantsThanks ,
Chen
Homework Statement
I'm trying to calculate the Fourier Series for a periodic signal defined as:
y = x 0<x<2Π
y = 0 2Π≤x<3Π
Homework Equations
Fn = 1/T ∫T f(t)cos(kwοt + θk)[/B]
cn/2 + ∑k=1k=∞(cn)cos(kwοt+θk)
cn= 2|Fn|
θk=∠Fn
The Attempt at a Solution
I got Cn =...
I'm trying to generate contours that plot with the animation using contour(X,Y) but it's not quite working. I only need it to be in the x-y plane at 0km depth (see picture for greater clarification)
% A script to plot two 3D waves.
clear
%Define the total time for simulation
T_total=10;
%Set...
I have an integration that doesn't have a solution in the table of integrals. So, I evaluated it using Mathematica using the command NIntegrate. However, when I compare the result with Monte-Carlo simulations, there is a very small constant gap between the two curves. Is it because of the...
I want to write a Matlab code which removes all frequency components from a .wav sound file except those within ##±25 Hz## of ##523 Hz## as well as its harmonics (up to the Nyquist frequency). I want to do this without using any built in filters.
Here is my code so far:
[s, Fs] =...
Mod note: Moved from a technical forum section, so missing the homework template
I want to write code for this double sum in MATLAB and I have written following code:
x = 100; % to calculate omega and u
l = 300; % to calculate omega
p = 10;
omegaa= x/l; deltaH = 200;
deltat =...
Hello Everybody,
I'm new to this interesting forum and this is my first post :)
So i wonder if can i use a Trial version of Matlab to perform some simulation for my Phd. Is the Trial version allow doing some important tests ?
Thank you for your answer
Here is a link the code which I am trying to modify. It is the radial average of a matrix function.
http://uk.mathworks.com/matlabcentral/fileexchange/46468-radialavg-zip/content/radialavg.m
I want to restrict the function to only look within certain angles, e.g. 15 degrees either side of the...
Hi, I am a novice at MATLAB and just started using it. I need some help with it. I want to post process an array of time domain signals using a specific algorithm. These time domain signals are acquired using labview and I want to post process them using matlab. I have the equation for post...
Hi. I have this code in matlab:
/ /
I=dlmread('C:\Users\rshah\Desktop\Polymer Project\monteCarloCode\E=1e8.txt');
F=fft2(I); F = fftshift(F); % Center FFT
F = abs(F); % Get the magnitude since F is complex
F = log(F+1); % Use log, for perceptual scaling, and +1 since log(0) is undefined...
water moves over a stationary horizontal flat plate of one-meter length. if velocity of water is 1 m/s, draw boundary layer and friction coefficient versus x for this plate.
hint: start your curves from x=1cm.Professor asked us to do it in Matlab or Excel and I'm not sure I understand how to...
Homework Statement
I have made a plot of a given .wav file in Matlab. The problem asks: find the fundamental frequencies of the 3 vibrating strings, and identify some of their harmonics.
Homework Equations
3. The Attempt at a Solution [/B]
So I made a Matlab plot of the power spectrum over...
In post #5 of this thread, Jedishrfu commented that Freemat is a cheap and free alternative to Matlab. My question is how close an alternative is it. I need to learn python and MATLAB for my upcoming entry into a grad program this fall. Python is free, of course, but should I buy the actual...
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...
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...