Answered
I'm having trouble with ode45. It keeps getting the "not enough input arguments" error.
[t,x]=ode45(@f,ts,xo); instead of [t,x]=ode45(f,ts,xo);

4 years ago | 0

| accepted

Answered
Ode45 produces Nan output as I try to solve a differential equation.
T1m = 300; Rm = 0.3243; Rt = 0.45; Rh = 0.1985; n =101; r = linspace(Rh,Rt,n); Cp = 1015; Vt1m = 87.88; Va1m = 211.45; Vt1 = ...

4 years ago | 0

| accepted

Answered
Don't know where my code is wrong and how to fix it
Pi = sym(pi) double(Pi) Pi = sym('pi') double(Pi) You understand the difference ?

4 years ago | 0

| accepted

Answered
How to use symsum command for a function of two variables and two indices?
syms x y i j assume(i,'integer') assume(j,'integer') A = symsum(symsum(x^i*y^j/factorial(i+j),i,0,Inf),j,0,Inf) x0 = 0:0.2:1...

4 years ago | 0

| accepted

Answered
How can I calculate the H0_LOS & P_rec_dBm and draw it at every new psi value?
If psi becomes an array instead of a single value, the expression (m+1)*A_det/(2*pi*d_tr^2)*cos(phi)^m*cos(psi) also becomes ...

4 years ago | 1

| accepted

Answered
Problem with function output Problem with function output
y must be a vector with element between min M and max M. This doesn't seem to be true in your case since you generate y in bet...

4 years ago | 1

| accepted

Answered
Fitting Kinetic model to estimate kinetic parameter.
You treat the initial conditions at t=0 as unknowns k(8:14). But you have the concentrations at t=0 from your experimental data...

4 years ago | 0

Answered
symbolic integration depends on different equivalent forms of function
The difference is a usual "constant of integration". If you differentiate both B and B_ with respect to y and then with respect...

4 years ago | 0

Answered
How shall I sort along a dimension?
sort(A,3,'descend')

4 years ago | 0

Answered
"Sort 3_D array along the third dimension"
It means that B(:,:,1) <= B(:,:,2) is arranged by ordering the vectors [2,-1], [3,9],[1,0] and [6,12].

4 years ago | 0

Answered
Plotting 2-D regions without prior knowing the numeric limits
https://de.mathworks.com/matlabcentral/fileexchange/9261-plot-2d-3d-region

4 years ago | 0

| accepted

Answered
Code to repeat rows multiple times
table = ['1/12/22';'1/13/22';'1/14/22'] new_table = repelem(table,3,1)

4 years ago | 0

| accepted

Answered
When substituting an expression into an functions its keeps flipping the sign of the substituting
(2-6*a)^2 = (6*a-2)^2 (1-14*a)*(2-6*a) = (14*a-1)*(6*a-2) (1-14*a)^2 = (14*a-1)^2 So why is it so important for you that the ...

4 years ago | 0

| accepted

Answered
How to modify the code to get my desired array?
N = 9; d = 0.25; rx = [(N-1)/2*d:-d:d,zeros(1,(N+1)/2)].'; ry = [zeros(1,(N+1)/2),d:d:(N-1)/2*d].'; r = [rx,ry,zeros(N,1)]

4 years ago | 0

| accepted

Answered
How to calculate gradient from semilogy plot graph?
In the left part, your functional equation is approximately f(x) = 10^(-3.2*x+70) I don't know from your question whether you ...

4 years ago | 0

| accepted

Answered
System of 4 non-linear equations yields Empty sym: 0-by-1
%parameters I_sc = 0.473; V_oc = 2.6; V_m = 2.32; I_m = 0.455; R_s = 0.001; T = 313.5; k = 1.38e-23; e = 1.6e-19; c = 1...

4 years ago | 0

Answered
radial diffusion pde boundary conditions
Here is an example for the 1d spherical diffusion equation dT/dt = 1/r^2 * d/dr (r^2*D*dT/dr) with boundary conditions dT/dr ...

4 years ago | 1

| accepted

Answered
Getting NaN while using the ratio of power and factorial
exp(400)*200 is quite large ... format long l=0; lp=2; d=200; a2= ((-sqrt(d))^lp); a3 =((-sqrt(d))^l); a1 = 1.0; sum1 = ...

4 years ago | 1

Answered
Solving system of PDES using Method of Lines
Try this code. At least, it gives a result. clear all; clc; close all; L=500; ...

4 years ago | 0

| accepted

Answered
Need help on program
h = 0:50:50000; for i = 1:length(h) if h(i)<11000 Te(i) = 15.04-0.00649.*h(i); pe(i) = 101.29.*((Te(i)+2...

4 years ago | 0

| accepted

Answered
how find the perimeter of irregular shape
tf=2*pi; phi=0:0.01:tf; m=4; n1=9/16; n2=6; n3=2; u=1; v=1; r=(((abs((1/u).*cos((m*phi)/4))).^n2)+((abs((1/v).*sin((m*ph...

4 years ago | 1

| accepted

Answered
Error using odearguments?
syms t Vol = 900; % Volume for emulsion injected g = 9810; % mm/s^2 - gravity L = 0.5e-6; ...

4 years ago | 1

Answered
Defining Differential Equation in Runge Kutta 4th order
Ta = 300; g = 9.81; V=12; %Volt I=10; %Ampere delta = 1; %switch r=0.01; %[m] l=0.2; %[m] Aw = pi*r^2; Al = l*2*r; m=6...

4 years ago | 1

| accepted

Answered
code to solve second order coupled PDE
It's not a system of PDEs, but of ODEs. Convert the two second-order ODEs to a first-order system of 4 ODEs. Then use ODE45 to ...

4 years ago | 0

Answered
Why does my function abc give error with optimtool
The product r*k in the line A = exp(-1j*r*k);% Steering matrix is not defined. k is (3x3), r is (Nx3) where N = 10. Setting ...

4 years ago | 0

| accepted

Answered
Please help me code this
c = integral(@(x)integral(@(y)sqrt(x.^2+y.^2),0,sqrt(2*x-x.^2)),0,2,'ArrayValued',true) syms x y c = int(int(sqrt(x^2+y^2),y,0...

4 years ago | 0

Answered
Too many input arguments.
emu has 9 input parameters, but you call it with 10. 9 inputs: function f = emu(t, x, nd, alpha, mu, D0, Vol, g, D) ...

4 years ago | 1

| accepted

Answered
4th order ODE, 4 boundary conditions
%solinit = bvpinit(linspace(0,0.05,1), [1, 0]); solinit = bvpinit(0:0.05:1, [1, 0,0,0]); sol = bvp4c(@ab, @bc4,solinit); %x =...

4 years ago | 0

Answered
How to plot implicit function with conditions?
Doesn't look that nice ... fimplicit3(@fun,[-5 5 -5 5 -5 5]) function values = fun(x,y,z) [theta,r] = cart2pol(x,y); ...

4 years ago | 0

Answered
Final Point Equals Initial Point when trying to optimize
Here is a code where A does not equal A0: A0=1e-3*[1.5*(10^7),1*(10^6),1*(10^6)] sum(fit(A0).^2) options = optimset('TolFun',...

4 years ago | 0

| accepted

Load more