Beantwortet
How to plot Trajectories of simple mechanism
The trajectory you speak of is, in effect, one of the two points of intersection of two circles of radius 2*r whose centers are ...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
How to write the anti natural logarithim of this function?
u(a,b) = exp(2.20-3.40*a^2+4.50*b^3)

mehr als 9 Jahre vor | 1

| akzeptiert

Beantwortet
Solve Equation Using a Loop?
1. In computing a, d, and M2sol you need to use M1(i) instead of M1. 2. Using the ‘solve’ function here has the problem that ...

mehr als 9 Jahre vor | 0

Beantwortet
If I have an equation such as x(theta) = z0 + v*tan(theta) - c/(v^2*cos(theta)^2), how would I be able to use MATLAB to find theta(z) given that v, c, and z0 are known quantities. I think this is a transcendental equation.
Assuming Walter’s guess is correct, you are attempting to solve for theta as a function of x for the equation x = z0 + v*ta...

mehr als 9 Jahre vor | 0

Beantwortet
Could someone please help me speed up my code?
It is the repeated ‘mean’ of 24008 elements at a time taken 13978444 times that is the time-consuming aspect of your computation...

mehr als 9 Jahre vor | 1

Beantwortet
integro-differential equation?
You should solve this using one of the ‘ode’ numerical differential equation functions for a second order equation in the ordina...

mehr als 9 Jahre vor | 0

Beantwortet
Angles between 3D vectors in groups
It is not necessary to rearrange your A and B arrays. Just use the three-argument forms of ‘cross’ and ‘dot’, so they operate a...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
Why rand function is not uniform in large intervals?
It seems clear from his most recent comment that where Pankaj says “uniform” he actually means a "logarithmic" distribution wher...

mehr als 9 Jahre vor | 1

Beantwortet
How to know the step time inside the function that integrated by ode45?
You might be interested in a comment made in <http://www.mathworks.com/help/matlab/ref/ode45.html> “If tspan contains two ...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
Efficiently Swapping Columns in a Matrix
It is possible that matlab accomplishes A(:,[i j]) = A(:,[j i]); by the compiler equivalent of t1 = A(:,i); t2 = A(:,j...

mehr als 9 Jahre vor | 0

Beantwortet
I want to create a 3D mesh that looks like this
That is exactly what matlab’s ‘interp2’ is designed to do. Read about it at: http://www.mathworks.com/help/matlab/ref/int...

mehr als 9 Jahre vor | 0

Beantwortet
I need help with imaginary numbers!
You should understand that matlab’s “<“ operator only tests the real part of a complex number. For a pure imaginary number it wo...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
How to calculate the limit of an integral?
Assuming you already know the numerical values of rho, P(K-1), alpha, r0, r, and the function f(x,r), you should be able to solv...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
How to add two loops for two variables in a nonlinear ode
This particular equation can be solved by ordinary calculus methods. It has the three possible analytic forms: 1) For y >...

mehr als 9 Jahre vor | 0

Beantwortet
Debug while statement with iterative
As far as I can see, your equations are entirely linear, and therefore you can solve them very fast using matrix division. Prep...

mehr als 9 Jahre vor | 1

Beantwortet
division of large size matrix
Writing B = A\C is equivalent to writing A*B = C, but for matrices of your size this amounts to trying to solve 49 linear equati...

mehr als 9 Jahre vor | 1

Beantwortet
How can I plot a 3D plane knowing its center point coordinates and its Normal
Using Dr. Siva’s notation with the point at (x1,y1,z1) and normal vector v = [a,b,c], (v should be a row vector,) you can plot a...

mehr als 9 Jahre vor | 4

| akzeptiert

Beantwortet
Draw random number from Normal distribution past a threshold value
If your normal distribution without the truncation would have been mean = mu and standard deviation = sig, then do this: r...

mehr als 9 Jahre vor | 1

| akzeptiert

Beantwortet
Having problems with loops
You can use a second-order approximation for your derivative as follows. If x are the numbers in the first column and t the tim...

mehr als 9 Jahre vor | 0

Beantwortet
if statement question on two variables
Try this: format hex f_x2(k) f_gbest You might be surprised by the result. Or else you can do this: fpri...

mehr als 9 Jahre vor | 0

Beantwortet
How do I find values that make up a desired linear combination of vectors?
There are infinitely many choices for x and y. Your inequalities can be reduced to: 0 < x < y < 2*x Any pair of x and y...

mehr als 9 Jahre vor | 2

| akzeptiert

Beantwortet
How to vectorize matrixvector multiplications with previous-dependent input?
The for-loop can be eliminated, but I doubt that it will save you any time. K = 200; Xi = 50; l = 0.311; t = [...

mehr als 9 Jahre vor | 2

| akzeptiert

Beantwortet
fzero runs out of iterations
You should try giving ‘fzero’ an x0 (estimate) value in the form of a two-element vector such that the function is of opposite s...

mehr als 9 Jahre vor | 0

Beantwortet
How to pick well known points on a sphere ?
The problem is with the line “i = n+1” in your function. It is located inside the inner loop whose index is n. This means that...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
How can I draw a sin line with use of the Maclaurin rule? What did I do wrong?
The quantity x has not been defined in your code, so the plot plot(x,y(k)) won’t work. Even though you had “for x = 0:...

mehr als 9 Jahre vor | 0

Beantwortet
how to solve the error "Operands to the || and && operators must be convertible to logical scalar values."?
The quantities g1, g2, and g3 each have more than one element in them. You cannot use the short-circuit ‘&&’ and ‘||’ for such ...

mehr als 9 Jahre vor | 0

Beantwortet
How to get a matrix in a for bucle
How about creating a 6 x 2 matrix: y = zeros(6,2); for k = 1:3 x = x + 2; y(2*k-1:2*k,:) = x; end Questi...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
what does matlab do in A/b if both matrices are 1x4 matrices in order to come up with a number ???
When you write x = A/b, it is like writing x*b = A, and for this to make sense in your situation as far as size is concerned x m...

mehr als 9 Jahre vor | 1

Beantwortet
How to find equation level?
The key to solving such a problem is that the point A’ must not only satisfy the equation for the plane (one equation) but the v...

mehr als 9 Jahre vor | 0

Beantwortet
matlab code for iterative equation
If you like the lazy approach to problems, note that if abs(T) < 1, you can rewrite your equation as: x(k+1)-b = T*(x(k)-b...

mehr als 9 Jahre vor | 0

Mehr laden