답변 있음

how to split a dataset for training and testing in matlab?

randsample, cvpartition, and randperm can all be useful for creating training/test splits. As @Sargondjani mentions, we need mor...

how to split a dataset for training and testing in matlab?

randsample, cvpartition, and randperm can all be useful for creating training/test splits. As @Sargondjani mentions, we need mor...

15일 전 | 0

| 수락됨

답변 있음

run takes too long!

Vectorizing the for loop gives a nice speedup. There are almost certainly other optimizations possible. clc clear; % percent ...

run takes too long!

Vectorizing the for loop gives a nice speedup. There are almost certainly other optimizations possible. clc clear; % percent ...

16일 전 | 1

답변 있음

How to quantify the goodness of a fit?

EDIT: My first posting on this was incomplete, so I radically edited it. Sorry for any confusion if you saw the first version. ...

How to quantify the goodness of a fit?

EDIT: My first posting on this was incomplete, so I radically edited it. Sorry for any confusion if you saw the first version. ...

17일 전 | 0

| 수락됨

답변 있음

take the length of each row

There are probably a few ways to do this. Here is one, which relies on reading the file into a numeric array, which will pad the...

take the length of each row

There are probably a few ways to do this. Here is one, which relies on reading the file into a numeric array, which will pad the...

17일 전 | 0

답변 있음

How to create a vector that repeats 5 values per increment in a for loop?

v = 100:50:1000; u = repelem(v,5);

How to create a vector that repeats 5 values per increment in a for loop?

v = 100:50:1000; u = repelem(v,5);

17일 전 | 0

답변 있음

Plot question as values for both axis are different

Do you mean you just want to place two plot on the same axes? Then you use hold figure hold on plot([2 3 5],[7 11 13]) plot(...

Plot question as values for both axis are different

Do you mean you just want to place two plot on the same axes? Then you use hold figure hold on plot([2 3 5],[7 11 13]) plot(...

21일 전 | 0

답변 있음

Generate a random sequence of PAM-4 but with values -1,-0.33,0.33,1

I didn't research PAM-4 enough to know whether each element is independent from prior values. The following code will generate a...

Generate a random sequence of PAM-4 but with values -1,-0.33,0.33,1

I didn't research PAM-4 enough to know whether each element is independent from prior values. The following code will generate a...

21일 전 | 0

답변 있음

It is possible to use sprintf to print a string input?

I think you want c1= sprintf('Indicate the units of the variable %s',vi); rather than c1= sprintf('Indicate the units of the ...

It is possible to use sprintf to print a string input?

I think you want c1= sprintf('Indicate the units of the variable %s',vi); rather than c1= sprintf('Indicate the units of the ...

21일 전 | 0

| 수락됨

답변 있음

Connecting to ChatGPT using API

Did you try following the instructions in the error message, and use Name-Value pair 'MediaType','application/x-www-form-urlenc...

Connecting to ChatGPT using API

Did you try following the instructions in the error message, and use Name-Value pair 'MediaType','application/x-www-form-urlenc...

21일 전 | 0

답변 있음

Counting sequences for a non-parametric statistical test (sequence test or RUN test).

I see you found and accepted a solution. An alternative would have been to download the versatile RunLength utility from the Fil...

Counting sequences for a non-parametric statistical test (sequence test or RUN test).

I see you found and accepted a solution. An alternative would have been to download the versatile RunLength utility from the Fil...

22일 전 | 1

답변 있음

Array indices must be positive integers or logical values

I'm guessing that when you wrote B(L - x) (in two places), you intended this multiplication: B.*(L - x) instead. The way you...

Array indices must be positive integers or logical values

I'm guessing that when you wrote B(L - x) (in two places), you intended this multiplication: B.*(L - x) instead. The way you...

22일 전 | 1

답변 있음

Plot curve through data points

You can use a different interpolation method. pchip looks like what you want: x = [15.9, 16.9, 17.5, 19.6]; v = [1.108287307, ...

Plot curve through data points

You can use a different interpolation method. pchip looks like what you want: x = [15.9, 16.9, 17.5, 19.6]; v = [1.108287307, ...

23일 전 | 1

| 수락됨

답변 있음

Identify, for each column of a matrix, numbers that are smaller than the previous ones, creating a 0 1 output having the same size of the original matrix

My output is a bit different from yours, but I think I followed the algorithm you wanted. M = [ ... 1.05 21.22 17.2; ... 2....

Identify, for each column of a matrix, numbers that are smaller than the previous ones, creating a 0 1 output having the same size of the original matrix

My output is a bit different from yours, but I think I followed the algorithm you wanted. M = [ ... 1.05 21.22 17.2; ... 2....

24일 전 | 1

답변 있음

Select only the matrices within the cell

Does this do what you want? % Make up some input data, with one cell remaining empty A = cell(3,1); A{1} = rand(2,5); A{3} =...

Select only the matrices within the cell

Does this do what you want? % Make up some input data, with one cell remaining empty A = cell(3,1); A{1} = rand(2,5); A{3} =...

24일 전 | 0

답변 있음

How to arrange a matrix in descending order w.r.t rows?

Answering here, based on your comment to my other answer. It seems that you just want to sort the matrix a according to its nor...

How to arrange a matrix in descending order w.r.t rows?

Answering here, based on your comment to my other answer. It seems that you just want to sort the matrix a according to its nor...

24일 전 | 0

답변 있음

How to arrange a matrix in descending order w.r.t rows?

Probably use the sortrows function. I'd be more specific, but it is unclear to me what you mean by "largest row". For example, w...

How to arrange a matrix in descending order w.r.t rows?

Probably use the sortrows function. I'd be more specific, but it is unclear to me what you mean by "largest row". For example, w...

24일 전 | 0

답변 있음

how to get gini coeffecient

Seems to work here. (See the code that ran below.) Did you download the function and put it somewhere in your MATLAB path? Wha...

how to get gini coeffecient

Seems to work here. (See the code that ran below.) Did you download the function and put it somewhere in your MATLAB path? Wha...

25일 전 | 0

답변 있음

Regression model with two equation

As @Torsten mentions in his comment, the way you have written your equations, it is not possible to see why they are coupled. T...

Regression model with two equation

As @Torsten mentions in his comment, the way you have written your equations, it is not possible to see why they are coupled. T...

25일 전 | 0

답변 있음

Problems trying to find fakes dates.

This behavior is due to "carryover" in date vectors and strings. As recommended there, and many other places in the documentati...

Problems trying to find fakes dates.

This behavior is due to "carryover" in date vectors and strings. As recommended there, and many other places in the documentati...

26일 전 | 1

답변 있음

how can I give name to an array column?

MATLAB has several data types. Some of them, for example the "table" and "structure" data type, can have variable names associa...

how can I give name to an array column?

MATLAB has several data types. Some of them, for example the "table" and "structure" data type, can have variable names associa...

26일 전 | 1

답변 있음

How to make changes in the table

Probably the easiest way to do this is via the following data operations: "unstack" the max/min temperatures into their own col...

How to make changes in the table

Probably the easiest way to do this is via the following data operations: "unstack" the max/min temperatures into their own col...

26일 전 | 0

| 수락됨

답변 있음

How to create a time vector that is incremented between two datetime strings?

I think you intended endTime = datetime(2023,01,10,11,22,01.700)+duration; rather than endTime = datetime(2023,01,10,11,22,01...

How to create a time vector that is incremented between two datetime strings?

I think you intended endTime = datetime(2023,01,10,11,22,01.700)+duration; rather than endTime = datetime(2023,01,10,11,22,01...

26일 전 | 0

답변 있음

Merge a matrix present in the same position but in two different cells

Here is one way: % Inputs rng default cell = {rand(2,3); rand(5,7); []}; cell_A = {rand(2,1); rand(5,1); []}; % Output n...

Merge a matrix present in the same position but in two different cells

Here is one way: % Inputs rng default cell = {rand(2,3); rand(5,7); []}; cell_A = {rand(2,1); rand(5,1); []}; % Output n...

27일 전 | 0

| 수락됨

답변 있음

How this write in summation form in matlab a0*b0+a1*b1+...................an*bn?

Assuming you actually have vectors, and not variables named a0, a1, a2, etc., then you can use the dot function: a = [1 2 3]'; ...

How this write in summation form in matlab a0*b0+a1*b1+...................an*bn?

Assuming you actually have vectors, and not variables named a0, a1, a2, etc., then you can use the dot function: a = [1 2 3]'; ...

27일 전 | 1

| 수락됨

답변 있음

How can I plot 18 lines in different colors on a single plot?

If your version of MATLAB is 2019b or later, I suggest the colororder function. (I see that you mention an older version, so thi...

How can I plot 18 lines in different colors on a single plot?

If your version of MATLAB is 2019b or later, I suggest the colororder function. (I see that you mention an older version, so thi...

27일 전 | 0

답변 있음

Error while plotting zero crossing detector

To remove all the red stars, comment out this line: plot(xx1,zeros(1,length(ZX))-y1,'r*') To remove only the first red star, c...

Error while plotting zero crossing detector

To remove all the red stars, comment out this line: plot(xx1,zeros(1,length(ZX))-y1,'r*') To remove only the first red star, c...

28일 전 | 0

| 수락됨

답변 있음

what is the short code for the following?

It's a little tricky to answer this, without knowing how you plan to use these variables afterward. But, ket = eye(14); bra = ...

what is the short code for the following?

It's a little tricky to answer this, without knowing how you plan to use these variables afterward. But, ket = eye(14); bra = ...

29일 전 | 1

| 수락됨

문제를 풀었습니다

Find Air Temperature from Cricket Stridulation Rate

Stridulation is the process that creates a cricket's “chirp” by rubbing their wings or legs. According to the Old Farmer's Alma...

29일 전

답변 있음

Histogram from numberdensity values.

Is this bar graph what you need? If not, can you explain a bit more? x = [6 5 3 23 67 33 74]; y = [5 8 2 4 9 2 1] *1e24; ba...

Histogram from numberdensity values.

Is this bar graph what you need? If not, can you explain a bit more? x = [6 5 3 23 67 33 74]; y = [5 8 2 4 9 2 1] *1e24; ba...

약 1달 전 | 0

답변 있음

how to made matrix of x,y,z from .xyz format file?

I don't know of any native MATLAB support, but it looks like the user-contributed atom submission might help you.

how to made matrix of x,y,z from .xyz format file?

I don't know of any native MATLAB support, but it looks like the user-contributed atom submission might help you.

약 1달 전 | 0

| 수락됨