Réponse apportée
Select nearest non zero value in column
b = [0; 0; 0; 2; 0; 0; 0; 0; 0; 3; 0] nearestfun = @(b) interp1(find(b),b(b~=0),(1:length(b))','nearest','extrap'); ...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
apply a different condition to 2 columns
Example from you attached mfile >> a = [... 0.4317 0.9203 0.0155 0.0527 0.9841 0.7...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
command for extracting data??
'end' when used in array indexing is replaced by |size(x1,n)|, where |n| is the dimension where the 'end' appears. Here in yo...

plus de 7 ans il y a | 0

Réponse apportée
I have a problem with LU
The four and five-output syntax are only applicable for *sparse* input matrix. You can try by converting your dense matrix to...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
I have an array with 5 numbers, I want to concatenate it with another array with the same 5 numbers in a different order that do not correspond to the original.
What you need is the so called <https://fr.mathworks.com/matlabcentral/fileexchange/30189-randpermfull derangement>, a permuta...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to change this matrix for expected matrix?
rot90(A,2)

plus de 7 ans il y a | 2

Réponse apportée
Looking for a more elegant (less process-time consuming) code that obviates the external for loops.
% order everything as 8D array as following % (x,y1,z1,z2,z3,t1,t2,t3) MM = permute(M,[1 2 5 3 4 ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
how I can find the edges of polygon given by voronoin used for 3D vertices in matlab??
From the doc: [V,C] = voronoin(X) returns Voronoi vertices V and the Voronoi cells C of the Voronoi diagram of X. C{k} ...

plus de 7 ans il y a | 0

Réponse apportée
please help simplify this for-loop-hell
data = {ceil(20*rand(100,6)) ceil(20*rand(50,6)) ceil(10*rand(20,6))}; biggest_data_series = randperm(15)'; biggest_...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I solve a Ax=b using lsqnonlin with constraints (x(1)>x(2)>...>x(6)>x(7))?
You can transform the constraint x(1) >= x(2) >= ... >= x(n) By changing variables y(1) = x(1) y(2) = x(2)-x(1) .....

plus de 7 ans il y a | 1

Réponse apportée
finding 2D curvature for a left ventricular plot
The original code is here: <https://fr.mathworks.com/matlabcentral/fileexchange/32696-2d-line-curvature-and-normals FEX excha...

plus de 7 ans il y a | 0

Réponse apportée
Determine the index of the value closest to the mean value of each group
Exactly as with my previous answer, but adapted for OP's test data read from Excel [~,~,C] = xlsread('MLdata.xlsx'); T...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to pull specific data from solution set?
What prevent you to use bdipuniodefun() to compute the velocity dW/dt from |T| and |W| ?

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How To Vectorize a For loop
Min=min(X)*(1-1e-6); %A little smaller than Minmimum value of X Max=max(X)*(1+1e-6); %A little bigger than Maximum value of...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Efficient way to apply fsolve to large 2D array element
It looks like you solve for pixel position of some distorded images, and you has a model for a distorsion. If you approximate...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Determine the index of the value closest to the mean value of each group
ntests = 1000; TC = ceil(10*rand(ntests,1)); R = rand(ntests,1); % Here is the n x 2 input matrix A = [TC, R]; ...

plus de 7 ans il y a | 0

Réponse apportée
How to create pairwise comparison matrix for row matrix?
Replace |==| with whatever comparison operator that is suitable for you C = a == a.' Edit, seem like you want (this...

plus de 7 ans il y a | 0

Réponse apportée
How to find the number of occurrences of each pair in a matrix?
A = [1 2 3; 2 3 1; 2 1 3]; u = unique(A); P = nchoosek(u,2); P = [P;fliplr(P)]; [~,J] = ism...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
What is wrong with: [betta;delta;gamma]=inv([ab ab_cd -cd])*[C-A];
You cannot capture elements of array on the lhs directly to variables, you have to split it: x = inv([ab ab_cd -cd])*[C-A];...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How to find the mean of one column based on the value in another column
You command is correct (beside using 8th column instead of 2nd) *BUT*: Don't name your (output) variable MEAN, you will have ...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How to make all values before first non zero element in a matrix 1?
Assuming A is your matrix flipud(cumsum(flipud(A)))

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Could anyone help me to solve the issue
set(gca,'xtick',(34:2:40))

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can i count the occurences of each element in a list of matrices?
XXXL = cat(1,X{:}); u = unique(XXXL(:)); n = histcounts(XXXL(:), [u,;inf]); bar(u,n) If you have memory issue,...

plus de 7 ans il y a | 0

Réponse apportée
How can I add constraints in a solution of a function?
n = 6; L = randn(n); S = L'*L; y = randn(n,1); rft = randn(1,1); su = 2; sl = -1; % T = V*V' T = S...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Replace groups of numbers in a matrix checking connections in 8-directions
What you need is a labeling algorithm. If your don't have Image Processing toolbox, there are several in FEX for example this <h...

plus de 7 ans il y a | 0

Réponse apportée
the polyarea function gives the wrong area
I think MATLAB result is right, your expectation is wrong. Check area >> 0.1807*0.4258-(0.1807-2*0.009)*(0.4258-2*0.00...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Standard deviation along 2 axes
D3 = rand(3, 51, 8) std(reshape(permute(D3,[1 3 2]),[],size(D3,2)))

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Solving for a matrix
> K = [7 -8 1 0 0 0 0; -8 16 -8 0 0 0 0; 1 -8 14 -8 1 0 0; 0 0 -8 16 -8 0 0; 0 0 1 -8 14 -8 1; 0 0 0 0 -8 16 -8; 0 0 0 0 1 -...

plus de 7 ans il y a | 1

Réponse apportée
Could anyone help me to solve the issue in the following code
Adapt the <https://fr.mathworks.com/matlabcentral/answers/426511-could-anyone-help-me-to-solve-the-issue#answer_343806 answer th...

plus de 7 ans il y a | 0

Réponse apportée
Fast concolution of image and ellipse of varid sizes
You might try this <https://mathworks.com/matlabcentral/fileexchange/24504-fft-based-convolution FEX> file.

plus de 7 ans il y a | 0

Charger plus