Answered
random numbers can be divided b
Try this: r5 = randi(10,1,20)*5; % Creates 20 Random Integers From 5 To 50, All Of Which Can Be Divided E...

7 years ago | 0

| accepted

Answered
How to plot contour without interpolation on a nonuniform grid?
Have you experimented to see how contour (or contourf) works with your data? Did the function throw an error? If not, just l...

7 years ago | 0

Answered
add numbers to an array correspondingly
Use bsxfun: A = [ 6 10 14 ]; B = [0.0152 0.0134 0.0120 0.0121 0.0109 0.0100 0.0089 0.0084 0...

7 years ago | 0

Answered
Index exceeds the number of array elements (10), How do I solve this error??
Five lines above it, you initialise the for loop as: for xx=1:11 Perhaps: for xx=1:10 will eliminate the error

7 years ago | 0

| accepted

Answered
How to separate matrix elements based on randomized indices
If you want, you can do it without an expressed loop (the accumarray function of course loops internally): a = randi(9,2,10); ...

7 years ago | 0

Answered
How to exclude a variable from fit by custom function.
Try this: T = 42; % Defined In Your Workspace y = @(a,g,x) a+g./(exp(T./x)-1); T...

7 years ago | 0

Answered
Temperature contour plot from x,y coordinates and corresponding Temperatures?
See if the griddata (link) function will do what you want.

7 years ago | 0

| accepted

Answered
How to use condition to output a new matrix
Just use one &: if (Sim_EVT > CB) & (Sim_EVT <(CB+CA))) You can probably do ths in one line: ClassB2 = (CA.*0.7761194...

7 years ago | 0

| accepted

Answered
if-statement with conditions.
You can safely delete this assignment: condintion = in1 < in2; because it overwrites the ‘condition’ argument. You can als...

7 years ago | 2

| accepted

Answered
Please rectify the error in the code
Try this instead: semilogy(SNR,[The_awgn; The_rayl; BER1'; BER2']);

7 years ago | 1

| accepted

Answered
How can I plot arrows over a function? (For ODE solution)
Try this: t = linspace(0, 2, 25); h = t(2)-t(1); s = sin(2*pi*t/max(t)); ds = gradient(s,h); dt = gradient(t,h); figure...

7 years ago | 0

| accepted

Answered
How to scan a variable for a certain pattern
Try this example: x = randi([0 1], 1, 100) idx = strfind(num2str(x, '%d'), '101101') I’m not exactly certain what you want t...

7 years ago | 0

Answered
I want to find the standard deviation of each data point in the matrix.
If you have R2018a or later, use the normalize (link) funciton. It returns the z-scores of your data. Otherwise, this prod...

7 years ago | 1

| accepted

Answered
How do I eliminate multiple 60Hz harmonics within 1 set of data in an ECG
The Signal Processing Toolbox is best for this. See: Remove the 60 Hz Hum from a Signal (link). You’ll need to design a separa...

7 years ago | 1

| accepted

Answered
frequency vector in a fft
Try this: plot(f,ccf(1:numel(f))*2) That should do what you want. (It plots the ‘positive half’ of the fft result, from D-C ...

7 years ago | 1

| accepted

Answered
How can I plot 2 vectors of different length?
Without knowing any constraints you may have, try this: data = rand(1, 32); % Create Data ...

7 years ago | 2

| accepted

Answered
is there a bandwidth limit on the bandstop filter
The easiest way to see what’s going on with it is to use fvtool to look at it, and to give it a short random signal to look at t...

7 years ago | 0

| accepted

Answered
How can I specify axis spacing?
One option: x = [4 8 16 32 64 128 256 512 1024]; plot(log2(x), Y) set(gca,'XTick',log2(x), 'XTickLabel',x) It would be a bi...

7 years ago | 0

| accepted

Answered
Using wrapTo2Pi without toolbox
I wrote a little utility function for my own use to do just that: Angles2pi = @(a) rem(2*pi+a, 2*pi); % F...

7 years ago | 3

| accepted

Answered
Error function plot with two variables
You will need the meshgrid (link) or (ndgrid (linked to on that page)) functions, and the surf (link) (or mesh (linked to on tha...

7 years ago | 0

Answered
Voice waveform in Matlab
The plot appears to be data. Your reference to ‘coding’ it is at best ambiguous. If you want to analyse it, one option is ce...

7 years ago | 0

| accepted

Answered
How can I export a 2D cell into either a .csv or .xls file?
I’m not certain what your cell contains. One option is to use the cell2mat (link) functiion to convert it to a matrix, then u...

7 years ago | 0

Answered
plotting the confidence bands
I can’t run your code because the patch call you posted is corrupt. Try this in place of your set calls: xt = get(gca, 'XTi...

7 years ago | 0

Answered
90% amplitude of wave
Probably: max90 = max(wave)*0.9;

7 years ago | 0

Answered
how to identify unique columns, based on the first two rows, make an average of the uniques columns and remove the duplicate columns?
With ‘M’ as your matrix: M = [10.0500 9.7500 9.8500 9.8500 9.7500 9.5500 9.8500 47.1500 47.1500 47...

7 years ago | 0

| accepted

Answered
How to make matlab count
One way is to use the nnz (link) function with a logical vector: x = 5 M=[1 2 3 4 5 1 2 3 5 6 7 2 4 3 5] Count = n...

7 years ago | 1

Answered
Multiple delimiters for readtable
To specify more than one delimiter, use a cell array of character vectors: t = readtable('data.txt','Delimiter',{'tab', '+'}, ...

7 years ago | 1

| accepted

Answered
Plotting two matrixes in same plot
I am not certain what result you want.. One option: figure plot(A) hold on plot(B) hold off If you want them oriented d...

7 years ago | 0

Answered
Mathematics of the bandpass function
When I used it, the bandpass function designed an efficient elliptical filter. You can simulate it with the ellipord, ellip, zp...

7 years ago | 0

Answered
Display radius on the plot
You did not define ‘ro’. When you do, you can plot the radius easily as: plot([0 xra(45)], [0 yra(45)], '-b', [0 xc(135)...

7 years ago | 1

| accepted

Load more