Answered
Interpolate rows of an image/matrix
Guessing — EvenRows = randn(5, 10); Matrix = NaN(10); Matrix(2:2:end,:) = EvenRows MatrixInterp = fillmissing(Matrix,'linea...

4 years ago | 0

| accepted

Answered
How do you make a label for a point on a plot separate into multiple lines?
Use sprintf instead — ii = 1; indMaxAmp(ii) = 24; maxAmp(ii) = 42; txt = sprintf('f = %.3f Hz\nP1 = %.3f dB', indMaxAmp(ii)...

4 years ago | 1

| accepted

Answered
contourf lower edge effects, how to fix and how does contourf work
We’re missing the filter function you’re using, so not able to run your code. However the pspectrum 'spectrogram' plot demonstr...

4 years ago | 1

| accepted

Answered
fft(x), why divide with L?
The Fourier transform uses repeated summations of the original vector to create the transform vector. Dividing my the length of...

4 years ago | 0

| accepted

Answered
How can I get my distance variable to be [0.1:0.7] to show as [0.1,0.2,0.3,0.4,0.5,0.6,0.7]
The default ‘step’ using the colon operator is 1, so the condition is immediately satisfied and only the first element appears. ...

4 years ago | 0

Answered
Can MatLab help this beginner with a chemistry problem about acid-base titrations
I was in the process of posting a response to the yesterday when my computer sbruptly crashed (in the wake of the Win 11 2022 2 ...

4 years ago | 0

| accepted

Answered
Help with 3D contours aligned to discrete surface data
Reading the files is not an option, so I went straight for the ‘Problem.fig’ file. I’m not certain that the contour lines ar...

4 years ago | 0

| accepted

Answered
How to display a particular range of log value at x-axis?
I am not certain what you want the result to be. Perhaps using xlim would work (regardless of the axis scaling, however it ma...

4 years ago | 0

| accepted

Answered
How to use a Fir1 filter to make a lowpass filter
The filter specification needs to be: blo = fir1(128,0.48,chebwin(129,30)); because of the filter length.. That will work. ...

4 years ago | 0

| accepted

Answered
Help with contours at maximum z-level in surfc
I asked about this a while ago, and received a repl;y from MathWorks that I sent along to Yair Altman for inclusion in Undocumen...

4 years ago | 0

| accepted

Answered
Help with choice of contour intervals in surfc
The second object in surfc is the countour plot, so address it and set the 'LevelList' property — [X,Y,Z] = peaks(50); figu...

4 years ago | 0

| accepted

Answered
How do I get a maximum and minimum for a singular wave while ignoring the other local maximums and minimums?
Using my code in How can I create isolated waves from data I have? — LvPks = islocalmax(y, 'MinProminence',0.01, 'MinSeparatio...

4 years ago | 0

| accepted

Answered
Kinetic Models (Monod Equations)
See: Monod kinetics and curve fitting A somewhat improved version of that is in: Parameter Estimation for a System of Differe...

4 years ago | 0

| accepted

Answered
printing matrix data in the correct order (fprintf)
data_info = [2020 3 21 12 0 2020 3 21 12 10 2020 3 21 12 20 2020 3 21 1...

4 years ago | 1

Answered
Why isn't my max iterations increasing?
Always tell the functions that there is an options structure available — answer1 = fsolve(fun, x0, options) They do not infer...

4 years ago | 1

| accepted

Answered
How can I create isolated waves from data I have?
The most robust way I am aware of to detect zero-crossings is: zci = find(diff(sign(y))) where ‘y’ is the signal youwant to a...

4 years ago | 0

| accepted

Answered
How do I download the signal processing package into my MATLAB R2022a?
This has changed over time. In MATLAB, click on Add-Ons and then click on View My Products. That should offer you the opportun...

4 years ago | 1

Answered
How to convert YYYYDDMMhhmm into 5 columns of YYYY, DD, MM, hh, mm?
One approach — A = [202021031200; 202021031210]; As = string(A) ADT = datetime(As, 'InputFormat',"yyyyddMMHHmm") ADTM = [...

4 years ago | 0

Answered
How to create figure containing 4 plots with tiledlayout for different values of a parameter?
The essence of creating the tiledlayout here is: tiledlayout(2,2) for k = 1:numel(idx_JC_vec) nexttile idx_JC = idx...

4 years ago | 1

| accepted

Answered
how to extend a straight line passing through two points until it meets the y axis of the Cartesian plane
It already meets the y-axis at the origin (0,0). If you want to extend it to , that is straightforward — slope = -53634 / -...

4 years ago | 0

| accepted

Answered
ARRANGE DATA IN MATLAB
It depends on the result you want — v = 1:10 vm1 = repmat(v, 10, 1) vm2 = v(:) * v Other possibilities also exist. .

4 years ago | 0

Answered
How to interpolate and plot discrete measurement data corresponding to spacial coordinates?
It is definitely possible to interpolate those values to a finer set of coordinates and to use scatter3 to display them with re...

4 years ago | 0

| accepted

Answered
How do I ask for a string input?
It is likely easier to save it to a cell array — FileName{i} = input("File Name: ","s"); That worked when I tried it offline...

4 years ago | 0

| accepted

Answered
How do you change the color on a class in a legend?
Try something like this — figure; hold on hp{1} = plot(Xred(1,:),Xred(2,:),'r.'); hp{2} = plot(Xblue(1,:),Xblue(2,:),'b.'); ...

4 years ago | 0

| accepted

Answered
x and y- line until point
Illustrating the approach — x = linspace(0, 5); % Create Data y = sin(2*pi*x/2.5)...

4 years ago | 0

| accepted

Answered
How to use num2str inside text with latex interpreter?
I prefer to use sprintf for this. (If you use any escape characters, you need to use double backslants. See the documentation ...

4 years ago | 0

| accepted

Answered
Error when trying to plot a polynomial with data.
Use the polyval function.

4 years ago | 0

| accepted

Answered
How to fit my data with a custom equation meant to come out as a parabola?
The ‘constant’ (parameter vector) is giving back three values because you are giving it three values to begin with: [min(avera...

4 years ago | 0

Answered
Get Lapalce transform from filter specifications
Not that I am aware of, however it would be relatively straightforward to create it — Rp = 1; Rs = 50; [b,a] = ellip(5, Rp,...

4 years ago | 0

| accepted

Answered
How to properly set ticks, numbers and the their decimal places on colorbar?
Try something like this — [X,Y,Z] = peaks(50); figure surf(X, Y, Z) grid on colormap(turbo) hcb = colorbar; % get(hcb)...

4 years ago | 0

| accepted

Load more