Answered
Trouble plotting solution to two 2nd order ODEs using forward Euler method
The following sorts out your Euler integration: v0=85;%m/s angle=51*pi/180;%rad g=9.81;%m/s^2 m=0.145;%kg r=0.036;%m A=pi*...

5 years ago | 1

| accepted

Answered
Return the value of Matrix
mat_c(:,2)

5 years ago | 1

| accepted

Answered
vibration of a rod using spectral element method
I don't know if it solves your problem, but your last line should probably have ifft(u2f) not ifft(u2) on the right hand side.

5 years ago | 0

Answered
Not enough input arguments error in function
The following works for me (I['ve chosen random numbers for x as you didn't say what ones you used): x = rand(1,12); y = organ...

5 years ago | 0

Answered
How to merge tow rows in one row?
Like so A = [ 1 2 3 4 5 6 7 8 9 10 11 12]; B = [A(1,:) A(2,:)];

5 years ago | 0

Answered
Matlab Numerical integral issue
Your problem occurs when the upper limit of the integration exceeds k0. Are you sure the functions are defined correctly for th...

5 years ago | 0

Answered
Why is an extra line being plotted?
More like this, I think: numFlr=2; Phi_EigVec=[1 3;2 -3;]; y1=zeros(numFlr,1); y2=zeros(numFlr,1); x1=zeros(numFlr,1); x...

5 years ago | 0

| accepted

Answered
Substitute the value of variable in an equation
Like this, for example: F = @(x,y,a) 3*x.^2*y+4*y.*x.^3+3*a*x; F1 = @(x,y,a) 4*x.*y.^2+3*y; x = 2; a = 3; y = 4; disp(F(...

5 years ago | 1

Answered
how can I interpolate functions
doc interp1

5 years ago | 0

Answered
not geting the plot and my loop is not working
Needs to be as follows: sigma=0.047193; V_tip=180; W=180; Cd_avg=0.01; R=2.235; Rv=80.529; ...

5 years ago | 0

Answered
function reshape creating matrix
"A" only has 11 elements. You want B to have 12 elements (3*4). If you set A = 10:21, for example, it will work.

5 years ago | 0

| accepted

Answered
tryin analyze a 3d truss
Your matrix "connectivity" has 12 rows, but only 2 columns, yet you are trying to access the third (4'th, 5'th ...12'th) column....

5 years ago | 0

Answered
Filling in values of a formula into another formula.
Your equation depends only on t, not x. The following is a modification of your code where I've removed the parameters that are...

5 years ago | 1

| accepted

Answered
ising model ploting problem
You have your plot commands within function "initSpins", which is never called by the coding above it! Also check line 49, wher...

5 years ago | 0

| accepted

Answered
Integral Not Calculating Numeric Result
Replace q = int(F,1,2) by q = int(F,1,2,'IgnoreAnalyticConstraints',true)

5 years ago | 0

| accepted

Answered
How to calculate a certain length of mean in a row of data points?
Use reshape to turn the 500000x1 vector into a 50000x10 matrix, then use mean and std on this.

5 years ago | 0

| accepted

Answered
Run and plot complex function
You probably meant to put parentheses in the following line: X=exp(1i*Omega)./exp(1i*Omega)-0.8; Did you mean: X=exp(1i*Omega...

5 years ago | 0

| accepted

Answered
How to control the outcome of an ODE?
How about just modifying dydt(5) within the function to % Temperature if y(5)>=600 dydt(5) = 0; else dydt(5) = ( (...

5 years ago | 0

| accepted

Answered
Error when solving differential equations
Your function has function dydt = vdpi1(t,y) but you really want dy returned, not dydt.

5 years ago | 0

Answered
not getting plot , why?
Arrange it like this sigma=0.047193; V_tip=180; W=180; Cd_avg=0.01; R=2.235; k=1.1; A=pi*R.^2; P_e= 61147.4; h=0:100:...

5 years ago | 0

Answered
Solving a linear system of 1st order ODEs using the Forward Euler method and ode45
You were confusing time and x position. Try tf = 4; %final time You are integrating wrt time not x tspan = [0,tf]; h = .05;...

5 years ago | 0

| accepted

Answered
How can I solve this ode problem?
You get a singularity (divide by zero) when u = 60, giving infinite acceleration. You need to include a guard against this.

5 years ago | 1

| accepted

Answered
My function f(x) doesn't display (compute?) the result for when f = 0.
Replace diff(g) by gradient(g)

5 years ago | 1

Answered
Taking a descend interval
Insert tau = n+1-t; then raise 1/800 to the power tau.

5 years ago | 0

| accepted

Answered
Complex Sinwave to plot
Like this x = 0:0.1:4.56; p = zeros(1,numel(x)); q = zeros(1,numel(x)); for i = 1:numel(x) p(i) = fn(x(i)); q(i) =...

5 years ago | 0

Answered
Extreme difference between the value of a function and the result in matlab
Must hit an overflow. Express it as: a=sqrt(4950000001); b=30000; r = (a/b)^2; y1 = 333.75+r*(11*r - b^2 -121 - 2/b^4)+5.5*...

5 years ago | 1

Answered
How to calculate the projection of point onto a line
Try doc std

5 years ago | 0

Answered
Unable to perform assignment because the left and right sides have a different number of elements
Like this? % 1. Define Initial Conditions N = 50; % x_0 = 50*pi/180*randn(2,N); phi_0 = x_0(1,:...

5 years ago | 0

| accepted

Load more