Answered
How to insert loop variable inside plot label?
I assume you want to include it in your *|ylabel|* call. This works: ylabel(sprintf('\\theta %d', i)); The double ...

8 years ago | 1

| accepted

Answered
I want to adjust the x-axis according to the histogram distribution.
I am not certain what you want to do. Try this: x = 0:50; % Create Data y = exp(-0.1...

8 years ago | 0

Answered
Add lines along the axes
I am not certain what you want. Try this: x = linspace(-2, 5, 250); y = sin(2*pi*x + 0.2) + 0.3; figure ...

8 years ago | 1

| accepted

Answered
Is my code set up correctly? (Vectors)
It seems to be correct. However you do not need the loop, since the *|‘N’|* calculation is not a function of *|‘n’|*. So s...

8 years ago | 0

Answered
Load function not properly loading a numeric ASCII file
Your file is *|(24 x 47)|*, and *|load|* reads it correctly and completely: D = load('20180919N.txt'); I copied your ...

8 years ago | 0

| accepted

Answered
Is there a way to run an entire string of operations elementwise?
You have my sympathies. In the future, use the <https://www.mathworks.com/help/matlab/ref/vectorize.html *|vectorize|*> (li...

8 years ago | 0

| accepted

Answered
How to extract x,y,z coordinates from a plot 3 3d line plot?
See: <https://www.mathworks.com/matlabcentral/answers/100687-how-do-i-extract-data-from-matlab-figures *How do I extract data fr...

8 years ago | 0

Answered
Error with vectors not being the same length
I suspect that what you want is to plot *|‘Zmag_actual’|* and *|‘Zang_actual’|* against (a slightly tweaked version of) your com...

8 years ago | 0

| accepted

Answered
Evaluate a distribution programmatically
The <https://www.mathworks.com/help/stats/fitdist.html *|fitdist|*> (link) function will fit a distribution to data, producing a...

8 years ago | 1

| accepted

Answered
Find numerical gradient of a function
If I understand correctly what you want to do, this is one approach: xx = randi(9,1,3) % Cre...

8 years ago | 0

Answered
Problem with loading data
*_‘Any idea how to load all the data for 31 days of each month?’_* As you mentioned, not all months *_have_* *|31|* days. ...

8 years ago | 0

| accepted

Answered
How to resample multiple sampling frequencies within a large dataset?
I am not quite certain what you want. One suggestion is: <http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_...

8 years ago | 0

| accepted

Answered
Simple question about for-loop error: Unable to perform assignment because the left and right sides have a different number of elements.
You originally define *|‘x’|* as a *|(3x1)|* vector: x=[1;1;1]; and later assign it as a scalar: x(n+1)=Z*(b-T*x(...

8 years ago | 0

Answered
not enough input arguments
It _could_ be that you ran your function by clicking on the green *Run* arrow in the Editor. You need to define the function ar...

8 years ago | 0

Answered
i need to plot a line in 3D scatter plot
Use the <https://www.mathworks.com/help/matlab/ref/hold.html *|hold|*> (link) function to plot both to the same axes. ...

8 years ago | 1

| accepted

Answered
Numbers on the y-axis dont start at 0
I am not certain what you want with respect to the origin location. See the documentation for <https://www.mathworks.com/help/m...

8 years ago | 0

Answered
How to find derivative of CSV data plot?
It is easiest to use the <https://www.mathworks.com/help/matlab/ref/gradient.html *|gradient|*> (link) function: [D,S,R] =...

8 years ago | 0

| accepted

Answered
Array indices must be positive integers or logical values.
This will run: t = [1 24 48 72]; x = linspace(0,1,4); for ii = length(t) u=1.656e-5; c(ii)=(0.5).*erfc...

8 years ago | 0

Answered
how to replace zeros's with o.1 in the ouput?
Try this: duration = randi([0 9], 1, 15) % Create Vector duration(duration == 0) =...

8 years ago | 1

| accepted

Answered
Finding specific values in an array
One approach: data = randi(20, 4800, 17); % Create Data [r,c,v] = find(data > 10); ...

8 years ago | 0

Answered
log of a vector
A complex result for one element produces what _appears_ to be a complex result for _all_ elements. For those elements that are...

8 years ago | 0

| accepted

Answered
I have 2 columns of data, speed and Torque. I am looking for a way to capture the value of Engine where Torque is zero.
Try this: [D,S,R] = xlsread('sample.xlsx'); ridx = find(D(:,2) <= 0); oneAbove = D(ridx-1,:) oneAbove = ...

8 years ago | 1

| accepted

Answered
How to generate a frequency vs time graph with a 16 Channels EEG .dat file on matlab?
Use the Signal Processing Toolbox <https://www.mathworks.com/help/signal/ref/spectrogram.html *|spectrogram|*> (link) function. ...

8 years ago | 0

Answered
Obtaining the significance of coefficients from polyfit
See if the File Exchange <https://www.mathworks.com/matlabcentral/fileexchange/39126-polyparci *|polyparci|*> (link) function wi...

8 years ago | 1

| accepted

Answered
How to use INVERSE FFT in matlab on csv data?
You need to do the *|ifft|* on *|‘FTy’|*. You will likely need to multiply *|‘FTy’|* by *|‘L’|* first. The *|ifft|* result...

8 years ago | 0

Answered
Could anyone please help me with collection of EOG data base
Start with the PhysioNet page on <https://physionet.org/mimic2/Signals_Class/eog.shtml *Electrooculogram (EOG)*> (link).

8 years ago | 1

| accepted

Answered
contour plot based on xyz data
Your data are gridded. You only need to *|reshape|* them into your *|‘X’|*, *|‘Y’|*, and *|‘Z’|* matrices: D = load('data...

8 years ago | 2

| accepted

Answered
Why is my table array not outputting?!
Try this slight variation: OptimalSystems = {'System_A','System_B','System_C','System_D','System_E'}; Gain = [5/sqrt(2)...

8 years ago | 1

| accepted

Answered
Generate sine wave with varying phase
One approach: t = linspace(0, 2, 500); f = 10; s(1,:) = sin(2*pi*f*t/t(end)); s(2,:) = [sin(2*pi*f*t(1:numel(t)/2...

8 years ago | 0

| accepted

Answered
Hello, any one help me, i am new in this field. How apply band pass filter for 0.5 Hz to 35 Hz on recorded EEG data?
If you have *|R2018a|* or later, use the <https://www.mathworks.com/help/signal/ref/bandpass.html *|bandpass|*> (link) function....

8 years ago | 0

Load more