Computational biologist.

Answered

comparing probability with random draw and choose a transition state

You can construct events by a simple element-wise comparison: events = R < P; event2_num = sum(events, 2); event1_num = sum(...

comparing probability with random draw and choose a transition state

You can construct events by a simple element-wise comparison: events = R < P; event2_num = sum(events, 2); event1_num = sum(...

ungefär 3 timmar ago | 0

Answered

Making a 1D array/vector from a table

X = cell2mat(X_cell); % X_cell: your original cell myVec = X(X(:, 3) == 0, 1);

Making a 1D array/vector from a table

X = cell2mat(X_cell); % X_cell: your original cell myVec = X(X(:, 3) == 0, 1);

ungefär 3 timmar ago | 1

| accepted

Answered

Reading a matrix from a .txt file

Try this myMat = readmatrix('myfile.txt', 'delimiter', ' ');

Reading a matrix from a .txt file

Try this myMat = readmatrix('myfile.txt', 'delimiter', ' ');

6 dagar ago | 1

| accepted

Answered

Reversing the order of EVEN rows in an array

d(2:2:end, :) = fliplr(d(2:2:end, :));

Reversing the order of EVEN rows in an array

d(2:2:end, :) = fliplr(d(2:2:end, :));

6 dagar ago | 0

| accepted

Answered

Error When Using Writetable

test2 variable is the one causing this error. If you want that empty column in your output XLSX file: Table_WLS.test2 = repmat(...

Error When Using Writetable

test2 variable is the one causing this error. If you want that empty column in your output XLSX file: Table_WLS.test2 = repmat(...

7 dagar ago | 0

| accepted

Answered

Table Mean and Standard Deviation

try this head(x) z1 z2 z3 z4 __ __ __ _______ 7 2 4 0.88646 4 1 ...

Table Mean and Standard Deviation

try this head(x) z1 z2 z3 z4 __ __ __ _______ 7 2 4 0.88646 4 1 ...

10 dagar ago | 0

Answered

variance explained & pca

pareto only shows the first 10 bars at maximum. You can do it easily with help of cumsum: [~, ~, ~, ~, explained] = pca(rand(10...

variance explained & pca

pareto only shows the first 10 bars at maximum. You can do it easily with help of cumsum: [~, ~, ~, ~, explained] = pca(rand(10...

10 dagar ago | 1

| accepted

Answered

How can I code the given representations to the labels? (Hats confused me a bit.)

You can find full list of symbols/letter here. But for \hat{x} you can do as: plot(1:10, 1:10, '.-') title('$$\vert$$$$\hat{y}...

How can I code the given representations to the labels? (Hats confused me a bit.)

You can find full list of symbols/letter here. But for \hat{x} you can do as: plot(1:10, 1:10, '.-') title('$$\vert$$$$\hat{y}...

11 dagar ago | 1

| accepted

Answered

Extract ¨multiple .xls file from a folder?

If you want to extract the content of all your .xls files within a certain directory at once, you can do it as: % assuming you'...

Extract ¨multiple .xls file from a folder?

If you want to extract the content of all your .xls files within a certain directory at once, you can do it as: % assuming you'...

11 dagar ago | 0

| accepted

Answered

Search string array column for a specific string

Have you tried ismember? You only need column 5, but you fed first argument of strcmp with the whole string array. rowIdx = fin...

Search string array column for a specific string

Have you tried ismember? You only need column 5, but you fed first argument of strcmp with the whole string array. rowIdx = fin...

12 dagar ago | 0

| accepted

Answered

minimum output matrix from data

A=[ 0 2.8284 5.6569; 2.8284 0 2.8284; 5.6569 2.8284 0; 1.4142 3.162...

minimum output matrix from data

A=[ 0 2.8284 5.6569; 2.8284 0 2.8284; 5.6569 2.8284 0; 1.4142 3.162...

12 dagar ago | 0

Answered

how to select multiple rows from a large matrix and leave 1 row every time

A = rand(20, 100); keepRowsIdx = setdiff(1:size(A, 1), 4:4:size(A, 1)); Columns 1 through 10 1 2 3 5 ...

how to select multiple rows from a large matrix and leave 1 row every time

A = rand(20, 100); keepRowsIdx = setdiff(1:size(A, 1), 4:4:size(A, 1)); Columns 1 through 10 1 2 3 5 ...

13 dagar ago | 0

| accepted

Answered

You must pass X as a floating-point matrix.

Your TestSet must have the same structure as your Training set. You can try this result = predict(SVMmodel, Labels(:, 1:9));

You must pass X as a floating-point matrix.

Your TestSet must have the same structure as your Training set. You can try this result = predict(SVMmodel, Labels(:, 1:9));

17 dagar ago | 0

| accepted

Answered

How to create a new parameter in one table based on multiple observations in a second table?

Let's call you first able tabc and the latter tabd. What you bascially need is to first select patients with true events, and th...

How to create a new parameter in one table based on multiple observations in a second table?

Let's call you first able tabc and the latter tabd. What you bascially need is to first select patients with true events, and th...

17 dagar ago | 1

| accepted

Answered

Replace some values of a vector with values from another vector of the same size

You've missed the fact that k is of logical class: A = [0 0 -3 -8 -10 0 0] B = [-12 -12 -4 -4 -4 -12 -12] k = (A < B) C = A ...

Replace some values of a vector with values from another vector of the same size

You've missed the fact that k is of logical class: A = [0 0 -3 -8 -10 0 0] B = [-12 -12 -4 -4 -4 -12 -12] k = (A < B) C = A ...

17 dagar ago | 0

| accepted

Answered

Problems with creating a dynamic struct with num2str

First of all you cannot choose a digit as filed name due to the same reason you cannot choose it as a variable name. for i = 1:...

Problems with creating a dynamic struct with num2str

First of all you cannot choose a digit as filed name due to the same reason you cannot choose it as a variable name. for i = 1:...

20 dagar ago | 1

| accepted

Answered

Change significance value in ttest2

I found a question asked here saying that trying ranksum should give the same p value as ttest2 ... No, it doesn't say that. ...

Change significance value in ttest2

I found a question asked here saying that trying ranksum should give the same p value as ttest2 ... No, it doesn't say that. ...

21 dagar ago | 0

Answered

Summation of specific range of matrix

n = size(Q_all, 1)/56; Q_aus = (0); for i = 1:44 Q_aus(i, 1) = sum(sum(Q_all(56*i-55:56*i,:),2)); end

Summation of specific range of matrix

n = size(Q_all, 1)/56; Q_aus = (0); for i = 1:44 Q_aus(i, 1) = sum(sum(Q_all(56*i-55:56*i,:),2)); end

21 dagar ago | 0

| accepted

Answered

How to create two independent Normal distribution ?

You basically can generate multiple independent normal random variables form a multivariate normal dist. You just need to define...

How to create two independent Normal distribution ?

You basically can generate multiple independent normal random variables form a multivariate normal dist. You just need to define...

21 dagar ago | 1

| accepted

Answered

Comparing data in a matrix/table

One way would be to use groupsummary: tab = a1 a2 a3 a4 ________ ________ __ __ ...

Comparing data in a matrix/table

One way would be to use groupsummary: tab = a1 a2 a3 a4 ________ ________ __ __ ...

22 dagar ago | 1

Answered

Rename 10000 Text files

files = {'tab1.txt', 'tab2.txt'}; target = replace(files, 'tab', ''); cellfun(@(x, y)movefile(x, y), files, target)

Rename 10000 Text files

files = {'tab1.txt', 'tab2.txt'}; target = replace(files, 'tab', ''); cellfun(@(x, y)movefile(x, y), files, target)

22 dagar ago | 0

Answered

help with regexp on txt file

str = '16/12/2020 18:30:59.443 Ico 3 Vco 1e7 Ico -3.2e+8 Vco 1.12e-7 Ico -3200 Vco 2.345e14'; regexp(str, '(?<=(Vco|Ico)...

help with regexp on txt file

str = '16/12/2020 18:30:59.443 Ico 3 Vco 1e7 Ico -3.2e+8 Vco 1.12e-7 Ico -3200 Vco 2.345e14'; regexp(str, '(?<=(Vco|Ico)...

22 dagar ago | 1

| accepted

Answered

Changing color of a certain cell in a matrix after breaking a for-loop

You could overlay red rectangles on those cells passing the predefined cutoff (if you wanna stick with the summer colormap). ...

Changing color of a certain cell in a matrix after breaking a for-loop

You could overlay red rectangles on those cells passing the predefined cutoff (if you wanna stick with the summer colormap). ...

26 dagar ago | 0

Answered

Writing Matlab Table to File

First of all, you are using fprintf incorrectly, and thankfully all MATLAB errors are quite intuitive. This one tells you, you'v...

Writing Matlab Table to File

First of all, you are using fprintf incorrectly, and thankfully all MATLAB errors are quite intuitive. This one tells you, you'v...

27 dagar ago | 0

Answered

Why I get 1×0 empty double row vector?

xq1 (and therefore X1) simply may don't contain min(oh1) since you are discretizing [0, max(oh1)]. What you can do is to find th...

Why I get 1×0 empty double row vector?

xq1 (and therefore X1) simply may don't contain min(oh1) since you are discretizing [0, max(oh1)]. What you can do is to find th...

27 dagar ago | 0

| accepted

Answered

EMBL RESTful API post request error

You are almost there, except that MATLAB doesn't have a dictionary data type as Python3 has, so you should construct a struct in...

EMBL RESTful API post request error

You are almost there, except that MATLAB doesn't have a dictionary data type as Python3 has, so you should construct a struct in...

27 dagar ago | 1

| accepted

Answered

Error using plot Vectors must be the same length.

The error is quite clear, 0:200 size doesn't match that of K. numel(0:200) is 201 while numel(K) is 199. It's better to replace ...

Error using plot Vectors must be the same length.

The error is quite clear, 0:200 size doesn't match that of K. numel(0:200) is 201 while numel(K) is 199. It's better to replace ...

28 dagar ago | 0

| accepted

Answered

Move multiple rows without swapping

H = randi([0 1], 6, 10) H = 0 1 0 1 1 0 0 0 1 0 1 1 1 0 1 ...

Move multiple rows without swapping

H = randi([0 1], 6, 10) H = 0 1 0 1 1 0 0 0 1 0 1 1 1 0 1 ...

ungefär en månad ago | 0

| accepted

Answered

How to get the mean of a graph ?

If you have the figure file (*.fig) the easiest way is just to open it and from Tools menu select Data statistics.

How to get the mean of a graph ?

If you have the figure file (*.fig) the easiest way is just to open it and from Tools menu select Data statistics.

ungefär en månad ago | 0

Answered

take a part from name

If the structure of your string always conforms to the above leading/trailing underlines, you can use regexp: str = 'CC5_ts1_CC...

take a part from name

If the structure of your string always conforms to the above leading/trailing underlines, you can use regexp: str = 'CC5_ts1_CC...

ungefär en månad ago | 0

| accepted