답변 있음
Creating a function with equation as an input
Like this: %sigma11 refers to 11:==> 1_: First U equation _1: fisrt term in equation. N = 3; % arbitrary value sigma11...

거의 5년 전 | 1

| 수락됨

답변 있음
Coding an Equation to be solved
This should do it, assuming you know the values of the other constants: % Arbitrary data L = 1; rho = 1; A = 1; sigma = 1; ...

거의 5년 전 | 2

| 수락됨

답변 있음
what does this code represents
First two rows of third column of matrix A. For example A = 0.8147 0.0975 0.1576 0.1419 0.6557 0.9058 ...

거의 5년 전 | 2

| 수락됨

답변 있음
How to plot trajectory of angles at varying x, y, and z position
Do you mean something like this (where I've obviously used arbitrary data): x = linspace(0,1,10); y = linspace(0,2,10); z = l...

거의 5년 전 | 0

| 수락됨

답변 있음
Am I implementing the correct code for the ∂2T/∂x2 + ∂2T/∂y2 = 0 ? The slider on the left of the Matlab command window keep vibrating vigorously for over 10 minutes
The following modifications to your code work: L=1; nx=20; ny=20; x=linspace(0,L,nx); y=linspace(0,L,ny); dx=x(2)-x(1); d...

거의 5년 전 | 1

| 수락됨

답변 있음
Using ode45 to solve a Second Order Non-linear ODE
Within your function pend you have function sdot = pend_P(t,s) a=10*(pi/180); b=0; ...etc This resets a and b to the initia...

거의 5년 전 | 0

답변 있음
Convert near zero complex parts to 0
Does the following do what you want yyFix = round(yy*10^n)/10^n; where you choose n as desired.

거의 5년 전 | 2

| 수락됨

답변 있음
Milstein's high order method graph stays at 0
Your line Xmil = Xmil + dt*r*Xmil.*(K-Xmil) + ..... probably needs to be Xmil(i+1) = Xmil(i) + dt*r*Xmil(i).*(K-Xmil(i)) +...

거의 5년 전 | 0

답변 있음
Array indices must be positive integers or logical values.
Look at cos(t(100-i)). When i is 100 this wants t(0). However, indexing starts at 1 in Matlab, not 0.

거의 5년 전 | 1

답변 있음
Different sizing on LHS and RHS
It works ok using fzero, as follows: %set variables To = 330; MF_max = 0.2; L_max= 2.1; G = 1.4; R = 287; f = 0.003; Po...

거의 5년 전 | 0

| 수락됨

답변 있음
solve() is unable to find a solution
Just solve it numerically using fzero. Take the initial guess close to the average value of the bounds you specify: k1_0 = 0.2...

거의 5년 전 | 1

| 수락됨

답변 있음
how to plot f(x,y) = x^2/y, y>0
Set the range of values of x and y of interest, then use meshgrid and surf doc meshgrid doc surf

거의 5년 전 | 0

| 수락됨

답변 있음
False Position Method (Plot)
Like this: f = @(x) 1000*x^3 + 3000*x - 15000; x_l = 0; x_u = 4; if f(x_l)*f(x_u) > 0 fprintf('There is no solut...

거의 5년 전 | 0

답변 있음
Fluid Pathline using Euler's Method with MATLAB
Replace t1=t0+h; by t0=t0+h; or add a line t0 = t1;

거의 5년 전 | 3

| 수락됨

답변 있음
How to add zero in even position of a matrix
Like this a = [1;2;3;4]; z = zeros(size(a)); b = [a';z']; b = b(:)

거의 5년 전 | 0

| 수락됨

답변 있음
How to assign string to a number?
Something like? disp(['a = ',num2str(a)])

거의 5년 전 | 0

답변 있음
Differential Equations MATLAB issue
Make sure your function 'nonlinear' returns a column vector. Your have initial conditions as [0, 0]. This should be either [0,...

거의 5년 전 | 0

답변 있음
Estimate parameters of Ordinary Differential Equations (ODE)
This works (see the comments): % == Script == exp_t = [0, 0.20, 0.400, 0.60, 0.80, 1, 1.20, 1.40, 1.60, 1.80, 2]; exp_y = [4....

거의 5년 전 | 0

| 수락됨

답변 있음
Plotting using a for loop
Like so: E=200*10^9; %Pa Elastic Modulus v= 0.28; %Poisson's Ratio eps=linspace(0,0.1,1000); Y= 375.8; m=2000; n=0.5; for...

거의 5년 전 | 0

| 수락됨

답변 있음
Plotting Newton Interpolating Polynomial
Do you mean something like this? xconsts = [-1.9021 -1.1756 0 1.1756 1.9021]; y = [0.0268 0.2362 0.5 0.2362 0.0268]; yconsts ...

거의 5년 전 | 0

답변 있음
differentiation of function inside another function
Use the chain rule!

거의 5년 전 | 0

답변 있음
how to make a for loop in an ODE 45
More like this I think: data = [0 86; 1 86; 2 117; 6 120; 7 130; 8 135; 13 169; 16 179; 23 224; ... 27 230; 29 242; 36 234...

거의 5년 전 | 0

답변 있음
Solve system of equations with 4 + 2N equations
Not entirely clear to me what you want, but perhaps something like the following, where the edge equations are taken outside the...

거의 5년 전 | 0

| 수락됨

답변 있음
Turning a function into anonymous function
What do you think is wrong with it? It works ok. Add plot(t,T_an2(t)),grid at the end to see the result.

거의 5년 전 | 0

답변 있음
solving 13 interdependent odes simultaneously by ode45
Well, the following works. I wouldn't know if the results make sense! qgin=12; c_g_in=[1 2 3 4 5 6 ]; c=zeros(13,1); c_l_in...

거의 5년 전 | 0

답변 있음
solving sets of two differential equations using Runge Kutta 4th order code
Here is the corrected version 1: % Solve y'(t)=-2y(t) with y0=3, 4th order Runge Kutta y10 = 3; % Initial Con...

거의 5년 전 | 0

답변 있음
Fitting a sum of exponentials to data (Least squares)
Use Matlab's best-fit matrix approach as follows: t=[0.5 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]; N=[5995 4930 3485 2550 191...

거의 5년 전 | 0

답변 있음
Matlab solving a system of equations
Parameters, dx, Px, Tx, Mx and Vx can be evaluated simply as follows: a = 1.4; x = -0.5:0.1:0.5; b = 0.153 + x.^2; dx = ...

거의 5년 전 | 0

답변 있음
Question on implementing Jacobi Method
More like this perhaps N=10; % 50; A=gallery('poisson',N); n=size(A,1); xs=ones(n,1); b=A*xs(:); MaxIter=10*n; TOL=1.e...

거의 5년 전 | 0

더 보기