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

Answered
ode45 and rungekutta yield different result
Both results look the same for me. C_p=3.026700000000000e-10; kp=392400000; theta_p = 0.231516000000000; R_s=20*1.8e6; % ohm...

4 years ago | 1

| accepted

Answered
exponential curve fitting in MATLAB for any type of x and Y data with equation y=ae^bx to calculate a and b coefficients
Instead of your code (in which you linearize f giving biassed parameter estimates) use the following: fun = @(p)p(1)*exp(p(2)*x...

4 years ago | 0

Answered
How to plot implicit function with conditions?
Use "fimplicit" or "fimplicit3" and select ranges for the variables: https://de.mathworks.com/help/matlab/ref/fimplicit.html h...

4 years ago | 0

Answered
Find vector that minimize the matrix equation
x = A\b is a vector that minimizes norm(A*x-b).

4 years ago | 1

Answered
How do I multiply a matrix and a column vector of variables ?
Try a combination of str2sym and cell2sym (I don't know the class of "ans" from your description) to convert ans to a symbolic c...

4 years ago | 1

| accepted

Load more