Answered
I want to generate uniform distribution of points on the surface of a sphere
https://de.mathworks.com/matlabcentral/fileexchange/37004-suite-of-functions-to-perform-uniform-sampling-of-a-sphere

4 years ago | 0

Answered
I am trying to get values for my lagrange interpolation. Can someone help me out and explain what im doing wrong here?
x = [1, 2 ,3 , 4, 5, 6] y =[ 1.5, 3,6,11,15,17] h = .1 n = length(x)- 1; points = []; xpVal =[]; for m= 1:n +1 xp = ...

4 years ago | 1

| accepted

Answered
First column matrix into ones
X = [1 4; 2 2; 3 6]; X(:,1) = 1 or y = ones(size(X,1),1) depending on how your question is meant.

4 years ago | 0

| accepted

Answered
Non Dimensionalization Of Self Similar Curves
s = 2:10 f = @(x,a)exp(-((x-60)/a).^2) x = 40:0.01:80; for i = 1:numel(s) fnum(:,i) = f(x,s(i)); end plot(x,fnum) By ...

4 years ago | 2

| accepted

Answered
accessing single function from an array of functions
f = {@(t) t, @(t) exp(t), @exp} % the second and third are equivalent SecondFunction = f{2}; ValueOfSecondFunction = SecondFun...

4 years ago | 0

| accepted

Answered
Can someone help me with this integration
THETA_S = 0:0.1:pi/2; for i = 1:length(THETA_S) theta_s = THETA_S(i); f1 = @(theta_v,phi) ((((1/(2.*pi)).*((pi-phi).*...

4 years ago | 1

| accepted

Answered
Boundary conditions for Catenary (hanging cable), solve for 3 unknown constants (c1 c2 c3)
The equations "fsolve" must solve for c are (1) c(3) + c(2)*cosh((L(1)-c(1))/c(2)) - L(2) = 0 (2) c(3) + c(2)*cosh((R(1)-c(1))...

4 years ago | 1

| accepted

Answered
BVP4C, differential equation for beam deflection
This is the solution for w(0)=w'(0)=0: M = [50 40 30 20 10 0]; I = [1 1 1 2 2 2]; E = [190e9 190e9 100e9 100e9 100e9 100e9]; ...

4 years ago | 0

Answered
I have a path of a vehicle going in concentric circles. There is some deviation in the circles due to various errors. How do I get an average circular path?
Use" lsqnonlin" to fit your (x,y) data to the equation (x-xc).^2+(y-yc).^2-r^2 = 0. The parameters "lsqnonlin" will determine a...

4 years ago | 0

Answered
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Nx=50; Ny=50; Mx=20e-9; My=20e-9; x=linspace(-Mx/2,Mx/2,Nx); y=linspace(-My/2,My/2,Ny); Vb1=...

4 years ago | 0

Answered
Computing the jacobian of an anonymous function - MATLAB
Why not simply using "fsolve" to calculate steady state ? For "fsolve" to work, you only have to supply the function ModelRHS -...

4 years ago | 1

Answered
Why is the error appearing? How to solve it? "Error using optimfcnchk If FUN is a MATLAB object, it must have a feval method"
function main % Limits LB = [0.0485 0.0365 0 0 0]; UB = [0.055 0.039 24 0.7 2.5]; % Optimization parameters X0 = [0.05 0....

4 years ago | 0

| accepted

Answered
Issue with 4 equations with 4 unknowns
syms a b c d equation1=2*(c*a-c)==(-.650034*a); equation2=2*(c*b+(1.95*d))==.0271656*b; equation3=(.6*d)+(3.3*b)==1; equatio...

4 years ago | 0

| accepted

Answered
Solving a system of 2 ODEs with Implicit Euler Method? Please Help!
As you can see from the plot obtained from ODE15S, there are discontinuities in the solution of the ODE. I don't think you will...

4 years ago | 0

Answered
I am trying to find the roots of this equation but my code doesn't work. It keeps saying theta0 is unrecognized,
function main theta0 = 0; theta = fzero(@f,theta0) end function res = f(theta) y0 = 2; yf = 1; v0 = 20; x =...

4 years ago | 0

Answered
optimization for min and max values of a parameter
function main Angmin = -30*pi/180; Angmax = 30*pi/180; A =[]; b = []; Aeq =[]; beq= []; lb = [-Inf -Inf -I...

4 years ago | 0

Answered
Converting symbolic matrix to numeric matrix with while loop
First solve the equations for all variables involved being scalars: syms N1 N2 N3 N4 N5 N6 a2sym a3sym a4sym a5sym a6sym S1sym ...

4 years ago | 0

| accepted

Answered
estimate the relative sensitivity coefficients
% TODO - Write the function declaration. Name the function SIRmodel tRange = [0 100]; % Initial condition Y0 = [0;0]; % Para...

4 years ago | 0

Answered
Matlab doesn't run
n = -5:0.01:5; x21 = exp(-abs(n)); X_21= @(w) sum(x21.*exp(-j*w*n),2); w = linspace(-2*pi,2*pi,100).'; plot(w,abs(X_21(w)));...

4 years ago | 0

Answered
Root LP problem is unbounded.
Yes, I can see it with my naked eye that you can make the objective function as big as you like. Take x(1) = 1e100, x(2) = 1e10...

4 years ago | 2

| accepted

Answered
Different error calculation between Finite Element Method's numerical solution and exact solution
xvec = linspace(0,pi,9); f1 = @(x)(interp1(xvec,usol,x,'linear') - sin(x)).^2; l2_error = sqrt(integral(f1,0,pi)) for the L2-...

4 years ago | 0

Answered
Generate Lognormal distribuition with normrnd
If X is normal distributed with parameters mu=0 and sigma, then Y = 10^(X/10) = exp(X*log(10)/10) = exp(X/sigma * sigma*log(10...

4 years ago | 0

| accepted

Answered
How to perform integration of product of multiple function inside a for loop?
for a=1:num x=depth(a); Photon_flux=@(lambda)((A*((((h*c)/lambda)^2)/(exp((((h*c)/lambda)/(k*Ts)))-1)))*q); ...

4 years ago | 1

| accepted

Answered
help solving polynomial equation
det(H) is a polynomial of degree 10 in w. Since the roots of polynomials of degree > 4 can't explicitly be given, you will have ...

4 years ago | 0

Answered
Why do I receive "Error using daeic12 (line xx) This DAE appears to be of index greater than 1." when using dae solver ode15s?
With the ODE15S solver in octave, the second code also works and gives the correct results: function main N_EQ = 5; % numb...

4 years ago | 1

| accepted

Answered
ODE solver-using initial conditions in events function
If you want to use the event option, you can pass x(0) as an additional argument to the event function function and return contr...

4 years ago | 0

| accepted

Answered
Finding all possible combinations of objects
Brute force: n1 = 83; n2 = 50; n3 = 125; n4 = 35; nsol = 0; for i = 0:n1 for j = 0:n2 for k = 0:n3 ...

4 years ago | 0

Answered
working on a simple vector addition but every result in the loop shows up, even after i allocate memory. can someone please help me out? thanks a lot
A = [7 21 30 40]; B = [11 4 14 6]; [rows, columns] = size(A); D = zeros(size(A)); for i = 1:rows for j = 1:columns ...

4 years ago | 0

Answered
Array as input for symbolic function
gamma = 1.4; syms A_ratio M eq1 = A_ratio == ((gamma+1)/2)^((gamma+1)/(2*(gamma-1)))*((1+(gamma-1)/2*M^2)^((gamma+1)/(2*(gamma...

4 years ago | 0

| accepted

Load more