Answered
how to plot this function?
f = @(x) abs(x)<=pi/2; x = linspace(-pi,pi,200); plot(x,f(x))

4 years ago | 0

Answered
how to derivate a polynomial with x , y and z terms
how polyder function would work in this case? Your function is not a polynomial ; thus it doesn't work. "polyder" works on vec...

4 years ago | 0

Answered
A question for orth
Can you get an integer vector for the orthonormal basis of range(A) (thus with length 1) ? Answer: No. Further, range(A) is not...

4 years ago | 0

Answered
How to modify built-in function tolerance for 'lsqcurvefit'?
FunctionTolerance and StepTolerance are the parameters in the options-structure you can play with.

4 years ago | 1

| accepted

Answered
I need to multiply each element of a vector of five values by another vector 2000 values.
Transpose the theta vector.

4 years ago | 0

| accepted

Answered
Hello Matlab! I would love to find a solution to this error
Something like this ? f = @(a,b) (cos(3.86*a)+cos(3.86*b)); g = @(a,b) (cos(1.93*a)*cos(1.93*b)); T = @(a,b)[2.86*sqrt(6)+2.5...

4 years ago | 0

Answered
How to use the SUM() function..?
Did you create a MATLAB function with name sum.m ? If yes, rename it.

4 years ago | 0

Answered
Count occurances on multidimensional matrix with multiple criteia on different dimnesions
A = zeros(3,4,2); A(:,:,1)=... [90 95 90 80 70 90 95 70 60 90 90 60]; A(:,:,2)=... [1 1 1 1 2 2 2 2 1 2 1 1]; occur...

4 years ago | 0

Answered
Prolate spheroid surface area
I calculated the surface area of a sphere of radius 1 which should be 4*pi. The below formula from WolframAlpha seems to work ...

4 years ago | 0

Answered
Solve system of equations with two unknowns (should be the smallest rational number possible)
Easy for a,b real: a = b = sqrt(k). More involved for a,b rational. For a,b real it can be solved as an optimization if you d...

4 years ago | 0

Answered
How to calculate the intersection point of lines on a loglog graph.
eprime=0.59; sigmaprime=277500; %Constants for Manson Coffin Equation b=-0.087; c=-0.58; %Young's Modulus E=30*10^6; ...

4 years ago | 1

| accepted

Answered
i need to get my variable y to vary....as its a key variable for this entire system. i cant seem to find a way. would you help me in that regard...
In x0, set y to the value you want. In PBR, set dxdW = [dnNO_dW; dnH2_dW; dnN2_dW; dnH2O_dW; dnN2O_dW; dnO2_dW; 0.0; dT_dW]; ...

4 years ago | 0

Answered
Calculate the area and volume of revolution based on some data points
y = [0,38.161563,39.751307,40.878082,42.701189,44.524296,45.047229,45.990198,46.933167,46.785121,... 46.225562,41.318857,36...

4 years ago | 2

| accepted

Answered
How to use "poissrnd" function?
lambda = 4 What is the unit of lambda ? Mean number of arrivals per minute ? And you want to get a random vector for arrivals...

4 years ago | 0

Answered
Store prime and non-prime numbers
x=[1:50]; x=x'; jj=0; %index for prime_num nn=1; %index for nonprime_num p=[]; np=[]; np(1) = 1; for i=2:length(x) i...

4 years ago | 1

| accepted

Answered
Can someone explain to me how to code the Tangent line and Normal line
https://de.mathworks.com/matlabcentral/answers/1816450-can-someone-tell-me-how-will-i-be-able-to-remove-the-error-in-this-script...

4 years ago | 0

| accepted

Answered
Extract values from one matrix and with iteration solve the system of linear equations
B = rand(3,3); A1 = 4; rhs = -A1*B(1,:).'; Mat = [-ones(3,1),B(2:3,:).']; sol = Mat\rhs; C1 = sol(1) A2 = sol(2) A3 = s...

4 years ago | 0

Answered
I get "vectors must be the same length". How come?
How do you want to plot a vector of length 302 against a vector of length 352 ? It's not possible. x1 = 0:0.1:5; x2 = 5:0.1:35...

4 years ago | 0

Answered
Is there any way to find the row with closest values in matrix with a given array values?
How do you define "closest" ? The Euclidean distance between array and rows of the matrix ? Then you can use mat1 = [1.0000 ...

4 years ago | 0

| accepted

Answered
linear combination of vector and permutation
values = [-1 1]; %// data k = 3; %// data n = numel(values);...

4 years ago | 1

| accepted

Answered
a simple calculation by each row
Take ^(1/eta) of both sides of the equations. You get linear equations in x. Solve them. See solution above.

4 years ago | 1

| accepted

Answered
Does MATLAB have inverse tangent integral TI2(z)?
format long x = 0.5; Ti2 = 1i*( -dilog(1-1i*x) + 0.25*dilog(1+x.^2) ) Ti2_compare = integral(@(x)atan(x)./x,0,x)

4 years ago | 0

Answered
matlab not using the variable i give it in differential equation
syms k N t P(t) knum = 0.025; Nnum = 1000; sol = simplify(dsolve(diff(P,t)==k*P*(1-(P/N)), P(0)==200)) sol = subs(sol,[k N],...

4 years ago | 0

Answered
Failure in initial objective function evaluation. FSOLVE cannot continue.
fun = @root7d; x0 = [10,10]; x = fsolve(fun,x0) fun(x) function F = root7d(x) %parameters vp=100; kp=0.5; q=1;...

4 years ago | 0

| accepted

Answered
problem using the solve method
syms t eqn = 1000/(exp(log(4) - t/40) + 1) == 800; tsol = vpa(solve(eqn, t))

4 years ago | 0

| accepted

Answered
How can I fix "Error in sym/subsref (line 898) R_tilde = builtin('subsref',L_tilde,Idx); ?
KgQ(indiciesQ,indiciesQ) = KgQ(indiciesQ,indiciesQ) + subs(KeQ,[x1Q x2Q x3Q], [xQ(i*2-1) xQ(i*2) xQ(i*2+1)]); % Ke into Kg contr...

4 years ago | 0

Answered
Solving 3 equations with 3 unknowns
No problem. A = [2*sqrt(44.4) 0 0; 2*sqrt(34) 2*sqrt(3.92) 2*sqrt(57.4);2*sqrt(21.8) 2*sqrt(25.5) 2*sqrt(25.5)]; b = [52.11;52...

4 years ago | 1

| accepted

Answered
If I had the derivative of an equation and had data points how would I plot them
d = @(x)1 - sin(x)./(2*sqrt(x)) - sqrt(x).*cos(x); x = [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0]; plot(x,d(x))

4 years ago | 0

| accepted

Answered
All combinations of the sum of 2 columns
a = [29;31;34].' ; b = [31;31;31] ; x = b-a xmax = max(x(:))

4 years ago | 1

| accepted

Load more