답변 있음
Randomly splitting of a number in a sum format.
n = 10; for j=1:10 r = n; i = 1; clear s while r > 0 s(i) = ceil(r*rand); r = r-s(i); ...

6달 전 | 0

| 수락됨

답변 있음
mldivide algorithm for an underdetermined system of equations
The outline of "\" goes as following: % Test data A=randi(10,3,2)*randi(10,2,5) b=randi(10,3,1) [Q, R, P] = qr(A,'vector')...

6달 전 | 2

| 수락됨

답변 있음
Function to create struct with parameters
s = buildparams() function s = buildparams() a = 1; b = 2; s = gathervars(); end function s = gathervars() vars = eva...

6달 전 | 0

제출됨


nchoosek_enum
nchoosek with enumerate selection. This function never build the full combination array in memory

6달 전 | 다운로드 수: 1 |

답변 있음
Creating separate combinations with repetition
I program a function nchoosek_enum that is almost like nchoosek, excepted that you can pass an enumerated array i that selects t...

6달 전 | 0

답변 있음
How to get all combinations from this matrix?
ch=['MRWI' 'IDMZ' 'CGBI' 'JKNO']; c=num2cell(ch,2); [c{:}]=ndgrid(c{:}); n=size(c,1); c = reshape(cat(n+1,c{:}),[],n)

6달 전 | 0

| 수락됨

답변 있음
How to trim the non-manifold triangle off the stl file?
There is SW that can detect topology issue and attempt to correct it, such as https://www.meshlab.net/

6달 전 | 0

답변 있음
how to count the number of occurrences of these numbers (with some conditions)
A(1,:) = [1, 2, 5, 2 , 1 , 2]; A(2,:) = [0,1,1,0,1,0]; [B,~,J] = unique(A(1,:)); N = accumarray(J(:),A(2,:)'); B = B'; ta...

6달 전 | 0

| 수락됨

답변 있음
How to select complementary elements from a vector?
d = [33 20 4 5 6 75 8 9 0]; I = [1 3 7]; d(I) = []

6달 전 | 0

답변 있음
How to select complementary elements from a vector?
d = [33 20 4 5 6 75 8 9 0]; I = [1 3 7]; d(setdiff(1:end,I))

6달 전 | 0

| 수락됨

답변 있음
Matlab equivalent of rand() in C++
random4 = randi(item)-1

6달 전 | 0

| 수락됨

답변 있음
Multiple griddata calls into a single one (same grid)
For nearest/linear/cubic method you can build the matrix https://www.mathworks.com/matlabcentral/fileexchange/85939-mat-op-ex, f...

6달 전 | 0

답변 있음
Multiple griddata calls into a single one (same grid)
If you are ready to trade 'v4' method for something else, you can use scatteredInterpolant % example of fake data x = -3 + 6...

6달 전 | 0

답변 있음
Passing structs/objects to functions
"Does the compiler realize which parts of the struct are actually needed and pass only these to the function? " MATLAB don't pa...

6달 전 | 0

| 수락됨

답변 있음
Smallest number of data type single
>> realmin('single') ans = single 1.1755e-38 >>

6달 전 | 0

답변 있음
How to remove redundant elements in a sparse matrix?
E = triu(E);

6달 전 | 1

답변 있음
Please help me vectorize my loop to construct query vector from sample points
xs=cumsum(ceil(10*rand(1,10))) t=pi; p=cumsum([0 ceil(diff(xs)/t)]); xq=interp1(p,xs,0:p(end))

6달 전 | 0

| 수락됨

답변 있음
Non-convex shape as a collisionBox for robot path planning
The MATLAB probably use GJK algorithm that requires convex shape. You should split the object in sum of convex. I can recommend...

6달 전 | 0

답변 있음
Fast implementation of max-plus matrix multiplication
function C = mp_prod(A,B) m=size(A,1); n=size(B,2); AA=reshape(A,m,1,[]); BB=reshape(B.',1,n,[]); C=max(AA+BB,[],3); tic/t...

6달 전 | 2

답변 있음
Preallocating cells with unknown output size
If the size is not known, a good way is the to grow the preallocation array exponentially. Rather than the assigment X{i,j} =...

6달 전 | 0

| 수락됨

답변 있음
Size mismatch error on dimension 2: expected 1, but actual size is 3 (Matlab Coder)
Size of ones(SimCoreIn(k).Ns,SimCoreIn(k).Np) = 102 x 3 So (102 x 1).*(102 x 3) gives (102 x 3) right. Right but cod...

6달 전 | 0

| 수락됨

답변 있음
Why the sparse pattern of a sparse matrix changed
The mex probably creates a non-valid sparse matrix, use spok to check validity

6달 전 | 1

| 수락됨

답변 있음
continuous piecewise linear approximation of data set
see if this can help you https://www.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation

6달 전 | 0

답변 있음
App does not execute properly unless in debug mode [R2020b]
May be you should add drawnow so as things get refresed app.run.Enable='off' drawnow

6달 전 | 0

답변 있음
Calling script from a function is recommended?
Inconvenience: MATLAB coder cannot work on script inside function

6달 전 | 0

질문


Calling script from a function is recommended?
Now and then I call script from a function, the purspose is often initialize some constant values that are shared by across the ...

6달 전 | 답변 수: 2 | 0

2

답변

답변 있음
How to speed up this for loop containing kronecker product?
Yesterday I profile your code and the majority of time is eaten by H = K_D*K_D' - K_S*K_S'; not by Kronecker. The question is...

6달 전 | 0

답변 있음
svds(X,r) and svd(X,'econ') generating different singular vectors for large complex matrix X ??
The singular value (eigen) decomposition SVD/SVDS is not unique, vectors is up to scaling, (values is up to order for eigen valu...

6달 전 | 1

| 수락됨

답변 있음
How to find the first element in ascending numbers that repeat?
A = [1 2 3 4 0 1 0 1 0 1 0 1 2 3 4 0 1 0 1 0 1 1 2 3 4] b = find(A(1:end-1)==1 & diff(A)>0)

6달 전 | 0

더로드