Suspensa Vix Via Fit

Answered

How to reshape a matrix (something that can't be done with reshape function)

A = [1,4,7,10;2,5,8,11;3,6,9,12] nmc = 2; % output number of columns nmr = 3; % output number of rows per "group" B = reshape...

How to reshape a matrix (something that can't be done with reshape function)

A = [1,4,7,10;2,5,8,11;3,6,9,12] nmc = 2; % output number of columns nmr = 3; % output number of rows per "group" B = reshape...

14 minuter ago | 0

Submitted

Next Available Filename

Returns the next unused file or folder name. The name is created by incrementing a numbered suffix.

ungefär 10 timmar ago | 10 downloads |

Answered

find all sequences between delimiters in an array

v = [1,1,0,2,0,2,1,2,1,1,1,0,2,1,2,0,0,1,1,1,1,1,1,2,1,0]; [begIdx,endIdx,~,match] = regexp(sprintf('%d',v),'2.*?0')

find all sequences between delimiters in an array

v = [1,1,0,2,0,2,1,2,1,1,1,0,2,1,2,0,0,1,1,1,1,1,1,2,1,0]; [begIdx,endIdx,~,match] = regexp(sprintf('%d',v),'2.*?0')

ungefär 13 timmar ago | 1

| accepted

Answered

User defined function that evaluates anonymous function with variable number of inputs

Your mistake was deciding to use eval, which is one way that beginners paint themselves into a corner with slow, inefficient, co...

User defined function that evaluates anonymous function with variable number of inputs

Your mistake was deciding to use eval, which is one way that beginners paint themselves into a corner with slow, inefficient, co...

ungefär 22 timmar ago | 0

Answered

Array indices must be positive integers or logical values

"every element is positive and >0" Nope: S = load('data_req.mat') find(S.IntOutAdr==0)

Array indices must be positive integers or logical values

"every element is positive and >0" Nope: S = load('data_req.mat') find(S.IntOutAdr==0)

en dag ago | 0

Answered

Storage elements from matrix in other one, with indexing.

The MATLAB approach: A = [8,3,0,2;9,6,1,4;10,6,2,1;1,6,2,8] v = [2,4]; out = A(v,v)

Storage elements from matrix in other one, with indexing.

The MATLAB approach: A = [8,3,0,2;9,6,1,4;10,6,2,1;1,6,2,8] v = [2,4]; out = A(v,v)

en dag ago | 1

Answered

Extend a string within a for loop by values from switch case

Forget about C. The MATLAB approach is to work with vectors and matrices (which is where the name MATLAB comes from): inp = 'A...

Extend a string within a for loop by values from switch case

Forget about C. The MATLAB approach is to work with vectors and matrices (which is where the name MATLAB comes from): inp = 'A...

en dag ago | 1

Answered

Control Dynamically Multi-Dimension Matrix on fprintf

A(:,:,1) = [1,2,4;5,2,1;6,2,1]; A(:,:,2) = [4,6,1;8,0,3;1,2,4]; A(:,:,3) = [5,8,2;4,4,4;1,0,0]; D = ndims(A); F = repmat(',%...

Control Dynamically Multi-Dimension Matrix on fprintf

A(:,:,1) = [1,2,4;5,2,1;6,2,1]; A(:,:,2) = [4,6,1;8,0,3;1,2,4]; A(:,:,3) = [5,8,2;4,4,4;1,0,0]; D = ndims(A); F = repmat(',%...

2 dagar ago | 0

| accepted

Answered

Apply a change on all the double variables of a .mat file at once

"Do you have any idea on how I can apply a change on all the double variables of a .mat file at once." Easy: load into an outp...

Apply a change on all the double variables of a .mat file at once

"Do you have any idea on how I can apply a change on all the double variables of a .mat file at once." Easy: load into an outp...

4 dagar ago | 0

Submitted

Interactive Regular Expression Tool

Develop and refine regular expressions in an interactive figure that shows all of REGEXP's outputs.

4 dagar ago | 17 downloads |

Answered

make a matrix from a structure field.

Where S is the name of your structure: out = vertcat(S.ch_nme2) https://www.mathworks.com/help/matlab/matlab_prog/comma-separa...

make a matrix from a structure field.

Where S is the name of your structure: out = vertcat(S.ch_nme2) https://www.mathworks.com/help/matlab/matlab_prog/comma-separa...

4 dagar ago | 1

| accepted

Answered

Resolving Matrix dimensions must agree

Use strcmp or strcmpi to check if two text strings match or not: if strcmp(A,B) Alternatively you could use one switch stateme...

Resolving Matrix dimensions must agree

Use strcmp or strcmpi to check if two text strings match or not: if strcmp(A,B) Alternatively you could use one switch stateme...

6 dagar ago | 1

Answered

read a large number of hdf5 files with for loop and store in new variables

"I want to make new variables as I have some post proccesing manipulation to do on these data." You might want to do that, but ...

read a large number of hdf5 files with for loop and store in new variables

"I want to make new variables as I have some post proccesing manipulation to do on these data." You might want to do that, but ...

6 dagar ago | 0

| accepted

Answered

How can I make the difference or subtraction between two scalar vectors?

x1 = [1,2,5,8]; x2 = [2,1,0,6]; setdiff(x1,x2) https://www.mathworks.com/help/matlab/set-operations.html "and do we choose v...

How can I make the difference or subtraction between two scalar vectors?

x1 = [1,2,5,8]; x2 = [2,1,0,6]; setdiff(x1,x2) https://www.mathworks.com/help/matlab/set-operations.html "and do we choose v...

6 dagar ago | 0

| accepted

Answered

How to convert cell array to float array?

M = [... as a numeric matrix (e.g. CELL2MAT or STR2DOUBLE) 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 1 1 1 0 ...

How to convert cell array to float array?

M = [... as a numeric matrix (e.g. CELL2MAT or STR2DOUBLE) 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 1 1 1 0 ...

6 dagar ago | 0

Answered

How to internally change decimal separator while importing data from a csv?

Do NOT use CD to access data files: it is more efficient to use absolute/relative filenames (with FULLFILE). To import a CSV (a...

How to internally change decimal separator while importing data from a csv?

Do NOT use CD to access data files: it is more efficient to use absolute/relative filenames (with FULLFILE). To import a CSV (a...

6 dagar ago | 1

| accepted

Answered

Concatenate 3-D matrix in a for loop

Where C is a cell array containing all of your arrays: out = cat(1,C{:}); https://www.mathworks.com/help/matlab/matlab_prog/co...

Concatenate 3-D matrix in a for loop

Where C is a cell array containing all of your arrays: out = cat(1,C{:}); https://www.mathworks.com/help/matlab/matlab_prog/co...

6 dagar ago | 0

| accepted

Answered

why is the variable order in a user defined function important in lsqnonlin optimisation?

"Why does the order in the self defined function important for lsqnonlin fitting?" In some languages inputs can be specified by...

why is the variable order in a user defined function important in lsqnonlin optimisation?

"Why does the order in the self defined function important for lsqnonlin fitting?" In some languages inputs can be specified by...

6 dagar ago | 1

Answered

Finding and reporting the variable (Single number) of several with the largest value

The MATLAB approach is to use vectors/matrices (which is where the name MATLAB comes from): V = [0.0076,0.46,0.05]; C = ["A","...

Finding and reporting the variable (Single number) of several with the largest value

The MATLAB approach is to use vectors/matrices (which is where the name MATLAB comes from): V = [0.0076,0.46,0.05]; C = ["A","...

7 dagar ago | 0

Answered

Comma separated function output requests

Is this documented? [A{1:2}] = myone(1,2,3,4) % okay [B{1:1}] = myone(1,2,3,4) % okay [C{1:0}] = myone(1,2,3,4) % NARGOUT==0 ...

Comma separated function output requests

Is this documented? [A{1:2}] = myone(1,2,3,4) % okay [B{1:1}] = myone(1,2,3,4) % okay [C{1:0}] = myone(1,2,3,4) % NARGOUT==0 ...

7 dagar ago | 1

Answered

how can i avoid Nan in matlab expression and return 0

"if X is positive it must give 10, If X is negative it must give 5, If X is zero, it must give 0." X = randi([-3,3],1,9) % rand...

how can i avoid Nan in matlab expression and return 0

"if X is positive it must give 10, If X is negative it must give 5, If X is zero, it must give 0." X = randi([-3,3],1,9) % rand...

7 dagar ago | 0

Answered

Sorting operation on a string matrix

s = ["1 9:53.3"; "3 9:23.5"; "5 2:16.2"; "2 2:45.6"; "4 12:01.2"]; [~,X] = sort(str2double(extractBefor...

Sorting operation on a string matrix

s = ["1 9:53.3"; "3 9:23.5"; "5 2:16.2"; "2 2:45.6"; "4 12:01.2"]; [~,X] = sort(str2double(extractBefor...

7 dagar ago | 1

| accepted

Answered

Assigning strings from struct variable

Use a comma-separated list: https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://www.mathworks...

Assigning strings from struct variable

Use a comma-separated list: https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://www.mathworks...

7 dagar ago | 2

| accepted

Answered

Textscan Importing Multiple Inputs From One Text File

S = readlines('ResultA3forMatlabv2.txt'); F = @(s)sscanf(s,'%f,'); C = arrayfun(F,S,'uni',0) C{1:3} % the first few lines

Textscan Importing Multiple Inputs From One Text File

S = readlines('ResultA3forMatlabv2.txt'); F = @(s)sscanf(s,'%f,'); C = arrayfun(F,S,'uni',0) C{1:3} % the first few lines

8 dagar ago | 0

Answered

Print output if elements of a list match values in a column

A = [1;2;3;4;5;6;7;8;9;10]; B = ["A";"B";"C";"D";"E";"F";"G";"H";"I";"J"]; e = [3;6;8;10]; C = ["A";"A";"B";"F";"D";"H";"C";"...

Print output if elements of a list match values in a column

A = [1;2;3;4;5;6;7;8;9;10]; B = ["A";"B";"C";"D";"E";"F";"G";"H";"I";"J"]; e = [3;6;8;10]; C = ["A";"A";"B";"F";"D";"H";"C";"...

9 dagar ago | 0

| accepted

Answered

Why this code gives error?

Exactly as the plot documentation shows, the LineSpec must come directly after the X/Y data: plot(f,20*log10(FFT_abs/max(FFT_ab...

Why this code gives error?

Exactly as the plot documentation shows, the LineSpec must come directly after the X/Y data: plot(f,20*log10(FFT_abs/max(FFT_ab...

9 dagar ago | 0

Submitted

Hyphenate

Word hyphenation using Franklin Mark Liang's algorithm (aka Knuth-Liang algorithm). Used in TeX.

10 dagar ago | 3 downloads |

Answered

Save several results from recursive function

In my experience by far the easiest way to achieve this is to use a nested function, something like (pseudocode): function out ...

Save several results from recursive function

In my experience by far the easiest way to achieve this is to use a nested function, something like (pseudocode): function out ...

11 dagar ago | 0

| accepted

Answered

Why can't I put the 1x3 matrix into 1x3 variable?

"Why?" Because the square brackets have different meanings on the Left Hand Side (LHS) and Right Hand-Side (RHS) of the equals ...

Why can't I put the 1x3 matrix into 1x3 variable?

"Why?" Because the square brackets have different meanings on the Left Hand Side (LHS) and Right Hand-Side (RHS) of the equals ...

11 dagar ago | 2

| accepted

Answered

How to use the parameters of other functions within the ‘cellfun’ function?

https://www.mathworks.com/help/matlab/math/parameterizing-functions.html f = @(a)smoothdata(a,'movemedian',100); x = cellfun(f...

How to use the parameters of other functions within the ‘cellfun’ function?

https://www.mathworks.com/help/matlab/math/parameterizing-functions.html f = @(a)smoothdata(a,'movemedian',100); x = cellfun(f...

13 dagar ago | 0

| accepted