Answered
line not appear in plot
The ‘i_density’ vector begins with 0 and the log of 0 is -Inf. Starting it instead with a very small value, and re-writing ‘e...

2 years ago | 0

Answered
How to fill the plot to some specific value
Try this — t = linspace(0, 2*pi, 500); s = sin(t); figure plot(t, s, 'LineWidth',1.5) Lv1 = s >= 0.5; Lv2 = s <= -0.5; ...

2 years ago | 1

| accepted

Answered
How to find fitting optimized parameters to fit a system of non-linear ODEs to experiment.
You will need to post the ‘modified_data.xlsx’ file as well to run this here. My edit of your code — Model_Exp_Fit funct...

2 years ago | 2

| accepted

Answered
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 ...

2 years ago | 1

| accepted

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

2 years ago | 1

Answered
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...

2 years ago | 1

| accepted

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

| accepted

Answered
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...

2 years ago | 1

Answered
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...

2 years ago | 0

Answered
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) ...

2 years ago | 1

Answered
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. ...

2 years ago | 0

Answered
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}; ...

2 years ago | 0

Answered
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).'; ...

2 years ago | 0

| accepted

Answered
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 ...

2 years ago | 0

| accepted

Answered
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...

2 years ago | 1

| accepted

Answered
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...

2 years ago | 2

Answered
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...

2 years ago | 0

| accepted

Answered
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...

2 years ago | 0

| accepted

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

2 years ago | 0

| accepted

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 1

Answered
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...

2 years ago | 0

| accepted

Answered
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).^...

2 years ago | 0

Answered
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 ...

2 years ago | 1

| accepted

Answered
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(...

2 years ago | 1

| accepted

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

2 years ago | 0

Answered
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...

2 years ago | 2

| accepted

Answered
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...

2 years ago | 0

| accepted

Answered
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. ...

2 years ago | 1

Load more