Réponse apportée
Matrix having one row
Avoid using LENGTH Replace with for i = 1:size(x,1) ... end

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Memory cost of multiplying sparse matrices
I guess MATLAB creates a temporary buffer of length equals to the number of rows of A when A*B is invoked. The exact detail only...

presque 6 ans il y a | 0

Réponse apportée
How can I pseudorandomize with constrains and make spesific number spread equally among the array?
Unzip this attached file, you'll get a pfile r1234.p Call it A = r1234 You'll get the result as specified.

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Replacing several values in multidimensional array simultaneously
A(:,:,1) = [1 2 3 ; 4 5 6]; A(:,:,2) = [7 8 9 ; 10 11 12]; s = size(A); A(:, sub2ind(s(2:3),[2 3],[1 2])) = 0 % = [0 0; 0...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to generate a matrix with assigned probability?
it doesn't matter whereas it run in for-loop or not. x = 0.8; % probability of 1s m = 5; n = 2; % for ... A = rand(m,n)...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Permutations of array retaining sub-array groups together
Try this: A = [ 1 2 3 4 5 6 7 8] G = [ 1 2 2 2 3 4 5 5 ] l = diff(find([true,diff(G)>0,true])); Ag = mat2cell(A, 1, l); A...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to calculate the angle between two sets of scatter plots?
clear o_data = [3.11009098091043 0.0161338808382554 -3.50871929189684; 34.1536562864604 0.446152781388255 -3....

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How do I found A-B*x which these matrix are 3x3
Waoh, revise the theory of eigen vectors and linear algebra in general Multiply a vector by a constant diagonal matrix is like ...

presque 6 ans il y a | 0

Réponse apportée
Extract sub n-dimensional array from n-dimensional array
% Testt matrix A=randi(10,[2,3,4]) n = ndims(A); s = size(A); i = repelem({':'}, 1, n) ; i{end} = 3 % whatever page s...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
error in matrix multiplication
MATLAB uses two different BLAS functions to perform B*D' and B*K In the first case, it use D and it never explicitly compu...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
how to plot 2D mesh using coordinates and connectivity matrix?
Use FILL or PATCH

presque 6 ans il y a | 0

Réponse apportée
How to get the best combination of element to approach a value?
EDIT CODE If you have optimization toolbox a = [68,150,270,560,1000,2200,4700,9400] ; val = 7611 A = [ a, -1; -a, -1...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to find the index of a non-integer array with closest value to any integer?
x = [3.75 22.95 2548.01 424.5] [~,i] = min(abs(x-round(x)))

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Finding Minimum value of an anonymous function using fminbnd
You should not mix between discrete sampling of your function G and continuous evaluation required by FMINBND % Given : ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
creating a matrix from a vector
v2=linspace(-30,10,100) % This iis a ROW vector not column M1 = [v2.', v2.', v2.'] M2 = [v2; v2; v2]

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Solving Matrix functions with a function
x0 = zeros(48,1); xA = lsqnonlin(@(x) f(x)-A, x0)

presque 6 ans il y a | 0

Réponse apportée
why my empty cell array taking 104 bytes instead of 112 bytes..?
A = {[]} is NOT an empty cell, it's 1 x 1 cell contains an empty array. An empty cell is A = {}

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Reversing binary stream Conversion According to attached table?
function [output, outputchar] = reversebinrestore(m, array) if ischar(array) array = array-'0'; end switch m ca...

presque 6 ans il y a | 1

Réponse apportée
How to calculate the area of one Pixel?
The formula you get doesn't depend on the UNIT assuming you use the same unit everywhere. If length is pixel, then use area wit...

presque 6 ans il y a | 0

Réponse apportée
How do I create a function script to check the positive definiteness of a a square matrix of any size?
Code based on Sylvester's critterion function tf = isposdef(M) tf = ispd(M+M'); end function tf = ispd(M) tf = det(M)>0 &...

presque 6 ans il y a | 0

Réponse apportée
How I can solve linear programming with multiple quadratic and linear constraints?
Use FMINCON

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to create a checkerboard matrix without inbuilt function.
Two more methods toeplitz(mod(0:7,2)) or for even size kron(ones(4),[0 1;1 0])

presque 6 ans il y a | 0

Réponse apportée
Is discussion of cryptography allowed?
How those US regulations would matter for foreign participants like me? I'm not under those restriction or I'm I? If the answe...

presque 6 ans il y a | 0

Réponse apportée
Converting a maximizing problem into a minimizing program using linprog
You just need to reverse the sign of f. Don't touch the rest.

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Access outer varargin inside a nested function
A varargin is just a cell. So pass it in the nested function as input argument function outer(a, b, varargin) function inn...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Graph Laplacian : very small values instead of zeros
Roughly the smallest non-zero eigenvalue of the laplacian has lower bound of 2*(1-cos(pi/N)) where N is the longest path of yo...

presque 6 ans il y a | 1

Réponse apportée
How to reproduce original matrix, after deleting zeros from matrix for computations
Put the index on the LHS CompleteResult = zeros(size(CompleteWlData)); % or nan(...) CompleteResult(Wl_indices) = FurtherProce...

presque 6 ans il y a | 1

Réponse apportée
How can I make a 2D color map?
Something like this R=[1 0; 1 0]; G=[1 1 0 0]; B=[0 0 0 1]; R = interp2(R,8); G = interp2(G,8); B = interp2(B,...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
I have random uniform distributed points in a 3D plot. How can I subdivide the plot into cube shaped grids with equal volume.
N=1e3; % Number of points cubesize = 100; % meter subdivision = 3; % == 27^(1/3) subcubesize = cubesize/subdivision; % G...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
rcond warning differs from computed value of rcond
When your matrix is ill-conditionned, everything computing that is related to the subspaces of the smallest eigen values are aff...

presque 6 ans il y a | 1

| A accepté

Charger plus