Réponse apportée
Generate random numbers with truncated Pareto distribution
According the https://en.wikipedia.org/wiki/Pareto_distribution the pareto has bounded on the lower side by what they called xm...

plus de 3 ans il y a | 0

Réponse apportée
inpolygon usage with big matrices or faster function
Try this https://fr.mathworks.com/matlabcentral/fileexchange/27840-2d-polygon-interior-detection?s_tid=srchtitle At some point ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
2 vectors compare it
A=[2 3 4 5 10 7 15 9 16 12 17 18 19 20]; [As,is] = sort(A(:)); col = 1 + (is>size(A,1...

plus de 3 ans il y a | 0

Réponse apportée
fminunc : A VERY STRANGE PROBLEM!
Just shooting in the dark here and wonder if you let the UseParallel option of fminunc to true or false? It could be that the ...

plus de 3 ans il y a | 0

Réponse apportée
Can we Generate a Random Matrix with No Repeated Elements
Just the reshape long vector returned by randperm m = 3; n = 2; A = reshape(randperm(10,m*n), m, n)

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to rank 3d matrix across 2 dimensions
iNames(VarSORT); won't change iNames, you need to assign the expression to a variable VarsRank iVars = zeros(361,181,5); iVa...

plus de 3 ans il y a | 0

Réponse apportée
Efficient construction of positive and negative matrix
If your B is given then the 2nd method in this script is faster P = [1 3 8 18]; N = 20; B = fliplr(dec2bin((1:2^N)-1,N)-'0'...

plus de 3 ans il y a | 0

Réponse apportée
Optimoptions - Invalid solver specified error
Check if you have license and installed optimization toolbox by typing ver

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Matrix Product optimization with Bsxfun
You simply cannot invent something that does not exist (support) in MATLAB, the function mtimes is not supported by bsxfun see f...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
how to flip a function
f = @(x) x.^3; ivf = @(y) y.^(1/3); g = @(x)x; ivg = @(y) y; a = 0; b =1; fplot(f, [a, b]), hold on fplot(g, [a, b], 'Li...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to create a second command window in my GUI?
Just let the main GUI (with welcome message and push button) to launch another MATLAB session system('matlab -r ...') with -...

plus de 3 ans il y a | 0

Réponse apportée
Matlab Mex File with OpenMP compiling and showing active threads but not actually using them
A little bit late reply. I believe the main reason is there is a problem in your code, not in the compilation option. because ...

plus de 3 ans il y a | 0

Réponse apportée
How can I approximate this large matrix?
What about T = M; niter = 5: for k=1:niter T = M*(speye(size(M)) + T); end This returns T = M + M^2 + .... + M^6

plus de 3 ans il y a | 1

Réponse apportée
Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN
Replace ^2 by .^2 (with the dot) in fe if you want to square element wise. There migjt be some other operation like * or / that...

plus de 3 ans il y a | 0

Réponse apportée
Contradictory results in command window with variable class and ischar function?
class structure(8).timetotemp is like class('structure(8).timetotemp') which return char. The correct function syntax call ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to speed up MEX function?
Last experience, Time with C OpenMP, Intel Parallel Studio XE 2022 CIntel_elapsed_time = 0.0574 [sec] 2.5 faster than MATLAB ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Using ismembertol for multiple coincidences
Using ismembertol is inappropriate A = [5 3 4 2]; B = [2 4 4 4 6 8]; tol = 1; [ib,ia]=find(B'<=A+tol & B'>=A-tol); c = a...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
equally spaced nodes and chebyshev nodes matlab
I have just answered another fellow here

plus de 3 ans il y a | 0

Réponse apportée
Matrix column updation via optimization
Using Housholder transformation, B is uniquely determined only for n=3. I claim that my code solve the problem of argmin(norm...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to check if two planes intersect with each other?
Use this FEX https://fr.mathworks.com/matlabcentral/fileexchange/49160-fast-mesh-mesh-intersection-using-ray-tri-intersection-wi...

plus de 3 ans il y a | 0

Réponse apportée
non-uniform symmetric grid in 1D
The chebychev nodes cross my mind leftbnd=-10 rightbnd = 10; n = 30 chebychevgrid=@(leftbnd,rightbnd,n)leftbnd+((rightbnd-...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
griddata vs griddedinterpolant vs scatteredInterpolant for given data
gridded data interpolant (A set of points that are axis-aligned and ordered, generated by meshgrid/ndgrid on monotonic grid vect...

plus de 3 ans il y a | 1

Réponse apportée
Renaming the fields of structure
for i = 1:10 % 1:n filename = sprintf('file%d', i); s = load([filename '.mat']); fieldname = filename; s.(fi...

plus de 3 ans il y a | 0

Réponse apportée
How to speed up MEX function?
I don't know well C++, but I have practiced quite a lot mex C. It looks like this statement just move a bunch of data outputs[...

plus de 3 ans il y a | 0

Réponse apportée
Efficient way to reshape data
This avoids inner transposition permute(reshape(data,2,[],3),[1 3 2])

plus de 3 ans il y a | 1

Réponse apportée
Sparse matrix from the columns of an initial square matrix
n=3;m=2; A=randi(10,n,m) % m columns are used; not n J=(1:m*n); I=mod(J-1,n)+1; B = sparse(I, J, A) C = full(B) % if f...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Execute same .m multiples times in parallel
You have to wrap your script in function and then call parfor if you have parallel toolbox. Please read about precautions of se...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
What limitations does MATLAB have in pseudo-random sequence generation ?
According to this page, the period of Mersenne Twister (64 bit version, the default engine used by rand()) method is 2^19937-1

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Finding cluster of positive and negative numbers in an array, then the maximum and minimum value in each cluster
NOTE: max of [-3 -2] is -2 not -3. Your array has 17 elements, cannot have element index of 18. a = [ 2 -2 1 4 5 -3 -2 1 -1 2 5...

plus de 3 ans il y a | 0

Réponse apportée
how to make a matrix only showing Permutation without order ?
This is called combination with repetition You don't need to generate the permutation and filter out which can take much larger...

plus de 3 ans il y a | 0

Charger plus