Respondida
Multiple 3d random walks
lambda = 3; %Mean free path numberOfSteps = 10000; % Total number of steps numberOfPaths = 3; % Number of paths x(1,:) = ra...

más de 3 años hace | 1

| aceptada

Respondida
Laplace Inversion Of Bessel Function
Try the numerical way of finding the inverse Laplace transform: https://de.mathworks.com/matlabcentral/fileexchange/39035-numer...

más de 3 años hace | 0

| aceptada

Respondida
Error using / .
If T is an array of multiple temperatures, you have to use elementwise division: k = k0 * exp((-Q) ./ (R*T)) instead of k = k...

más de 3 años hace | 0

Respondida
How to implement this coupled ODE
clc,clear,close all global Ve Cd A_r g g = 9.8; % m/s^2 Cd = 0.47; r = 3.7; % m A_r = pi * r^2; rho_fuel = 1000;...

más de 3 años hace | 0

Respondida
Solving ODE with boundary conditions
You have a first-order ODE. For first-order ODEs, you can prescribe one boundary condition, not two. Or one of the parameters ...

más de 3 años hace | 1

Respondida
Help with non linear equations.
fun = @(x)[8.07-(x(1)-x(2)+x(2)*0.9^(-1/x(3)));11.82-(x(1)-x(2)+x(2)*0.5^(-1/x(3)));284.23-(x(1)-x(2)+x(2)*0.1^(-1/x(3)))]; x =...

más de 3 años hace | 1

| aceptada

Respondida
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
k1=180; k2=50; k3=220; knew=linspace(k1*0.4,k1*1.6,20); m1=1.1; m2=3.4; for i=1:length(knew) K{i}=[knew(i)+k2,-k2;-k2,...

más de 3 años hace | 0

Respondida
How do i plot two graphs in the same figure without it telling me that the vectors must be the same length?
Use figure; scatter(Stroom,Spanning_fit); hold on Stroom1 = 0:5:140; Spanning_fit = Stroom1*...

más de 3 años hace | 0

| aceptada

Respondida
Passing arguments through a function
x = -5:1:5 disp(TopFunction(@(x)lin(x,1,2),x)) disp(TopFunction(@(x)square(x,1),x)) function y = TopFunction(func,x) y = f...

más de 3 años hace | 0

Respondida
Why is my code showing output as an array instead of single value?
If your inputs and the variable t are scalar values, A cannot be an array. My guess is that you specified t as a vector. %A ch...

más de 3 años hace | 0

Respondida
error because "pkg load symbolic"
In MATLAB, you don't need to load a package: pkg load symbolic This is an octave command. In MATLAB, either you have a licenc...

más de 3 años hace | 0

Respondida
solving system of non-linear equations for array of variables gives 0x1 syms
The numerical solver does not find a solution. Are you sure a solution exists ? epsilon0 = rand(3,1); P = 0.05; options = op...

más de 3 años hace | 0

Respondida
Why does .* create a matrix when multiplying a row vector by a column vector
Why does this happen? After some reading I learned matlab has 'implicit expansion' which is what I assume is happening. But I gu...

más de 3 años hace | 1

Respondida
using a Monte Carlo simulation with 100,000 trials to find the probability of a random integer that is larger than the other random integer in [4,21]
A > B, and A >= B. I think the right code is supposed to plot a figure with a blue line and a red line, and there should be 100,...

más de 3 años hace | 0

Respondida
Controlling state transition using transition probability matrix in Markov chain?
I understood that if my current state is 2 and if transition probability is 0.4 then from TPM my next state will also be 2. Th...

más de 3 años hace | 0

Respondida
gamultiobj constraints without any mathematical relation with variables
Use an output function "OutputFcn" specified in the options structure of the solver. Within this function, you can calculate "a...

más de 3 años hace | 1

Respondida
fzero not working with nested functions and mvncdf
r = 0.03; d = 0.06; sigma = 0.2; V0 = 100; L = 40; VB = 0.6*L; TL = 10; T = 1; a = (r - d - sigma.^2./2)./(sigma.^2); K...

más de 3 años hace | 0

| aceptada

Respondida
strange solution of an equation by Symbolic Toolbox
A MATLAB error. A second "solution" is computed that does not solve the equation. MATLAB needs to square your equation several...

más de 3 años hace | 0

Respondida
Find minimum value of a function with 4 parameters
distanceAntenes = @(x) -sqrt((x(3)-x(1))^2+(x(4)-x(2))^2); x = fmincon(distanceAntenes, [5 6 3 7],[],[],[],[],[0 0 0 0],[10 10 ...

más de 3 años hace | 0

Respondida
I have a line of experimental data and need to plot confidence interval
N = size(y,2); instead of N = size(y,1);

más de 3 años hace | 0

Respondida
does anyone know how to solve these two problems?
One way to solve the two problems: https://de.mathworks.com/help/symbolic/sym.piecewise.html

más de 3 años hace | 0

Respondida
Arrays have incompatible sizes for this operation
You should look up characters and if-statements in the documentation. clc; clear; %This function is will determine the rate o...

más de 3 años hace | 1

Respondida
How to take the sum of a series of variables to a limit?
What's the underlying function with these Fourier coefficients ? %% Fourier coefficients a_(10) = (6)/(20*pi)*exp(pi/2); a_(9...

más de 3 años hace | 0

Respondida
Use Ode 45 in Chua's system with non linear function need to be solved but I don't know how iterate the non linear function in loop?
[t,x] = ode45(@chua_function,[0 150],[0.1 0.1 0]); plot3(x(:,1),x(:,2),x(:,3),'r') title(" Chua's circuit") xlabel('x') ylab...

más de 3 años hace | 1

| aceptada

Respondida
Finding the root of a function between an interval
format long y = @(x) 1 - sin(x); z = @(x) x.^2; test1 = @(x) y(x)-z(x); x = fzero(test1,[0 1])

más de 3 años hace | 0

| aceptada

Respondida
Creating a script with multiple conditions and equations
T = @(T_ute) (36.44 - 0.64*T_ute).*(T_ute<-4) + 39*(T_ute>=-4 & T_ute<=4) + (43.26 - 1.06*T_ute).*(T_ute > 4 & T_ute <=21) + T_u...

más de 3 años hace | 0

Respondida
Some Problems related to linear equation and elliptic equation
syms a b x y k m eqn1 = x^2/a^2+y^2/b^2==1; eqn2 = y==k*x+m; eqns = [eqn1 eqn2]; [x,y] = solve(eqns,[x,y]) P1 = [x(1),y(1)...

más de 3 años hace | 1

| aceptada

Respondida
Solving linear system with constraints
x0 = 2; sol = fmincon(@obj,x0,[],[],[],[],[],[],@nonlcon) function value = obj(x) value = -x; end function [c, ceq] =...

más de 3 años hace | 1

Respondida
Euclidean distance between the rows of the matrix and the vector
A = rand(30,4800); B = rand(1,4800); C = sqrt(sum((A-B).^2,2))

más de 3 años hace | 0

Respondida
How can I calculate vector relative errors in percent?
x = rand(100,1); ms = mean(x); vs = var(x); relative_error_ms_in_percent = abs(ms-0.5)/0.5 * 100 relative_error_vs_in_percen...

más de 3 años hace | 0

Cargar más