Question


creating a matrix by expanding a row
Suppose I have a 1*N row vector A. I want to vertically concatenate A for M times to create M*N matrix. Please advise.

8 years ago | 1 answer | 0

1

answer

Question


Sorting the elements of a matrix, Part 3
Suppose I have a matrix A. I want to define a matrix B where, for each row, taking entries in the first column and the second co...

8 years ago | 2 answers | 0

2

answers

Question


"Function definitions are not permitted in this context."
I use R2017a and I got the above error message when trying to define a function in a script. Please advise.

8 years ago | 1 answer | 0

1

answer

Question


create a matrix with the same entry
I would like to create, given x and NRows, a vector y that is NRows*1 and every element of y is x. Please advise.

8 years ago | 1 answer | 0

1

answer

Answered
loop over a list of numbers, Part 2
for S = [3 6 18]

8 years ago | 0

Question


loop over a list of numbers, Part 2
I want to have a loop over a list of numbers. I ran numlist = {3, 6, 18}; for S=1:length(numlist) S ...

8 years ago | 1 answer | 0

1

answer

Question


legend of a plot
Suppose we have lgndcell = regexp(sprintf('%2d class (Mean: %.3f, Std: %.3f)\n', [numlist{:}; mean(A); std(A)]), '\n', 'spl...

8 years ago | 0 answers | 0

0

answers

Question


extract only positive entries from a matrix
Suppose I have a vector A=[0 1 2]; I just want to create a vector B with only positive entries B=[1 2]; Please a...

8 years ago | 1 answer | 0

1

answer

Question


define global variables in a script with functions
I want to define a variable x at the beginning of the script and then I want a function in the script to be able to use this x w...

8 years ago | 2 answers | 0

2

answers

Question


A function that updates the input
Very basic question. Can I define a function that updates a matrix A with another entry B. That is function A=Update(A,B) ...

8 years ago | 1 answer | 0

1

answer

Question


automatically adjust numbers in the legend
I have a legend that says legend('Y axis','6 runners','12 runners','24 runners') What I want to have is that, given ...

8 years ago | 1 answer | 0

1

answer

Question


ismembertol not working correctly
I have two matrices A and B in the attached xls file and run [~,loc3] = ismembertol(A(:,2),B(:,1),0.01); and the outcome...

8 years ago | 1 answer | 0

1

answer

Question


loop over a list of numbers, Part 2
In a previous question, I have asked I would like to run a loop over a list of numbers like {3,6,18}. Please advise. The...

8 years ago | 1 answer | 0

1

answer

Question


loop over a list of numbers
I would like to run a loop over a list of numbers like {3,6,18}. Please advise.

8 years ago | 4 answers | 3

4

answers

Question


Display only a few grid points the x axis of the plot
When I draw a plot, I only want to display only, let us say, 6 points in the x axis of the plot regardless of the grid points. F...

8 years ago | 0 answers | 0

0

answers

Question


Generating samples of two dimensional random variable, Part 2
In a previous question, I asked: "First I want to generate a two-dimensional random variable (X1,X2) where X1 is from unif [0...

8 years ago | 0 answers | 0

0

answers

Question


Generating samples of two dimensional random variable
First I want to generate a two-dimensional random variable (X1,X2) where X1 is from unif [0,1] and X2 is independently from unif...

8 years ago | 1 answer | 0

1

answer

Question


dealing with "At least one END is missing: the statement may begin here."
I got the above error message. There are many loops in the code. Is there any way to efficiently track these for loops in the co...

8 years ago | 1 answer | 0

1

answer

Question


Plot: vertical legend for x axis
I have the horizontal legend for x-axis as you see in the attached graphics. But in this way numbers are hard to see. I would li...

8 years ago | 1 answer | 0

1

answer

Question


error message in legend
I tried to have a following legend in a plot legend([Plot1, Plot2, Plot3],'6 bidders (Mean ' + string(mean(OutputSpacing(:,...

8 years ago | 2 answers | 0

2

answers

Question


Histogram: put mean and std in the legend
In the code below I will have histograms of three series. I want to have mean and std of three series calculated and displayed i...

8 years ago | 1 answer | 0

1

answer

Question


Numbers are different but plots look always same
I run the program that uses rand and I use rng shuffle at the beginning of the code. The numbers calculated are different but th...

8 years ago | 0 answers | 0

0

answers

Question


Substitute values from one matrix to another、Part 3
"Suppose I have a matrix A = [1 2;1 2;2 4;2 4]; and B= [1 0.1;2 0.2]; I want to have a matrix 4 * 2 matrix C where *...

8 years ago | 0 answers | 0

0

answers

Question


Substitute values from one matrix to another, Part 2
In a previous question, I asked the following question: "Suppose I have a matrix A = [1 2;1 2;2 4;2 4]; and B= [1 0....

8 years ago | 0 answers | 0

0

answers

Question


substitute values from one matrix to another
Suppose I have a matrix A = [1 2;1 2;2 4;2 4]; and B= [1 0.1;2 0.2]; I want to have a matrix 3 * 2 matrix C where ...

8 years ago | 1 answer | 0

1

answer

Question


mean of elements of a matrix
I have a matrix A. I want to take an average of all elements of A. Please advise.

8 years ago | 3 answers | 0

3

answers

Question


Viewing three dimensional matrix
Suppose I have a 3D matrix A(i,j,k). Suppose I want to view a 2 matrix A(1,:,:). Please advise.

8 years ago | 1 answer | 0

1

answer

Question


put headers in a matrix (but not in the first row)
Suppose I have a matrix A [ 5 150; 6 170] where the first column is the height and the second column is the weight. I like to pu...

8 years ago | 1 answer | 0

1

answer

Question


Output matrices indexed by parameters
I run a program where the parameters are (say) a, b, and c. I would like to have an output matrix (say) A indexed by the value o...

8 years ago | 1 answer | 0

1

answer

Question


How to delete all figure plots
I run a program with plot and histogram. Then the program generates plot windows. I would like to delete all these figure window...

8 years ago | 1 answer | 1

1

answer

Load more