답변 있음
How to solve this in Matlab using loop and symsum
Do you really want to do it with a loop and symsum? Why not just N = 10; % for example i = 1:N; sum(1./i + 1./((i+2).*(i+3)...

대략 5년 전 | 0

| 수락됨

답변 있음
To simulate the SIMULINK model on MATLAB
The following loop seems to do it: for i=1:1:length(n) %Backward Euler method (Integrator 1) for n1=1:1:length(n) ...

대략 5년 전 | 0

| 수락됨

답변 있음
Work out a large expression
Here's one way syms s Z1 Z2 vr R = 10000; c = 1e-6; Z1 = 1/(s*c); Z2 = 1/(s*2*c); % 0 = -V1*R^3-V2*Z1*R+V2*R^2-V2*R^2*Z1...

대략 5년 전 | 1

| 수락됨

답변 있음
Not enough input arguments.
More like this: t=0:0.1:5; x0=0; xdot0=5; z0=[x0,xdot0]; [T,Z]=ode45(@motor,t,z0); % Note @motor, not just motor. plo...

대략 5년 전 | 0

| 수락됨

답변 있음
invalid use of operator
c_L=(ci*ri)/ro.*(1-exp(1).^((-ro.*t/.((ri-ro).*t+1500)))); should be c_L=(ci*ri)/ro.*(1-exp(1).^((-ro.*t./((ri-ro).*t+1500)))...

대략 5년 전 | 0

답변 있음
Simpsons Rule to Numerical integrate a function (Lorentzian Function)
With an Inf limit you divide by Inf in simprl, resulting in a NaN. Use large, but finite limits. You havem't writtn your Lor...

대략 5년 전 | 1

| 수락됨

답변 있음
Plotting a two dimensional equation with an integral
Something like this K = 1:10; % or whatever values you want for i = 1:numel(K) I(i) = integral(@(theta) Ifn(theta,K(i)),...

대략 5년 전 | 0

| 수락됨

답변 있음
help for projectile equation
These are the equations (note that theta is measured from the horizontal, and is positive in the anticlockwise direction): ...

대략 5년 전 | 0

| 수락됨

답변 있음
How to sum part of a matrix using loop command
Try replacing B(k1,k2) = sum(A(k1,k2:3:end),2); by B(k1,k2) = sum(A(k1,k2:35:end),2);

대략 5년 전 | 0

답변 있음
Problem using ode23tb (Error: Index exceeds the number of array elements)
Must be something to do with the nested functions! It works when structured as follows: [t,y] = ode23tb(@yfn,[0 pi/(10e6*pi)],[...

대략 5년 전 | 0

| 수락됨

답변 있음
4th order Runge-Kutta Problem in Special ranges
Change y(0) = -1; to y(1) = -1; Matlab indices start at 1 not zero.

대략 5년 전 | 1

답변 있음
how to find the period for the 0.2s,0.8s,1s and 2s ?
You need to change the size of the vectors etc appropriately. For example, for period = 0.2 you could have T1 = 0.01; t1 = 0:...

대략 5년 전 | 0

답변 있음
How to create a new variable in each iteration of the for loop?
One way as follows: y = 1024; %for example winSize=[16,64,256,1024,4096]; for i = 1:numel(winSize) if winSize(i) == 16 ...

대략 5년 전 | 0

| 수락됨

답변 있음
Non-Linear Coupled First-Order ODEs (with multiple derivative terms in each equation).
These ode's can be rearranged as follows: As long as you know initial values for a, b and c, then given that you know everyth...

대략 5년 전 | 0

| 수락됨

답변 있음
How can i make the integral curves?
Like so? [x,y] = meshgrid(1:0.5:6,-3:0.5:2); u = ones(size(x)); v = (x.*y+y.^3)/2*x.^2; r = sqrt(u.^2 + v.^2); plot([0,0],[...

대략 5년 전 | 0

| 수락됨

답변 있음
How to clump/consolidate values together using the mean function
Here's one way cw = 4; %cell width a = 1:8; b = (1:8)'; c = a.*b; mat=ones(8,8); %temporary matrix avfn = @(m) mean(m,'A...

대략 5년 전 | 0

답변 있음
solve non linear equations
Add these lines at the end to get the values of S and J Soln = vpasolve([eqn1, eqn2],[S, J],[1 1]); disp(Soln.S) disp(Soln.J)...

대략 5년 전 | 0

답변 있음
How to find an unknown in an integral equation
Here's one way: nA0 = 1; % Initial guess nA = fzero(@fn, nA0); disp(nA) function Z = fn(nA) alphaA = 0.52; T ...

대략 5년 전 | 0

| 수락됨

답변 있음
Error: Function definition not supported in this context. Create functions in code file.
You need to turn Z=sin(2*pi*fc*p)./(pi*p); %Define truncated Sinc function% into Z=sin(2*pi*fc*p)./(pi*p); %Define trunca...

대략 5년 전 | 1

답변 있음
Using a another function within ODE45
More like this (but note the comments near the end): %Default Values m_c = 2; % Container Mass s1 = 16; ...

대략 5년 전 | 1

| 수락됨

답변 있음
Conditionals within ODE45
You could try the following simplistic approach %Default Values m_c = 2; % Container Mass s1 = 16; % Sp...

대략 5년 전 | 1

| 수락됨

답변 있음
Need Help..............Error using stem (line 43) X must be same length as Y.
Either you want stem(t,xaa); or you want to use t1 in the definitions of xa11, xa22 etc.

대략 5년 전 | 1

답변 있음
What am I doing wrong here I keep getting a plot with either to many things on it or not enough all I want is a plot with two y axis and an x axis
Like this g = 9.81; theta = 46.97; theta2= 55; v1= 13.5; v2= 16.05; x= (0:0.1:2.3); x2= (0:0.1:5.14); y= x*tan(the...

대략 5년 전 | 0

| 수락됨

답변 있음
Two linear equation with absolute value equation
Do you mean something like this X0 = [-50 -5]; [X, Fval] = fminsearch(@(X) fn(X),X0); x2 = X(1); x1 = 50-x2; x4 = X(2); x3 =...

대략 5년 전 | 1

답변 있음
10%+10%
Because the % symbol indicates that the rest of the line is a comment. So the only non comment parameter Matlab sees is the fir...

대략 5년 전 | 2

| 수락됨

답변 있음
Function handling problem in loop
Try doc str2num to convert from text to numeric. Also, you might find it easier to define: k = [5.16 5.12 4.89 4.79 4.99 5.4...

대략 5년 전 | 0

| 수락됨

답변 있음
I can't randomly distribute the dots
Try using Yikikz=rand(size(Elevation)).*Elevation;

대략 5년 전 | 1

답변 있음
How to fix error in fsolve
Is it just a case of changing F(1) = X(1) - exp(13.5-(2700/(x(3)-55))); to F(1) = x(1) - exp(13.5-(2700/(x(3)-55)));

대략 5년 전 | 1

답변 있음
Error in using Integration, How to fix it ?
Since x has t in the denominator. t=0 will cause problems, so start at t = 0.02 instead, perhaps! This would require a change i...

대략 5년 전 | 0

| 수락됨

답변 있음
Ode and monod solver
Your equation has the following analytic solution (assuming Xa is a constant): You can plug in the known values for S0 (ie. t...

대략 5년 전 | 1

| 수락됨

더 보기