Risposto
Identify the maximum values within fixed time intervals of a time series data set
Try this — Time=[4 5 6 7 8 9 10 25 26 27 28 29 46 47 48 49 50 58 59 60]; %Time vector, in minutes x=[ 0 5 0 1 3 11 2 0 0 1 8 ...

oltre 2 anni fa | 1

| accettato

Risposto
Offering Designated Computer Activation
Contact Support Include the URL to this thread in your message to MAthWorks.

oltre 2 anni fa | 1

Risposto
Customize the x-axis of hht plot
Putting 501 datetime x-ticks would be impossible to read, at least with this example. This creates all of them, nowever only us...

oltre 2 anni fa | 1

| accettato

Risposto
How to plot two figures side by side in a same plot?
The subplot and tiledlayout calls appear to be interfering with each other. Commenting-out the tiledlayout calls produces thi...

oltre 2 anni fa | 0

Risposto
How to fit two equations to two data set simultaneously and with multiple fitting parameters?
The Symbolic MathToolbox is not the best option here. Try a numeric approach, such as this one — x = [100 63.1 39.8 25.1 15...

oltre 2 anni fa | 0

| accettato

Risposto
help wtih plotting ode function
There are two problems: First, ‘x0’ is initially identically zero, and that creates an Inf result for the first value of ‘A’ a...

oltre 2 anni fa | 1

Risposto
Smooth a time serie not afectig max/minimun data?
See if the Signal Processing Toolbox envelope function will do what you want. Choose the 'peak' option, and experiment with the...

oltre 2 anni fa | 0

Risposto
How to reduce my sample rate of data
Use a colon-operator generated vector with the necessary step. Example — A = [1:50; randn(1,50)].' idx5 = 1:5:size(A,1) ...

oltre 2 anni fa | 1

Risposto
Extracting certain frequencies from FFT results using a window function
Frequency dokmain filtering is possible, however not ideal. If you want to do that, the fftfilt function is the best option. ...

oltre 2 anni fa | 0

Risposto
I need help with a code that uses a text file and its path to compare the data points to a sine wave that best fits the data
The data trace a straight line without any oscillations at all — T1 = readtable('Data18.txt') x = T1{:,1}; y = T1{:,2}; ...

oltre 2 anni fa | 0

Risposto
offset on y-axis
To plot them all on the same axes, you would need to offset them by some constant factor. x = linspace(350, 600).'; ...

oltre 2 anni fa | 0

| accettato

Risposto
Can someone please explain what I’m doing wrong?
The semicolon in the legend call is wrong (in this context). It would be better to write all that as a script rather than in ...

oltre 2 anni fa | 0

| accettato

Risposto
Can MATLAB read .txt like FORTRAN?
Yes. Use the fixedWidthImportOptions function to define the field widths, then use that in conjunction with readtable to read...

oltre 2 anni fa | 1

| accettato

Risposto
when I open a script in MATLAB, it opens it in a new window instead of the main one. how do I change that?
I am not certain what you are referring to. In the upper right corner of the Editor, there is a white downward-pointing tira...

oltre 2 anni fa | 2

Risposto
Assigning values to the arguments of a function handle
Again, using numbered variables as not considered good programming practise. I believe this correspoinds to your original cod...

oltre 2 anni fa | 0

| accettato

Risposto
I am using the symbolic tool box and have generated a number that has over 25,000 digits and would like to store that number in it's entirety onto a disk file.
One option would be to save it as a string array — syms x x = vpa(pi, 250) srt_x = string(x) whos You might want to s...

oltre 2 anni fa | 0

| accettato

Risposto
How do I convert double to cellstr?
Use the compose function (introduced in R2016b) — A = [2 25 1017]; Ac = compose('%d',A) .

oltre 2 anni fa | 0

| accettato

Risposto
Why do I get the error "Unrecognized function or variable"?
The important information is likely not shown here. My guess is that you are referring to ‘HW1’ somewhere else (perhaps in anot...

oltre 2 anni fa | 0

Risposto
Error with using fminsearch
Yoiu need to add the 'Vars' argument to your matlabFunction call— syms x y; % Peaks Funktion f = 3*(1-x)^2 * exp(-x^2-(y...

oltre 2 anni fa | 1

Risposto
Error using patch Value must be of numeric type and greater than 1.
I was not able to get these to work with patch (I still do not understand what that problem is), however with a minor modificat...

oltre 2 anni fa | 0

| accettato

Risposto
Moving from an index in the matrix to an x,y value
Perhaps something like this — x = linspace(0, 10, 50); y = linspace(0, 10, 50); zm = exp(-(x-4.5).^2/4) .* exp(-(y(:)-4.5).^...

oltre 2 anni fa | 0

Risposto
whos - I can't capture the output
Perhaps something like this — A = magic(7); B = string(randi(9, 4)); C = sin(2*pi*(0:0.01:1)); whos S = whos; Fields ...

oltre 2 anni fa | 1

| accettato

Risposto
Make a contourf plot beautifuller
The first one (with or without contour lines) is possible with a combination of the surf and view functions — [X,Y,Z] = peaks(...

oltre 2 anni fa | 1

| accettato

Risposto
Implementing Hilbert Function to obtain envelope
The envelope function was introduced in R2015b. It makes these problems easier.

oltre 2 anni fa | 0

Risposto
Extracting data from text file after a specified word
The textscan function works well for these sorts of problems if the files have a consistent internal structure — contents = fi...

oltre 2 anni fa | 2

| accettato

Risposto
Generate coordinates (3D), having the same contour as the initial circle but with a smaller size
One approach — nodes = importdata("plane_new_ok.mat"); center = importdata("node_new_ok.mat"); rf = scatteredInterpolant(n...

oltre 2 anni fa | 0

| accettato

Risposto
How can I add two fft functions?
It is obvious from looking at the code that the fft results have different lengths, specifically 523 and 1046 elements in each. ...

oltre 2 anni fa | 1

Risposto
Where is the month, day and year string stored in a plot with a datetime axis which shows hours and minutes in the xticklabel string?
If you have R2023b, you can use the recently introduced xsecondarylabel function — t1 = datetime('2023-04-01 04:00:00'); t2...

oltre 2 anni fa | 0

| accettato

Risposto
area in trapz coming out negative
‘... was wondering if I can just take the abolute value and if that would be bad data?’ If the descending values of the indep...

oltre 2 anni fa | 1

Risposto
Error using fopen for obj file
A returned value of -1 means that fopen can’t open the file. First, run: which fileIn to see if MATLAB can find it. If no...

oltre 2 anni fa | 1

| accettato

Carica altro