Answered
How can I change the definition of x to find the value of y(3.5112)( i mean y(x1)) for this question ?
I don't know if it helps: %%main func clear all; close all; clf; clc; % Define the function x = linspace(-10,10,100); ...

4 years ago | 0

Answered
Trouble defining a set of parameters while using ode45 to solve a system of differential equations
This page should help you: https://de.mathworks.com/help/matlab/math/ode-event-location.html

4 years ago | 0

Answered
Finding the turning point on a curve
v = [-0.000499915992890149 -0.00136716055731299 -0.00312202879147695 -0.00415143850349407 -0.003723995799058...

4 years ago | 0

| accepted

Answered
how to substitute a symbolic differential equation?
syms x(t) y(t) lambda h = 2*diff(x,t,2) + (diff(y,t))^2; xtt = diff(x,t,2); yt = diff(y,t); h_subs = subs(h,[xtt,yt],[lambda...

4 years ago | 0

| accepted

Answered
How to pre-allocate a double for following script ?
What about syncat = zeros(100000,2) ?

4 years ago | 1

| accepted

Answered
Getting a system of equations and the using ODE45
fun = @(x) Xi.'*[1;x(1);x(2);x(3);x(1)^2;x(1)*x(2);x(1)*x(3);x(2)^2;x(2)*x(3);x(3)^2;x(1)^3;x(1)^2*x(2);x(1)^2*x(3);x(1)*x(2)^2;...

4 years ago | 1

| accepted

Answered
i need to find the optimize values of R for a values in an interval but R values are in form of the root of the equation; how to solve this sir? for simple equation it was ok.
I think this is the safest way: syms R a p = -282091600255531819/9878934086330590709531986654911361482361187039433493704830155...

4 years ago | 0

| accepted

Answered
Index in position 3 exceeds array bounds (must not exceed 1)
"orph" has dimension 1 x 20000 because you overwrite the image by the command orph = [i,j]. Then you try to access orph(:,:,2)...

4 years ago | 1

| accepted

Answered
i need to find the optimize values of R for a values in an interval but R values are in form of the root of the equation; how to solve this sir? for simple equation it was ok.
Try "fmincon" for the problem min: R s.c. f(R,a) = 0 (f is the complete expression between "t=solve(" and "==0,R)) a_left <...

4 years ago | 0

Answered
Error using cat Dimensions of arrays being concatenated are not consistent.
Xtrain = cat(2,Xtrain,smat.'); would work, I guess.

4 years ago | 0

Answered
How to find L from the given code?
lags = 0.6; k1 = 3; k_1 = 1; k2 = 2.5; k3 = 1; k_3 = 1; k4 = 2; k5 = 1; E1 = 1; E2 = 2; K1 = (k_1+k2)/k1; K2 = (k_3+k...

4 years ago | 1

| accepted

Answered
i have to plot the percentage of heads by the times token is trowed times, in a game of head or tail, but a need help for doing that. What can I use in my plot?
N = 500; x=rand(1,N); for i = 1:length(x) if x(i) < 0.5 x(i) = 1; % cara else x(i) = 0; % coroa ...

4 years ago | 0

| accepted

Answered
ode15s solver produces wrong solution
t0 = 0; % initial time tf = 1; % final time nt = 20; % number of output times xl = 0; % left point xr = 1; % right point nx...

4 years ago | 0

| accepted

Answered
How to store n iterations of randomly generated matrices
n = 10 ; bounds = [1 100] ; %interval over which the random number generator will produce values randA = zeros(3,3); randA_al...

4 years ago | 0

Answered
Numerical answer to Partial derivative of Hopfield-style Energy in symbolic expression
p is (4x1), not (16x1). And keep r_mat as matrix, then E = -0.5*p.'*r_mat*p - c.'*p ( r_mat can be assumed symmetric ). By...

4 years ago | 0

| accepted

Answered
Error from ode15s
psi = 0.63; psip = 0.27; L = 150e-6; Ts = 60; k = 0.00158; q0 = 4.62e3; C0 =1.03; gama = 5021.8; Jw = 8.5e-6; a = psi*...

4 years ago | 0

Answered
Array indices must be positive integers or logical values.
e = exp(-SNR_index.^2./2) SNR_index is undefined. compute_the_Q = integral(@(SNR_index) (1/sqrt(2*pi)).*e, SNR_index,Inf,'Arra...

4 years ago | 0

Answered
How can I simulate Buffon's needle on MATLAB?
https://simonensemble.github.io/2018-04/buffon

4 years ago | 0

| accepted

Answered
Solve Three non-linear equations for 3 variables system
You might want to try a numerical solver, but the two I tested also didn't succeed. fun = @(A,B,C)[72000-(B*4000)/(log(A*4000)-...

4 years ago | 0

Answered
Coupled ODE using ODE15s with multiple outputs
When communicating with ODE15S, the solution must be treated as one vector of size 200, not as two vectors of size 100. E.g. f...

4 years ago | 0

| accepted

Answered
Is it possible to (non-linear) minimize x^y by choosing both x and y?
fun = @(x) x(1)^sqrt(x(2)); lb = [1.01,1.01]; ub = [100,2]; x0 = [1.01,1.01]; sol = fmincon(fun,x0,[],[],[],[],lb,ub,@nonlco...

4 years ago | 0

Answered
What is wrong in script?
I would have progrmmed it this way, but the result seems to be the same. My guess is that there is a mathematical trick to extr...

4 years ago | 0

Answered
How to generate plot
a = 5; n = 30; P0 = 100; c = 3; s = cos((2*(1:n)-1)*pi/(2*n)); x = a*s; P = P0*exp(-0.5*(x/c).^2).*(1-x/c).^2; K1 = sqrt(...

4 years ago | 1

Answered
What is an efficient way of finding the maximum value under a certain limit?
A = [1,2,3;4,5,6;7,8,9]; A(A>=8) = -Inf [m,i] = max(A,[],'All') [row,col] = ind2sub(size(A),i)

4 years ago | 1

| accepted

Answered
How I can give condition & plot the solution of this differential equation. . . . . . . Please Guide
dsolve doesn't succeed. Thus use a numerical solver (bvp4c) to solve your equation. syms A theta(z) dtheta=diff(theta,z) d...

4 years ago | 0

Answered
diffusion from point source boundary conditions
if i use the "s" variable for the solver, does this input it at r=0, or for every value of r? For every value of r (at least if...

4 years ago | 1

| accepted

Answered
Arrays have incompatible sizes for this operation.
This line of code is giving me vector of a length of 214. If dt1 correspond to Fc values half hour and you want the maximum Fc ...

4 years ago | 0

Answered
is the "for loop" is wrong? what can be the solution?
ti = 0; tf = 100E-4; tspan=[ti tf]; o = 1E6; tc = 70E-9; tf = 240E-6; a1 = 0.02; a2 = 0.02; P1 = 1; P2 = 1; k = ...

4 years ago | 0

Answered
Ordinary differential equation, transforming into a single ODE
beta = 0.21; mu = 0.29; omega = 1; v0 = 1.0; vdp1 = @(t,y)[y(2);-beta*y(2)+(1+mu*cos(omega*t))*y(1)-y(1)^3]; [t,y] = ode45...

4 years ago | 0

Answered
How to prevent warning when running fplot of a function containing bessel functions?
O is only determined up to a constant. You must fix this constant of integration to get reasonable results (I assumed O(1e-8) = ...

4 years ago | 0

| accepted

Load more