Answered
How to set up the Matrix variables to use Options = optimoptions('lsqcurvefit','algorithm','levenberg-marquardt')
I am not certain how ‘M1T’ and ‘M2T’ enter into this, however witth the ‘K’ values as the independent variables, and the ‘M’ val...

2 years ago | 0

| accepted

Answered
how to create vector 1 1 1 1 1 1 2 2 2 2 2 2?
An alternative approach — v = reshape(ones(6,1)*[1 2],1,[]) .

2 years ago | 0

Answered
Integral2 MATLAB Function Error: Q = integral2Calc(fun,xmin,xmax,yminfun,ymaxfun,opstruct);
Note that because ‘zprime’ only enters into your calculations in ‘R’ and that is defined as: R = sqrt(a^2 + (z_prime - z_prim...

2 years ago | 0

| accepted

Answered
Reading a text file using readtable, Matlab stubbornly refuses to accept dates in anything but US-format
You need to pass the options structure to readtable. Perhaps something like this — type('Dave_2024_07_26.txt') opts = d...

2 years ago | 0

| accepted

Answered
contour plot problem Z must be at least a 2x2 matrix
Anotther option, using the scatteredInterpolant function — x=[80;100;90;90;90] y=[4;4;2;6;4] [X,Y] = meshgrid(x,y); % Polly...

2 years ago | 0

| accepted

Answered
islocalmax('flat selection') selecting 0 value points
In the lower plot image, if you are referring to the collection of orange asterisks before the start of the variable section (fo...

2 years ago | 0

Answered
Representation of Gabriel's Horn
If you want it to look more like the image you posted in your question, one option is to use the daspect function.. It allows yo...

2 years ago | 0

| accepted

Answered
How to make bar plot with group mean and add scatter plot on top to demonstrate samples within group?
Apparently the group means are the heights of the bars. Try this — MC1 = randn(50,2)*10 + [80 81]; ...

2 years ago | 1

| accepted

Answered
how to do a contour plot using function handle?
Provide arguments to ‘M’ and it works — T=linspace(0,2*pi,100); d = linspace(0,2*pi,100) ; [X,Y] = meshgrid(T,d);...

2 years ago | 1

| accepted

Answered
Eliminate the long number appearing in symbolic calculations
You can conttrol the number of digits displayed by including a second argument (here 7) to your vpa call — syms J1 term = ...

2 years ago | 1

| accepted

Answered
function find() sometimes doesn't work properly
With Floating-Point Numbers you need to use a tolerance, so with find, usually one of the approaches in tthe second loop will wo...

2 years ago | 1

| accepted

Answered
how can solve this problem : Conversion to cell from double is not possible.
Perhaps — X = fillmissing(X(:), 'nearest'); .

2 years ago | 0

Answered
Interpolate y and y using a 3D vector with similar length
To do the relatively simple first interpolation, use the interp2 function. Tto draw the surface plot, the best option is the ...

2 years ago | 0

| accepted

Answered
Genetic Algorithm with a graph
I am not certaiin what you want, however creating an options structure using optimoptions and including the name-value pair 'Plo...

2 years ago | 0

Answered
I enabled fft function in oscillioscope and it saved the data as FFT amplitude (dBV) and frequency domain how ever I want my time domain and ampltude signals original data.
You cannot reliably invert a Fourier transforom unless you also have the phase information. Lacking the phase information, you ...

2 years ago | 2

| accepted

Answered
I want to plot RMSE from mat file but it gives error
One option is to use the cellfun function (keeping ‘two’ as a cell array). The other option is to use the cell2mat function to ...

2 years ago | 0

| accepted

Answered
Rotating a line plot to obtain a 360-degree color map
Itt would help to have the data. It also appears that the line is not the same everywhere (it may be part of a matrix), altho...

2 years ago | 0

Answered
Match columns and fill datasets
Using the accumarray function tthis can be done in one line — File_1 = [1 1 1 1 1 ...

2 years ago | 0

| accepted

Answered
Difference in computational time
It appears to work correctly. What else needs to be done? (W.R.T. ‘Miscellaneous’, you can use the daspect funciton or diffe...

2 years ago | 0

| accepted

Answered
How to use contourf to plot a mesh not generated in matlab, i.e. imported mesh coordinates from abaqus. The issue is that coordinates are not sequential.
It would help tto have your data. Since there are (x,y,z) coordinates (there can be duplicates), I would use the scatteredInt...

2 years ago | 1

Answered
Coloring area between two graphs in specific interval
It would help to have the code, or at least a file thtat I can get the information from. Lacking that, a bit of creativity ...

2 years ago | 0

| accepted

Answered
Problem with legend: colors don't match value of variable
I can’t run this since ‘fn’ is missing. n = 101; x = linspace(-100, 100, n); y = linspace(-100, 100, n); [X, Y] = meshgrid(...

2 years ago | 0

| accepted

Answered
Hello, I would like to know how to draw a shaded region like this?
Perhaps something like this — x = linspace(0, 5, 25).'; y = 5*exp(-0.5*x) + randn(size(x)); fcn = @(b,x) b(1).*exp(b(2).*x...

2 years ago | 0

| accepted

Answered
I want to access multiple parameters that I have defined in a function
Since the ODE integration funcitons only use the first output of the ODE functiton, one option is to add them as outputs, then w...

2 years ago | 0

| accepted

Answered
Locate peaks of an fft without using 'findpeaks'
In R2023a you should have the islocalmax function, that does essentially the same as findpeaks, although with slightly different...

2 years ago | 0

Answered
Why such a fuss with ndgrid and meshgrid issues?
I’m not certain what the problem is. I generally prefer scatteredInterpolant to griddata. The choce of meshgrid or ndgrid ...

2 years ago | 1

Answered
lsqcurvefit not working properly
It is difficult for me to understand what you are doing in this version of your code. You have a curve that is in part an exp...

2 years ago | 1

| accepted

Answered
Overwriting the maximum function evaluation
The options structure to lsqcurvefit must be the argument to it, since (except for name-value pair arguments), arguments to MAT...

2 years ago | 0

| accepted

Answered
How to use fft to analyse the refelction specturm?
It would help to have ‘xx.xlsx’, however lacking it, I will synthesize something like it — Fs = 0.1; L = 1000; t = linspace(...

2 years ago | 1

| accepted

Answered
fdesign.lowpass; error messages of one of examples
@Jongsoo Kim — Your posted code works in R2024a, as demonsttrated here. You did not post the version you are using, and there c...

2 years ago | 0

Load more