답변 있음
extracting arrays from a taylor series and plotting
It looks as though your T is incorrectly computed. For each of three different counts, n = 2, 5, and 50, you need to compute n ...

11년 초과 전 | 1

답변 있음
Can x、y、z、Y、b and c be derived by constant letters by matlab?
Your question is a rather perplexing one. Variables in matlab can be indicated by any letters. However, you cannot use the sam...

11년 초과 전 | 0

답변 있음
How to simulate a spherical pendulum in matlab?
Bas, you have a sign error in the gravity term. It should be: -g*sin(phi)/L Use one of matlab's 'ode' solvers to numer...

11년 초과 전 | 1

| 수락됨

답변 있음
Link the 2th column of a matrix to the first depending on another matrix.
Perhaps what you need is [~,ix] = ismember(B,A(:,1)); C = A(ix,:); This assumes that every value in B is to be found ...

11년 초과 전 | 0

답변 있음
Im having trouble finding the mean of a row
Given that matrix_name is 5-by-3, tand(mean(matrix_name,2)).*120 will produce a 5-by-1 matrix, not a 1-by-5. The '2' w...

11년 초과 전 | 1

답변 있음
how we can solve a determinant
@Arjun. As you undoubtedly are aware, any row of a determinant can be subtracted from another row without changing the value of ...

11년 초과 전 | 3

답변 있음
How to calculate the means of n adjacent units of a vector?
If you want the mean of each n successive values in A, to place it in X, do this: X = mean(hankel(A(1:n),A(n,end)),1);

11년 초과 전 | 3

| 수락됨

답변 있음
How to delete an repeated values in matrix?
If x is your array with repetitions [~,ia] = unique(x,'first','legacy'); x = x(sort(ia));

11년 초과 전 | 0

답변 있음
The reshape function used in the code below
I would advise you to place the line display(size(img_y)) immediately after the line img_y = uint8(fread(fid, nRo...

11년 초과 전 | 0

답변 있음
independence in rand function
In a strict sense 'rand' is totally deterministic, since it depends entirely on the seed value with which it starts, and cannot ...

11년 초과 전 | 0

| 수락됨

답변 있음
Fibonacci number without any loops?
Here is a formula (not using loops) for the Fibonacci numbers ranging from n = n1 to n = n2: L1 = (1+sqrt(5))/2; L2 = ...

11년 초과 전 | 2

| 수락됨

답변 있음
How to write the correct expression of this function?
v = v.^v;

11년 초과 전 | 1

| 수락됨

답변 있음
How to generate the following matrix
y = repmat(x,10,1); y(:,1:2) = y(:,1:2) + repmat(5*floor((0:29).'/3),1,2);

11년 초과 전 | 1

| 수락됨

답변 있음
I need help with matrix size confliction in code
The error refers to the element-by-element multiplication "w.*tt". You are attempting to multiply the three elements of row vec...

11년 초과 전 | 1

| 수락됨

답변 있음
Undefined function or method in function
Since you are not passing 'Observed' to 'my_fum' as a function argument, you must make its value known to the function as a para...

11년 초과 전 | 0

| 수락됨

답변 있음
How to give g variable (which is vector) into char() function
Study this carefully: http://www.mathworks.com/help/matlab/ref/char.html

11년 초과 전 | 0

답변 있음
Non- linear equation system
I would suggest you temporarily disregard the equation with f4 and regard x2 as a known parameter. That leaves you with five li...

11년 초과 전 | 0

| 수락됨

답변 있음
Solve equation x^(0.7)-x^(-0.3)==1 get wrong answer??
I think I can account for the extraneous "solution" you received. If you substitute x^(0.1) = y, which can be expressed as x = ...

11년 초과 전 | 2

답변 있음
Please please help fix my error!
In the equation for 'cvH2' you are doing a matrix right divide when you use "/" without the dot. You are doing a matrix divisio...

11년 초과 전 | 0

답변 있음
a sequence of a sum of product
You can vectorize your summation. I assume H is a 10-element row vector as you have shown it. h = zeros(10,1); for p ...

11년 초과 전 | 1

| 수락됨

답변 있음
Slope along the curve
If the X values are not uniformly-spaced, the expression (Y(i+1)-Y(i-1))/(X(i+1)-X(i-1)) is not a very accurate approxi...

11년 초과 전 | 1

답변 있음
1st graph plots fine, 2nd graph is an error.
You cannot plot three variables in two dimensions! Either use plot3 or else plot only two of your variables. For example, plot...

11년 초과 전 | 0

답변 있음
How to speed up 2 loops with the intersect function?
Some possible improvements: 1) You could compute 'Qnor' in the following way: if k<=1 Qnor(i,1) = 1; else ...

11년 초과 전 | 0

| 수락됨

답변 있음
How to combine this value ?
If you want all twenty values to be stored in 'sol', you need to move the line j1=1; to execute before entering the out...

11년 초과 전 | 0

답변 있음
Simple Question: gradient function Formula
For 2 <= k <= 199, the computation is a central difference: a(k) = (x(k+1)-x(k-1))/(2*h) However, for the two endpoints...

11년 초과 전 | 2

| 수락됨

답변 있음
I'm new to Matlab...never used it before and I need help with calculating reimann sums
Assuming x and y are vectors of the same length with corresponding x- and y-values, do this: Ls = sum(y(1:end-1).*diff(x))...

11년 초과 전 | 0

답변 있음
Half life question in matlab
Bradley, just ask yourself, "what power of 2 do I have to divide 50 by to get 20?". Then that power should be the ratio of the ...

11년 초과 전 | 0

답변 있음
Problem using diff comand
I am guessing that your difficulty is due to the low number of digits accuracy, namely only 3, that you requested. Write ...

11년 초과 전 | 0

답변 있음
How to create a function that returns a matrix with one more popped piece randomly added and the location of it.
Use 'randi' twice to generate random indices for the row and column and then add 1 there.

11년 초과 전 | 0

| 수락됨

답변 있음
How can I get different 2D Matrices from a 3D matrix?
Use matlab's 'squeeze' function to eliminate the singleton dimension(s).

11년 초과 전 | 0

더 보기