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

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

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

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

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

4 months 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

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

4 months 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 ________ ________ __ __ ...

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

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

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

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

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

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

5 months ago | 2

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

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

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

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

5 months ago | 0

| accepted

Answered

Fancy Correlation Plots in MATLAB

Maybe something like this can work for you (after more polishing) % sample correlation matrix r = normalize(randn(10, 10), 'ra...

Fancy Correlation Plots in MATLAB

Maybe something like this can work for you (after more polishing) % sample correlation matrix r = normalize(randn(10, 10), 'ra...

5 months ago | 0

| accepted

Answered

Scatter with different colors based on id column

What abou this? scatter(positionX, positionY, sz, ID, 'filled') % example scatter(rand(10, 1), rand(10, 1), 200, randi(5, 1...

Scatter with different colors based on id column

What abou this? scatter(positionX, positionY, sz, ID, 'filled') % example scatter(rand(10, 1), rand(10, 1), 200, randi(5, 1...

5 months ago | 0

| accepted

Answered

How to correctly set up a particular Paired ANOVA test?

You can use ranova, but as you've realized it does not do multiple comparisons for you. You can do the post-hoc test with pairwi...

How to correctly set up a particular Paired ANOVA test?

You can use ranova, but as you've realized it does not do multiple comparisons for you. You can do the post-hoc test with pairwi...

5 months ago | 0

Answered

Program should continue running the remaining script

return is quite intuitive and it does what it's suppoed to do: Returns control to invoking script or function. If you wanna cont...

Program should continue running the remaining script

return is quite intuitive and it does what it's suppoed to do: Returns control to invoking script or function. If you wanna cont...

5 months ago | 2

| accepted

Answered

how to open multiple .txt files?

If all the files have the same structure/data format, you can use datastore to merge them: fileNames = {'t1.txt', 't2.txt', 't3...

how to open multiple .txt files?

If all the files have the same structure/data format, you can use datastore to merge them: fileNames = {'t1.txt', 't2.txt', 't3...

5 months ago | 0

| accepted

Answered

Compare two tables arrays of different sizes

% create two tables [t1, t2] = deal(table("0" + (1:5)', "blah" + (1:5)',... repmat(1:3, 5, 1), 'VariableNames', {'v1', 'v2...

Compare two tables arrays of different sizes

% create two tables [t1, t2] = deal(table("0" + (1:5)', "blah" + (1:5)',... repmat(1:3, 5, 1), 'VariableNames', {'v1', 'v2...

5 months ago | 0

Answered

Matlab plugin and Rstudio packages

There are some equivalent R functions in MATLAB (e.g. here). But there is no tool that can automatically and perfectly convert a...

Matlab plugin and Rstudio packages

There are some equivalent R functions in MATLAB (e.g. here). But there is no tool that can automatically and perfectly convert a...

5 months ago | 0

| accepted

Answered

How could I change the axis for a boxplot that is automatically produced from ANOVA test?

You can set XTickLabel property of the generated boxplot. mydata = randn(20, 3); anova1(mydata); set(gca, 'XTickLabel', {'A',...

How could I change the axis for a boxplot that is automatically produced from ANOVA test?

You can set XTickLabel property of the generated boxplot. mydata = randn(20, 3); anova1(mydata); set(gca, 'XTickLabel', {'A',...

5 months ago | 0

| accepted

Answered

dot product between two different size of matrix

X = sum(bsxfun(@times, A, B), 2);

dot product between two different size of matrix

X = sum(bsxfun(@times, A, B), 2);

5 months ago | 1

| accepted

Answered

Calculate confidence interval of data set

I'm not sure if you want to calculate CI or something like reference range. Regardless, as you can see on quantile help page, it...

Calculate confidence interval of data set

I'm not sure if you want to calculate CI or something like reference range. Regardless, as you can see on quantile help page, it...

5 months ago | 0

Answered

How can I make one vector out of two vectors with different lengths?

A = [1 1 1 1] B = [0 0 1 0 1 0] C = [B, A];

How can I make one vector out of two vectors with different lengths?

A = [1 1 1 1] B = [0 0 1 0 1 0] C = [B, A];

5 months ago | 1

Answered

text file above 43 mb

MATLAB offers lots of ways to read text files, including textscan, readtable, fileread or low-level I/O (fread). However, when y...

text file above 43 mb

MATLAB offers lots of ways to read text files, including textscan, readtable, fileread or low-level I/O (fread). However, when y...

5 months ago | 0