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
I have a couple of MATLAB questions hopefully you guys can help me out
40).The volume of a right prism is base area * vertical_dimension. Find the volumes of the prisms with triangles of problem 29 as their bases, for vertical dimensions of 10.
I don't understand which...
A few months ago my hard drive crashed and I managed to recover the data and I tried to run some of my old programs (one solving an ODE via Newton's method. Before the crash, the error was 10^-8 after around 3 iterations, now it won't converge. It looks fine, ithe than writing the code from...
Homework Statement
Hello, I want to obtain a solution to a, where k is a constant. The formula is:
k/a = tan(a)
I need to write a MATLAB code for this but I have been struggling for hours. And I must send the project to my professor in an hour. :(
Homework Equations
I know that I need to...
I'm applying laplace transform to a spring-mass system, the most basic one. I write this code which takes initial values x(0) and v(0) as input and I'm computing x(t) in matlab. But for some values it gives me complex roots for x(t) which doesn't seem possible. If not for laplace I can solve the...
Hello,
I recently just started a Masters program in Electrical Engineering with a focus on Electromagnetics. I'm also currently working for a large engineering company.
I'm considering purchasing the student version of Matlab so I can work on antenna problems. What packages should I...
Hi everyone,
I'm working on a project where I need to produce a 3D plot for matrix using Matlab. The plot must comprise of both alpha and beta in 3D. Alpha, A is a 320 x 333 x 4 matrix, where each individual layer (i.e. A(320,333,i) for i = 1:4) represents one image's angles. The beta matrix...
Hi there!
i have this function handle:
integrando= @(x,landa,t) 1-exp(-((1/(landa*t))*((exp(-landa*x)/x)+((x-x0).*(1+landa*x0)-x0)*(exp(-landa*x0)/(x0^2)))));
which as you can see using
fplot(@(x) integrando(x,3,0.00063),[0 1.1225])
its value is constant (actually 1, and then starts...
hello.can anyone help me to plot this function in matlab
Q=quad(@(omeg)myfun(omeg,x,t),-20,20).im not sure if this is correct.my m file function goes like that
function y= @myfun(omeg,x,t)
y=besselj(1,omeg.*x).*cos(omeg.*t).*omeg;
thanks in advance
Homework Statement
hey there..
I really hope u guys can help me extracting the important element from the question below;
A signal is sampled at the sampling rate of 10kHz. The signal has useful signal content
between 1kHz and 2.4kHz, and distortion of not more than 1dB is required for...
Homework Statement
The context of this question is that it is the first question on a post grad paper in transducers and sound reinforcement. We've been looking at using electrical circuits to model acoustical and mechanical systems, and also using two-port analysis.
I need to create a...
Hi,
As the title suggests, I have a 2D array of data. Essentially, I solved a DE using MATLAB and it gave me the array of x against t. I want MATLAB to create a function for me by interpolation so I can use it again (to solve another different set of DEs). I've been stuck on this for a while...
Help in Matlab problem!
Hello guys, I really need your help in this question, it's a maclaurin series and I don't know how to do it in matlab. here is the question :
http://sphotos-a.ak.fbcdn.net/hphotos-ak-snc6/734976_2640341944275_792908261_n.jpg
I hope that you can help me ASAP :(
Homework Statement
Let G = (V,E) be a graph with vertices V and edge set E.
Aldous-Broder algorithm:
Input: G = (V,E)
Output: T = (V, W), where W is a subset of E such that T is a spanning tree of G.
Let W be the empty set. Add edges to W in the following manner: starting at any...
Good Day Everybody,
Please assist me on these problems
1. I wish to put six plots on the same plot using matlab. The details of each plot are stated below
PLOT 1
x axis range 0:1
y axis range 0:1
PLOT 2
x axis range 0:1
y axis range 0:1
PLOT 3
x axis range 0:1
y axis range...
Good Day Everybody,
Please assist me on these problems
1. I wish to put six plots on the same plot using matlab. The details of each plot are stated below
PLOT 1
x axis range 0:1
y axis range 0:1
PLOT 2
x axis range 0:1
y axis range 0:1
PLOT 3
x axis range 0:1
y axis range...
I have come across a MATLAB code for solving the spruce budworm differential equation.But,I would like to solve the same differential equation for a range of parameters(r=0:5,q=0:10).I am having problems trying to define the array of matrices for each loop.Please look at the code below:% This...
Has anyone found that their MATLAB programs are now giving nonsensical results in te latest version of matlab? I wrote a program which worked very well in the 2011 version of MATLAB but now in the 2012 version of MATLAB it still sort of runs but nor yields nonsensical results. I can show...
Homework Statement
x[n] = Ʃ ck * δ(n-k), from k = -N to N. Plot the DTFT as a function of the number of terms N. This is a finite sum.
Homework Equations
The equation for the DTFT of a signal, which is Ʃ x[n] * e-j*2∏*∅*n, from n = -∞ to +∞
The Attempt at a Solution
I have...
Hi
Controlling the LEGO NXT Using MatLab
What are my mistakes in this code ??!
COM_CloseNXT
all
clc
clear
handle = COM_OpenNXT();
COM_SetDefaultNXT(handle);
COM_CloseNXT(handle);
NXT_GetBatteryLevel(handle);
COM_CloseNXT(handle);
COM_CloseNXT
all
clc
clear...
Use finite difference method to solve for eigenvalue E from the following second order ODE:
- y'' + (x2/4) y = E y
I discretize the equation so that it becomes
yi-1 - [2 + h2(x2i/4)] yi + yi+1 = - E h2 yi
where xi = i*h, and h is the distance between any two adjacent mesh points.
This is my...
Hello Everybody,
I'm trying to plot the frequency spectrum of RIN using Matlab.
I've the following code
function p=rateblock
tau_s = 3e-9;
N0 = 1e24;
A =1e-12;
P0 = 1/(A*tau_s);
TSPAN = 0:1e-2:10.23;;
Y0 =[0 0];
[T,Y] = ODE45(@rate_equation,TSPAN,Y0);
subplot(2,1,1)...
Hey guys. I need to graph a piecewise function in MATLAB and I don't know how to do it. On top of that, it is also in radians:
f(θ)
=
(80/∏2) θ, -∏/2 ≤ θ ≤ ∏/2
(80/∏) - (80/∏2) θ, ∏/2 ≤ θ ≤ 3∏/2
How do I graph it in MATLAB? And other than that, is there a way in MATLAB that I can take...
Homework Statement
I'm reading through the help files and came across this example:
s = tf('s');
H = s/(s^2 + 2*s +10);
I understand that when using a rational expression it must be specified, s= tf('s');
I also understand that the rational expression is entered through H=s/(s^2 +...
Homework Statement
I am using MATLAB Symbolic Tool Box "Dsolve"
to solve 2nd order, linear, ordinary, non-homogenous differential equation with initial conditions.
Homework Equations
Equation of motion with base excitation (vibration: single degree of freedom system)
The Attempt at...
accumarray documentation
Is anyone proficient in the use of accumarray?
I supply two vectors of same length, indices L,weights W, L positive integers as required.
I sort the indices to ascending.Then, the result of accumarray is not equal to unique(L).How could this be?
Code for illustration:
i...
Hi,
I am plotting 3 graphs in MATLAB using plotyy as
[ax h1 h2] = plotyy(x1,Ftemp,x2,Fsnow);
hold(ax(2), 'on');
h3 = plot(ax(2),x1,Fprec);
I am thus adding the third graph to the right hand y-axis. I then set the limits and tickmarks for the right hand y-axis as
set(ax(2), 'xlim'...
Homework Statement
The problem picture is attached(file 1),its a beam subjected to horizonatal ditributed load
2. Relevant examples
the MATLAB solution for rectangular shape with vertical load on the upper right corner is like follow, i try to modify it according to the new picture...
Homework Statement
A straight wire of electric charge truncate to length L has a linear charge density of ρ= 8 C/m. Using a computational approach calculate the electric field due to the truncated line at any arbitrary point in space.
Consider L = 1 m, assume line lies along y-axis with...
Help me with coupled ode45 equations in MATLAB please
I have no idea to turn these into MATLAB code, and here is the porblem:
y(1)' = y(2)
y(2)' = - (r+re)/(L+le)*y(2) - y(1)/c*(l+le)
y(3)' = y(4)
y(4)' = -c*y(4).^2 /m+L*y(2).^2/(2*m)
where
re = ro+Rpr*z+Lpr*z'
le = Lo+Lpr*z
the rest...
I programmed a function that outputted this weird answer that looks like:
ans =
1.0e+147 *
Columns 1 through 16
0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000
Columns...
Hello,
I have the attached paper, and I want to write equations 4, 5 and the equation in the first line after equation 5 in MATLAB. I did it as following:
Np=24;
L=19;
TapsL=[1 19 20];
S=length(TapsL);
Index=zeros(S,1);%Tap Locations
c=zeros(L+1,1);
cHatMP=zeros(L+1,1)...
Homework Statement
Okay, so I need some help with this Matlab program. I never learned Matlab, so I'm trying to do it as best as I can. The question is: Calculate the 2nd and 3rd degree Taylor polynomials for the function f(x)=ln(1+x) about the point a=0 Plot these polynomials and the...
Hi friends.
I want to fit my x datas and y datas with a function in the most exact way.my data is:
x=[0.3 0.5 0.7 0.9 1 1.3 1.4 1.5 2 3 5 7 9 10 30 50 70 90 100];
y=[13.4347 8.3372 6.3107 5.27 4.93 4.28 4.14 4.0199 3.6349 3.3178 3.1282 3.0691 3.0432 3.0354 3.0043 3.0016 3.0008 3.0005...
Hi all,
I am having database of 963 users .
Records of two users are
uid gender occupation age
1 F student 23
2 M teacher 30
Now i need to calculate the similarity of each user with every other as
sim(ui,uj)=0.8*sim(age) +...
Hey guys. I am trying to simulate some circuits in MATLAB's Simulink, and I always get some weird graph which is not sinusoidal at all. I wanted to know if anyone could tell me which block am I missing if I want to get a good sinusoidal wave.
Here are the pictures of the circuit and the...
Hi friends
I want to get 3variable integral from a function which is in terms of x,y,z,m,a
but I know that a=0.01 and m=3
and want to integrate over x ,y,z
>> triplequad((4 .*((-2.* a + m).^2 .*(4 .*a + m) +4 .*a.^2 .*(2.*(2.*a - m).* cos(z) + cos(y) .*(4.* a - 2.* m + 4 .*a.* cos(z) - m...
I need to make two plots of volume as a function of time vs pressure as a function of time. When plotted the graph will have an enclosed area. I am having trouble on how to have MATLAB plot these two functions against each other.
My experience with MATLAB is having a function defined in a...
I'm having trouble getting two outputs. Here's a simple example:
function [a b] = test2()
a = 2;
b = 5;
When I run the code, I only get the output of a = 2:
>>test2
ans =
2
How can I get b outted as well?
Hi all,
I would like to be able to plot this function in MATLAB \mathcal{V} (\phi_{1}, \phi_{2}) = m^2(\phi_{1}^2 + \phi_{2}^2) + \lambda( \phi_{1}^2 + \phi_{2}^2)^2Where \phi_{1,2} , m^2 , \lambda \in \mathbb{R} and \lambda > 0 I am aware that the cases m^2 > 0 and m^2 < 0 yield two...
This is what my book gives for recursion of fibonacci sequence (matlab coding).
function res = fib(n)
if n == 1;
res = 0;
elseif n == 2
res = 1;
else
res = fib(n-1) + fib(n-2);
end
Am I mistaken or this doesn't work for fib(3)? Keep in mind I am still learning about...
A is a sparse matrix. B is a vector. I have the following code:
for j=1:N
B=A*B;
end;
This part of the code is inside a function which gets called about 160000 times. I ran the Profiler and this part is the bottleneck. How can I make it more efficient?
Hi all,
I need to find where a collection of curves are all approximately equal to zero (given some tolerance level) and was wondering if anyone could help me?
I'm running the following script in MATLAB:
dF2=0.001;
dG2=0.001;
initF2=0.522;
initG2=-0.603;
K=zeros(2);
etaspan=[0...
Hello,
This is my first semester as a graduate student in astrophysics. I have a project and I should use MATLAB. Unfortunately, I don’t know how to use the software. Can someone please recommend any tutorials, books, links, ebooks, …
Thanks a lot
I made a user-defined function for Height.
function Ht=Height(t,V,Theta);
Ht=V*t*sin(Theta)-4.9*t.^2;
end
V is initial velocity, and i kept on getting input "V" is undefined.
Can someone help me please!
I tried to make a user-defined function.
function Ht=Height(t,V,Theta);
Ht=V*t*sin(Theta)-4.9*t.^2;
but then i kept on getting Input argument "V" is undefined...
can someone help me please
My book explains the command x(:,1) as "x,all rows,first column".
Q.How does the output of ode45 for a system of differential equations look like?
But,when I solve a system of 2 first order differential equations(w.r.t time),I take x as a "column vector".
[x1
x2]
So,if I wanted to plot x(1)...
dear friends
i want to do set of operation in MATLAB but i have a problem:
first of all, i want to take 3variable integration from f which is function of x,y,z,m,a
but i want to integrate only over x,y,z
after that for a special "a" forexample a=0.01 i want to solve the equation.i mean...
I am trying to investigate the statistical variance of the eigenvalues of sample covariance matrices using Matlab. To clarify, each sample covariance matrix, \hat{\mathbb{R}}_{nn}, is constructed from a finite number, N, of vector snapshots, each sized (L_{vec} \times 1) (afflicted with random...