When a resistor (R), capacitor (C) and battery (V) are connected in series,
a charge Q builds up on the capacitor according to the formula
Q(t) = CV(1 − e−t/RC)
if there is no charge on the capacitor at time t =0. The problem is to monitor the
charge on the capacitor every 0.1 seconds in...
Hi All,
I have been trying to solve a complex number equation for character impedance with MATLAB but it continues to tell me that "indexing must appear last on index addressing". I am new to MATLAB so I think that my code is wrong.
What I am using is
complex sqrt (R+jwL)(G+jwC)...
Hi everyone,
I'm trying to make my MATLAB code run as efficiently as possible.
II have a 2xN vector designated like so:
acc1(1,:) = A*rc(1,:);
acc1(2,:) = B*rc(2,:);
where A and B are scalars,.
Is it possible to combine these two into a single line of code?
Cheers
--------------------------------------------------------------------------------
Hello,
I am new to this forum so please kindly let me know if my question needs to be posted in another area.
I am trying to write a MATLAB code to show a chirped Gaussian function and I am having some...
Hello,
I am new to this forum so please kindly let me know if my question needs to be posted in another area.
I am trying to write a MATLAB code to show a chirped Gaussian function and I am having some trouble with it. I am trying to obtain a chirped Gaussian pulse by modulating a chirped...
Homework Statement
Generate Geometric RV with Porbabilty of succcess 0.1 using only rand()
Homework Equations
rand()
geometric rv P=(1-p)^(k-1) * p where p=0.1, k is number of trial in which we get 1st success
The Attempt at a Solution
rand(n)
Homework Statement
Generate 1,00,000 triplets(sets of three) of Uniform random variables on [0,1]. Y be max of each triple and Z be min of each triple. Derive the densities for these RV from theory and compare histograms of Y and Z with densities found in theory.
Homework Equations...
What is the Matlab code for generating 100,000 Raleigh Random Variable with sigma^2=2 using rand command only. Generate histogram and normalize it by dividing 1,00,000 times the bin width
Can anyone help me by giving MATLAB code to simulate semiconductor laser rate equation by finite difference methord. i wrote a code but that was not working. so i need it badly. please help me.
Hi so i have a heat transfer project to determine the material (aka the thermal conductivity) and length of a 2d wall. It has to have between -1 and 1 net rate of heat loss from the southern side and above 145 rate of heat transfer from the eastern side. The wall is 20 cm high na the boundry...
Hi I tried to run this code, but to aveil (both in MATLAB and in mathematica).
In the attachment there's a printscreen of the code and the errors, can someone help me with this?
Thanks.
Homework Statement
Well I was just practicing MATLAB by going through different MATLAB codes available online:smile:.I found this DMT simulation.Here is the link
http://cnx.org/content/m11721/latest/
Now I decided to add another block in this implementation - The RS encoder(coz...
Hi. i have seen similar questions on here but can't quite get them to apply to my problem
i have wrote some MATLAB code but I'm having problems puting in a loop
heres my code
-----------------------------------------------------------------------------------------
clear
clc
for...
Hi,
I am writing a code for planetary motion using ODE with runge-kutta.
Currently it has only two body, however, I could not get the initial values to fit in properly, the bodies will not move in circular orbital motion. They are moving towards each other.
at the v=[10 0;-10 0]...
Hey guys,
I need help. Say i take a picture of a dot in a frame followed by another picture whereby the dot has moved to another spot in the frame. How do I calculate the distance between these 2 dots? At the end, i would have 2 jpeg images of the dot at 2 different locations. What I'm trying...
Hi fellows!
I need a bit of help with transforming a MATLAB code that simulate magnetic field of two concentric solenoid TO a plot that simulate the magnetic fields of high voltage transmission lines (specificly two and four lines), how can it be modified? here is the code:
% GKLmagnet2.m...
We need a MATLAB code for a normalized gradient eq. help! :)
Hello, we need help in converting this normalized gradient equation into a MATLAB code. Please see the image. Thanks! :)
http://img706.imageshack.us/img706/7998/thesisformula.jpg
Hi guys,
I've got some MATLAB code that calculates the forward kinematics for a robotic arm. This calculation relies on the successive multiplication of a series of 4x4 matrices, and currently I have this coded (more or less) as:
...
T(:,:, 1) = T0;
for i = 2:njoints
T(:,:, i+1) =...
What's wrong with this MATLAB code for Rutherford scattering, it won't run for me! :(
Hi,
I can't do matlab...and have to plot the trajectory of alpha particles in rutherford scattering. I've made an attempt, but i know I've gone wrong somewhere. Could someone tell me how to fix it? I'd be...
Hi,
I am trying to use the shooting method to determine the angle of a projectile. However for some values of distance and initial velocity my value for angles get stuck between two values.
I want to put a piece of code into my shooting method which can either detect that my while loop has...
Hello.
Can anyone help me in producing a Matlab code that will read a sparse matrix and then calculate the eigenvalues of it, show the sparsity pattern of it etc. I have the the sparse matrix data in compressed sparse row (CSR), compressed sparse column (CSC) formats and also in Co-ordinate...
First let me introduce myself. I'm and electronics engineer with 10 years of experience in the instrumentation of particle beams. I left the field for 10 years and have been fortunate to be granted a second lease of life on particle accelerators. Slowly over time the job has come to involve more...
hi,
I am doing project related to object recognition using decision trees and random subwindows.For which i nee d MATLAB code for extracting random subwindows/subimages(size is 16x16) from the image files and after that i need to get the gray values of the subimages.
Hiiii
I am doing research on multiuser CDMA; I have simulated MUD's in both AWGN and Rayleigh fading channel. I need help in Multistage Successive interference Cancellation. Kindly if anyone have the m code for this, please share.
For others, I can get you papers from most of the...
Hello!
Im writing a technical report with "article" as documentclass in Latex.
I want to attach my MATLAB code in the appendix.
If I copy and paste the text it won't look like the MATLAB code but it will look like a report..
What command should I use so the text just looks like it is ...
Hello,
I have the following equation, and I want to program it using MATLAB. But it is a recursive function, and it seems that I can not handle it well. So please if anyone can help, I will be thankful.
Hi i Would like to solve the the following eqn using Matlab
Since I am new to Matlab, I would request u to help me in this regard
(∂^2 T)/〖∂r〗^2 + 1/r (∂T )/∂r+(∂^2 T)/〖∂z〗^2 = 1/α (∂T )/∂t+τ/α (∂^2 T)/〖∂t〗^2 - { (1+δ(t) )-(1+δ(t-tp) }*IoKa/k 〖exp( - 2r/σ^2 〗_^2)exp(-zka)
where δ(t) =76ns...
Hi i Would like to solve the the following eqn using Matlab
Since I am new to Matlab, I would request u to help me in this regard
(∂^2 T)/〖∂r〗^2 + 1/r (∂T )/∂r+(∂^2 T)/〖∂z〗^2 = 1/α (∂T )/∂t+τ/α (∂^2 T)/〖∂t〗^2 - { (1+δ(t) )-(1+δ(t-tp) }*IoKa/k 〖exp( - 2r/σ^2 〗_^2)exp(-zka)
where δ(t) =76ns...
Hi i Would like to solve the the following eqn using Matlab
Since I am new to Matlab, I would request u to help me in this regard
(∂^2 T)/〖∂r〗^2 + 1/r (∂T )/∂r+(∂^2 T)/〖∂z〗^2 = 1/α (∂T )/∂t+τ/α (∂^2 T)/〖∂t〗^2 - { (1+δ(t) )-(1+δ(t-tp) }*IoKa/k 〖exp( - 2r/σ^2 〗_^2)exp(-zka)
where δ(t) =76ns...
i need to build a code which asks the user for the size of the desired diamond and then draws it, i can get this to workl perfectly by using the fprintf command and building the diamond out of 4 parts,: see code-
clc
clear
h=input('enter height of diamond :');
y=1;
while y<=h/2
for...
i need to write this into MATLAB
http://www.engin.umich.edu/class/bme456/ch10fitbiphasic/biphasfit19.gif
which i have done here:
uj = (-sig/Ha)*(xj-(((2*h)/(pi^2))*((((-1)^n)/((n+1/2)^(1/2)))*sin((n+1/2)*((pi*xj)/h))*exp(((-Ha*ko)/(h^2))*((n+1/2)^2)*(pi^2)*t))));
how do i vary n...
Hihi,
Let's say I have the linear equations ,A
2x +3y +4z
5x+6y-7z
5x-4y+3z
then I can always write as a matrix multiplication A= B*x
matrix B =
2 3 4
5 6 -7
5 -4 3
times
matrix x
x
y
z
Then., how can I tell MATLAB to express in the matrix multiplication form so...
This is some Matlab code that my group has been working on. None of us really code all that much, and have only had one year of Comp Sci. It doesn't help that this is all our our first times using Matlab, either. :/
The problem is calculating a value for a and aPrime. We're trying to use...
hey guys,
i want to wirte a function which takes as its arguments two lists of co-ordinates (the first
is a list of customers and the second for possible switch locations), and determines the index of the best switch location to minimise the amount of cable required.
I have done the...
Homework Statement
Graph of x(t) = 9e^-2t for t>=0 and y(t) = 4e^(-9*pi*t).
Is my MATLAB code correct? I did it by hand and I'm getting a different answer, so I don't know which one is the correct one... if my hand one is correctly done or if the MATLAB one is correct. I'm learning MATLAB on...
Homework Statement
A DT system has the unit response h[n] = (0.2(1.3)^n)u[n]. You then input x[n] = sin(n*pi/2)u[n]. Find the convolution.
Homework Equations
None.
The Attempt at a Solution
>> n = 0:30;
>> h = 0.2*(1.3).^n;
>> x = sin(n*pi/2);
>> s = conv(h,x);
I left out u[n] because we...
I have a very simply MATLAB code. When I try go run it, I get no graph and switching over to the MATLAB command line, I see:
ans =
char
Here is the code:
t = linspace(0,60);
v = 3.22;
for q_0 = [0:1:2007];
q = q_0*exp(v*t);
plot(t,q)
hold on
end
It looks just...
MATLAB code help please...
Hi,
My name is Jennifer.Iam new to Matlab programming.Iam working on reducing the noise content in audio communication.Iam using Hamning codes for the same.I have a sample code with me,which iam uploading in a zip file.Iam unable to understand how it works.Can...
Optimization: I am going insane here
:cry: :cry: I've really run out of ideas... please help me.!
%golden.m
function [f,a]=golden(func,p,tol)
func='dfunc';
p=[0 1]
g=0.38;
a=p(1);
b=p(2);
r=b-a
tol=0.01;
iter=0
while r>tol
x=[a+g*r b-g*r]
y=feval(func,x)
if...