Answered
How do I extract data from a matrix with a specific column value and place into a row in a new matrix.
Here is a straightforward method, assuming equal number of duplicates in the first column. % Input M = [1, 25 3, 33 3. 45 2...

2 years ago | 0

Answered
How can I fill the area between these lines and curves?
You can use the fill function.

2 years ago | 1

Answered
Delete columns if sum of a group of 10 columns is zero
Here is one way. for nc = 123:-10:3 colIdx = nc:(nc+9); if sum(Data1(15:end,colIdx),"all")==0 Data1(:,colIdx...

2 years ago | 0

| accepted

Answered
two x-axes, one above and one below, inverted
This documentation explains how to do multiple axes. And then you'll need to set the XDir property of one of the axes to "rever...

2 years ago | 0

Answered
Fit nonlinear regression model
Answering your main question: beta0 is the initial guess at the coefficients of the fit. In your case, MATLAB is expecting a vec...

2 years ago | 0

| accepted

Answered
Why there is a Invalid Expresssion error in my fit function?
Your code works: n = [1433;2700;1000000]; s = [1170.98;780.65;390.33]; f= fit(n,s,'power1') Did you perhaps try to spread th...

2 years ago | 0

| accepted

Answered
Ordering of an array based off conditions
% Input data tmp = {'1e2','1h4','1t0', '3g2', '3g3', '3g4', '3q0', '3q1', '3q2'}; letter_list = {'t','q','e','g','h','i','j'};...

2 years ago | 0

| accepted

Answered
How can I set the NaN values to black in a pcolor plot?
Set the axes background color to black: % Generate sample data data = rand(10, 10); data(3, 3) = NaN; % Set a specific value...

2 years ago | 1

| accepted

Answered
extract statistically independent words
You can do n-gram processing with the Text Analytics Toolbox.

2 years ago | 0

Answered
problem inconsistent dimension arrays
We can't run your code because we don't have all the inputs to do so. I suggest using the debugger to halt your code at that lin...

2 years ago | 0

| accepted

Answered
In order to automate the fitlm command I need to select numerical data from a matrix, and matching variable names from another character array. I get an error on fitlm command
One way that is close to the syntax you used is this: lm=fitlm(tbl,sprintf('%s ~ %s',erase(strtrim(VarNames(OriColumns(i,1),:))...

2 years ago | 0

Answered
I would like to delete the black line in the boxes
Those are the whiskers, in the compact style. You can set their length to zero. (I also removed outliers, to show it more clearl...

2 years ago | 0

| accepted

Answered
A line does not appear when I plot
The way you have coded this, both h and Temp are going to be scalars (single values) after the loop completes, so there is only ...

2 years ago | 1

Answered
What does this error mean?
This error means that a file named noisyaudio.wav was not found in your MATLAB search path.

2 years ago | 0

Answered
How to plot 2 columns for 5 data set categories with different length using boxplot
There is a very similar example in the documentation for the boxchart function. To give more specific advice than that, we'd pr...

2 years ago | 0

| accepted

Answered
No true random for standalone (files only) in AppDesigner?
Disclaimer: I've never used AppDesigner, or distributed standalone MATLAB exe files. Sounds like it is starting from the defaul...

3 years ago | 1

Answered
Legend is not showing all the colors - bar plot
In each subplot, you are plotting [singleObjsPerc(i,1:2); singleObjsPerc(i,3:4); singleObjsPerc(i,5:6); singleObjsPerc(i,7:8); ...

3 years ago | 1

| accepted

Answered
How do you remove a value from a table based on its value
One can do what you ask as follows: Value = ([0,0,1,1,0]); Heading = (["Radius", "Speed", "Type", "Location", "ID"]); Combine...

3 years ago | 0

| accepted

Answered
Error regarding array while creating Nakagami-m Fading Model
If you use the MATLAB debugger, and stop your code just before that line, you'll see that the variable data and rx_data are not ...

3 years ago | 0

Answered
Subplot output data seen in two different window.
On this line of your code xlabel('W_r'); ylabel('I'); figure; the figure command is creating a new figure window. Don't call t...

3 years ago | 0

Answered
Colorbar is opposite of scatterplot
It is more difficult to debug your result, when you have not given us the full code that generates your figure. But, I see no p...

3 years ago | 0

| accepted

Answered
Set default TileSpacing and Padding
Here's how to get the current default setting, which you can then set as you wish. get(groot,"defaultTiledlayoutPadding") get(...

3 years ago | 0

| accepted

Answered
How to take a mean from a range of values
x = [1 2 3 4 5]; y = [10 20 30 40 50]; xInRange = (x>2.5) & (x<=4.5); mean(y(xInRange))

3 years ago | 0

| accepted

Answered
Multiplication of two arrays of different size
A = [2 3; 5 7; 11 13]; B = [4 6; 8 9; 10 12; 14 15]; C = A * B.'

3 years ago | 0

Answered
Lower and upper bounds of correlation coefficient
You can look at the code of corrcoef by typing edit corrcoef In R2022b, the computation is done in lines 158-172. I didn't fi...

3 years ago | 0

Answered
linear model of my code and the R^2 answer change every time i change the input, but the non-linear model gives me the same R^2 answer even when changing my input.
Here is why you always get the same result for your "non-linear" model. Notice that your first variable (Cement) is the one wit...

3 years ago | 0

Answered
Why my test accuracy higher than validation accuracy?
There is no mystery here. Although in general a classifier will perform a little less well on the test set, sampling error can l...

3 years ago | 1

| accepted

Answered
Software compatibility intel vs M1 apple
Here are the system requirements for R2023a. (You can link to other releases from that page as well.) The M1 chip is supported,...

3 years ago | 0

Answered
Error in Kramers-Kronig Relations
You haven't defined a variable named k_vec before this line of code n_vec = zeros(size(k_vec)); so MATLAB errors out when it t...

3 years ago | 0

Answered
Normalization of probability distribution function
It might help if you uploaded your data, so that we can run your code. To me, eyeballing your curve does look like it has area ...

3 years ago | 1

| accepted

Load more