Answered
Take UTC time data from excel, plot in MATlab
I have no idea what the problem is, however if time in‘HH:mm:ss’ format in Excel is being imported as decimal numbers in MATLAB,...

3 years ago | 0

Answered
How can I plot Low Pass Butterworth Filter's response graph when its input wave is square wave?
Plot it however you like. Perhaps — [z,p,k] = butter(5, 0.05); [sos,g] = zp2sos(z,p,k); t = linspace(0, 10, 1E+3); s =...

3 years ago | 0

| accepted

Answered
Find x and y cordinates and t for z=0
Without knowing more, try something like this — x = x(:); y = y(:); z = z(:); zidx = find(diff(sign(z))); for k = 1:numel(...

3 years ago | 0

Answered
Matlab code on How to fix the problem with this signal?
Use the detrend function — F = openfig(websave('disppertime','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1...

3 years ago | 1

| accepted

Answered
Problem with legend command
This is a known problem with certain AMD graphics drivers, although it was fixed a while ago. Go to the GeForce Experience we...

3 years ago | 0

Answered
interp1 issue - resampling
Try something like this — variable1=[24.6944086885135;21.0998152063394;14.7533601994682;6.76823133654033;6.73000233602188;8.34...

3 years ago | 0

| accepted

Answered
Convert Number of Days to just a number
As it currently exists, ‘B’ is a duration. Use the days function to convert it to a double-precision number. Then, it work...

3 years ago | 0

| accepted

Answered
Plot peaks for each column in a csv then fit a curve.
There are no visible peaks in the time-domain signal. Doing the Foureir transform and finding the peaks is easy enough, howev...

3 years ago | 0

| accepted

Answered
Matlab sensing the dynamic data changes and automatically plotting
Just the code this time — data = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1175778/newdata3.cs...

3 years ago | 0

| accepted

Answered
Simple Way to Find How Far Down a Number Is
Use the find function — T1 = array2table([rand(10,3) randi([0 1], 10, 1)]) RowIdx = find(T1.Var4 == 0) . .

3 years ago | 1

| accepted

Answered
Plotting a scaler and adding a legend to graph
The ‘rollt’ value is a scalar. If you want to plot it as a funciton of ‘v’ create it a s vector with — plot(v,rollt*ones(si...

3 years ago | 0

Answered
When coding of function that shows error in yellow underline.
I have no idea what ‘f’ is, however in order to compare function outputs, it is necessary to evaluate the functions. So the c...

3 years ago | 0

Answered
Genetic Algorithm and objective function value
If the objective funciton is the same as the fitness function (and I have no idea what you are doing), the result should be the ...

3 years ago | 0

| accepted

Answered
How to know the passband of the savitzky golay matlab filter?
The Savitzky-Golay filter is not a discrete filter in the usual sense, and while all digital filters work best with uniformly-sa...

3 years ago | 0

Answered
Generating random angles between interval
Try something like this — random_angles3 = rand(1,3)*2*pi - pi random_angles1000 = rand(1,1000)*2*pi - pi; figure histo...

3 years ago | 0

Answered
How to add zoom box to matlab plot??
See the axes documentation section on Position Multiple Axes in Figure.

3 years ago | 0

Answered
How to apply any 2D lines on to a given 3D surface?
This is actually straightforward with the griddedInterpolant function, providing the data are gridded to begin with. The surfac...

3 years ago | 0

| accepted

Answered
flushing the keyboard input after a pause.
I generally do not use input, preferring inputdlg instead.

3 years ago | 1

| accepted

Answered
How can I a function on the interval
If you want the x and y values, you need to ask for them — f = @(x)x+log(x) hfp = fplot(f,[0.1 1]); x = hfp.XData y = hfp...

3 years ago | 0

Answered
I keep getting an error?
It may be necessary to use the cell2mat function if the arrays are in a cell array. The existing cell array elements must be pu...

3 years ago | 0

Answered
how to write values with dms2degrees
This is a real challenge. There must be an easier way to do this, however if there is, it eludes me. I wrote my own functi...

3 years ago | 0

| accepted

Answered
Why does this happen when using the log scale for the y-axis?
Setting the BaseValue parameter to a positive value is an option. All the bar heights appear to be positive.

3 years ago | 1

| accepted

Answered
I am trying to plot this
Try this — t = linspace(0, 2*pi, 1E3); % Time Vector x = 1:2:31; ...

3 years ago | 0

Answered
How do I code rearrange equation?
Use the isolate funciton. (The solve function is also an option.) syms a t v_0 x_t x_0 Eqn = x_t - x_0 == v_0*t + a*t^2/2 ...

3 years ago | 0

Answered
Fail to unzip .gz file using 7zip in Matlab
I’m not certain what you want to do. MATLAB has the built-in unzip and gunzip functions that I use frequently, especially her...

3 years ago | 0

Answered
Improving first coding project
I deleted my answer because the other one was upvoted, meaning that in all likelihood, since the other is so long, even though I...

3 years ago | 1

Answered
Time approximation in matlab
If the sampling interval was constant: SamplesPerHour = 1500/24 Otherwise, you could use the retime funciton with the interva...

3 years ago | 0

Answered
Trying a overlapping but piecewise plot
The problem description leaves much to the imagination. If you want to offset them on the x-axis, this likely requires a loop. ...

3 years ago | 0

| accepted

Answered
Trying to change the y axis range in fplot
See if ylim will do what you want — syms s a b c d e f n10 = a + (b*s) + c*(s^2) + d*(s^3) + e*(s^4) + f*(s^5) n10_d1 = diff...

3 years ago | 1

| accepted

Answered
How to extract labels from a xlsx graph in matlab
It depends how you’re importing the Excel file. If you use readtable, the header line (assuming only one) will be ‘VN’ in: T...

3 years ago | 0

Load more