Suspensa Vix Via Fit

Answered

Can I use randi and say random number from 1 to 30 except 8 and 9? (for example)

This is MATLAB, so your first thought should always be to use arrays and indexing: vec = setdiff(1:30,8:9) % or [1:7,10:30] or ...

Can I use randi and say random number from 1 to 30 except 8 and 9? (for example)

This is MATLAB, so your first thought should always be to use arrays and indexing: vec = setdiff(1:30,8:9) % or [1:7,10:30] or ...

ongeveer 3 uur ago | 1

| accepted

Answered

How do you align column in a matrix?

Node = [1,0,0,0;2,100,0,0;3,200,0,0;4,33.3333321,0,0;5,66.6666641,0,0;6,133.333328,0,0;7,166.666672,0,0] fmt = '%3d,%13.9g,%13d...

How do you align column in a matrix?

Node = [1,0,0,0;2,100,0,0;3,200,0,0;4,33.3333321,0,0;5,66.6666641,0,0;6,133.333328,0,0;7,166.666672,0,0] fmt = '%3d,%13.9g,%13d...

ongeveer 4 uur ago | 0

| accepted

Answered

How to separate a string(1x1 cell) into a 1x4 cell

chr = 'A5E6C11D B5E6C11D C5E6C11D D5E6C11D'; spl = split(chr)

How to separate a string(1x1 cell) into a 1x4 cell

chr = 'A5E6C11D B5E6C11D C5E6C11D D5E6C11D'; spl = split(chr)

ongeveer 4 uur ago | 1

| accepted

Answered

combine number from cell array and letter to a string

C = {'3','1','4'} S = join(strcat("V",C),"-") % output = string or the old-fashioned way: S = sprintf('-V%s',C{:}); % output ...

combine number from cell array and letter to a string

C = {'3','1','4'} S = join(strcat("V",C),"-") % output = string or the old-fashioned way: S = sprintf('-V%s',C{:}); % output ...

ongeveer 5 uur ago | 1

| accepted

Answered

invalid concatenation of structure with matrix

P = fullfile(folderTest,setTestCur); X = {'*.jpg','*.png','*.bmp'}; N = numel(X); C = cell(1,N); for k = 1:N C{k} = di...

invalid concatenation of structure with matrix

P = fullfile(folderTest,setTestCur); X = {'*.jpg','*.png','*.bmp'}; N = numel(X); C = cell(1,N); for k = 1:N C{k} = di...

ongeveer 19 uur ago | 0

| accepted

Answered

ned to turn iterated columns into a single column

Do NOT use EVAL for trivial code like this. Rather than forcing yourself into writing complex, obfuscated code just because you ...

ned to turn iterated columns into a single column

Do NOT use EVAL for trivial code like this. Rather than forcing yourself into writing complex, obfuscated code just because you ...

1 dag ago | 0

Answered

reshape matrix with variable length to vector

M = [1,2,3;4,5,6;7,8,9] V = reshape(M.',1,[])

reshape matrix with variable length to vector

M = [1,2,3;4,5,6;7,8,9] V = reshape(M.',1,[])

1 dag ago | 1

| accepted

Answered

How to convert a string into a date or datenum?

"... but i cant, since functions like datetime need the numbers separated." I don't see that restriction mentioned anywhere in ...

How to convert a string into a date or datenum?

"... but i cant, since functions like datetime need the numbers separated." I don't see that restriction mentioned anywhere in ...

1 dag ago | 1

Answered

How to read the data from .txt file and plot?

Read the error message and follow its advice to use curly-brace subscripting rather than parentheses: data = readtable('rans1_d...

How to read the data from .txt file and plot?

Read the error message and follow its advice to use curly-brace subscripting rather than parentheses: data = readtable('rans1_d...

1 dag ago | 1

| accepted

Answered

How to insert data to a matrix based on index values stored in a matrix?

a = randi(9,7,5) b = [2,2,3,1,2;6,5,7,6,5] rwv = 1:size(a,1); idx = rwv(:)<=b(1,:) | rwv(:)>=b(2,:); a(idx) = NaN If you ar...

How to insert data to a matrix based on index values stored in a matrix?

a = randi(9,7,5) b = [2,2,3,1,2;6,5,7,6,5] rwv = 1:size(a,1); idx = rwv(:)<=b(1,:) | rwv(:)>=b(2,:); a(idx) = NaN If you ar...

1 dag ago | 0

| accepted

Answered

How to read in more rows to a cell array from a text file?

This would be easier if each block used an integer instead of "First", "Second", etc. By far the best would be leading text foll...

How to read in more rows to a cell array from a text file?

This would be easier if each block used an integer instead of "First", "Second", etc. By far the best would be leading text foll...

2 dagen ago | 1

| accepted

Answered

Create a matrix with elements clockwise

More efficient: M = spiral2(5,8)

Create a matrix with elements clockwise

More efficient: M = spiral2(5,8)

2 dagen ago | 1

| accepted

Answered

Why does my V returns a single scalar value?

You are using the wrong divide operator: V=(P*x.^2).*(3*L-x)./(E*I) % ^^ https://www.mathworks.com/help/matl...

Why does my V returns a single scalar value?

You are using the wrong divide operator: V=(P*x.^2).*(3*L-x)./(E*I) % ^^ https://www.mathworks.com/help/matl...

2 dagen ago | 0

| accepted

Answered

Sorting Column Variable to a Row

Do NOT use loops for this, the inbuilt tools are much better! First lets create some fake data in a table: C = randi(6,30,1); ...

Sorting Column Variable to a Row

Do NOT use loops for this, the inbuilt tools are much better! First lets create some fake data in a table: C = randi(6,30,1); ...

2 dagen ago | 0

| accepted

Answered

Concatenate 2D matrices into one 3D matrix with for loop

C = struct2cell(data); A = cat(3,C{:}); https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://...

Concatenate 2D matrices into one 3D matrix with for loop

C = struct2cell(data); A = cat(3,C{:}); https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://...

3 dagen ago | 0

Answered

Is there a way to find number of blocks in a matrix?

Assuming that the blocks do not contain zeros: A = [1,2,0,0,0,0,0,0,0;3,4,5,6,0,0,0,0,0;0,7,8,9,0,0,0,0,0;0,1,2,3,4,5,0,0,0;0,0...

Is there a way to find number of blocks in a matrix?

Assuming that the blocks do not contain zeros: A = [1,2,0,0,0,0,0,0,0;3,4,5,6,0,0,0,0,0;0,7,8,9,0,0,0,0,0;0,1,2,3,4,5,0,0,0;0,0...

3 dagen ago | 0

| accepted

Answered

Arrange array elements in 1st column w.r.t corresponding values in 2nd column

A = [1,9;1,14;3,11;5,13;7,15;9,17;11,19;14,21] B = myfun(A) function out = myfun(inp) out = []; while numel(inp) vec ...

Arrange array elements in 1st column w.r.t corresponding values in 2nd column

A = [1,9;1,14;3,11;5,13;7,15;9,17;11,19;14,21] B = myfun(A) function out = myfun(inp) out = []; while numel(inp) vec ...

3 dagen ago | 0

| accepted

Answered

Find order of increasing integers

V = [3,4,8,9,10,13]; D = diff(find([true,diff(V)~=1,true])); C = mat2cell(V,1,D)

Find order of increasing integers

V = [3,4,8,9,10,13]; D = diff(find([true,diff(V)~=1,true])); C = mat2cell(V,1,D)

3 dagen ago | 0

| accepted

Answered

How to specify index variable name of for loop programmatically?

"Is there a cleaner way to rethink this problem?" Of course. Using MATLAB effectively means using arrays and indexing. Note th...

How to specify index variable name of for loop programmatically?

"Is there a cleaner way to rethink this problem?" Of course. Using MATLAB effectively means using arrays and indexing. Note th...

4 dagen ago | 1

| accepted

Answered

Understanding the difference between ndgrid and meshgrid (from Numpy)

If you must replicate numpy.meshgrid (with the default indexing='xy') then do not use ndgrid, unless you want to waste time perm...

Understanding the difference between ndgrid and meshgrid (from Numpy)

If you must replicate numpy.meshgrid (with the default indexing='xy') then do not use ndgrid, unless you want to waste time perm...

4 dagen ago | 1

| accepted

Answered

Find only numeric strings on cellstr array.

Writing regular expressions or pattern matching that robustly detects all valid number formats is not such a trivial task... it ...

Find only numeric strings on cellstr array.

Writing regular expressions or pattern matching that robustly detects all valid number formats is not such a trivial task... it ...

4 dagen ago | 1

Answered

convert an array of 0s and 1s to binary & reverse

B = [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]; D = pow2(7:-1:0)*reshape(B,8,[])

convert an array of 0s and 1s to binary & reverse

B = [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]; D = pow2(7:-1:0)*reshape(B,8,[])

5 dagen ago | 1

Answered

How I can detection column indexes of string 'rn_mill_tonnage' (n=1,2,3,4....)

C = {'X','Y','Z','size(X)','size(Y)','size(Z)','volume','r1_cu_mill_grade','r1_mill_tonnage','r2_cu_mill_grade','r2_mill_tonnage...

How I can detection column indexes of string 'rn_mill_tonnage' (n=1,2,3,4....)

C = {'X','Y','Z','size(X)','size(Y)','size(Z)','volume','r1_cu_mill_grade','r1_mill_tonnage','r2_cu_mill_grade','r2_mill_tonnage...

6 dagen ago | 0

| accepted

Answered

I am unable to understand the use of ~ here.I know that find peaks returns two arguments x and y axis of peak

https://www.mathworks.com/help/matlab/matlab_prog/ignore-function-outputs.html In both of the examples you show, the code's aut...

I am unable to understand the use of ~ here.I know that find peaks returns two arguments x and y axis of peak

https://www.mathworks.com/help/matlab/matlab_prog/ignore-function-outputs.html In both of the examples you show, the code's aut...

7 dagen ago | 0

Answered

error in my code

You need to download this FEX submission (by clicking on the big blue "Download button"): https://www.mathworks.com/matlabcentr...

error in my code

You need to download this FEX submission (by clicking on the big blue "Download button"): https://www.mathworks.com/matlabcentr...

7 dagen ago | 0

Answered

from C_T_Sep_1 to C_T_Sep_10 they are vectors the same thing for C_A_Sep_1... C_A_Sep_10, I want to create matrix C_T_Sep and C_A_Sep and put the vector inside it, using loop

Your code design makes your task much harder. By forcing meta-data into the variable names, you have forced yourself into writin...

from C_T_Sep_1 to C_T_Sep_10 they are vectors the same thing for C_A_Sep_1... C_A_Sep_10, I want to create matrix C_T_Sep and C_A_Sep and put the vector inside it, using loop

Your code design makes your task much harder. By forcing meta-data into the variable names, you have forced yourself into writin...

7 dagen ago | 0

| accepted

Answered

get 0 in the end of a regexp function

x = 1.2569e-15; v = regexprep(sprintf('%#.6g',x),{'\.','e.+'},'')-'0'

get 0 in the end of a regexp function

x = 1.2569e-15; v = regexprep(sprintf('%#.6g',x),{'\.','e.+'},'')-'0'

7 dagen ago | 0

Answered

extract numbers from cells

Simply download my FEX submission SIP2NUM: https://www.mathworks.com/matlabcentral/fileexchange/53886-scientific-prefix-to-numb...

extract numbers from cells

Simply download my FEX submission SIP2NUM: https://www.mathworks.com/matlabcentral/fileexchange/53886-scientific-prefix-to-numb...

7 dagen ago | 0

Submitted

Customizable Natural-Order Sort

Alphanumeric sort of a cell/string/categorical array, with customizable numeric format.

8 dagen ago | 44 downloads |

Submitted

Natural-Order Filename Sort

Alphanumeric sort of filenames or filepaths, with customizable numeric format.

8 dagen ago | 350 downloads |