Answered

abcd is efghijk?

function C= circulant(x) n=length(x); C=zeros(n,n); C(:,1)=x; for j=2:n C(:,j)=[C(n,j-1); C(1:n-1,j-1)]; end

abcd is efghijk?

function C= circulant(x) n=length(x); C=zeros(n,n); C(:,1)=x; for j=2:n C(:,j)=[C(n,j-1); C(1:n-1,j-1)]; end

1 day ago | 0

| accepted

Answered

abcd is efghijk?

function C= circulant(x) n = length(x); C = x(mod((1:n)'-(1:n),n)+1);

abcd is efghijk?

function C= circulant(x) n = length(x); C = x(mod((1:n)'-(1:n),n)+1);

1 day ago | 0

Question

Memory leak with OPENGL hardware

Context: I have a matlab code that output a complex 3D graphic animation on GUI figure, involving patch, lines, markers, camera ...

1 day ago | 0 answers | 0

Answered

Obtain all integer partitions for a given integer

I wrote a short function that doesn't need to post-proceesed with UNIQUE (wast of time and memory) when using with NSUMK or allv...

Obtain all integer partitions for a given integer

I wrote a short function that doesn't need to post-proceesed with UNIQUE (wast of time and memory) when using with NSUMK or allv...

1 day ago | 0

Answered

abcd is efghijk?

function C= circulant(x) toeplitz(x,circshift(flip(x),1)) end

abcd is efghijk?

function C= circulant(x) toeplitz(x,circshift(flip(x),1)) end

2 days ago | 0

Answered

Set of sequnce number

>> A = [1,2,3,4,5,6,7,8] A = 1 2 3 4 5 6 7 8 >> polyval(A,10) ans = 12345678...

Set of sequnce number

>> A = [1,2,3,4,5,6,7,8] A = 1 2 3 4 5 6 7 8 >> polyval(A,10) ans = 12345678...

3 days ago | 0

Answered

Histcounts including values beyond bin edges

Append -Inf/+Inf in your finite edges

Histcounts including values beyond bin edges

Append -Inf/+Inf in your finite edges

3 days ago | 1

| accepted

Answered

Meaning of less/greater than in handle objects

I believe the graphic handle object at one point of MATLAB history (before R2014b?) is just a double numbers unique assigned too...

Meaning of less/greater than in handle objects

I believe the graphic handle object at one point of MATLAB history (before R2014b?) is just a double numbers unique assigned too...

3 days ago | 0

| accepted

Answered

How can I access the last values of a list using end?

list(end-3)

How can I access the last values of a list using end?

list(end-3)

5 days ago | 1

| accepted

Answered

Matrix having one row

Avoid using LENGTH Replace with for i = 1:size(x,1) ... end

Matrix having one row

Avoid using LENGTH Replace with for i = 1:size(x,1) ... end

6 days ago | 0

| accepted

Answered

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...

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...

6 days ago | 0

Answered

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.

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.

6 days ago | 0

| accepted

Answered

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...

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...

6 days ago | 0

| accepted

Answered

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)...

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)...

7 days ago | 1

| accepted

Answered

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...

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...

7 days ago | 1

| accepted

Answered

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....

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....

9 days ago | 1

| accepted

Answered

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 ...

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 ...

9 days ago | 0

Answered

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...

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...

11 days ago | 1

| accepted

Answered

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...

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...

11 days ago | 1

| accepted

Answered

how to plot 2D mesh using coordinates and connectivity matrix?

Use FILL or PATCH

how to plot 2D mesh using coordinates and connectivity matrix?

Use FILL or PATCH

11 days ago | 0

Answered

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...

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...

11 days ago | 0

| accepted

Answered

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)))

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)))

12 days ago | 0

| accepted

Answered

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 : ...

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 : ...

12 days ago | 0

| accepted

Answered

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]

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]

12 days ago | 1

| accepted

Answered

Solving Matrix functions with a function

x0 = zeros(48,1); xA = lsqnonlin(@(x) f(x)-A, x0)

Solving Matrix functions with a function

x0 = zeros(48,1); xA = lsqnonlin(@(x) f(x)-A, x0)

12 days ago | 0

Answered

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 = {}

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 = {}

14 days ago | 1

| accepted

Answered

Reversing binary stream Conversion According to attached table?

function [output, outputchar] = reversebinrestore(m, array) if ischar(array) array = array-'0'; end switch m ca...

Reversing binary stream Conversion According to attached table?

function [output, outputchar] = reversebinrestore(m, array) if ischar(array) array = array-'0'; end switch m ca...

14 days ago | 1