Question


running a loop and saving separate files
Hi I am running a loop and saving each file separately. The syntax I am using is for i = 1:10 RUN PROGRAM sa...

8 years ago | 1 answer | 0

1

answer

Question


making a movie from plots
I am making an animation using a loop and the pause() function, and I want to save the entire animation to make a movie. The plo...

9 years ago | 2 answers | 1

2

answers

Question


division of two matrices
I have a nx2 matrix A = [1 1; 2 1; 3 -1; 0 1]; and I have a nx1 matrix B = [1; ...

9 years ago | 2 answers | 0

2

answers

Question


indexing and performing operations in matrix
I have an nx2 matrix A. I also have an interaction matrix of A, which looks like this: interact = [1 2; ...

9 years ago | 0 answers | 0

0

answers

Question


listing/enumerating numbers
I have the following matrix, named interact: interact = [1 2; 1 3; 2 1; 2 3; ...

9 years ago | 2 answers | 0

2

answers

Question


replacing entries in matrices
I begin with a nx2 matrix (coordinate positions of n particles in a 2d plane), call this R. Initially, all the elements in R are...

9 years ago | 1 answer | 0

1

answer

Question


rearranging the ind2sub result
I used [r,c] = ind2sub(size(matrix),idx) and the result gives me something like: [r,c] = 1 1 2 1 4 1 5 1 ...

9 years ago | 1 answer | 0

1

answer

Question


indexing problem in a matrix.
I have n particles scattered in space. I measured the distances of all the particles relative to all the other particles by givi...

9 years ago | 1 answer | 0

1

answer

Question


reverse indexing with conditions
Let A = [1 2 4 6 10], I want to find the indices of the matrix for which the element less than 5. So if I say: A < 5, then i...

9 years ago | 2 answers | 0

2

answers

Question


if statements using logical operators
Let me define first that: 'distance' is a vector (1 x n) and 'f' is a scalar (1 x 1). Example: distance = [1 10 5]; f = 2. T...

9 years ago | 1 answer | 0

1

answer

Question


towards object oriented programming?
I have n particles which I want to study individually. At first, they are randomly distributed over a certain region so I can cr...

9 years ago | 1 answer | 0

1

answer

Question


assigning a vector to a function
I made a function that returns a vector as a response. I noticed that this vector is not 'stored' as I check the workspace. So I...

9 years ago | 2 answers | 0

2

answers

Question


question about x(1:n) vs x(n:1)
If we want to create a row vector with elements '20' then we can say: x(1:n) = 20. (n is a number you can specify). Why is it ...

9 years ago | 1 answer | 0

1

answer

Question


drawing a line using drawnow
I am drawing a line from a point (x_1, y_1) to a terminal point (x_2,y_2). for t=0:0.01:5 plot(x_1+(x_2-x_1)*t, y_1+(...

9 years ago | 2 answers | 0

2

answers

Question


tracing a path using plot
I want to see a line being traced on screen as the loop is running. x=0; y=0; for t=1:0.01:10 plot(x+t, y+t, 'r...

9 years ago | 1 answer | 0

1

answer

Question


how to randomly select an element in a matrix
Hi, I have a matrix for example A = [1,2,3,4,5,6]; I would like to randomly select an element in A. How do I do that? ...

9 years ago | 1 answer | 0

1

answer

Question


putting a coordinate system on a video frame
I have a video converted into many frames in matlab. Now, I want to have each frame to have a coordinate system with domain: [0,...

9 years ago | 0 answers | 0

0

answers

Question


loading a video INTO matlab
Hi, I wish to load a video into matlab and I typed: obj=VideoReader('vid1.mp4') A bunch of error messages appeared: ...

9 years ago | 0 answers | 0

0

answers

Question


Tutorial request for 2D Animation
I am new to Matlab. I have random points in the 2D plane which I can plot using scatter(x,y). Initially, it is easy to do be...

9 years ago | 1 answer | 0

1

answer

Question


appending data to scatter(x,y)
I am n random points in two dimensional space (x,y). I am using scatter(x,y) to visualize them. Now I want to take the cente...

9 years ago | 2 answers | 1

2

answers

Question


making a new coordinate system in matlab
Hello, I am trying to make a grid of cells for 'gridworld' coordinate system. I am not sure if it is freely available or I have ...

9 years ago | 1 answer | 0

1

answer

Question


storing a value as a vector
Hello, I am running an iteration which helps find the eigenvalues of a matrix. I want to store the eigenvalues in each itera...

9 years ago | 1 answer | 0

1

answer

Question


calculating or knowing the bias of a simulation
Hello, I am using Matlab to estimate a probability distribution function using histograms with a bin side of 0.05 on the int...

9 years ago | 0 answers | 0

0

answers

Question


kernel density estimation and regression (?)
Hello, I am trying to estimate the pdf of a random variable two ways: First is by making an estimation analytically (by hand...

9 years ago | 0 answers | 0

0

answers

Question


fitting a custom curve in histogram
Hello, I have a histogram plot data and I want to fit some curve that is "non-traditional". Instead of the usual normal, bet...

9 years ago | 1 answer | 0

1

answer

Question


independence in rand function
Hi, The rand function in matlab generates random numbers that are uniformly distributed. If for example, I say a = ran...

9 years ago | 1 answer | 0

1

answer

Question


plotting piecewise functions with logarithm
I am plotting a piecewise function as in below: x_axis=[-40:0.01:40]; g=5; if x_axis<0; plot(x_axis, (1/40).*lo...

9 years ago | 2 answers | 0

2

answers

Question


How is this an exponential curve?
Hello, I would like your help on the following code. How does this trace an exponential curve? N=8000; % ...

9 years ago | 2 answers | 0

2

answers

Question


histogram and plot at the same
Hello, Please help. I want to draw a plot of a function (the ones we have when we use plot()) and a histogram (with the bin...

9 years ago | 1 answer | 0

1

answer

Question


plotting many things in one window
Hi, I have X, which is a 100x100 matrix. I would like to plot each row with respect to the integers 1:100. Of course I could...

9 years ago | 1 answer | 0

1

answer

Load more