Answered
Issues with area function to fill under plot
Try this: y = 0:20; x = rand(size(y)); figure(1) plot(x, y) hold on patch([ zeros(size(x)) x ], [ flipl...

9 years ago | 1

| accepted

Answered
How to find the minimum value of the function of two variables e.g sin(x)*cos(y), and plot it with surf?
Your code just needs a bit of tweaking to do what you want: f = @(x,y) sin(x).*cos(y); x0 = [rand,rand]; [xmin,...

9 years ago | 0

| accepted

Answered
How do I get a magnitude respons with frequency at the x-axis?
Yes! Supply the sampling frequency (here *|‘Fs’|*) as an argument to *|freqz|* to get the plot in terms of actual frequency...

9 years ago | 3

| accepted

Answered
What does a reshape error mean? Palmer's Drought Indices Calculator
You need to be certain that the length (maximum dimension) of *|‘lat_col’|* is an _integer multiple_ of *|12|*. That appears to...

9 years ago | 0

| accepted

Answered
Position of an element in a vector
The *|ismember|* (or perhaps preferably *|ismembertol|*) function is your friend here. *_EDIT_ —* The *|‘-2’|* index will ...

9 years ago | 7

Answered
Constraints on randomly generated integers randi
One approach: x1 = 5; % Create Limits x2 = 15; %...

9 years ago | 1

| accepted

Answered
How to make a 1x10 matrix from the 1st and 2nd row of a old matrix
Try this: x = [6 43 2 11 87;12 6 34 0 5;34 18 7 41 9]; Out = [x(1,:) x(2,:)] Out = 6 43 2 11 ...

9 years ago | 0

Answered
Removing values so two vectors are the same length
If I understand correctly what you want to do, something like this will work: time = 1:15; ...

9 years ago | 0

Answered
How to plot a complex function ?
It depends on what you want to do. To plot the real and imaginary parts as a function of *|‘z’|*: plot(z, real(f(z)),...

9 years ago | 1

Answered
How can i Break a sampled signal up into 4 sections to use for 4 seperate fft calculations
*_References_:* <http://www.mathworks.com/matlabcentral/answers/259953-how-can-i-detect-frequency-of-dtmf-tone-wav-file *Ho...

9 years ago | 0

| accepted

Answered
Convert numeric values to ASCII code
Try this: t = 2.5; Out = int64(num2str(t)) Out1 = 1×3 int64 row vector 50 46 53

9 years ago | 0

| accepted

Answered
Normalize data set between 0 and 1
The format is not important with respect to the calculations. The values you want from your imported Excel data, and the minimu...

9 years ago | 0

Answered
In an array or a matrix, how to I find the position of a largest number. and print the postion
Use the *|max|* function, with or without the *|find|* function. V = randi(9, 1, 10); ...

9 years ago | 0

Answered
I just have one simple question. How do i calculate the integral of this area?
One approach: r=@(z)2+sin(5*z+2.2*cos(5*z)); z=linspace(0,2*pi); x=r(z).*cos(z); y=r(z).*sin(z); Ixy = cum...

9 years ago | 0

| accepted

Answered
Integrating The Normal Probability Density Function
The *|normcdf|* function will do the integration for you: Mean = 1853.910; Standard_Deviation = 1.829; lims = [1855....

9 years ago | 2

| accepted

Answered
How I applly a bandpass filter in a signal?
Since it is research, here is your filter: Fs = 1000; % Sampling Frequenc...

9 years ago | 3

| accepted

Answered
How can I plot M with SIR ?
I am not certain what result you want. Try this: N = 3; Q = sqrt(3) * N; n = 2; Mfcn = @(M) 1./(M * 6) .* Q....

9 years ago | 0

Answered
if statement does not execute the statements
If I understand correctly what you want to do, this should work: A = randi(9, 7, 4); ...

9 years ago | 1

| accepted

Answered
Plot vertical lines in a figure with a certain distance
Try this: x = linspace(0,1, 250); % Create Data y = 5+randn(size(x)); ...

9 years ago | 1

| accepted

Answered
How do is solve the problem of ' subscripted assignment dimension mismatch' in below code
Try this: lambda=0:1:10; t=20; MTBF = 1./lambda; R = @(t) exp(-t./MTBF); MTTF = MTBF-t; plot(MT...

9 years ago | 0

Answered
How to plot more values and join them with line?
Try this: figure(1) semilogy(x, y, '-xk') legend('h = 0.9', 'Location','SW') xlabel('N') ylabel('error') gr...

9 years ago | 0

Answered
Statistically comparison between n sets of data which have non Gaussian distribution
The Mann-Whitney (the *|ranksum|* function) is for two-sample comparisons only. If you want to do multiple comparisons, the <ht...

9 years ago | 2

| accepted

Answered
identify duplicate entries of matrix and delete
Assigning your matrix to variable *|‘M’|*, this should do what you want: [~,idx] = unique(M(:,1:5), 'rows', 'stable'); ...

9 years ago | 0

| accepted

Answered
single sided amplitude fourier spectrum
See the documentation for <https://www.mathworks.com/help/releases/R2015a/matlab/ref/fft.html *|fft|*> (link). *_The Code_ —*...

9 years ago | 0

| accepted

Answered
bars at specific (x,y) points
If *|‘D’|* are your data, so that *|‘D(:,1)=X’|*, *|‘D(:,2)=Y’|*, *|‘D(:,3)=T’|*, try this: H3 = accumarray(D(:,[1 2])+1, ...

9 years ago | 1

Answered
How to add data between numbers in a vector.
This seems to work: data = 1:5; for k = 1:length(data)-1 NewData(:,k) = linspace(data(k),data(k+1),10); end ...

9 years ago | 0

Answered
how can i smooth this plot?
You have broadband noise. There _may_ be a signal at _about_ *|0.35|* Hz. The Fourier transform analysis: D = xlsrea...

9 years ago | 0

| accepted

Answered
I want to draw an arrow in vector.
One option is the *|quiver|* plot: Q = [0.977 -0.016 -0.016 0.176]; QX = Q(:,1); ...

9 years ago | 0

Answered
Startup.m works well in 2016a but not in 2017a
See the <https://www.mathworks.com/help/matlab/release-notes.html?rntext=&startrelease=R2015a&endrelease=R2017b&category=Advance...

9 years ago | 0

Load more