Matlab code Definition and 129 Threads
-
N
4th order Runge Kutta Matlab with 2 2nd order ode
Homework Statement Hi There! MX''=Fn(sin θ - uCos θ ) MZ''=Fn(cos θ + uSin θ ) - Mg Fn,M,θ,u is constant fn/M = 0.866 M = 6000 θ = 30 u = 0.5774 i split my motion equation into 2 individual 1st ode, X' = Vx Z' = Vz Vx'=[fn*(sin θ - uCos θ )]/M Vz'={[fn(cos θ + uSin θ )]/M} - g...- noelll
- Thread
- 2nd order Matlab Matlab code Ode Runge kutta
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
MATLAB How to do a double integral on matlab?
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)...- Lucas94
- Thread
- Double integral Integral Integral calculus Matlab Matlab code Multivariable calculus
- Replies: 4
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Storing calculations into a list
I have a code that loops through and does some computation on 5 random values from my lists of data (2187 rows long). for i = 1:3 randomdata = round(rand(5,1).*2187); xval = x(randomdata) yval = y(randomdata) numerator = length(xval).*nansum(xval.*yval) -...- Tone L
- Thread
- Calculations List Matlab code
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
MATLAB Solving MATLAB Sum Loop Issue with 2,187 Data Points
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...- Tone L
- Thread
- Loop Matlab Matlab code Sum
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
4th ODE runge kutta (hiemenz equation)
Hi all i want to write a MATLAB code by runge kutta solution for hiemenz equation. F''' + FF'' + 1 - F'^2 = 0 BCs F(0)=F'(0)=0 and F'(inf)=1 I have programmed for RK Fehlberg, RK4 and RK5 method but the results of these three methods are not matching with actual values. In the cod I defined...- seyfi
- Thread
- Matlab Matlab code Ode Runge kutta
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
E
MATLAB 2D diffusion equation, for matlab code.
https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/12204847_801668796608594_2127169351_n.jpg?oh=f6ea92a40c93e4d843a4bf26a358677d&oe=56404FC5- Eddie Be
- Thread
- 2d Code Diffusion Diffusion equation Matlab Matlab code
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
MATLAB Solving MATLAB Loop with X & Latitudes
I have a list of latitudes: lats = 41.0100000000000 43.7800000000000 44.4200000000000 41.2500000000000 42.8000000000000 42.7500000000000 42.4900000000000 42.4900000000000 42.7800000000000...- Tone L
- Thread
- Loop Matlab Matlab code
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
E
Code of the Angular Spectrum Method
I constructed my code of the Angular Spectrum Method. However, as the distance between the object and the plane of interest increases, the diffraction pattern never disappears; there is still some sort of a diffraction pattern, and I am expecting that it disappears as distance increases. Here...- ecastro
- Thread
- Angular Code Fourier transform Fresnel diffraction Matlab code Method Spectrum
- Replies: 7
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
T
Matlab code running loops to meet conditions
Homework Statement This is not homework but I am trying to solve a problem to see to general a set of numbers for the grassmanian equations to use in something else.[/B] I have five variables a,b,c,d,e. a-b,a-c,a-d,a-e,b-a,b-c,...etc so that none of them are the same so it generates all...- thestrong
- Thread
- Code Conditions Loops Matlab Matlab code Running
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
W
MATLAB Converting Excel formulae into Matlab code
Hi everyone, I will start off by saying that I am a complete novice in Matlab and prefer to use Excel however the data that I have requires more computing power than Excel can provide. I have 16 sets of data with over 70,000 rows and 9 columns. The first column is a time series separated into...- warfinch
- Thread
- Code Excel Formulae Matlab Matlab code
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
I
MATLAB Line following Matlab Code. How to Start?
So we're using NXT 2.0 and MATLAB to program a robot to follow a white line through a maze. I'm using a light sensor, color sensor and an ultrasonic sensor in the process. Any programming/Coding ideas of how i should start? This is the maze...- ItsAli
- Thread
- Code Coding Line Matlab Matlab code Programming Robot Sensor
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
A
MATLAB Could you check (if statment block) in my MATLAB code please?
function RunlogisticOscilnumericalfisherfixedn0omega omega=1; N0=1; k = 10; A = 1; p0 = 0.1; tspan=(0:0.1:4); [t,p] = ode45(@logisticOscilnumerical,tspan,p0,[],omega,k,N0); figure(1) plot(t,p) xlabel('Time') ylabel('p') P = @(T) interp1(t,p,T); f = @(t) ( ( A.*( ( N0.*...- Avan
- Thread
- Block Code Matlab Matlab code
- Replies: 29
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
A
MATLAB MATLAB code for Computational Fluid Mechanics
Hello guys, I'm writing to get some help on an exercise I've been thinking but I can't get to solve. I have to write the code for the Example 8.5 of the book White, Fluid Mechanics. Here is the problem and the solution I have to obtain. It is about one duct that has three sections in which I...- airliner
- Thread
- Code Computational Fluid Fluid mechanics Matlab Matlab code Mechanics Pde
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Trouble with understanding MatLab code
Homework Statement A = [1 3; 2 4]; %Okay, so we are starting with this matrix N = 2; %Here we are setting N equal to '2' for k = 1:N %So here we have a 'for loop' for variable 'k' starting at 1 in increments of '1' up to 'N', which %happens to be '2' so once this function gets to '2' it...- mesa
- Thread
- Code Matlab Matlab code
- Replies: 6
- Forum: Engineering and Comp Sci Homework Help
-
Triple redundancy sensor matlab code
Homework Statement Hardware redundancy is important in many real-world engineering systems. Specifically, installing multiple sensors that measure the same quantity provides a level of safety in the event that one instrument fails during the mission lifetime. You do not want an expensive...- gfd43tg
- Thread
- Code Matlab Matlab code Sensor Telescope
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
H
MATLAB Composite Simpsons 1/3 matlab code
hey guys, So I'm working on a MATLAB function that uses simpsons 1/3 rule to find an integral. This is what I have done so far, but I'm not 100% confident.. I seem to get double when I use greater segments. If anyone would be able to have a look at give me some tips that would be very much...- haz
- Thread
- Code Composite Matlab Matlab code
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
E
MATLAB Need MATLAB Implementation for OFDM Communication Systems in Continuous-Time?
Hello all, Does it occur that anyone here working on OFDM communication systems? I need a MATLAB implementation of such systems in the continuous time. I will provide the math derivations if requested. Thanks- EngWiPy
- Thread
- Code Matlab Matlab code System
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
E
MATLAB Matlab Code for Time-Frequency Transformation
Hello everyone. Sorry if the question is silly, but in really need to know something. We know that The Fourier transform of time is frequency and the inverse of frequency is time. In Matlab can anyone tell me how to write it ? Because in the book Non linear fiber optics by Agrawal we found that...- eahaidar
- Thread
- Code Matlab Matlab code Transformation
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
B
MATLAB Help with MATLAB code; discrepancy between graph max and Matlab's max
Hi, For some reason, when I run this MATLAB code, I'm getting what looks like about 10,000 for Rf for the largest Vo on the graph, but MATLAB is giving me Rf at (Vo)max as 100,001 Any ideas? clc; clear; close all; syms Rf Rf = 0:0.1:100000; VRt25 = 18.*(10000)./(10000 + Rf)...- babayevdavid
- Thread
- Code Graph Matlab Matlab code Max
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
J
MATLAB MatLab code for these Integrals.
How can I write proper language for these integrals in MatLab ? Your helps really appreciated. John Mark- John Mark
- Thread
- Code Integrals Matlab Matlab code
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
1
MATLAB Plotting Beam Emittance with MATLAB Code
Hi, I want to write a very simple code to plot the beam emittance knowing x,y,z and vx,vy,vz of each particle. I have generated with a tracking code a very simple beam (cone distribution with 1° divergence) and I want to compare the emittance of this beam with the one calculated by a...- 1Keenan
- Thread
- Beam Code Matlab Matlab code Plotting
- Replies: 6
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
E
MATLAB Solve Matlab Code Problem: Nonlinear Fiber Optics
I took this code from the agrawal book: nonlinear fiber optics and I wanted to see the results : %---specify input parameters clear all; distance= input('enter fiber length (in units of L_D)= '); beta2=input(' dispersion: 1 for normal, -1 for anomalous'); N=input('Nonlinear parameter N=')...- eahaidar
- Thread
- Code Matlab Matlab code
- Replies: 14
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
G
MATLAB code for generating PPM :
Hi all, I am quite new to MATLAB . I would like some help on the following: generation of Pulse Position Modulation using a MATLAB code. thank you :)- Ghassan99
- Thread
- Code Matlab Matlab code
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
W
How to Create MATLAB Code for Geometrical Optics Image Transformation?
Hello all, i have frustrating task in my lab... i have to generate a code in MATLAB that will get the focal length and the object distance from the lens, i.e image (1000X1000 pixels). transfer it through the lens and, for the output it should be the result of it...- wuid
- Thread
- Code Geometrical Geometrical optics Matlab Matlab code Optics
- Replies: 8
- Forum: Advanced Physics Homework Help
-
B
Matlab code for solving and plotting function x'(t) = 1 + t*sin(t*x)
Homework Statement I am trying to solve and plot the function, x'(t) = 1 + t*sin(t*x) where x(0) = 0 and t_final = 1, in order to compare this exact solution to the approximations of Euler's and Improved Euler's Method. Can anyone help me with the code in order to solve this problem, and then...- bdoherty1994
- Thread
- Code Function Matlab Matlab code Plotting
- Replies: 3
- Forum: Calculus and Beyond Homework Help
-
B
MATLAB Matlab Code for solving and plotting function x'(t) = 1 + t*sin(t*x)
Hi everyone, I am trying to solve and plot the function, x'(t) = 1 + t*sin(t*x) where x(0) = 0 and t_final = 1, in order to compare this exact solution to the approximations of Euler's and Improved Euler's Method. Can anyone help me with the code in order to solve this problem, and then plot...- bdoherty1994
- Thread
- Code Function Matlab Matlab code Plotting
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
R
MATLAB Matlab code for detection of location of a crack using natural frequen
please help i have to write a MATLAB code for DETECTION OF THE LOCATION AND SIZE OF A CRACK IN STEPPED CANTILEVER BEAMS BASED ON MEASUREMENTS OF NATURAL FREQUENCIES the reference paper is DETECTION OF THE LOCATION AND SIZE OF A CRACK IN STEPPED CANTILEVER BEAMS BASED ON MEASUREMENTS OF...- ritika.krishna
- Thread
- Code Crack Detection Matlab Matlab code Natural
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
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...- hunt_mat
- Thread
- Code Matlab Matlab code
- Replies: 4
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
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...- SooEunKim
- Thread
- Algorithm Code Graph Matlab Matlab code Trees
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
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...- thekey
- Thread
- Code Lego Matlab Matlab code
- Replies: 5
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
R
MATLAB What is the error in running Newton's Method in Matlab for a specific function?
I've been using this for a Newton Approximation in Matlab function x = Newton(f, fp, x, nmax, e) % f is an inline function which we apply Newton's method on % fp is an inline function that is the derivative of function f % x is the initial guess of the root % nmax is the total number...- renolovexoxo
- Thread
- Code Matlab Matlab code Method Newton's method
- Replies: 7
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
E
MATLAB Where is my mistake in this MATLAB code?
Hi, I am trying to plot the AN product sec II.C in the attached paper as: clear all clc s=0.5; w=0; d=5; f=0:20; NdB1=(17-30.*log10(f)); N1=10.^(NdB1./10); NdB2=40+20*(s-0.5)+26.*log10(f)-60.*log10(f+0.03); N2=10.^(NdB2./10); NdB3=50+7.5*w^0.5+20.*log10(f)-40.*log10(f+0.4)...- EngWiPy
- Thread
- Code Matlab Matlab code Mistake
- Replies: 10
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
MATLAB Matlab code natural numbers subset
I have array of natural numbers from 1 to n. They are divided into m groups, where m*(m-1)=n. I need all m-1 elements from first group, last m-2 elements from second group, last m-3 elements from third group...zero elements from last group. For example 5*4=20: 1,2,3,4; 5,6,7,8...- martika
- Thread
- Code Matlab Matlab code Natural Natural numbers Numbers
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
F
MATLAB Need help with matlab code for Newton-raphson ( really bad)
The code runs but I get the wrong answers can you take a look at the code for this . ANSWERS ****************** x(1) = 1.035 x(2) = 1.086 x(3) = 0.927 ****************** clc clear F = @(x) [15*x(1)+(x(2)^2)-4*x(3)-13;... (x(1)^2)+10*x(2)^2-x(3)-11...- fizzkilla
- Thread
- Code Matlab Matlab code
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
F
MATLAB Need help with Matlab code for gauss siedel i get errors, need imediat help
Please I need HELP IMEDIATLY This is the error message that i get ? Error using ==> gauss_sied Too many input arguments. Error in ==> HW_14 at 23 [x_wo, cnt, x_w,cntt] = gauss_sied(xo, A, b, es, lam); clc clearC = [-8 1 -2 -20 2 -6 -1 -38 -3 -1 7 -34]; A = C(:,1:end-1); b = C(:,end);nr =...- fizzkilla
- Thread
- Code Errors Gauss Matlab Matlab code
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
H
MATLAB Matlab code for 2D inverse Fourier transforms
I have written some routines that compute the 2D inverse Fourier transform, if anyone thinks that this may be useful at all then please let me know and I will gladly post the code.- hunt_mat
- Thread
- 2d Code Fourier Inverse inverse fourier Matlab Matlab code
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
D
MATLAB Altering Matlab Code for a Logistic Map Cobweb Plot
I found some Matlab code that works. However, I am not sure how to alter it for my needs. How can I make the code work for this:##N_{t+1} = \frac{(1+r)N_t}{1+rN_t}##What needs to be changed? %%% MAKES A COBWEB PLOT FOR A LOGISTIC MAP % compute trajectory a=3.0; % parameter x0=0.2...- Dustinsfl
- Thread
- Code Map Matlab Matlab code Plot
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
F
What is wrong with this matlab code?
Write a user-defined MATLAB function for the following math function: y(t) = -0.2x^4 + e^(-0.5x)*x^3+7x^2 The input to the function is x and the output is y. Write the function such that x can be a vector Use this function to make a plot of the function y(x) -3≤x≤4 function y=chp7one(x)...- Firben
- Thread
- Code Matlab Matlab code
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
A
MATLAB Help with writing a matlab code
?hi, im trying to write a code that should do this- create a random sized zeros vector create a random size ones vector i have to do this several times and combine it all(by that order) into one vector that should lookz like- 0000011111001111001... does anybosy have an idea how to do it...- alas
- Thread
- Code Matlab Matlab code Writing
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
R
MATLAB Problem regarding Matlab code for n no of quantum well
I have written a code which is something like that clc X = input('Molefraction of Al in system:'); n=input('no of well:'); width=zeros(1,50); for j=1:(2*n+1) width(j,:)=input('length of areas:'); end del_eg=1.247*X; V1=0.6*del_eg; V=zeros(1,100); for j=1:n...- Rajat Karmaka
- Thread
- Code Matlab Matlab code Quantum Quantum well
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
G
MATLAB How to write Matlab code for a multivariate Beta distribution
Hello, I am working on a problem in which I first sample two unknown probabilities, p and q, from Beta distributions, and then I want to sample both of them at the same time from a multivariate Beta distribution. This is the code that I have for sampling p and q individually from Beta...- glacier302
- Thread
- Beta Code Distribution Matlab Matlab code Multivariate
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
P
MATLAB Understanding the @ Rule in MATLAB Code with Quad Command
HI every one what's the @ rule in the MATLAB code? especielly when we use quad command.- pmehnati
- Thread
- Code Matlab Matlab code
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Z
Matlab code using ode45 difficulty
Homework Statement I've been trying to get this code to work: ode45(@(t,y) fallode(t,y,B), [0, tmax], [31330, 0]) Homework Equations function dy = fallode(t, y, B) % ODE function to model a fall over a large range of % altitudes, reaching up to high subsonic Mach numbers. % y(1) is...- zfolwick
- Thread
- Code Difficulty Matlab Matlab code Ode45
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
C
MATLAB Improving Tumor Detection with Matlab: A Collaborative Approach
Hey, I'm working on a DSP project that is using Matlab to improve the detection ratios of Computer aided Diagnosis (CAD). However the companies that are capable of doing this sort of CAD ensure that their code is not distributed. If anyone has or knows how to get a piece of code like...- Corey1984
- Thread
- Code Matlab Matlab code
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Z
MATLAB Need help to solve of Matlab code
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...- zayodi
- Thread
- Code Matlab Matlab code
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
K
Matlab code for solving complex numbers
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)...- Kayne
- Thread
- Code Complex Complex numbers Matlab Matlab code Numbers
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
M
MATLAB Making MATLAB Code Efficient: A 2xN Vector
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- Meurig
- Thread
- Code Matlab Matlab code Vector
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
C
MATLAB Transfer fourier series into matlab code.
Hey guys, i need to transfer Fourier series equation into MATLAB code. Anyone can help me in transfering?- chingwee88
- Thread
- Code Fourier Fourier series Matlab Matlab code Series
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
N
MATLAB code to Geometric Random Variable
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)- neeraj.patel1
- Thread
- Code Geometric Matlab Matlab code Random Random variable Variable
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
N
MATLAB code to Generate Raleigh Random Variable
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- neeraj.patel1
- Thread
- Code Matlab Matlab code Random Random variable Variable
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help