Question


Comment out the rest of the code
Suppose I have a list of codes and I would like to comment out everything after line 100. Is there any way simpler thatn %{........

8 years ago | 2 answers | 0

2

answers

Question


Discretizing a continuous distribution
Suppose I have a continuous pdf on [0,1]. Suppose I have grid points {0,0.1,...,1}. Suppose I calculate f(0),f(0.1),...,f(1) and...

8 years ago | 2 answers | 0

2

answers

Question


Name the column of a matrix and updating the matrix
Suppose I have a matrix A. Suppose I want to name the first column as B. And then I want to make it so that if I change the valu...

8 years ago | 1 answer | 0

1

answer

Question


Create a function from a table, Part 2 (revised)
Given an n*2 matrix A =[a b], I would like to write a function f that takes an element of the first column and then returns the ...

8 years ago | 1 answer | 0

1

answer

Question


integral2 with restriction in the domain of the integral{X<Y}
Suppose I want to calculate the numerical integral \int_{[x,y] \in [0,1]^2: x<y} f(x)g(y) dxdy Please advise how to procee...

8 years ago | 0 answers | 0

0

answers

Question


integral2 error message
Suppose I use D=120, A=3,C=1 pdf = @(x,y) D*power(x,A)*power(1-y,C); integral2(pdf, 0, 1, 0, 1) (note that...

8 years ago | 1 answer | 0

1

answer

Question


Filling up a vector
Suppose I have 1 by 2N vector x=zeros(1,2*N); Now I have N of 1 by 2 vector y1=ones(1,2), y2=ones(1,2) and I w...

8 years ago | 1 answer | 0

1

answer

Question


numerical integration of a function of two variables
Suppose I have a function f defined on [0,1]^2 -> R and I want to numerically evaluate \int_{[0,1]^2} f(x,y)dxdy Please a...

8 years ago | 1 answer | 0

1

answer

Question


concatenating vectors generated with loop
I would like to run a for loop like for i=1:N output=[1 i] output2 = [output2 output] end Bu...

8 years ago | 2 answers | 0

2

answers

Question


Checking the calculation of joint pdf
I now calculate the joint pdf of order statistics from iid uniform [0,1] according to the formula at https://en.wikipedia...

8 years ago | 0 answers | 0

0

answers

Question


Creating a matrix where the element of the second column is smaller than the element of the first column, Part 2
In my previous question https://www.mathworks.com/matlabcentral/answers/373976-creating-a-matrix-where-the-element-of-the-se...

8 years ago | 1 answer | 0

1

answer

Question


Output names indexed by parameters
Suppose I have a for loop and I would like to have outputs whose name appended by the index of the for loop. for i=1:10 ...

8 years ago | 1 answer | 0

1

answer

Question


Extract some columns from a matrix
Suppose I have a matrix A and suppose I want to create a new matrix from 1st, 3rd, and 4th column of A. Is there any compact way...

8 years ago | 1 answer | 0

1

answer

Question


Setting all the entry in multiple columns to zero
Suppose I have a matrix A that is 1000*5. Suppose I want to set all the elements in the third, fourth, and fifth columns to be z...

8 years ago | 1 answer | 0

1

answer

Question


Create a function from a table
Suppose I have a matrix A = [ 3 0.1; 1 0.2; 2 0.3]; I now want to have a function that takes an entry of the first column...

8 years ago | 2 answers | 0

2

answers

Question


Divide every entry of a column by the same number
Suppose I have A = [1 2 3; 4 5 6; 7 8 9]; and I want to divide every entry in the second column by 2 so the answer is ...

8 years ago | 1 answer | 0

1

answer

Question


Summing up entries in the second column only when an entry in the third column is positive
Suppose I have a matrix N =[ 1 2 0; 4 5 1; 7 8 0]; I like to choose the row only with the positive third column and then ...

8 years ago | 1 answer | 0

1

answer

Question


How to generate a joint probability matrix from a data matrix, Part 2
To follow up, suppose I now want to create bins: Suppose the input is *bin center = (0.5 1 1.5) *bin edge = (0.25 0.7...

8 years ago | 0 answers | 0

0

answers

Question


How to generate a joint probability matrix from a data matrix
Suppose I have a data matrix Sample# X Y 1 1 1 2 1 2 3 1 1 Then I want to generate a joint prob...

8 years ago | 2 answers | 0

2

answers

Question


Meaning of 'dsa'
What is the meaning of 'dsa' used as a table name, for example, in https://www.mathworks.com/help/stats/grpstats.html (I ...

8 years ago | 1 answer | 0

1

answer

Question


Pivot table using grpstats
Hello, Let us I want to calculate the sum and mean of wealth for men and women. I set Type ={men, women} and have created ...

8 years ago | 1 answer | 0

1

answer

Question


Saving the plot: saveas does not seem to work
I have the following code and I try to save the plot with "saveas" but it does not seem to work. Please advise. ...

8 years ago | 1 answer | 0

1

answer

Question


how to change the tick frequency on a timeseries x-axis
In my plot, x-axis refers to months (like 05-2007). There are more than 100 months in the data thus the plot x axis does not loo...

8 years ago | 0 answers | 0

0

answers

Question


Remove gridline from plot
I would like to know the steps to remove gridline (see attached) from the plot. Please advise.

8 years ago | 1 answer | 0

1

answer

Question


Plot legend below the plot
For the plot, how can I put the legend below the plot (as in excel)?

8 years ago | 1 answer | 1

1

answer

Question


Plot of a three dimensional matrix
Suppose I have a three dimensional matrix where the first index is the city, the second index is time. and the third index is te...

8 years ago | 1 answer | 0

1

answer

Question


Pivot table with different operations for columns
Suppose I have a table that rows represent yyyymmdd and columns represent height and weights. I want to create a pivot table...

8 years ago | 1 answer | 0

1

answer

Question


Read a spreadsheet and calculate statistics of each variable in the spreadsheet
I have a spreadsheet data with the header (variable name). I would like to: 1. Read the spreadsheet using Import Wizard. ...

8 years ago | 1 answer | 0

1

answer

Question


Creating aggregated variables from the data
Suppose I have data with the first column refers to the month, the second column refers to days, and the third column refers to ...

8 years ago | 1 answer | 0

1

answer

Question


Regression for each category
Suppose I have following data: the first column is the city, the second column is the height, and the third column is weight. ...

8 years ago | 2 answers | 0

2

answers

Load more