Answered
Error on Symbolic calculation : "Empty sym : 0-by-1"
Try this code. By the way: numel(v1(i,j)), numel(v2(i,j)) and numel(v3(i,j)) always equals 1 because v1(i,j), v2(i,j) and v3(i,...

3 years ago | 1

| accepted

Answered
symbolic function give error list of equations must not be empty
syms Shy Por_den = 0.4:0.1:0.8; W= 1.2; rho_ma = 2.75; rho_water = 1.03; rho_hydrate = 0.90; Measure_VEL=1.4:0.1:1.8; vw= 1.49...

3 years ago | 0

Answered
Need help in using trapz to integrate a definite function
Maybe you mean clear all c=3*10^8; % speed of light in vaccum h=6.626*10.^-34; % Planck constant k=1.38*10.^-23; % Boltz...

3 years ago | 0

Answered
Problem in solving equation with Gamma distribution parameters as unknowns
I'd try it numerically. Better initial values for y,z and la might give convergence. fun = @(y,z,la)[gaminv(0.95,y,z)-gaminv(0....

3 years ago | 0

| accepted

Answered
How to fit a histogram plot to a poisson distribution
Simply use lambdahat = poissfit(spacing_ratios) But I'm surprised you want to fit data that take non-integer values with a dis...

3 years ago | 0

Answered
why the plot of C is a constant through the time (differential equation résolution)
You start with an initial value y02 = 0. The rate of change of Y2 is z2 = 4.*(0.1.*exp(-5000./(8.314.*300))).*y, thus 0 since ...

3 years ago | 1

Answered
I want to know which of the two spaces each point belongs to in a 3-dimensional space divided into two parts by a single plane.
The two half-spaces that IR^3 is divided in by the plane are a(x-p)+b(y-q)+c(z-r) < 0 and a(x-p)+b(y-q)+c(z-r) > 0. So for a gi...

3 years ago | 4

| accepted

Answered
Solve closed loop system equation with disturbance input via function handle
By using interp1 to interpolate the column value to the time instant of the ODE integrator. Or use your own integrator with a f...

3 years ago | 1

Answered
How do i store the output from my for loop for each iteration
You must return "store", not "sol" to the program calling the function "tosolve".

3 years ago | 0

Answered
Find nth value in a matrix and plot on graph
Run = 6; i72=zeros([max(Run) 1]); i68=i72; i62=i72; i58=i72; i22=i72; i18=i72; i12=i72; i08=i72; for i = 1:Run if i==1 ...

3 years ago | 0

Answered
In an assignment A(:) = B, the number of elements in A and B must be the same. How can I fix this error?
For Run = 1, you get empty results for i72(1),i68(1),.... But i71(1),i68(1),... cannot be removed from the 2x1 arrays i71, i68,....

3 years ago | 1

| accepted

Answered
how to index the stating position of something?
x1 = [1 0 2 3 8 5 6 7 0 0 0 0 0 2 5 3 0 0 6 4]; out1 = LengthAndPosnZeros(x1) x2 = [1 0 0 8 5 0 0 3 3 3 3 0 0 0 0]; out2 = ...

3 years ago | 0

Answered
I have an error in my program. the error is about 'Error using letter_detection (line 4) Not enough input arguments.' using Matlab R2015A and I named the file letter_detection
You should test the procedure with a simple example: Write a function function s = addition(a,b) s = a+b; end and save it...

3 years ago | 0

Answered
I do not understand exit message given by lsqnonlin,
Should be function [c,ceq] = myNonlinearConstraints(x) V_sim= evalin('base','V_sim'); Vsim_max = max(V_sim); c(1) = x(...

3 years ago | 2

Answered
solution of a system of PDEs with finite difference method and runge kutta second order
Where is the x in your equations ? I only see differentiation with respect to t. And shouldn't the 2nd order differentiation in ...

3 years ago | 0

| accepted

Answered
I don't know how to include specific conditions in my code
a = [0 0 9 0; 0 0 1 8; 0 0 4 0; 0 0 2 3; 0 6 7 5]; z = lastzerorow(a) function z = lastzerorow(a) ...

3 years ago | 0

| accepted

Answered
Finite difference method for a system of pde
These kind of transformations are usually made to transform a system of PDEs to a system of ODEs that can be solved more easily....

3 years ago | 0

Answered
How to solve PDE with second order in the time derivative in Matlab?
You could try du/dt = v (1+t^2)*dv/dt +t*v = (1+x^2)*d^2u/dx^2 + x*du/dx du/dx = dv/dx = 0 at x = 0 % dv/dx = 0 is artifici...

3 years ago | 1

| accepted

Answered
I'm trying to do harmonic analysis, but it says that the t_get18consts function is not defined.
From https://www.eoas.ubc.ca/~rich/ (2019) I've modified v1.3b by running it through the matlab editor and fixing a lot o...

3 years ago | 0

| accepted

Answered
Solving linear systems in Matlab
x = A\(u-A*b) But it's the same as x = A\u - b

3 years ago | 0

| accepted

Answered
Efficient searching to find the first element of an array meeting a condition
"find" will use the "first" option by default which means that the command will return the first occurence of the event and will...

3 years ago | 0

Answered
Plot multiple graph after solving
syms y t g f1 = -2*g*t.^3/((1 - y).^(1-2*g)) + 2*g*(3 - t.^2)^2./((2 - t).*y.^(1-2*g)) + (8*g*t)./(y.^(1-2*g)) - 2*g*(3 - 2*t)....

3 years ago | 1

| accepted

Answered
Nested Numerical Integration with multivariable functions
d=.01; %1/e patch diameter; D=.35; %Aperture Diameter L=7e3; %Propagation distance; coeff=-11.64*(16/pi)^2*D^(-1/3); fun = ...

3 years ago | 1

| accepted

Answered
How to handle interface boundary condition in convection-diffusion reaction equation for pressure, velocity and concentration equation?
If the interface conditions are continuity of the variable and the flux, the finite element method will automatically respect th...

3 years ago | 1

| accepted

Answered
How to obtain an array of the indices from the original array when using nchoosek
You better get B from C, not C from B: A = [7, 8, 9]; v = 1:numel(A); C = nchoosek(v,2) B = A(C)

3 years ago | 1

Answered
How to find the intersection values of line and curve?
https://uk.mathworks.com/matlabcentral/answers/2009582-how-to-find-the-intersection-values?s_tid=srchtitle

3 years ago | 0

Answered
Integration with multiplication of whittaker and bessel function
MATLAB is not able to get an explicit antiderivative for "kr_real". That's why "int" returns the integral expression unchanged -...

3 years ago | 0

Answered
How do I fit two function in a same data at a time depending on the range ?
t = load("t.mat"); t = t.t; y = load("y.mat"); y = y.y; value_min = Inf; for i = 1:numel(t) fun1 = @(time)time.^2; ...

3 years ago | 0

| accepted

Answered
problem with fmincon: constraints are not satisfied
You cannot define your constraints in the objective function. Thus "c" and "ceq" are not used by "fmincon". To account for them,...

3 years ago | 1

Answered
Averaging data from seconds to three seconds because of different time variables
I'd repeat the data for 3 seconds three times. This does not manipulate your data with interpolation or averaging.

3 years ago | 0

| accepted

Load more