Answered
Keep getting the error "not enoguh input arguments"
You call the free_space function like this: if not(free_space(player_input)) but the free_space function takes two arguments: ...

4 years ago | 0

| accepted

Answered
How to change plotted graph's line?
If you leave the marker symbol off, the plot command will default to using a solid line with no symbol. You can also just explic...

4 years ago | 0

| accepted

Answered
The end operator must be used within an array index expression
In your code, you have not yet created any variable named y, before you call this line: y(1:end-1) = y(2:end-1) Therefore, you...

4 years ago | 2

Answered
How plot data as histograms?
This is not a histogram. It is a stacked bar chart. Take a look at this documentation to see how to construct this type of chart...

4 years ago | 0

| accepted

Answered
Axes not reconizing figure handle
The problem seems to be specifically with the XLabel argument, and the error message is non-intuitive (at least to me). This wo...

4 years ago | 1

Answered
Graph not being displayed
You missed a place where you need an element-wise operation. Try x=linspace(-5,5,130); y=((2.*x.^2)-(2.*x)-1)./((x.^4)+1); % Y...

4 years ago | 1

Answered
integration with limits using an array
Looking at the documentation for trapz, it doesn't seem like the syntax you are trying to use is valid.

4 years ago | 0

Answered
Find value in first table column that meets requirement then grab whole row
% Some pretend data A = randn(21,3) % The rows where the first column is greater than 0.9 output = A(A(:,1)>0.9,:)

4 years ago | 0

| accepted

Answered
What is the code of Gamma distribution with method of moments?
This submission to the File Exchange looks like it does what you want. Disclaimer: I have not used it, and don't know if this c...

4 years ago | 0

| accepted

Answered
Negative values in kernel density estimation
(Sorry for the delayed response. I didn't get a notification that you had replied to my comment.) The K-S density looks like a ...

4 years ago | 2

| accepted

Answered
Error with clusterDBSCAN.discoverClusters
Do you have the Radar Toolbox installed?

4 years ago | 0

| accepted

Answered
How to save workspace in stages while optimizing disk space
The save command has a syntax option that allows you to specify a list of variables to save, rather than saving all variables in...

4 years ago | 0

Answered
I used PCA on 9-D data. I want to plot PCs direction
Your comment was helpful. I think the biplot function may do what you need. The biplot illustrates what the original axes look ...

4 years ago | 0

| accepted

Answered
Linear mixed effects model standardization with Z score not giving consistent results
I'm not sure why you expect the model to be unchanged (or what specific aspects of the model you expect to be unchanged). Even ...

4 years ago | 0

| accepted

Answered
How to combine cell arrays with different dimensions?
Here is one way: % Simplified version of your data C = {rand(2,1), rand(3,1); rand(5,1), rand(7,1)}; % Concatenate th...

4 years ago | 0

| accepted

Answered
Performing Chi Square Test
The crosstab function calculates the table from raw data. It does not expect the table itself as input. After an admittedly bri...

4 years ago | 0

Answered
Is there a Matlab function to convert a plot into a matrix or image?
I assume you mean that you want to do it programatically, as opposed to interactively. I'm a creature of habit, and I generally...

4 years ago | 0

| accepted

Answered
How to calculate the minimum distance between two points?
I am not absolutely certain that this code is equivalent to what you wrote, because I cannot test it on my local machine. (I do ...

4 years ago | 0

| accepted

Answered
K-means clustering output matrix C (represent centroid locations)
You have 8 centroids, each of which is a point in a 10-dimensional space. Each row gives the 10 coordinates needed to locate tha...

4 years ago | 0

| accepted

Answered
How to calculate the minimum distance between two points?
I doubt that this is the main issue slowing down the code, but you should preallocate the memory for your output array. Growing ...

4 years ago | 0

Answered
Adding multiple variable contents in a single variable
If your data are already stored in dynamically named variables, then I think your only recourse is to use eval to do this task: ...

4 years ago | 1

| accepted

Answered
simple regression analysis issue
The method you used does not include an intercept, so your fit is forced to go through the origin. Try this instead (which is al...

4 years ago | 0

| accepted

Answered
Reshape matrix with averages of 4 elements in each row
Here is one way: n = 4; A = [ 0 2 2 4 0 6 4 6 1 1 2 8 0 0 4 0 9 9 2 8 0 0 0 8]; tmp = movmean(A,[0 n-1],2); B ...

4 years ago | 0

Answered
Why scatterplot shows one point in different color and rest all the points are different?
If I have interpreted your code correctly, you have plotted the x-y data, just in different groups. Your figure actually has fou...

4 years ago | 0

Answered
Problems clustering with kmeans
I think you might have success if you try the DBSCAN algorithm instead.

4 years ago | 0

| accepted

Question


Write file(s) with all properties of a MATLAB model
Suppose I have built a machine learning model in MATLAB. It has a list of properties (and underlying property data) that encapsu...

4 years ago | 1 answer | 0

1

answer

Answered
i have one dimensional array and i want to move every non zero element oh that array to exchange position with every zero in each iteration.
I think this does what you want: % Input data a = [1 2 3 4 0 0 0]; % Find the indices of the non-zeros and the zeros idxNo...

4 years ago | 0

Answered
Finding values with the same index in two arrays
RowCol1 = [17.487504; 17.487591; 17.487596; 17.487605; 17.487617]; RowCol2 = [16.113; 16.116; 16.244; 17.487591; 17.487596; 17...

4 years ago | 0

| accepted

Answered
Selecting Specific Elements in a Matrix Using Group
Height = [62; 65; 63; 70; 58; 70; 73]; Gender = [1; 1; 1; 2; 1; 2; 2]; % where 1 is female and 2 is male data_table = [Height(...

4 years ago | 1

| accepted

Answered
how can I classify the loads based on Bagging decision trees and compare it with actual data?
I have not gone through your whole code, but I loaded your MAT file and then ran C = confusionchart(Actualdata.Loads,Preddata.L...

4 years ago | 0

| accepted

Load more