Respondida
Getting this error : Operator '==' is not supported for operands of type 'cell'. what should I do?
https://uk.mathworks.com/help/stateflow/ref/strcmp.html

alrededor de 3 años hace | 0

Respondida
Problem with convergence using newtons method
Use PHI = matlabFunction(phi,'Vars',{n,k}) jacob_PHI = matlabFunction(jacob_phi,'Vars',{n,k}) n0 = -0.3; k0 = 3.4; instead ...

alrededor de 3 años hace | 0

| aceptada

Respondida
Iterative Process to find a variable in which two equations are equal and opposite
Here is at least one solution for h: % Equation Eo=1; Uo=1; Fc=1.03; Wc=2*pi*Fc; b=0.3; Ed=100; Ud=1; h0 = 10; fun = @...

alrededor de 3 años hace | 0

Respondida
Error using Time dependant Boundary Conditions with PDEPE
If "time" is the array corresponding to the data matrix, use data_actual = interp1(time,data,t) and set pr = [data_actual(1)...

alrededor de 3 años hace | 0

| aceptada

Respondida
Solving nonlinear equation with parameter
Tau = 0:0.01:1; kc0 = 270; Ea1 = 21500; Ea2 = 121500; n = 0.63; eps = 0.52; Cch4 = 0.2; Temp = 800 + 273; kcmax = kc0*ex...

alrededor de 3 años hace | 0

| aceptada

Respondida
How do I generate numbers from an Exponential Distribution within Min and Max values?
pd = makedist('Exponential','mu', 1.5); n = 100; lb = 0.5; ub = 4.3; rv = zeros(n,1); i = 0; while i < n r = random(p...

alrededor de 3 años hace | 0

Respondida
Index in position 2 exceeds array bounds
I already showed you how to solve "ode" as well as "ode1" simultaneously for D2p and D2q. This is necessary because both depend ...

alrededor de 3 años hace | 0

| aceptada

Respondida
Error due to integration
%filename ='Torque.xlsx'; %sheet = 'Averages'; %A = readtable(filename,'Sheet',sheet,'Range','A3:L32'); %A = table2array(A); ...

alrededor de 3 años hace | 0

| aceptada

Respondida
How do I fix "Index in position 2 exceeds array bounds (must not exceed 1)."
Before entering the loop after which the error message pops up, type size(gamma) size(sigma_g) size(g_omega_q_k_q) and chec...

alrededor de 3 años hace | 0

| aceptada

Respondida
optimization for nonlinear equation using fminunc
x0 = [1 1 1]; fun = @(x) x(1)*dsdt + x(2)*s.^x(3); f = @(x) sum(sum((fun(x) - p).^2)); x = fminsearch(f,x0) lhs = fun(x)

alrededor de 3 años hace | 0

| aceptada

Respondida
Trouble formulating Range Kutta
The expression [-ka3*A\[0; 1 ;0] zeros(3,1)] must be 6x6 instead of 3x2 in order to work for your system. And the numerical i...

alrededor de 3 años hace | 0

| aceptada

Respondida
Unable to perform assignment because the size of the left side is 10-by-1 and the size of the right side is 10-by-1-by-10.
In the assignments RHS(:,pp,gg) = (((1-alpha1(pp)... and RHS(:,pp,gg) = (((1-alpha2(pp)... the resulting term on the righ...

alrededor de 3 años hace | 1

Respondida
Generate function handle for odesolver dynamically
Define your equations by a function instead of a function handle. In the function, you can make a loop in order to account for t...

alrededor de 3 años hace | 0

| aceptada

Respondida
Retrieve value from cell(array)
solution = fsolve(F,arrayfun(@(i)vertcat(X_sol{1,i}(1,1)),1:size(X_sol,2))) But you should avoid making your code too general b...

alrededor de 3 años hace | 0

| aceptada

Respondida
How to compute 8 days mean from one year data?
data_matrix = readtable('sample.csv'); data_matrix = table2array(data_matrix); n = floor(365/8); out_day = zeros(n+1,9); for...

alrededor de 3 años hace | 0

Respondida
Runge-Kutta Integration 4th Order - Taylor Maccoll
% Isentropic exponent gamma = 1.4; % assumed shock anngle Theta_shock = 14.35; % Mach number M = 6; % Compute initial cond...

alrededor de 3 años hace | 0

Respondida
I have a code, but it keeps saying "Supplied objective function must return a scalar value.'
I have a code, but it keeps saying "Supplied objective function must return a scalar value.' Yes, that's true. Your function "S...

alrededor de 3 años hace | 0

Respondida
Unspecified number of dimension for ndgrid
https://uk.mathworks.com/matlabcentral/answers/372299-how-to-do-a-cycle-through-a-n-dimensional-grid-if-n-is-not-fixed

alrededor de 3 años hace | 0

| aceptada

Respondida
Not enough input arguments
You must return dCdt and dSdt at time t in function "SBR1": function dy = SBR1(t,y) C = y(1); S = y(2); ... % Calcu...

alrededor de 3 años hace | 0

Respondida
Runge-Kutta 4th order Integration - Taylor-Maccoll
gamma = 1.4; % intitial values uR(y1) and uTheta(y2), behind the shock wave g0(1) = 0.9078; g0(2) = -0.1262; % assumed shock...

alrededor de 3 años hace | 0

Respondida
I use the PSO optimization algorithm and I get the error Unable to perform assignment because the size of the left side is 10-by-1 and the size of the right side is 1-by-3.
The reason for the error message is obvious. You can't save a 1x3 array (actfunc(randperm(3))) in a 10x1 array (particles(:, 2))...

alrededor de 3 años hace | 0

| aceptada

Respondida
Creating a square multidimensional array from a function
x= -7:0.1:7; y= -7:0.1:7; z= -7:0.1:7; [X,Y,Z] = ndgrid(x,y,z); F = fun(X,Y,Z) size(F) function f = fun(x,y,z) f = ...

alrededor de 3 años hace | 0

| aceptada

Respondida
How to resolve this error "Array indices must be positive integers or logical values."
You forgot a multiplikation sign: t2=((f*vmax+xf*Dq*(-mum+3*m+12*(s^2))+4.5*(s^2)*(xf^2)*D2q)/(r-(3*m+3*(s^2)))); instead of ...

alrededor de 3 años hace | 0

Respondida
fitting data with a combination of exponential and linear form ( a*exp(-x/b)+c*x+d )
Try f(x) = a*atan(b*x) It's too steep at the beginning and too flat at the end, but better than your model function. data= r...

alrededor de 3 años hace | 1

Respondida
Linear Regression with Only Dependent Variables
The model with parameters a, b and c to be determined should be column_matrix_1 * a/sqrt(a^2+b^2) + column_matrix_2 * b/sqrt(a^...

alrededor de 3 años hace | 0

Respondida
Making a new column from old column
x = linspace(0.1,1,17).'; y = x; y(y>0.5) = 1;

alrededor de 3 años hace | 0

| aceptada

Respondida
Boundary value problem-bvp4c
Use ode45 and integrate backwards: https://uk.mathworks.com/matlabcentral/answers/1881197-numerical-integration-backwards-for-o...

alrededor de 3 años hace | 0

| aceptada

Respondida
How do i add a changing input over a interval using ODE45?
v = 25/3.6; % Speed of the car Lslope = (0.5/v)*1000; % Length of the slope in time (assuming v is ...

alrededor de 3 años hace | 0

Respondida
I am getting error "Index in position 2 exceeds array bounds (must not exceed 6)"
You should try [u,s,v]=svd(xi); instead of [u,s,v]=svd(xi,0);

alrededor de 3 años hace | 0

Respondida
3D Heat Equation in PDE Solver
T_center = interpolateTemperature(results, 5,5,0.5); You didn't specify the times at which you want the temperature to be suppl...

alrededor de 3 años hace | 0

Cargar más