Respondida
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...

casi 3 años hace | 0

Respondida
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....

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 0

Respondida
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 ...

casi 3 años hace | 1

Respondida
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...

casi 3 años hace | 4

| aceptada

Respondida
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...

casi 3 años hace | 1

Respondida
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".

casi 3 años hace | 0

Respondida
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 ...

casi 3 años hace | 0

Respondida
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,....

casi 3 años hace | 1

| aceptada

Respondida
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 = ...

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 0

Respondida
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(...

casi 3 años hace | 2

Respondida
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 ...

casi 3 años hace | 0

| aceptada

Respondida
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) ...

casi 3 años hace | 0

| aceptada

Respondida
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....

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 1

| aceptada

Respondida
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...

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 0

Respondida
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)....

casi 3 años hace | 1

| aceptada

Respondida
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 = ...

casi 3 años hace | 1

| aceptada

Respondida
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...

casi 3 años hace | 1

| aceptada

Respondida
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)

casi 3 años hace | 1

Respondida
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

casi 3 años hace | 0

Respondida
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 -...

casi 3 años hace | 0

Respondida
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; ...

casi 3 años hace | 0

| aceptada

Respondida
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,...

casi 3 años hace | 1

Respondida
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.

casi 3 años hace | 0

| aceptada

Respondida
Plotting the outcome of a 3D fit
x = 0:0.1:1; y = -1:0.1:1; [X,Y] = meshgrid(x,y); Z = X.^2+Y.^2+0.1*(-1+2*rand(size(X))); [Xout,Yout,Zout] = prepareSurfaceD...

casi 3 años hace | 0

| aceptada

Cargar más