Réponse apportée
How do I find the coordinates inside a rectangle or triangle?
INTERP2

plus de 7 ans il y a | 0

Réponse apportée
select numbers based on different probabiltiies
select = rand < 1e-6

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How i Calculate the average number of even numbers in an array?
a = [1.3700 1.2200 2.2000 2.2800]; ac = round(a*100); mean(ac(mod(ac,2)==0))/100 result ans = 1.9000

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
what is non-local total variation regularizarition (NLTV)?
That means the regularization of the image I(x,y) is of the form integral of lambda(x,y) | grad I (x,y) | dx*dy. lambda(x,y) i...

plus de 7 ans il y a | 0

Réponse apportée
Using the cubic spline code below, I need to extract the value found for x = 3.5. How do I call this value?
Run this after your code >> tempx = 3.5 tempx = 3.5000 >> [~,i] = histc(tempx,x); >> a(i) + b(i)*(tempx-x(i))+c(...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Which mldivide ('\') function is better
Use pseudo inverse PINV to get more stable solution. Never use "\" on nearly singular matrix. You are happy with 2008 is just pu...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Is "ismultithreaded" function exist?
Not that I'm aware of, in any case they will give out such information since they (TMW) have a habit to consider speed optimizat...

plus de 7 ans il y a | 0

Réponse apportée
FFT seems to be not calculating Nyquist component?
Change A*sin(2*pi*Fs/2*t) to A*cos(2*pi*Fs/2*t) Or alternativey you must put cos expression in the imaginary part of your...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Structure array slower than loose variables
Yes acessing field names is slow., so try to avoid doing it intensively.

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How to solve a complex-valued equation
So your equation is of the form a / (g - x)^2 = k* x Just multiply by (g - x)^2 in both sides, you'll get a = (g - x)^2 * k* ...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
For Loop to concatenate Matrix Product
A_All = []; A_0toAll = []; C_i = 1; for i=1:5 T_i = [i+2 i+3 i+4 i+5; i+3 i+4 i+5 i+6; i+4 i+...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Force slope and return intercept value (assuming a non-zero intercept)
m = WhatYouWantItToBe k = mean(log10(y)-m*log10(x))

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
get vector from a matrix ith row or column based on given dimension
c = repmat({':'},1,ndims(A)); c{dim}=i; A(c{:})

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Finding PDF for difference of two PDFs
For 2 dependent variables A and B, the pdf of A+B is pdf(A+B) = pdf(A) * pdf(B) where "*" is a continuous convolution operator...

plus de 7 ans il y a | 0

Réponse apportée
Specified number of ones in the matrix (column and row)
From an idea by Akira Agata n = 10; % Matrix dimension k = 4; % row/column sum target of 1s r = [ones(1,k) zeros(1,n-k)]; ...

plus de 7 ans il y a | 2

Réponse apportée
Using a vector as an index to a matrix
[m,n,p] = size(A); [I,J] = ndgrid(1:m,1:n); C = A(sub2ind([m,n,p],I,J,b(I)))

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Low Level Graphics Error
After crash you migh run opengl hardware opengl('save','hardware') to restore value. I systematically have opengl crash whe...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Finding rows of matrix A that do not overlap with any rows in Matrix B (without using for or while loop)
Assuming A and B are column-sorted for all rows A= [ 0 50; 200 250; 300 350; 400 450]; B=[50 200; 200 300; 300 400]; BB=res...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Need help with solving system of ODEs in Matlab
y=zeros(m, N+1); % numerical approx. vector I think it should be y=zeros(N+1,m); % numerical approx. vector Those things ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
preallocate array without initializing
MEX can do that, use for example this utility

plus de 7 ans il y a | 1

Réponse apportée
How to change matrix numbers positions
X(randperm(numel(X))) = X

plus de 7 ans il y a | 0

Réponse apportée
Difference between the individual rows of B and all the rows of A.
DIF = zeros(size(A,1),size(B,1)) for k=1:size(B,1) DIF(:,k)=sqrt((A(:,1)-B(k,1)).^2+(A(:,2)-B(k,2)).^2+(A(:,3)-B(k,3)).^2)...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Project 3D points onto a 2D plane with least overlap
Assuming your data points is store in (n x 3) array xyz xyzc = mean(xyz,1); [~,~,V] = svd(xyz - xyzc,0); xy2d = xyz*V(:,1:2);...

plus de 7 ans il y a | 1

Réponse apportée
Finding PDF for difference of two PDFs
Not sure if it helps but the green area is { (x:y) : 0 <= y <= min(p1(x),p2(x)) }

plus de 7 ans il y a | 0

Réponse apportée
randsample([0 1],1,true,[1 - p p]) ..... with p as a vector?
Assuming yoy have p in a vector r = rand(size(p))<p

plus de 7 ans il y a | 0

Réponse apportée
How can I efficiently (with no loops) compute the mean of each column in a matrix, taking different elements from each column?
M = [ 1 2 3 4 5; ... 6 7 8 9 10; ... 11 12 13 14 15]; idx = [ 1 2 3 2 1; ... 2 3 3 3 3]; m = si...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How can I efficiently (with no loops) compute the mean of each column in a matrix, taking different elements from each column?
M = [ 1 2 3 4 5; ... 6 7 8 9 10; ... 11 12 13 14 15]; idx = [ 1 2 3 2 1; ... 2 3 3 3 3]; [m...

plus de 7 ans il y a | 0

Réponse apportée
Generate all possible combinations
A = [1;2] B = [3;4] C = [5;6] D = [7;8] L = {A,B,C,D}; n = length(L); [L{:}] = ndgrid(L{end:-1:1}); L = cat(n+1,L{:}); ...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Generate All Possible combinations
A = [2;4;6] B = [1;3;5] [AA,BB] = meshgrid(A,B); C = [AA(:),BB(:)] ans = 2 1 2 3 2 5 ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I compute all the possible differences of the vectors in a matrix?
>> A = [1,2,3; 4,0,1; 2,3,5; 6,0,1]; >> r2 = nchoosek(1:size(A,1),2) r2 = 1 2 1...

plus de 7 ans il y a | 0

Charger plus