Respondida
Why ''int'' and ''integral'' return different answers
Your function has singularities at x = 0 and x = 1. Integral doesn't manage to estimate the area under the curve (which goes t...

casi 4 años hace | 0

Respondida
Need help understanding where to use the . when writing equations.
Read https://de.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html to understand. Dots are set for element...

casi 4 años hace | 0

| aceptada

Respondida
Solving for two variable.
I = [7.53*10^(-5) 3.17*10^(-4) 1.07*10^(-3) 3.75*10^(-3) 1.35*10^(-2) 4.45*10^(-2) 1.75*10^(-1) 5.86*10^(-1)]; U = [0.50 0.55 0...

casi 4 años hace | 0

Respondida
Newton's Method missing value
If n is the number of Newton steps, you must start with n = 0 instead of n = 1 in "Newtons_method". I counted the number of New...

casi 4 años hace | 0

Respondida
Solving system of two (non)-linear eqautions multiple times using a for loop
%% constants rho = 1.3; D = 0.126; %% choose W = 2600; RPM = 6000; Omega = RPM*((2*pi)/60); i = 1500:1000:4500; %Solutio...

casi 4 años hace | 0

Respondida
Don't get what is happening in matlab sin() function. need to know difference between sin(2*50*pi*t) and sin(2*1*pi*t)
t1 = 0:0.001:1; x = sin(2*50*pi*t1); t2 = 0:0.1:1; y = sin(2*1*pi*t2); subplot(2,1,1) plot(t1,x) subplot(2,1,2) plot(t2,y...

casi 4 años hace | 3

| aceptada

Respondida
Get array of elements based on occurrences of another vector
y=[0;1;2;3;4]; x=[1;1;2;2;2]; z{1} = y(x==1); z{2} = y(x==2); z{1} z{2}

casi 4 años hace | 1

| aceptada

Respondida
Divergent solution using ode45
We don't know the reason - technically, your code is correct. Although I would change it as shown below. What makes you think t...

casi 4 años hace | 1

Respondida
Interpolation for 2 dependent output data
Why is there an 181x2 double matrix for each input value ? If there are only two doubles for each input, first use interp1 for...

casi 4 años hace | 0

Respondida
I have a csv file (2 variables) saved to my computer and all I want to do is import it to matlab and plot it - how do I do this (sorry I am a beginner)?
One of these methods should work, I guess: https://de.mathworks.com/matlabcentral/answers/72545-how-to-import-csv-file-in-matla...

casi 4 años hace | 0

Respondida
plotting graph for Equation with constraints
Use (y.^2)+(x.^2)=1 ((x.*y).^2)+(-P).^2=1 to write x,y as functions of P. Then insert these expressions in T = P.*x+1.5*x....

casi 4 años hace | 0

Respondida
adding or subtracting depending on the number
rng ("default") amount = 0.5; variable = 5; number = 1; r = rand; if r >= amount variable = variable - number; else ...

casi 4 años hace | 0

Respondida
plotting graph for Equation with constraints
Use (y.^2)+(x.^2)=1 ((x.*y).^2)+(-P).^2=1 to write x,y as functions of P. Then insert these expressions in T = P.*x+1.5*x....

casi 4 años hace | 0

Respondida
Finding root of nonlinear functions
f = @(y)(y-0.8193318913*tanh(y)).*(0.7500000000e-3*y.^2-0.1622336517e-1)+0.2931044702e-2*tanh(y); fun = @(y)f(y)./(0.7500000000...

casi 4 años hace | 2

| aceptada

Respondida
Constrained linear least-squares problems, with unknowns in multiplier matrix
You must use a nonlinear optimizer (in this case: fmincon) because products of the parameters to be estimated are involved (b*V,...

casi 4 años hace | 0

| aceptada

Respondida
Mulitpling diffrent scalars to diffrent numbers in a matrix
Check your resulting vector. According to your rules, it is wrong. v = [1 6 3 17 30 7 10 4 25 27]; s = 17*ones(1,numel(v)); s...

casi 4 años hace | 0

Respondida
Integration of a vector inside function for ode45
In the code below, x(3) = integral_{tau=0}^{tau=t} -0.01*x(1) dtau t=0:0.01:10; in=pi/2; indxdt=0; [t,x]= ode45(@(t,x) slmc(...

casi 4 años hace | 0

| aceptada

Respondida
Gradient Descent Implementation on a function, as opposed to an equation
Use fun = @(x)ErrorFunction(x(1),x(2),x(3),x(4),x(5),x(6)) as the function handle you work on in the steepest decent.

casi 4 años hace | 0

Respondida
How to not use for loop
function dfdx = ddx(f, h) dfdx = gradient(f,h); end

casi 4 años hace | 1

Respondida
Surface data cloud fitting to even asphere model
% your data x = ...; y = ...; z = ...; p0 = [...]; % initial guess for R and kappa p = lsqnonlin(@(p)fun(p,x,y,z),p0) ...

casi 4 años hace | 0

| aceptada

Respondida
my limits wont work
syms x lim1= [nthroot(x^6+8,3)/4*x^2+nthroot(3*x^4+1,2)] limit(lim1,x, Inf)

casi 4 años hace | 0

Respondida
Output is giving me Empty sym: 0-by-1
f=1995.26; z=71440; seta=-77.04; syms c R; eqns = [ tand(seta) + 1 / ( 2 * pi * f * c * R ) == 0, z^2 - 1 / (R^2 + ( 2 * pi...

casi 4 años hace | 0

| aceptada

Respondida
What is the best function of the following shape?
x = -2:0.01:2; plot([x,x(end)],[1/pi*atan(2*x)+1/2,1/pi*atan(2*x(1))+1/2]) xlim ([-3 3]) ylim ([0 1])

casi 4 años hace | 2

Respondida
Plotting a function that performs a sum.
f = @(x,y,z) sum(sin((3:15).*sqrt(x*y))+z); x = linspace(0,1,100); y = 0.5; z = 0.1; plot(x,arrayfun(@(x)f(x,y,z),x)) But i...

casi 4 años hace | 1

| aceptada

Respondida
Can I use the in-built function 'mle' for Maximum Likelihood Estimate that maximizes the log-likelihood of a vector in MATLAB for this purpose?
x=[vector(1:L)]; pd = fitdist(x,'Normal'); nll = negloglik(pd)

casi 4 años hace | 0

Respondida
symbolic function of a symbolic vector variable
y = [-1, 2, -1]; syms f(z) z = sym('z',[1 3]); f(z) = y + z f(1,2,3)

casi 4 años hace | 0

Respondida
How to constrain the resulting equation from a polynomial surface fit to a positive range?
Use "lsqlin" and put the constraints p33(x(i),y(j)) >= 0 for all (i,j)-combinations. These constraints can be put as A*coeffs...

casi 4 años hace | 0

Respondida
4 Nonlinear equations solve for 4 variables
%Initial guesses E1o = 0.00009; E2o = 0.00009; E3o = 0.0009; Noio = 0.1; X0 = [E1o; E2o; E3o; Noio]; %call fsolve fu...

casi 4 años hace | 0

Respondida
Estimate for Residual variance function calculation
x = normrnd(10, 1, 1, 100); y = 1 + 2 .* x + normrnd(0, 1, 1, 100); n = 100; xBar = mean(x); yBar = mean(y); %slope sxy = ...

casi 4 años hace | 0

Cargar más