Answered
X = a strophoid x=a(t2-1)/(t2+1), y=at(t2-1)/(t2+1), a>0, t=[-a,a].how to build a curve y (x) on the specified view.(blue dotted with marker type square)
On your line 4. you left out a dot. You should have: y = a*t.*(-1+t.^2)./(1+t.^2); However this will only give you two...

10 years ago | 1

| accepted

Answered
problem with randsample when array with one element
That's what it is supposed to return. Read the website: http://www.mathworks.com/help/stats/randsample.html which stat...

10 years ago | 0

Answered
Column size mismatch error using pdist2
You have taken the transpose of 'condition1oder2' which gives it 36 columns. That's a no-no for 'pdist2'.

10 years ago | 1

Answered
How can I insert a row in the middle of a matrix/vector?
Suppose you want to insert the column vector y in the column vector x starting at index ix. x = [x(1:ix-1);y;x(ix,end)]; ...

10 years ago | 2

Answered
How to write the equivalent of an 'until loop' in matlab?
To reproduce the equivalent of repeat --- until in C, do this: b = true; while b do the loop computations ...

10 years ago | 2

Answered
Calculating mixed partial derivatives of a function A(x,y)
syms x y f(x,y) = x*sin(y); d2fdxdy = diff(diff(f,x),y); % = cos(y) Another way is: syms x y diff(x*sin(...

10 years ago | 1

| accepted

Answered
Please I need the codes to how I can solve a random linear system of size n x n, using the tic and toc statements to fi nd how the Matlab linear solver scales with the problem size n.
The "n by n random linear system" you ask about refers to a random square matrix A of size n by n, a random column vector, b, of...

10 years ago | 0

| accepted

Answered
Replace a zeros row with one under a condition very important for me
I'll just answer for your "First one" in getting "the same thing for the columns in A". Let x be a column in A. s = cumsum...

10 years ago | 0

Answered
How to analyze a distribution parameters?
I fail to see what the difficulty is here. If x is a vector containing all the values of the parameter in question, then y is a...

10 years ago | 1

| accepted

Answered
Hi, how do I compute f(x) = tan(x) at x=1 using the forward difference and the central difference. Using also h = 10^(-k), where k= 0,1,2,....,16.? I already did this but not too sure if it is correct.
You should beware of carrying out this computation as far as h = 10^(-16). Matlab's computation of 'tan' is only accurate to ab...

10 years ago | 0

| accepted

Answered
how to convert from column to row ?
B = A.';

10 years ago | 20

| accepted

Answered
Matlab Busy since four hours
Your method of appending columns to 'Result_matrix' is very time consuming. Also as Geoff points out, your creation of a new 'z...

10 years ago | 1

| accepted

Answered
function to calculate summation in matrix
Instead of inserting ones into a pre-existing A of zeros, it is easier to generate A from scratch: A = []; for k = 1:s...

10 years ago | 0

Answered
Turn imaginary numbers to complex
Your statement *"my Eigen values (l) are not of the form alpha+beta*i"* really isn't correct. They are both of that form where ...

10 years ago | 0

Answered
I am trying to create a program in MATLAB that uses a while-loop to calculate the product of the values of all the elements of A when A=[10,11,12,13,14,15,16,17,18,19]. So far I have the following program:
If you are required to use a loop rather than a vectorized method, you can do this: f = 10:19; product = 1; for k ...

10 years ago | 0

| accepted

Answered
Epsilon close solution to a trigonometrical system of equations.
The problem here is that you have more unknowns than equations. In such a case there is generally an infinite continuum of poss...

10 years ago | 0

Answered
I do not understand why my k value won't increase to 3. Is there an error in my logic?
Your condition "del_z == lt*k" is too demanding. Your computer is using binary numbers to approximate decimal fractions. When ...

10 years ago | 0

| accepted

Answered
how to draw circle with different radii in scatter plot?
Let P1 = [x1,y1], P2 = (x2,y2), and P3 = [x3,y3] be your three points. Then, interpreting your word 'intercepts' as meaning tha...

10 years ago | 0

Answered
I have a data set of 400 columns and 644rows .I need to select columns 1,2,11,12,21,22,.....381,382,391,392 or move these particular columns in to a matrix.how can i write code for this in matlab
If M is the matrix with 400 columns, and if M2 is the matrix to be obtained from it, do this: n = 400; M2 = M(:,mod((1...

10 years ago | 1

| accepted

Answered
Replace certain matrix values with zeroes (more complex than other similar questions)?
Let 'A' be your original matrix and 'G' be the goal matrix. m = size(A,1); n = sum(s); G = repmat(A,n,1); c = ...

10 years ago | 1

| accepted

Answered
Length of intersection segment.
This is the problem that led to the classical problem of elliptic integrals. However, you can solve your problem numerically us...

10 years ago | 1

| accepted

Answered
merging column elements into one
You can easily compress seconds, minutes, hours, days of the month, months, and years into one double precision floating point n...

10 years ago | 0

Answered
How can I solve this equation and do not get RootOf in my answers?
There is a theorem in mathematics known as the Abel-Ruffini theorem that states that there is no explicit formula for general qu...

10 years ago | 1

| accepted

Answered
why matlab is unable to solve these set of equations?
My suggestion would be to help out Matlab's 'solve' a little by the way the problem is approached. The sixth, seventh, and eigh...

10 years ago | 2

| accepted

Answered
i have array cv which contains 16 rows & 2 columns. i need to find index of any one column. for ex, ans=2 or ans=1. i tried the following code. but it doesn't give the correct answer.please send the code.thank u sir.
I think what you meant to do is: ind = find(cv(:,z) == 2); % Gives indices of each element in column z which equals 2

10 years ago | 0

Answered
Help with calculating median of an array without using built in function?
Next step: n = length(b); t = (n+1)/2; md = (b(floor(t))+b(ceil(t)))/2; % <-- median

10 years ago | 1

| accepted

Answered
Finding a variable in a equation
The following obtains a least squares value for K: K = y/(exp(x/25)-1); I am assuming x and y are still row vectors her...

10 years ago | 0

Answered
How to get smith form of a matrix in matlab
Use 'smithform' only in mupad. See <http://www.mathworks.com/help/symbolic/mupad_ref/linalg-smithform.html>

10 years ago | 0

| accepted

Answered
Matrix Dimension must agree..
The error message is telling you what the trouble is. The vector x(i,:) has 1000 elements for each 'i', but p(i,:) was input an...

10 years ago | 0

| accepted

Load more