Answered
choose elements from array randomly
One thing you can do is: % create vector a = randn(100,1); % determine how many elements is ten percent nume...

13 years ago | 0

Answered
How to plot two independent curves as symbols in one graph?
I don't have any problem with your code, what version of MATLAB are you using? Do these work for you? X1 = [1:99,1]'; X2 =...

13 years ago | 0

| accepted

Answered
divide matlab line plot in two lines of the same colour
You can easily break up the data where there is clear jump in the azimuth: 68.7000 to 287.0000 To do this you sort the azim...

13 years ago | 0

Answered
extraction of video frames in simulink
You should not start a new thread for the identical topic: <http://www.mathworks.com/matlabcentral/answers/48850-how-to-read-...

13 years ago | 0

Answered
How can i use L'hospital rule i.e sin(x)/x for x tends to zero?
You can do this: x = -5:0.001:5; y = sin(x)./x; plot(x,y) Since the increment in the x-variable is 0.001 and...

13 years ago | 0

Answered
divide matlab line plot in two lines of the same colour
Do you need to plot these with a line? Typically when you plot data like this you would just use a scatter plot plot(azimu...

13 years ago | 0

Answered
Cant get plotyy to work with string x tick labels
This has to do with how plotyy() creates two overlappying x-axes. You can work around this with the following: [AX,H1,H2] ...

13 years ago | 1

| accepted

Answered
Superimposing Normal Distribution on Histogram
Why do you say that you must have a number of bins that is not an integer? How can you have anything but a positive integer for ...

13 years ago | 0

Answered
how can i identify the damaged portion in the matrix?
What do you mean by "damaged portion" imcrop() optionally returns additional outputs like the cropping rectangle as well as the ...

13 years ago | 0

Answered
Questian about optmization errror.
First clear c if it's in your workspace and try this. c = [atan(deg2rad((x(9)-x(10))/(x(11)-x(12))))-... atan(d...

13 years ago | 0

Answered
How to get the fitted data by using Matlab's "Fit" Function?
It gives you a 1-D vector, but that 1-D vector is a polynomial in two variables, hence it is a function of the form f(x,y)=z ...

13 years ago | 0

| accepted

Answered
Question about infinite looping
Yes, you can program that in. For example, you can program in that if a solution is not found after so many iterations that you ...

13 years ago | 0

Answered
How to get the fitted data by using Matlab's "Fit" Function?
Hi, you can use the coeffvalues() method on the fitresult object. coeffs = coeffvalues(fitresult); That will give you ...

13 years ago | 1

Answered
same values using randi setting seed as default
I'm not sure exactly what you're asking here. If you are calling randi(10) even a small number of times (here 4 times), ...

13 years ago | 2

Answered
applying log to matrix converts from real to complex: why?
It makes perfect sense to me that log() can produce complex numbers, but I'm confused by the NaNs. Can you give an example of an...

13 years ago | 0

Answered
How can I delete a plot among many plot in one figure?
Click "edit plot" -- the arrow next to the printer icon. Then, click on the line you want to delete and then delete it. An...

13 years ago | 8

Answered
relation between the fft of full and segmented signal
That's because the spacing between the DFT bins depends not only on the sampling frequency, but ALSO on the length of the input ...

13 years ago | 0

| accepted

Answered
To run 'mexw32' from a script.
Hopefully you're on the correct machine for the mex file, but you just call the function without the mexw32 extension. out =...

13 years ago | 0

| accepted

Answered
using convolution with matlab
With all due respect, I think you need to take some time to read the MATLAB documentation. n = 0:3; x=n.^3-n.^2; ...

13 years ago | 0

| accepted

Answered
what is the purpose of the command line “y=y(1:64)”
It gives you an output signal the same length as your original signal, x. The following operations create a signal with 68 sampl...

13 years ago | 0

| accepted

Answered
using convolution with matlab
Use the function conv() See the help for conv()

13 years ago | 0

Answered
Amplitude Probability Density Function
ksdensity() will give you an estimate of the PDF for you data. If you have a hypothesis about the distribution of your data, ...

13 years ago | 1

Answered
Cross correlation negative lag time
If you look at the help for xcorr(), you'll see how the inputs are lagged with respect to each other. If the A input is delayed ...

13 years ago | 0

Answered
create a piece of music using matlab??
Simple sine waves are not going to sound like music even if you string them together. I'm not a music expert by any stretch of t...

13 years ago | 0

Answered
find the mean, energy and power of cosine function
You can just do: mean(x) Ex = norm(x,2)^2 % the energy Px = 1/numel(x)*norm(x,2)^2 % power If you do...

13 years ago | 0

| accepted

Answered
Period Operator Using filtfilt
The answer to what the period operator in your example does is the following. filtfilt() unlike filter() does not accept a df...

13 years ago | 1

Answered
Interp1 error: Can someone please help.
With the precision that you have it seems that your oldT vector is not monotonic. For example: X = 1:9; X = [X 9]; ...

13 years ago | 0

| accepted

Answered
Question about making a function file with vectors and variables
If A is not a variable in the workspace, then inputting it into a function will cause an error function sumout = testfunctio...

13 years ago | 0

Answered
Question about making a function file with vectors and variables
MATLAB will do that on its own. >> clear A % in case A is in the workspace >> a=[1 2 A 4] The MATLAB error message will...

13 years ago | 0

Answered
rand integer values from an array
You can use randi index = randi(length(A(:)),1,1); A(index) for a 1-D vector, you can just do length(A), but length(A(:...

13 years ago | 1

| accepted

Load more