Beantwortet
How to add negative number to the and of rand function
What about x = [floor(10*rand(1,5)),floor(-9*rand)]; (Note: writing "round(rand(1,5)*9)" makes 0 and 9 half as probable...

etwa 10 Jahre vor | 0

Beantwortet
Using the floor function to separate numbers
Your mistake occurs at the line: secondary = (initial - initial2)*10; You should have written Secondary = k - ini...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
Double integral of 2 function products with limits in variables
You can move f(x) outside the inner integral and what remains of the inner integral can be expressed in terms of the cumulative ...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Vectorize for-loop that changes overlapping parts of an array
It isn't perhaps that you have a for-loop that is slowing you down so much as that your loop is repeating the writing of ones so...

etwa 10 Jahre vor | 0

Beantwortet
Intersection of two triangles
Just combine the 'polyxpoly' result with two applications of 'inpoly' to test if either set of triangle vertices lies within the...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
Selecting points which belong to parallel planes
It's a matter of simple vector analysis. Let P0 = [x0,y0,z0] be some base point on your principal axis and let n = [nx,ny,nz] b...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
How to reassign matrix if it is greater than some value quickly
M = a; M(M<b) = 0; M is your answer.

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
how to use fsolve function to solve the x, y equations without create another m. file?
I would recommend you reduce your system to one equation and one unknown by substituting "-b/a*x1+.5/a^2" for x2: f(x1) = ...

etwa 10 Jahre vor | 1

Beantwortet
Whats wrong with my quadratic formula?
Apparently you are trying to see how many seconds the object in question would take to return to earth. The velocity equation i...

etwa 10 Jahre vor | 0

Beantwortet
How can I traverse a circle while identifying given points?
Let P1 = (x1,y1), P2 = (x2,y2), P3 = (x3,y3) be the three points and their respective coordinates. Perform these computations: ...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Remove certain elements from a matrix
Or you just write: NewData = OldData(OldData(:,2)==0,:);

etwa 10 Jahre vor | 0

Beantwortet
How to add specific rows that meet a condition?
N = 1:26; C =sum(bsxfun(@times,bsxfun(@le,A,N),B));

etwa 10 Jahre vor | 0

Beantwortet
compare Vector and matrix
n = size(B,1); B0 = [-Inf(n,1),B]; B1 = [B,Inf(n,1)]; A1 = repmat(A,1,size(B,2)+1); test = double((B0<A1)&(A1...

etwa 10 Jahre vor | 0

Beantwortet
How to solve system Ax=0 under the constraint that sum(x)=1?
In order to have a nonzero solution to A*x = 0, the matrix A must be singular, that is, its determinant must be zero. If its ra...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
Mahalanobis distance dimension question
The reason is that matlab must compute the covariance of the matrix X and then find the inverse of this covariance matrix in ord...

etwa 10 Jahre vor | 0

Beantwortet
How to create a random data set from the possible values?
Let L be a column vector with eleven integers, each the count of the number of possible values in the corresponding set of the e...

etwa 10 Jahre vor | 0

Beantwortet
How to Findthe permutation matrices that produce another matrix?
Let the matrices A and B be n x n with B a permuted version of the rows and columns of A. s = 1:n; I = eye(n); [~,...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
I would like to make an equation to solve t when T_max is equal to 450
It is simple division: t = 450/dot(OAe,cross(R,[0;0;1])); (<-- Corrected)

etwa 10 Jahre vor | 1

Beantwortet
Subscripted dimension mismatch error dec2hex
The dec2hex(colordata(i,j),6) quantity is a string of at least six hex characters, and yet your are attempting to place it in a ...

etwa 10 Jahre vor | 1

Beantwortet
Matrix is singular to working precision.
The matrix xx.^2 is indeed singular by its very nature, since its rows are all alike. When you write yy.^2 / xx.^2 you are aski...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Because the plot command does not work? Matlab calculate improper integrals?
The problem here is that (-1)^(1/3) has three different possible roots, namely: 1/2+1/2*sqrt(3)*1i, 1/2-1/2*sqrt(3)*1i, and -1. ...

etwa 10 Jahre vor | 0

Beantwortet
How to find parameters of the following coefficient based on optimization tool?
Define the following sum of squares of differences: ew=[0.679 0.613 0.613 0.501 0.497 0.50 0.389 0.386 0.386 0.391 0.390 ...

etwa 10 Jahre vor | 0

Beantwortet
Could someone please help me create a three-column array?
Here is my guess as to what you mean: M = [mean(measles,1).', mean(mumps,1).', mean(chickenPox,1).']; Each value in M is th...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Bit missing after circular shift
Your result can be accounted for if your A row vector is a string vector of 1's amd 0's except that its first element is a blank...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
cannot find explicit solution symbolic equation
You have what appears to be two equations but only one unknown, namely 'lamb1'. You might try listing 'lamb3' as a second unkno...

etwa 10 Jahre vor | 0

Beantwortet
How to iterate through 4Th array dimension a summation over the first 3 dimensions
A = sum(reshape(S,3*3*4,181),1); This will give you a vector with 181 elements, each being the sum over all the first thre...

etwa 10 Jahre vor | 0

Beantwortet
how to store the each values of x and y in the following loop so that i could plot graph x vs y ?
Change the two lines x=bc(1); y=bc(2); to: x(object)=bc(1); y(object)=bc(2); If 'stats' is large it ...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
how can i specify a parameter for each element of a random matrix?
Let Imin and Imax be n x m matrices in which Imin(i,j) is to be the lower limit for a(i,j) and Imax(i,j) its upper limit. ...

etwa 10 Jahre vor | 1

Beantwortet
Adding multiple elements from an array
A(1:9:55) = 0; v = sum(A,1);

etwa 10 Jahre vor | 0

Beantwortet
How to get a 3-D matrix out of my code.
doppler = repmat(reshape(frequency.',80,1,780),1,5512,1) .* ... repmat(reshape(c./(c+v_doppler.'),80,5512,1),1,1...

etwa 10 Jahre vor | 0

| akzeptiert

Mehr laden