已回答
scatteredInterpolant function gives error in input data if I try to interpolate a vectorial field where for each point I have 2 values, but in the doc it says that is allowed.
I guess you use an old MATLAB version that doesn't support vector interpolation. EDIT the doc is for 2023b more recent than you...

2 months 前 | 2

| 已接受

提问


sum results depending on array orientation
The issue of sum depending to array orientation is reported by @Matt J in this thread To me the flaw is serious enough that it ...

2 months 前 | 2 个回答 | 0

2

个回答

已回答
Just by changing values of k, the given code gives error. Why?
k need to be column vector and your transposed is miss placed. The correct is k = -((M/2-1):M/2).';

3 months 前 | 0

| 已接受

已回答
Quickest way for alternate indexing a vector
Try to do something clever (1st and 2nd methods) but it is slower than your code 53rd method). A small modificationof your code ...

3 months 前 | 1

已回答
function to generate collections of integers that all sum to the same value?
Look in File Exchange with the keywords integer partition. You'ill find many implementations for example this one: https://www....

3 months 前 | 0

| 已接受

已回答
Matlab memory optimization regarding output arguments
You better have your funtion codded like this function functie() x = 9; % Remove the braket x = functieLocala(x); ...

3 months 前 | 1

已回答
Size mismatch (size [1 x :?] ~= size [0 x 1]) - GPU Coder Deployment
Try to initialize index = zeros(1, 0); since you concatenate index horizontally in the for loop.

3 months 前 | 0

已回答
How can we compute batch matrix-matrix product of matrices (3-D tensors) in MATLAB?
b = 2; n = 3; m = 4; p = 5; A = rand(b,n,m); B = rand(b, m,p); AA = permute(A, [2 3 1]); BB = permute(B, [2 4 1 3]); ...

3 months 前 | 0

| 已接受

已回答
An annoying extrapolation problem
Because you insist on using anonymous function and ugly combined expression using scalar logical expression. The trick is no lon...

4 months 前 | 0

| 已接受

已回答
Why is the result matrix “rho” of function corr (A, B) not a symmetric matrix?
As the doc describe, for example rho(2,1) is the correlation between X(:,2) and Y(:,1) rho(1,2) is the correlation between X(:...

4 months 前 | 0

| 已接受

已回答
How to efficiently index into memory and call functions within for loops
When you index a hybrid slide (j positive integer scalar) % x = ... % j = ... xidx = x(:,:,:,j,:,:) (here I take a 6D array ...

4 months 前 | 0

| 已接受

已回答
is there a way to perform this task w/o using loops?
You might consider store in table instead NOTE: using table would be more convenient to access data, not necessary faster p.va...

4 months 前 | 1

已回答
How can I stabilize the matrix left division (i.e. "\")?
Try pinv, lsqminnorm it can stabilize somewhat the inversion with (near) singular matrix. Both bave a tolerance argument to tune...

4 months 前 | 0

已回答
square matrix containing Chebyshev polynomials becomes singular when its size becomes greater than a certain value
That is exactky what I have suggested in my answer: use the Chebyschev nodes t0 = 0; tf = 4; N = 75; syms x h = chebyshevT(...

4 months 前 | 0

已回答
square matrix containing Chebyshev polynomials becomes singular when its size becomes greater than a certain value
If you select discrete points d the Chebychev nodes see definition wiki, and not uniform, it will become well posed.

4 months 前 | 0

已回答
interpolate a 2D map (array) of density samples and preserve the total ?
Use trapz for the integration (not sum), it should match (up to round off) with linear interpolation and interger subsamping fo...

4 months 前 | 0

提问


xlabel/ylabel 'HorizontalAlignment' issue
I don't understand the 'HorizontalAlignment' of the text labels. It is not centered (when the figure has different size than the...

4 months 前 | 1 个回答 | 2

1

个回答

已回答
Coefficents of piecewise polynomial in matlab
Similar answer as here points = [1 0 -1 0 1;0 1 0 -1 0]; pp = cscvn(points) m = pp.dim; p = pp.pieces; %D = diff(poi...

4 months 前 | 0

已回答
cscvn of a function, coefficients and breaks
This is how to use pp m = 2; n = 5; % 25 in the original question points = rand(m,n); pp = cscvn(points) m = pp.dim; p =...

4 months 前 | 0

已回答
How to index two vectors together
There is FEX, and fast if you have compiler and compile the mex file. https://www.mathworks.com/matlabcentral/fileexchange/2985...

4 months 前 | 0

已回答
The difference between performing the fft2 and the convolution
Use this function, it will perform the convolution using fft method rightly https://www.mathworks.com/matlabcentral/fileexchang...

4 months 前 | 0

已回答
How can I rotate the axes' labels parallel to the orientation of the axes?
Try this (the letters of label are rotated but the aspect ratio remain constant so they can be read easily but are not look like...

4 months 前 | 0

| 已接受

已回答
Compact way to calculate the centroid of a boundary of a set of points
@Sim The area of the polygonal (A in the book) is sum(A)/2 in Jan code. So sum(A)*3 in Jan's code is equal to 6*area. They are...

4 months 前 | 0

已回答
Mex function Implementation for nested-functions
you did not include operation.c in mex command

4 months 前 | 2

| 已接受

已回答
Strange warning how to interpret it?
Fixed with update 4 https://www.mathworks.com/support/bugreports/3114312

4 months 前 | 2

| 已接受

已回答
Compute only a few entries of a big matrix product
It will not store the result in 2D matrix but 3D array. I hope you can switch to this format of storage. x=rand(10000,10); k =...

4 months 前 | 0

| 已接受

已回答
Matrix addition only to elements equal to zero
C=B; B0 = B==0; C(B0)=A(B0);

4 months 前 | 0

| 已接受

已回答
Code gets stuck loading when I try to run it.
First look of your code shows that you do this mistake: https://www.mathworks.com/help/matlab/matlab_prog/preallocating-arrays....

4 months 前 | 0

已回答
How to efficiently calculate a weighted sum of 3 dimensional matrix through a vector in matlab
This uses matrix multiplication so it should be well optimized and fast. [m,n] = size(A, [1 2]); C = reshape(A,m*n, []) * B(:)...

4 months 前 | 2

| 已接受

已回答
Matrix inverse in objective function
The inv() is not supported by optimization expression see https://www.mathworks.com/help/optim/ug/supported-operations-on-optimi...

4 months 前 | 0

| 已接受

加载更多