Réponse apportée
A faster union of polyshapes
using union of polyshape, just different order WARNING: code not fully tested and NOT commented not fully optimized. But it loo...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
How to select, or filter, the external border/boundary in a set of (x,y)-points? [Part 2]
Use the right tool: polyshape class load('borders2.mat') n = length(a); warning('off','MATLAB:polyshape:repairedBySimplify'...

plus de 2 ans il y a | 3

| A accepté

Réponse apportée
How to solve the matrix P in the Lyapunov equation "A'P+PA=- Q" in Simulink
I don't know simulink nor lyap function but just to tell you you can solve with standard algebra, so I hope it could be incorpor...

plus de 2 ans il y a | 0

Réponse apportée
Why is it so fast to calculate one-dimensional cubic Spline interpolation through matlab?
"I learned that the Time complexity of one-dimensional cubic Spline interpolation is at least n ^ 2" What is n? There is two d...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Calculate the average of each matrix block
A = [1 2 3 4 1 2 3 4 1 2 3 4 7 6 5 4 ; 1 2 3 4 1 2 3 4 1 2 3 4 7 6 5 4 ; 1 2 3 4 1 2 3 4 1 2 3 4 7 6 5 4 ; 1 2 3 ...

plus de 2 ans il y a | 0

Réponse apportée
How to programmatically determine the default number of workers set in parallel preferences
Please see if this thread can help you

plus de 2 ans il y a | 0

Réponse apportée
Generate a pseudo-random sequence of numbers with restrictions
Try this succeed = false; while ~succeed c = repelem(25,1,4); n = sum(c); r = zeros(1,n); for i=1:n ...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Memory efficient alternative for meshgrid?
Compute with auto-expansion capability after reshapeing vectors in appropriate dimensions rather than meshgrid/ndgrid % [a,b,c]...

plus de 2 ans il y a | 1

Réponse apportée
Attempt to grow array along ambiguous dimension.
Replace the problematic line of code with handGesture(repmat(~binaryFrame,1,1,size(handGesture,3))) = 0;

plus de 2 ans il y a | 0

Réponse apportée
unable to install MATLAB R2023a on windows 11
MATLAB_Runtime_R2023a_Update_3_win64 is not MATLAB, it's a runtime used by program built with MATLAB compiler. It's normal tha...

plus de 2 ans il y a | 1

Réponse apportée
Finding Indices of Zeroes Following Non-Zero Elements in MATLAB
seq = [0,0,0,0,0,0,1,3,5,2,4,6,7,8,3,0,0,0,0,4,1,10,22,11,22,44,44,12,0,0,0,0] b = seq ~= 0; union(findstr(b, [0 1]), findstr(...

plus de 2 ans il y a | 0

Réponse apportée
Is there a way to start indexing with 0 in MATLAB?
One way is to define your onw class with overloading subsref and subsasg https://www.mathworks.com/help/matlab/matlab_oop/code-...

plus de 2 ans il y a | 0

Réponse apportée
Least squares linear regression with constraints
"This is a non-linear problem of course, but I do linearize it by taking log on both side" That's the problem. When you transfo...

presque 3 ans il y a | 0

Réponse apportée
how to solve diagonal matrix of each page of a 3D vector ? pagediag?
[~,n,p] = size(A); [J,K] = ndgrid(1:n,1:p); B = accumarray([J(:) J(:) K(:)], A(:), [n,n,p]);

presque 3 ans il y a | 0

Réponse apportée
Meshgrid to be used for hexagons
If you need coordinates and no connectivity graph, the code can be simplified, you can use meshgrid if you wish to MATLAB autoex...

presque 3 ans il y a | 0

Réponse apportée
Meshgrid to be used for hexagons
Code from this thread. Not sure why you must use meshgrid https://www.mathworks.com/matlabcentral/answers/642930-adjacency-matr...

presque 3 ans il y a | 1

Réponse apportée
What is the mathematical principle of two-dimensional cubic Spline interpolation ?
The 2D spline is tensorial of 1D splines, meaning it makes 1D is x, then 1D in y. If you do the other way around it give the sam...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Inverse of sorting arrangement
If A has distinct elements such as A = rand(1,10) a single line command is [B,~,J] = unique(A); Check J B(J)

presque 3 ans il y a | 2

Réponse apportée
~exist(xxx) in IF condition not working
You have a FILE or FOLDER named "data" on some of your computers, not on other exists chech existing for file and folder as wel...

presque 3 ans il y a | 0

Réponse apportée
May I ask if there are any good methods in MATLAB that can fit broken lines
Use my FEX BSFK xyz=readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1417239/zx.txt') xyz0 = mean(...

presque 3 ans il y a | 0

Réponse apportée
For loop over permutations of 1:n with very large n
If you don't care about finding optimal solution, why not just do n = 1e15; % 1e18 has problem of coding as in my comment above...

presque 3 ans il y a | 0

Réponse apportée
find rows in a matrix where all the elements (of those rows) are not NaN
An alternative ways of testing a = [ NaN NaN NaN NaN NaN NaN NaN NaN NaN...

presque 3 ans il y a | 0

Réponse apportée
Inverse wavelet transform using only one wavelet transform
I guess because you feed in random data, the scale cannot by estimate correctly therefore the first level of the scale (and also...

presque 3 ans il y a | 0

Réponse apportée
try...catch for memory full error in imaq toolbox ?
To my knowledge there is no simple way to detect memory issue. What you ask MATLAB, e.g., using command such as [~,sys] = memo...

presque 3 ans il y a | 0

Réponse apportée
What could be a faster way to calculate first derivative of a field?
dfdt = (f(3:end)-f(1:end-2))*(1/(2*dt))

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Merging piecewise polynomial (pp) structures
Using BSFK from this FEX https://www.mathworks.com/matlabcentral/answers/1810010-free-knot-spline-approximation-bsfk-problem?s_t...

environ 3 ans il y a | 1

Réponse apportée
How do you reshape an array to preserve the order in each row of the original array?
A = magic(3) reshape(A.', [],1)

environ 3 ans il y a | 0

| A accepté

Réponse apportée
3 subplots with the bottom one split in 2 vertically?
Plenty of examples are given in the doc page https://www.mathworks.com/help/matlab/ref/tiledlayout.html

environ 3 ans il y a | 1

Réponse apportée
Speeding up matrix operations
Instead of calling trapz, use matrix multiplication, and this probably beats anything out there in term of speed and memory A =...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
Speeding up matrix operations
All loops are removed, but the memory requirement might be an issue. As I don't know what mean "very large N, M" I can't make a...

environ 3 ans il y a | 0

Charger plus