Beantwortet
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 ...

mehr als 11 Jahre vor | 1

Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

mehr als 11 Jahre vor | 0

Beantwortet
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...

mehr als 11 Jahre vor | 1

Beantwortet
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 ...

mehr als 11 Jahre vor | 3

Beantwortet
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);

mehr als 11 Jahre vor | 3

| akzeptiert

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

mehr als 11 Jahre vor | 0

Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
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 ...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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 = ...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
How to write the correct expression of this function?
v = v.^v;

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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);

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 0

Beantwortet
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...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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 = ...

mehr als 11 Jahre vor | 2

Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
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 ...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
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 ...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
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...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
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))...

mehr als 11 Jahre vor | 0

Beantwortet
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 ...

mehr als 11 Jahre vor | 0

Beantwortet
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 ...

mehr als 11 Jahre vor | 0

Beantwortet
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.

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 0

Mehr laden