Answered

Generate a Matrix with the structure in the description

A=nchoosek(1:128,2)

Generate a Matrix with the structure in the description

A=nchoosek(1:128,2)

37 minutos ago | 1

| accepted

Question

MEX: How to modify xml file for unsupported compiler?

Context: I download the intel oneAPI C++ compiler. The C compiler is not supported by Matlab R2020b and I try to design the xm...

alrededor de 18 horas ago | 0 answers | 0

Answered

Avoid MCR CACHE deletion each time an executable is launched

"Now, if I launch the Filter.exe, the folder of the Init.exe in the MCR_CACHE is deleted and a folder for the Filter.exe in the ...

Avoid MCR CACHE deletion each time an executable is launched

"Now, if I launch the Filter.exe, the folder of the Init.exe in the MCR_CACHE is deleted and a folder for the Filter.exe in the ...

alrededor de 21 horas ago | 0

Answered

How to Generate Randomized Data Set with Given Mean/Median/Standard Deviation

There is infinity of random variables with the same mean/median/standard deviation Here is one that meet what you ask (three di...

How to Generate Randomized Data Set with Given Mean/Median/Standard Deviation

There is infinity of random variables with the same mean/median/standard deviation Here is one that meet what you ask (three di...

1 día ago | 0

Answered

Vectorize for loop: corr2(A(:,:,i),B(:,:,i))

If you have R2020b, you mght try to vectorize with pagemtimes function (or use mtimesx from File exchange) meanA = mean(A,[1 2]...

Vectorize for loop: corr2(A(:,:,i),B(:,:,i))

If you have R2020b, you mght try to vectorize with pagemtimes function (or use mtimesx from File exchange) meanA = mean(A,[1 2]...

2 días ago | 0

| accepted

Submitted

MultipleQR

Perform a bunch of QR factorization of same size matrix

3 días ago | 6 downloads |

Answered

Multiplication of tranformation matrices gives strange result

Your decription does not match with what your code is doing (your code) You take T1 on (x,y) data You take T2 on (x,y)...

Multiplication of tranformation matrices gives strange result

Your decription does not match with what your code is doing (your code) You take T1 on (x,y) data You take T2 on (x,y)...

8 días ago | 1

| accepted

Answered

How to find the last 1 in every row

Depending on the density of 1s, but a for-loop (remember that?) might be the fatest function BenchMax A=rand(10000)>0.5; ...

How to find the last 1 in every row

Depending on the density of 1s, but a for-loop (remember that?) might be the fatest function BenchMax A=rand(10000)>0.5; ...

9 días ago | 0

Answered

Reshape data vector for a surf plot over a non-rectangular domain

A diamond shape is bijective mapped from/to a rectangular shape, thus meshgrid/ndgrid combined with surf are still applicable. ...

Reshape data vector for a surf plot over a non-rectangular domain

A diamond shape is bijective mapped from/to a rectangular shape, thus meshgrid/ndgrid combined with surf are still applicable. ...

10 días ago | 1

Answered

Matrix Operation and decomposition

Just straight as-it-is syntax A^(1/2) A^(-1/2) or sqrtm(A) inv(sqrtm(A)) % sqrtm(inv(A)) Checkout https://www.mathworks.co...

Matrix Operation and decomposition

Just straight as-it-is syntax A^(1/2) A^(-1/2) or sqrtm(A) inv(sqrtm(A)) % sqrtm(inv(A)) Checkout https://www.mathworks.co...

10 días ago | 0

| accepted

Answered

atan2 not consisent

Your result atan2(a(77:78,2),a(77:78,3)) ans = 3.141592653589793 -3.141592653589793 Type single value a(78,2) yo...

atan2 not consisent

Your result atan2(a(77:78,2),a(77:78,3)) ans = 3.141592653589793 -3.141592653589793 Type single value a(78,2) yo...

10 días ago | 0

Answered

Determinant of a unitary matrix

Here is one way of computing determinant of a complex matrix U, based on Q-less qr n = size(U,1); d = 1; for k=1:n i = k...

Determinant of a unitary matrix

Here is one way of computing determinant of a complex matrix U, based on Q-less qr n = size(U,1); d = 1; for k=1:n i = k...

10 días ago | 0

Answered

Counting consecutive negative numbers in an array

length(strfind([false v<0],[0 1])) or sum(diff([false v<0])==1)

Counting consecutive negative numbers in an array

length(strfind([false v<0],[0 1])) or sum(diff([false v<0])==1)

11 días ago | 1

| accepted

Answered

Output only numbers with complex conjugate

a(ismember(a,conj(a))&imag(a)>=0)

Output only numbers with complex conjugate

a(ismember(a,conj(a))&imag(a)>=0)

11 días ago | 0

| accepted

Submitted

Random unitary matrix (and standard subgroup of U(n))

Generate matrix of one of these four supported types of groups: O(n), SO(n), U(n), SU(n)

11 días ago | 0 downloads |

Question

Determinant of a unitary matrix

Is there any other (better) way to compute the determinant of the unitay matrix beside det (that calls lu factorization)? >> [U...

12 días ago | 2 answers | 0

Answered

Create Random Points in Elliptical Belt

If the two ellipse has the same aspect ratio and aligned then this is the method without rejection. n=1e4; ax=3; ay=1; rin...

Create Random Points in Elliptical Belt

If the two ellipse has the same aspect ratio and aligned then this is the method without rejection. n=1e4; ax=3; ay=1; rin...

12 días ago | 0

Answered

Find angle of rotation matrix in MATLAB

Yes the approach is wrong your code has plenty of bugs* you need to learn how to debug you need to pratice MATLAB onramp O...

Find angle of rotation matrix in MATLAB

Yes the approach is wrong your code has plenty of bugs* you need to learn how to debug you need to pratice MATLAB onramp O...

13 días ago | 0

Answered

difference between str2num and str2double for getting a matrix

Under the hood str2num uses EVAL str2double uses SCANF, and work only on scalar. I see no reason why SCANF is more accurate t...

difference between str2num and str2double for getting a matrix

Under the hood str2num uses EVAL str2double uses SCANF, and work only on scalar. I see no reason why SCANF is more accurate t...

13 días ago | 0

| accepted

Answered

how to calculate number of unique element in array?

c =[ 1 1 1 1 1 1 2 1 2 2 2 3 2 4 2 5 2 5 3...

how to calculate number of unique element in array?

c =[ 1 1 1 1 1 1 2 1 2 2 2 3 2 4 2 5 2 5 3...

13 días ago | 0

Answered

What is the simplest way to map vector values of float to matrix of floats ?

The only vector of key map container supports is char vector (variable length) If your vector has fixe length say n; you could ...

What is the simplest way to map vector values of float to matrix of floats ?

The only vector of key map container supports is char vector (variable length) If your vector has fixe length say n; you could ...

13 días ago | 0

Answered

Solving a linear system equations with variables on both sides

See my answer in another thread.

Solving a linear system equations with variables on both sides

See my answer in another thread.

13 días ago | 0

Answered

Bit wise operation of And and XOR together

Z=quad(0,1,1,0,1,0,1,1) function F10 = quad(u2,v2,w2,x2,u3,v3,w3,x3) % note: u2 and u3 not used anywhere F10=1+v2+x2+x2*v2+...

Bit wise operation of And and XOR together

Z=quad(0,1,1,0,1,0,1,1) function F10 = quad(u2,v2,w2,x2,u3,v3,w3,x3) % note: u2 and u3 not used anywhere F10=1+v2+x2+x2*v2+...

14 días ago | 0

Answered

surface plot face not showing colors corresponding to Zgrid in some areas

Here is a workaround, keep flat facecolor. You can use mean/min instead of max depending on what is relevant for you. Z=peaks(1...

surface plot face not showing colors corresponding to Zgrid in some areas

Here is a workaround, keep flat facecolor. You can use mean/min instead of max depending on what is relevant for you. Z=peaks(1...

14 días ago | 0

Question

LOADLIBRARY error 'CL' and LIMITS.H not found

I get this error message recently >> loadlibrary('C:\WINDOWS\system32\user32.dll', 'WinMouse.h') Error using loadlibrary Fail...

15 días ago | 0 answers | 1

Answered

grouping indices based on how close they are

If your array is sorted >> c = mat2cell(a,1,diff(find([true diff(a)>5 true]))); c{:} ans = 11 12 13 ans = ...

grouping indices based on how close they are

If your array is sorted >> c = mat2cell(a,1,diff(find([true diff(a)>5 true]))); c{:} ans = 11 12 13 ans = ...

15 días ago | 0

| accepted

Answered

Find first item with a certain condition and use it, instead of finding all items with that condition

Process by block, eventually you get the result after a couple of minutes p = zeros(1,100); p(1) = 3; n = 10^10; m = 1e7; ...

Find first item with a certain condition and use it, instead of finding all items with that condition

Process by block, eventually you get the result after a couple of minutes p = zeros(1,100); p(1) = 3; n = 10^10; m = 1e7; ...

15 días ago | 0

Answered

how to find kshortest path or use Dijkstra algorithm for 12 plot points.

Assuming you want to find all paths from 1 to 12, using the code AllPath here, here is the 6 paths with the total distances (euc...

how to find kshortest path or use Dijkstra algorithm for 12 plot points.

Assuming you want to find all paths from 1 to 12, using the code AllPath here, here is the 6 paths with the total distances (euc...

16 días ago | 0