Réponse apportée
Importing a text file with two headers and data so that the headers are the variable names
There are a lot of ways to deal with reading in data. This is one imaginative way of doing it, but I think it should work. (Her...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Finding the point of inflection on a curve
You need to find where the 2nd derivative is zero. There are many different ways to approach this. This is one possible way: ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
invers from covariance of a matrix*matrix'
cov(a) is ALWAYS singular for ANY square matrix a, because you subtract off the column means. This guarantees that you reduces t...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Fastest way of computing standard errors / inverting X'X
You can use symbolic math to find the inverse of a symmetric 3x3 matrix: syms a b c d e f real M = diag(inv([a b c; b d ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Misbehaving script
In your function handle, the "Q" that it is referencing is the original Q at the time you created the function handle. It is not...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
Finding the indices of the elements of one array in another
If A is sorted, then I think this is probably the easiest (and also fastest?) way to do it. [~,idx] = histc(B,A) If A is...

plus de 14 ans il y a | 0

Réponse apportée
a matrix equation problem
If B is invertible: x = sqrt(eig(B\A)) Reason: det(A-B*x^2) = 0 implies that det(B\A-I*x^2) = 0 If B is not ...

plus de 14 ans il y a | 0

Réponse apportée
help with dynamic variable names set with 'for' incrementer
You are right in that using EVAL to dynamically generate variable names is generally a messy approach that's not very readable, ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
fractional delay using FFT,IFFT
Ok. You've pretty much written exactly what you need to do. This is the right idea: signal(x)->X=FFT(x)->Y=X*exp(-j*2*pi*f*dt...

plus de 14 ans il y a | 6

Réponse apportée
cell operation
Maybe something like this? M{1,1} = {1 3 5 0} M{2,1} = {2 4 6 -1} M{3,1} = {7 8 9 2} cat(1,M{:})

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
histogram, indices of values used from the vector for each class?
If you have access to the functions in the Statistics Toolbox, I think GRPSTATS may help you c1 = [ 1 3 2 1 3 1 2 2 3 3 2 2...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Linprog and Max Function
Notice that f(d) = Df*d + max(0, g + Dg*d) + abs(h + Dh*d) is the same as f(d) = Df*d + max(0, g + Dg*d) + max(h + Dh*d, ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
How can i multiply the transfer function with a vector)
You need to invert the transfer function. But simply taking 1/G leaves you with more zeros than poles, and so you cannot exactly...

plus de 14 ans il y a | 2

Réponse apportée
Linprog and Max Function
Assuming by "just numbers" you mean "(constant) arrays", you can solve it by solving two linear programming problems. Step 1....

plus de 14 ans il y a | 0

Réponse apportée
How can i multiply the transfer function with a vector)
You can use the LSIM command. For example: s = tf('s'); G = (1.659e010*s^2 + 9.123e012*s + 4.147e014)/ (1.011e-005*s^7 + 0...

plus de 14 ans il y a | 2

| A accepté

Réponse apportée
Newbie to Matlab: How to find duplicates within a cell of arrays, arrays have varying sizes
Here is a one rather exotic way of doing it: % Step 1: Convert to strings Aunique = cellfun(@(x)char(typecast(x,'uint8')...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
Impulse Response using Dirac(t)
I think this is a very good question. Here is my explanation, but maybe someone can give a better one. In this equation: ...

plus de 14 ans il y a | 2

| A accepté

Réponse apportée
How to rotate a function about the y-axis
Something like this maybe? [X,Y]=meshgrid(-20:0.1:20); R = sqrt(X.^2 + Y.^2); J=besselj(1,R); Z=(J./R); Z(...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
Fast multiplication of rows of one matrix and columns of the second matrix
The fastest way to do something generally depends on the size and structure of your data. Don't assume loops are slower. For si...

plus de 14 ans il y a | 2

| A accepté

Réponse apportée
Strange problem in plotting
Are you sure you did your hand calculation correctly? I think the second result is correct. The result you are seeing is due ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Least squares problem with large matrix
Ok. I have an idea. So you basically have some linear function A(x) -> b that takes the vector space of [5x300] matrices and ...

plus de 14 ans il y a | 0

Réponse apportée
Line and a Line segment intersection
Define t = (c - y1 + m*x1)/(y2 - y1 + m*(x1 - x2)) * If 0 <= t <= 1, then they intersect at exactly one point. * If ...

plus de 14 ans il y a | 2

| A accepté

Réponse apportée
Linear data fitting
The problem is that your data is scaled very differently than the random data. If you normalize the data to a better scale firs...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Linear data fitting
One possible way, if you have access to the functionality in the Optimization Toolbox, is to treat this as an optimization probl...

plus de 14 ans il y a | 0

Réponse apportée
Ordering graphics objects
The UISTACK command is used to order graphics objects. help UISTACK

plus de 14 ans il y a | 0

Réponse apportée
Solving for an unkown matrix
This is the Sylvester equation. You can solve it using the LYAP command. A = rand(3); B = rand(3); C = rand(3); P ...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
BVP with no solution
The boundary conditions you wrote in your code are actually y(0) = 0; y(pi) = 1. But that's besides the point. As you said yo...

plus de 14 ans il y a | 1

Réponse apportée
matrix logical indexing
In the case of checking bounds by combining two logical statements, I think the following expression will generally be significa...

plus de 14 ans il y a | 0

Réponse apportée
how to plot functions of theta and phi..for example {cos(phi).^3 * sin(theta)+sin(phi)} in spherical coordinates.
First create a grid using spherical coordinates, and then convert the result into Cartesian coordinates. [theta,phi] = meshgr...

plus de 14 ans il y a | 0

Réponse apportée
Minimizing a function
This is a quadratic programming problem, and can be solved very easily using QUADPROG. The only thing is correctly expressing th...

plus de 14 ans il y a | 0

Charger plus