Answered
I want to get the difference between the present number and the previous number for 1000 set of data from the plot.
a = [2 3 5 7 11]; a - a' % All possible differences between pairs of elements of a

4 years ago | 1

Answered
How can I create a 16 round for loop in this problem?
Use a cell array to store the values: for k = 1:16 Key{k} = randi([0,1],[1,4]); In{k} = randi([0,1],[1,4]); Cip...

4 years ago | 0

Answered
Problem with index in position 1 exceeding array bounds in PSO algorithm
x_min and x_max are 1x2 vectors, but in the loop you try to access a second row of those matrices, which do not exist. I'm not ...

4 years ago | 0

Answered
Mean and Standard deviation table
You can use the groupsummary command.

4 years ago | 0

Answered
Intersect() with with repetition
I frankly have not quite figured out the logic of what you want as output, but I'm pretty sure that you can construct what you w...

4 years ago | 0

Answered
two for loops in parallel
If I understand you correctly, you don't need two for loops, and this will do what you want M=5; x=0; A=[1 4 7 10 13 16 19]; ...

4 years ago | 0

| accepted

Answered
24 Hours for run my for loop
Without seeing your code, it is impossible to know specifically what are possible approaches to speed it up, but two possibiliti...

4 years ago | 0

| accepted

Answered
How can i interpolate 1-D data, whit y especified values?
Unless I'm missing something, it sounds like you just want to interpolate x from y, instead of y from x: x = [1 2 3]; y = [1 4...

4 years ago | 0

| accepted

Answered
Hello everyone, I want to restrict the domain of a vector to return it to a smaller data set. For example, X between 2 and 7
X = [ 1 2 3 4 5 6 7 8 9 10 ]; idxToKeep = (X>=2) & (X<=7); Xkeep = X(idxToKeep) You can also do it all in one...

4 years ago | 0

Answered
chose the marker with plot3d
It looks like you used a hyphen instead of an underscore. x = 1:5; y = rand(1,5); z = rand(1,5); figure plot3(x,y,z,'blac...

4 years ago | 0

| accepted

Answered
How to improve regression models for a dataset with too many variables?
@NC_, as I expect you realize, your question is not really a MATLAB question, but is a generic machine learning question. You ar...

4 years ago | 0

| accepted

Answered
i trying to 3d plot, but mesh nor plot3 worked
This is what I get from your equation: xv = -5 : 0.01 : 5; yv = -5 : 0.01 : 5; [x,y] = meshgrid(xv,yv); f = 10*x.^2.*y -...

4 years ago | 1

| accepted

Answered
How can I find negative factorial ? (-0.5)!
Use the gamma function: x = -0.5; gamma(x+1) % gamma(x+1) is equal to factorial(x)

4 years ago | 1

| accepted

Answered
Converting Matrix to base b fails
dec2base returns a character array representation that can be multiple characters: dec2base(7,2) % "convert" decimal 7 to base ...

4 years ago | 0

| accepted

Answered
How can I insert a title under a group of subplots?
Personally, I would use the more modern tiledlayout (rather than subplot), but then add your text using an annotation (or just t...

4 years ago | 1

| accepted

Answered
Unable to perform assignment because the size of the left side is 1-by-1
My best guess as to the problem is that in this expression ones(1,k+i)-K(k+i) you don't really intend to add a vector of ones ...

4 years ago | 1

Answered
Set one common Xaxis for a sublot with rows = 1 and columns = 2
You may find the linkaxes command useful. You can also share properties (e.g. titles, xlabels) in a tiledlayout.

4 years ago | 0

Answered
what is the equivalent of 'improfile' in octave?
This Octave wiki page suggests that the improfile function is missing from Octave.

4 years ago | 0

| accepted

Answered
How do i delete the spaces that are in the middle of a string array?
Here is one way: str=' 123 456 '; str(str==' ') = [] This method relies on the fact that the white space is a space cha...

4 years ago | 1

Answered
Curve smoothing / fitting
Do you mean you want a smooth line that goes through all the points? You could fit a spline: % Set seed for reproducibility rn...

4 years ago | 0

Answered
Want to be able to call python 3.9 from MATLAB 2022a
I am not on a Windows machine, but I am pretty confident you want to download and run the last one you listed, the 64-bit Window...

4 years ago | 0

| accepted

Answered
Count the number of "aggregate" peaks in a vector?
I am absolutely positively NOT an expert in this, but I think what might be helpful here is putting your signal through a low-pa...

4 years ago | 1

Answered
How to increase the distance between labels on the matrix axes
When you say that making the font size smaller "didn't work", can you be more specific? Do you mean that even with the smallest ...

4 years ago | 0

Answered
What kind of coding do I need to create a program that will recognize the word I am saying and repeat that same word to me?
Take a look at the documentation on how to Record and Play Audio in MATLAB. FYI, it took me literally a few seconds to google t...

4 years ago | 0

Answered
please explain this code
I ran your code here. You can see that figure it creates. That's what the code does. It defines some data, does some calculation...

4 years ago | 1

Answered
Replicating one dimension of a 3d matrix
If M is your array, then output = repmat(M,[10,1,1]);

4 years ago | 1

| accepted

Answered
Matlab does plot datetime data (only hours) on wrong day
The most fundamental fix to your issue is to explicitly use the modern datetime format for your times. Then, downstream function...

4 years ago | 0

Answered
How to split a 3 by 3 matrix into rows and save rows separetly in arrays
ra = NewRange(1,:); rb = NewRange(2,:); rc = NewRange(3,:); Be aware that you may not actually need to do this separation, be...

4 years ago | 0

Answered
predictorImportance changes between releases
Are the ML model results themselves identical? Off the top of my head, I don't know enough about the algorithm and possible cha...

4 years ago | 0

Answered
How to add a line break in categorical array?
Here is one way: X = categorical({sprintf('First Inter-monsoon\\newline (March - April)'), ... sprintf('South...

4 years ago | 1

| accepted

Load more