Suspensa Vix Via Fit

Answered

How can I create a new cell array from a existing array that only holds specific values?

You are defining a scalar cell on the RHS and putting it inside another cell array on the LHS, giving you nested cell arrays. Bu...

How can I create a new cell array from a existing array that only holds specific values?

You are defining a scalar cell on the RHS and putting it inside another cell array on the LHS, giving you nested cell arrays. Bu...

ongeveer 3 uur ago | 0

Answered

removing specifics elements from a matrix

acomb_w = [... 1 1 2 1 3 1 4 1 1 2 2 2 3 2 4 2 ...

removing specifics elements from a matrix

acomb_w = [... 1 1 2 1 3 1 4 1 1 2 2 2 3 2 4 2 ...

ongeveer 6 uur ago | 2

Answered

How to multiply arrays to create a larger one

A = rand(3,4,3); B = rand(3,5); C = A(1,:,2).' * B(2,:)

How to multiply arrays to create a larger one

A = rand(3,4,3); B = rand(3,5); C = A(1,:,2).' * B(2,:)

ongeveer 18 uur ago | 0

Submitted

Maximally Distinct Color Generator

Generate maximally distinct colors in an RGB colormap.

ongeveer 18 uur ago | 56 downloads |

Answered

Logical comparison (>= to be specific) between each element (row) of a column vector, and all elements inside each row of a matrix having same number or rows, respectively

A = [1,2,3,4,5,6;7,8,9,10,11,12;13,14,15,16,17,18] B = [4;10;16] C = A>=B % requires >=R2016b C = bsxfun(@ge,A,B) % for earli...

Logical comparison (>= to be specific) between each element (row) of a column vector, and all elements inside each row of a matrix having same number or rows, respectively

A = [1,2,3,4,5,6;7,8,9,10,11,12;13,14,15,16,17,18] B = [4;10;16] C = A>=B % requires >=R2016b C = bsxfun(@ge,A,B) % for earli...

ongeveer 20 uur ago | 0

| accepted

Answered

atan2 not consisent

The reason is a little arcane: negative zero: https://en.wikipedia.org/wiki/Signed_zero The other answers and comments are wro...

atan2 not consisent

The reason is a little arcane: negative zero: https://en.wikipedia.org/wiki/Signed_zero The other answers and comments are wro...

1 dag ago | 3

Answered

How can i divide data into equal parts?

V = 1:100; C = mat2cell(V,1,[25,25,25,25]); C{1} % C{2}, etc.

How can i divide data into equal parts?

V = 1:100; C = mat2cell(V,1,[25,25,25,25]); C{1} % C{2}, etc.

2 dagen ago | 0

| accepted

Answered

How to call array with string

Fieldnames are not indices (or atleast, not in the way that you are trying to use them). And writing the app variable, loaded va...

How to call array with string

Fieldnames are not indices (or atleast, not in the way that you are trying to use them). And writing the app variable, loaded va...

2 dagen ago | 0

| accepted

Answered

Help regarding the Munsell and Kubelka-Munk Toolbox - RGB to Munsell conversion

The function sRGBtoMunsell calls the function xyYtoMunsell which calls the function IsWithinMacAdamLimits . The author wrote som...

Help regarding the Munsell and Kubelka-Munk Toolbox - RGB to Munsell conversion

The function sRGBtoMunsell calls the function xyYtoMunsell which calls the function IsWithinMacAdamLimits . The author wrote som...

3 dagen ago | 0

| accepted

Answered

Why its showing error using vertcat?

I suspect that this line sumx2y= sumx2y + (((x(i))^2)*y); requires indexing into y, e.g.: sumx2y = sumx2y + (x(i)^2)*y(i);

Why its showing error using vertcat?

I suspect that this line sumx2y= sumx2y + (((x(i))^2)*y); requires indexing into y, e.g.: sumx2y = sumx2y + (x(i)^2)*y(i);

4 dagen ago | 0

| accepted

Answered

Cell contents reference from a non-cell array object.

Each cell of v contains a numeric vector. So your indexing here: v{1}{k+1} = v{1}{k+1}-1 % ^ ^ ^ ^ wrong type of b...

Cell contents reference from a non-cell array object.

Each cell of v contains a numeric vector. So your indexing here: v{1}{k+1} = v{1}{k+1}-1 % ^ ^ ^ ^ wrong type of b...

4 dagen ago | 0

| accepted

Answered

Change 3x1 double to 1x3 double and convert it to a string to insert in text correctly

v = [0;2/3;2/3] num2str(v.') or sprintf('%g %g %g',v)

Change 3x1 double to 1x3 double and convert it to a string to insert in text correctly

v = [0;2/3;2/3] num2str(v.') or sprintf('%g %g %g',v)

5 dagen ago | 0

Answered

Preallocation of a vector of structure

n = 9; P = 'absolute or relative path to where the files are saved'; C = cell(1,n); V = setdiff(1:n,5); for k = V F = s...

Preallocation of a vector of structure

n = 9; P = 'absolute or relative path to where the files are saved'; C = cell(1,n); V = setdiff(1:n,5); for k = V F = s...

6 dagen ago | 0

Submitted

Convert between RGB and Color Names

RGB to color name. Color name to RGB. Palettes: CSS, HTML, MATLAB, SVG, X11, xcolor, xkcd,...

7 dagen ago | 46 downloads |

Answered

How to call data from files named with dynamic index

"select a great number of files for importing (best from a Windows Explorer "open a file" dialog)" If you really have a "great ...

How to call data from files named with dynamic index

"select a great number of files for importing (best from a Windows Explorer "open a file" dialog)" If you really have a "great ...

7 dagen ago | 0

| accepted

Answered

Add Variables to workspace from a struct

"My final goal is to export the variables as a .mat file that I would be able to use afterwards for other things" Then creating...

Add Variables to workspace from a struct

"My final goal is to export the variables as a .mat file that I would be able to use afterwards for other things" Then creating...

7 dagen ago | 1

Answered

Storing Multiple Arrays into Larger Array

This is easy if you store all of the data in one cell array (rather than in separate variables): C = {a,b,c,..,p}; % this is ho...

Storing Multiple Arrays into Larger Array

This is easy if you store all of the data in one cell array (rather than in separate variables): C = {a,b,c,..,p}; % this is ho...

8 dagen ago | 0

| accepted

Answered

delete zero elements from vector

k = nonzeros(k); k(end+1:end+2) = k(end)

delete zero elements from vector

k = nonzeros(k); k(end+1:end+2) = k(end)

8 dagen ago | 0

| accepted

Answered

How to create multiple arrays for multiple outputs of a function in a for loop

In MATLAB it is generally much better to loop over indices, rather than looping over data values: dt = 1e-6; D_targ = 100; v_...

How to create multiple arrays for multiple outputs of a function in a for loop

In MATLAB it is generally much better to loop over indices, rather than looping over data values: dt = 1e-6; D_targ = 100; v_...

8 dagen ago | 0

Answered

For loop help!

"... so becase of the amount of data i need a for loop" I doubt that using a loop would be a good approach. V = 1:12; R = 3; ...

For loop help!

"... so becase of the amount of data i need a for loop" I doubt that using a loop would be a good approach. V = 1:12; R = 3; ...

8 dagen ago | 0

Answered

Convert Array of Float to comma delimited string

data = [1,2,3,4]; strjoin(compose("%d",data),", ") % provides formatting control strjoin(""+data,", ") % default formatting

Convert Array of Float to comma delimited string

data = [1,2,3,4]; strjoin(compose("%d",data),", ") % provides formatting control strjoin(""+data,", ") % default formatting

10 dagen ago | 1

| accepted

Answered

How to extract output from function

To get De you could use arrayfun: a=1; b=2; ya=1; m=40; [t,y]=pure(@my,a,b,ya,m) [~,dE] = arrayfun(@(tv)my(tv,y),t) funct...

How to extract output from function

To get De you could use arrayfun: a=1; b=2; ya=1; m=40; [t,y]=pure(@my,a,b,ya,m) [~,dE] = arrayfun(@(tv)my(tv,y),t) funct...

10 dagen ago | 0

| accepted

Answered

Dynamic variable names for MATLAB table

Use array2table instead of table (the wrong function, unless you really want the array in one variable). Get rid of all of that...

Dynamic variable names for MATLAB table

Use array2table instead of table (the wrong function, unless you really want the array in one variable). Get rid of all of that...

10 dagen ago | 0

| accepted

Answered

Creating Diagonal Matrix from a Vector

The efficient MATLAB approach: g = [1,2,3,4,5]; z = zeros(1,numel(g)-1); m = toeplitz([g(1),z],[g,z])

Creating Diagonal Matrix from a Vector

The efficient MATLAB approach: g = [1,2,3,4,5]; z = zeros(1,numel(g)-1); m = toeplitz([g(1),z],[g,z])

10 dagen ago | 0

| accepted

Answered

Error when accessing indices of a vector

Is zero a valid index? n = 2; i = 262140; mod(i+n+1, 262143) Solution: to adjust from zero-based indexing (shown in the prov...

Error when accessing indices of a vector

Is zero a valid index? n = 2; i = 262140; mod(i+n+1, 262143) Solution: to adjust from zero-based indexing (shown in the prov...

11 dagen ago | 1

| accepted

Answered

Iterate through several tables of different sizes to perform calculations separately

"Is it possible to loop through them or do I need to create a pointer to each table? Is a pointer to a table possible in matlab?...

Iterate through several tables of different sizes to perform calculations separately

"Is it possible to loop through them or do I need to create a pointer to each table? Is a pointer to a table possible in matlab?...

12 dagen ago | 0

| accepted

Answered

two outputs of a function

[cnt,A] = matrice_nou_vechi([1,2],3,2)

two outputs of a function

[cnt,A] = matrice_nou_vechi([1,2],3,2)

13 dagen ago | 0

| accepted

Answered

find distances between vectors in a cell array

"pdist doesnt seem to work for me in this case bc the elements arent character arrays or strings." According to the pdist docum...

find distances between vectors in a cell array

"pdist doesnt seem to work for me in this case bc the elements arent character arrays or strings." According to the pdist docum...

14 dagen ago | 0

Answered

How to replace different values with NaN in a matrix.

Matrix = [50 51 52 53 54 55; 110 111 112 113 114 115; 1 0 0 1 0 0].' idx = Matrix(:,3)==0; Matrix(idx,2) = NaN

How to replace different values with NaN in a matrix.

Matrix = [50 51 52 53 54 55; 110 111 112 113 114 115; 1 0 0 1 0 0].' idx = Matrix(:,3)==0; Matrix(idx,2) = NaN

15 dagen ago | 0

Answered

Error using == Matrix dimensions must agree.

You don't need a loop, try this: idx = cellfun(@isempty,combined1); combined1(idx) = [] "Anyone who can spot the mistake?" Y...

Error using == Matrix dimensions must agree.

You don't need a loop, try this: idx = cellfun(@isempty,combined1); combined1(idx) = [] "Anyone who can spot the mistake?" Y...

15 dagen ago | 0

| accepted