回答済み
How can I find a unique solution within tolerance using solve?
As long as rank(A) equals 3 in the below code, your system of linear equations has a unique solution. syms Rx Risop Rison V1=2...

2年弱 前 | 1

回答済み
function must return a column vector
Allocate dy as a column vector before assigning values to it: %Ordinary differential equation dy = zeros(4,1); dy(1)=alpha*(1...

2年弱 前 | 0

回答済み
I'm having trouble solving a system of nonlinear equations with the fmincon function.
Use % Options for fmincon options = optimoptions('fmincon', 'Algorithm', 'interior-point', 'Display', 'off','ConstraintToleran...

2年弱 前 | 0

| 採用済み

回答済み
Simulation - number of samples
Is there a preset (optimum) value and how is this determined? As big as necessary and as small as possible. You will have to te...

2年弱 前 | 1

| 採用済み

回答済み
Need help with homework.
Note that the name of the German physician was Fahrenheit, not Farenheit. % prompt for user to choose which conversion chosen_...

2年弱 前 | 0

回答済み
Weird bugs when solving three coupled second order differential equations using ode45
syms x1(t) x2(t) y(t) t0 = [0 1]; % y0 must be given in the order as prescribed by S (see below), thus % y0 = (x2(0),dx2/dt(0...

2年弱 前 | 0

| 採用済み

回答済み
Bessel function has problems in converting symbolic function into handle function.
It works for the numerical "besselj" function. Its derivative is given here: https://uk.mathworks.com/matlabcentral/answers/93...

2年弱 前 | 0

| 採用済み

回答済み
Bessel function has problems in converting symbolic function into handle function.
This code seems to work. Can you show us where you encounter problems ? syms x n = 12; f = sqrt(sym(pi)/(2*x))*besselj(n+1/2,...

2年弱 前 | 0

回答済み
optimization expression includes an integration
c = optimvar("c",1,1,'Type','continuous','LowerBound',0.1,'UpperBound',10); g1 = @(x,c) exp(-0.5*(x./c).^2)./sqrt(2*pi*c^2); o...

2年弱 前 | 1

| 採用済み

回答済み
How can I clear an error "The expression to the left of the equals sign is not a valid target for an assignment?"
You have seven differential equations, but you only specify six boundary conditions. That's mathematically incorrect. plot_velo...

2年弱 前 | 0

回答済み
I am getting an error
Do you want to overwrite the MATLAB function "convolution1dLayer" by your own function ? function output = convolution1dLayer(i...

2年弱 前 | 0

回答済み
Why does this code give error?
Force the array ix1 to be of the same length as ix by explicitly allocating it with the size of ix: % Run the GBO algorithm...

2年弱 前 | 0

| 採用済み

回答済み
Problem Using the Median Function with Complex Numbers
c = a + (b-a)/2; k = (sign(a) ~= sign(b)) | isinf(a) | isinf(b); c(k) = (a(k)+b(k))/2; But in every case, you set...

2年弱 前 | 0

回答済み
issue with fmincon function.
I guess the objective function should read obj_fun = @(x) -(Nup - Nt) / Nup * sum(log2(1 + x(1:Ns) ./ (sigma2 * (vecnorm(reshap...

2年弱 前 | 0

| 採用済み

回答済み
Index in position 1 exceeds array bounds. Index must not exceed 18.
data = (EEG.icaweights(opt.component,:)*EEG.icasphere)*data(EEG.icachansind,:); You are aware that you overwrite the matrix "da...

2年弱 前 | 1

| 採用済み

回答済み
How do I construct matrices of multiple variables and plot a graph
tspan=[0 3]; x0=100; y0=0; z0=[x0;y0]; [tSol, zSol]=ode45(@odefun,tspan,z0); plot(tSol, zSol); function dzdt=odefun(t,z) ...

2年弱 前 | 1

回答済み
I don't know what this means
Most probably, you don't have write permission in the directory to which you want to unzip 'MerchData.zip'.

2年弱 前 | 0

回答済み
Coupled ODEs by ode45 and could not get the figures
% Initial conditions Y0 = [298; 0.75; 0.04; 0.015; 0.0331; 0]; % [T0; Xa0; Xc0; Xs0; Z0; Soc0] % Time span tspan = [0 3000]; ...

約2年 前 | 1

回答済み
Can integral2 left a variable inside?
@Guan Hao You cannot simply remove the w in your expression as suggested by @Umar. I'd do the general integration first and the...

約2年 前 | 0

| 採用済み

回答済み
A numerical calculation problem leading to Inf or NaN in matlab
log2(norm(x,lambda)) does not work ?

約2年 前 | 1

回答済み
Hello all, kindly, I have question , how can I get the piecewise function of this blood flow rate shown below using Matlab
T = 0.56; A = 220; fun = @(x)A*sin(2*pi*x/T).*(x>=0 & x<=T/2) + 0*(x>T/2 & x <=0.7); F = @(x)fun(mod(x,0.7)); x = linspace(0...

約2年 前 | 0

| 採用済み

回答済み
calling function from separate document for fitting
However, when I try to call script 1 from 2, I get a ton of error messages. Could I please ask why is this the problem? You ca...

約2年 前 | 0

| 採用済み

回答済み
Setting bounds for constants in a fit() object in terms of other constants in the fit object
Use "lsqcurvefit" and set A(1,2) = -1, A(1,3) = 1/min(x) and b(1) = 0 for the linear constraint condition A*x<=b.

約2年 前 | 1

回答済み
How store evolution of x over the iterations of lsqnonlin?
If you can't use the nested approach, define "history" as a persistent variable and call "myoutput" after the computation has fi...

約2年 前 | 1

回答済み
Something doesn't work for me in fit
hist_x=[10 30 50 70 90 110 130 150 170 190 210 230 250,... 270 290 310 330 350 370 3...

約2年 前 | 0

回答済み
simplify and reorganize symbolic expression
The only symbolic function that comes to mind is "coeffs". If this function does not do what you want, I fear you are lost here....

約2年 前 | 0

| 採用済み

回答済み
help with bvp4c error
Use solinit = bvpinit(x_init,[1 1 phi_c 0]); instead of solinit = bvpinit(x_init,[1 1 phi_c 0],w); Why did you use the w-pa...

約2年 前 | 0

回答済み
Index in position 1 is invalid. Array indices must be positive integers or logical values Error
Array indexing in MATLAB starts with 1, not with 0. But you try to set Pdata(0)=pressure01(0,1); in your nested loop for i = ...

約2年 前 | 0

回答済み
Is this a correct way to use fsolve?
Solve in w^2 instead of w - then there shouldn't be imaginary parts in the solution: F = @(w) ((1-p)/C)*(kappa^q - (w^2)^q)+y+z...

約2年 前 | 1

| 採用済み

回答済み
Performing Newton's divided difference and trapezoidal rule in one program
I don't know if this is what you want. Your code is very badly structured and hard to follow. Shouldn't x=[2 4 6 8 10 12 14 1...

約2年 前 | 0

| 採用済み

さらに読み込む