Matlab Definition and 1000 Threads

  1. M

    Help Solving MATLAB Questions Involving Triangles and Prisms

    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...
  2. H

    MATLAB MATLAB code has stopped working

    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...
  3. P

    I really with a MATLAB iteration code

    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...
  4. I

    MATLAB Inverse laplace in matlab gives iota

    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...
  5. A

    MATLAB What simulation software should I consider for antenna coursework and MATLAB?

    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...
  6. K

    MATLAB How to Create a 3D Plot in Matlab for Matrix Visualization?

    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...
  7. C

    MATLAB Problems using integral function in Matlab

    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...
  8. A

    MATLAB How to add trendline to semilog plot in matlab

    Hi, I have x and y vectors, x=[ 90868 68151 45434 34076 27261 13631 6816 3408 2273 1948 1705 1137 853 683 569 455 342 274 228 190]; y=[ 3680 3723 3800 3866 3920 4103 4250 4320 4340 4344 4350 4364 4373 4379 4384 4393 4398 4402 4405 4407]; I need to plot semilogx in MATLAB and add trendline and...
  9. K

    MATLAB Plotting a Function in MATLAB Using QUAD

    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
  10. N

    Need guide to design FIR bandpass filter using calculation or MATLAB

    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...
  11. P

    Creating a Model of a Tube/Ear Canal in MATLAB

    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...
  12. M

    MATLAB MATLAB help: Interpolating an array of data to create a function

    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...
  13. Y

    MATLAB Help with Matlab Problem: Maclaurin Series

    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 :(
  14. S

    MATLAB code for Aldous-Broder algorithm from spanning trees of a graph

    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...
  15. A

    MATLAB Plotting with different y-axes range in Matlab

    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...
  16. A

    MATLAB Combining Plots with Different Y-Axis Ranges in Matlab?

    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...
  17. marellasunny

    MATLAB Spruce budworm diff.eq,parameter variation using matlab functions

    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...
  18. H

    MATLAB Problems with the latest version of Matlab

    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...
  19. X

    Plotting DTFT of Finite Sum in MATLAB

    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...
  20. thekey

    MATLAB Please I need a Help with matlab code (Controlling the LEGO NXT Using MatLab)

    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...
  21. E

    MATLAB Use finite difference method to solve for eigenvalue E in Matlab

    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...
  22. M

    MATLAB Calculate Relative intensity noise using laser Rate equations matlab

    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)...
  23. J

    MATLAB Graph Piecewise Functions in MATLAB?

    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...
  24. S

    Quick question (hopefully) on Matlab transfer functions

    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 +...
  25. G

    MATLAB DSOLVE: Solving 2nd Order ODEs with Initial Conditions

    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...
  26. A

    MATLAB How to properly use accumarray in MATLAB with sorted indices and weights?

    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...
  27. T

    MATLAB How to Set Axis Limits for an Added Graph in MATLAB?

    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'...
  28. S

    How to Modify MATLAB Code for a Beam with Horizontal Distributed Load?

    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...
  29. K

    How Can MATLAB Help in Plotting the Electric Field of a Charged Wire?

    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...
  30. S

    MATLAB How Do You Solve Coupled ODEs Using MATLAB's ode45?

    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...
  31. E

    Matlab - Weird answer with all zeroes

    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...
  32. E

    MATLAB Writing mathematical equations in MATLAB

    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)...
  33. I

    Matlab Programming(Need help with the last couple of details)

    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...
  34. Q

    MATLAB Fit data with a curve in MATLAB

    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...
  35. M

    MATLAB Calculating similarity between users using matlab

    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) +...
  36. J

    MATLAB Troubleshooting MATLAB Simulink Circuits for Sinusoidal Wave

    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...
  37. Q

    MATLAB Problem in triplequad in matlab

    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...
  38. A

    MATLAB [Matlab] Plotting two functions of the same variable against each other

    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...
  39. E

    Why am I only getting one output when I run my Matlab function with 2+ outputs?

    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?
  40. M

    MATLAB Plotting a potential function in MATLAB

    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...
  41. N

    MATLAB Matlab recursion (error in book?)

    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...
  42. B

    [MATLAB] Making code faster/more efficient

    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?
  43. J

    MATLAB Functions close to zero in MATLAB

    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...
  44. P

    MATLAB .Getting Started with MATLAB for Astrophysics Projects

    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
  45. Q

    MATLAB Matlab help User defined function

    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!
  46. Q

    Matlab help User defined function

    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
  47. marellasunny

    MATLAB Output of ode45 for System of Differential Equations

    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)...
  48. Q

    MATLAB Solving a MATLAB Problem with 3 Variable Integration

    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...
  49. W

    MATLAB Estimating the variance of eigenvalues of sample covariance matrices in Matlab

    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...
  50. matqkks

    MATLAB Matlab or computer algebra systems

    How does Matlab or computer algebra systems find derivatives of functions? Is it correct that they use matrix transformation?
Back
Top