回答済み
Get Interpolation transfer relation matrix instead of interpolated values
The matrix can be derived from linear interpolation method only, by linear I meant the output is linear to the input. SPLINE met...

約6年 前 | 2

| 採用済み

回答済み
Nested for loops without repetition
I won't fix your code with 4/5 nested for-loops and if conditions and .... I give you an alternative code. It requires a functi...

約6年 前 | 0

| 採用済み

送信済み


All Permutations of integers with sum criteria
All Pernutations of integers with sum criteria

約6年 前 | ダウンロード 1 件 |

5.0 / 5

回答済み
Is there any method to calculate the inverse of matrix which changed a few values?
Apply this Sherman Morisson's formula in the page provided by Vladimir, if one set a single change: A(i,j) to new value newAij, ...

約6年 前 | 0

回答済み
How can I determine the amount of times a certain value can be achieved by summing values in a matrix?
I put here the code with limiting CPU time so one can run up to 50 samples. Matt should get credit for his original idea. fulll...

約6年 前 | 0

回答済み
How to limit calculation precision?
Perhaps all you need is cast all your input data/parameters/constants related your program to SINGLE. The relative precision is...

約6年 前 | 1

回答済み
Complex nested loops- matrix indexing
A=randi(10,20,20) % some tes matrix, replace it with yours B = A(6:1:17, 3:-1:2)

約6年 前 | 0

回答済み
K-th order neighbors in graph
Given A an (n x n) symmetric ajadcent matrix (undirected graph), and k the order (integer scalar), I propose this algorithm to f...

約6年 前 | 0

回答済み
Problem of ``sprandn'': the number of nonzero elements is inconsistent with density
The approximation is only good when density << 1. I think SPRAND/SPRANDN simply create random draw of (density*m*n) pairs of (i,...

約6年 前 | 2

| 採用済み

回答済み
Is there a way to do the following without running a for loop.
y = randi(5,1,5)' Then A = accumarray([(1:5)' y(:)], 1, [5 5]); or A = zeros(5,5); A(sub2ind(size(A),1:5,y'))=1

約6年 前 | 0

| 採用済み

回答済み
Raw by column wise multiplication of matrices
>> A=randi(10,4,3) A = 6 5 4 3 4 1 8 4 10 2 8 10 >> B=randi(10,3,4...

約6年 前 | 1

| 採用済み

回答済み
Smooth derivative of a matrix
Here is my take on the derivative by using a phase correction on all components of Uk. As example, I use the random matrix H g...

約6年 前 | 0

回答済み
Sorting a matrix using it's index
[Asort,idA] = sort(A,2) m = size(A,1); ilinA = (idA-1)*m+(1:m)'; Asort3 = A(ilinA) % get back Asort

約6年 前 | 0

回答済み
Smooth derivative of a matrix
I give just an idea that is like a big hammer. What if you use minimization technique to get a closest eigen vectors to the prev...

約6年 前 | 0

回答済み
Inserting a row in a matrix in a precise place
[~,r] = histc(b, [A(:,1); Inf]); Ab = [A(1:r,:); b; A(r+1:end,:)]; % r+1 is the row-position of b in the new array

約6年 前 | 0

回答済み
Row vector divide by row vector
It returns the scalar C (maxtrix 1x1) such that C*B ~ A in the sense that norm(C*B - A)^2 % or equivalently sum((C*B - A)...

約6年 前 | 0

| 採用済み

回答済み
Minimizing norm( a_i x - ( y B_i + c_i ) ) with constraint
If you have optimization toolbox you can do (see my other answer for definition of A, b and z) z= fmincon(@(z) norm(A*z-b,2).^2...

約6年 前 | 0

回答済み
Minimizing norm( a_i x - ( y B_i + c_i ) ) with constraint
So you want more or less Minimize | A*z - b |^2 with the constraint | z | <= 1. where |.| designates the l2 norm. I believe ...

約6年 前 | 2

質問


The Mathworks Support Team
I have seen The Mathworks Support Team creates various questions and answers that provide a lot of interesting knowledges, trick...

約6年 前 | 1 件の回答 | 0

1

回答

回答済み
Obtain 2D Histogram from 3D matrix and 2D pdf
Check this out

約6年 前 | 0

回答済み
Find all the possibles paths between 2 nodes in undirected graph
Test script % Generate random undirect graph % https://www.mathworks.com/matlabcentral/answers/563732 n = 10; % number of nod...

約6年 前 | 0

| 採用済み

回答済み
Properties of adjacency matrix
Another way - most direct perhaps link to matrix property - is using this property of Laplacian matrix: "The number of connecte...

約6年 前 | 0

回答済み
How to add repeated elements to a vector without looping?
accumarray([1 2 4 3 2 1 1]', 1)' Put [1 1 1 1 1 1 1]' as second argument if the values to accumulate are not uniform. (importa...

約6年 前 | 0

| 採用済み

回答済み
How to write pentadigonal matix?
m = 4; n = 3*m; T = diag(ones(1,n-3),3); A = T + T'; B = ones(3)-5*eye(3); A = A + kron(eye(m),B)

約6年 前 | 0

回答済み
Properties of adjacency matrix
Here is a quick and dirty calculation of connexed component using adjacent matrix. It returns the same output as MATLAB conncomp...

約6年 前 | 0

| 採用済み

回答済み
Generating parings of numbers and the pairs must not contain the same numbers
Use derangement (randpermfull function used below) n= 20; D = [1:n; randpermfull(n)]' R = D(randperm(n),:)

約6年 前 | 0

| 採用済み

回答済み
Generating parings of numbers and the pairs must not contain the same numbers
Not sure if you require each column is the set 1:20 if yes see my other answer. If not upperbnd = 20; % values in [1:upperbnd]...

約6年 前 | 0

回答済み
Finding unique rows using "uniquetol" from top
I suppose you can do something like this. I'm affraid the way UNIQUETOL and ISMEMBERTOL consider the TOL internally, and in some...

約6年 前 | 0

| 採用済み

回答済み
Discretizing the probability distribution
To generate 1D random variable with a prescribed continuous PDF, one need 2 things: able to integrate pdf (called cdf) able to...

約6年 前 | 0

| 採用済み

さらに読み込む