Beantwortet
how to calculate the power of 2 in a symbolic expression?
Try something like this — syms s1 s2 s3 v = 3*sqrt(5)*s1 + 27*sqrt(34)*s2 + 15*sqrt(629)*s3/17 + 3 v2 = 2^v v2 = vpa(v2, 6...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Issue with sgtitle and subplots. and question about applying a gradient hue to a lineplot
It may be cut off because of the limits on the figure 'Position' or 'OuterPosition' property. See if something like: Fig = ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to apply a relational operator on a cell in MATLAB?
Use the cellfun and nnz functions — B = num2cell(rand(41)); A = nnz(cellfun(@(x)x<0.0038, B)) .

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
If I try to use `sprintf` to format a string as numeric, why does a different number get passed?
Using: C='10'; ‘C’ is a character array, not actually a number. The conversion to double results in the ASCII codes for the ...

etwa 4 Jahre vor | 0

Beantwortet
Rotating X & Y Data
See if the rotate function will work.

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Adding parameter to file name string when saving a figure using savefig or figsave
I am not certain what you want. Perhaps — CHANNEL=1; dt = datestr(now,'yymmdd_HHMMSS'); filename = sprintf("C15_rhs_CalAD...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Formatting of result values.
That is not a format MATLAB will do automatically. I wrote a utility function for my own use for such requirements — x=0.00...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Plot - representation of frequency to time dependece
I would use the pspectrum function with the 'spectrogram' option. (The spectrogram function is also an option,. however the uni...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to smooth and normalize noisy data
I have no idea what result you want. One option is the filloutliers function (or similar functions) and another is the Signal...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to Solve recurrence equation
Try something like this — h(1) = rand; % Initial Condition h(2) = rand; ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Convert matrix into CSV, with each matrix element as a separate line including indices of matrix element
Try something like this — M = [0.5 0.1 0.6 0.9 0.8 0.3]; [r,c] = ndgrid(1:size(M,1), 1:size(M,2)); rv = reshape(r.',[]...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to find second intersection point?
It is easiest to do this symbolically — syms x f1 = 1/x; f2 = sqrt(5./2 - (x^2)); Intx = solve(f1 == f2) Intxd = double(I...

etwa 4 Jahre vor | 0

Beantwortet
Error using convert2quaterly: The value of 'TT1' is invalid.
The table argument has to be a timetable, so it must be converted after creating an appropriate datetime array for ‘date’. T ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to plot and filter some values from a csv file?
Use the rmoutliers function to remove the outliers. The easiest way to implement a polynomial fit to data like these is with ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to add Data Labels to Graph
I can’t run the code because of missing data. Instead of using num2str, use the compose function: text(x,y,compose('%.2f',c...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to plot two different scripts on one graph
Use the hold funciton — t = linspace(0, 100, 1001)*0.1; s1 = sin(2*pi*t); s2 = s1*1.5; figure plot(t, s1, 'DisplayName',...

etwa 4 Jahre vor | 0

Beantwortet
Why it comes up with the imaginary number?
The first raises 0.6 to the 0.1 power, then negates it. The second takes -0.6 to the 0.1 power, and taking a non-integer powe...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Finding corresponding values in data set
I would just do the interpolation using interp1 since it will interpolate to 0 or the closest value to it. Try this — M = r...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
how to define a frequenty domain to do an FFT over?
It would help to have an example. The fft function requires that the original data be sampled at regular intervals. The easi...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How can I optimize the FFT of very large arrays
One option may be to be certain that the original signal so that its length is zero-padded to a power of 2: Fs = 256; t = lin...

etwa 4 Jahre vor | 0

Beantwortet
How to find second order transfer function of tfestimate result
The tfestimate function may not be the funciton you want. Instead, use invfreqs (continuous) or invfreqz (sampled) to estimate ...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
How can we threshold a signal in both positive and negative sides?
I am not certain what you want as the result. The for loop and if block are not necessary. You can do this with logical inde...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do you remove non-integer values from a colorbar?
This required some coding gymnastics, however it may be what you want — cm = [1 0 0; 1 1 1; 0 0 1]; % Basi...

etwa 4 Jahre vor | 1

Beantwortet
lsqcurvefit with custom equation
There is a problem with ‘f’ since it is not obvioul what parameters are to be estimated. The function should be: f(parameter_...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do you remove tick marks (not labels) from a colorbar?
Try this — cm = [1 0 0; 1 1 1; 0 0 1]; % Basic Colormap cmi = interp1([-2; 0; 5], cm, (-2:5)) %...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Double conversion to use prctile function
I am not certain what ‘Model’ is, however if it resembles this array, indexing into it as a cell array is straightforward — Mo...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Convert x y coordinates and z data to Matrix
It would help to have the actual vectors. It may be possible to use the reshape function to create matrices from the vectors,...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do I make a red and blue colormap?
I am not exactly certain what you want, however the basic colormap is easy to create — cm = [1 0 0; 1 1 1; 0 0 1]; ...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Decomposing the time series of wind turbulance using Fourier series, and computing the spectra.
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1125355/data-MOOCTurbulenceDataSerie...

etwa 4 Jahre vor | 2

Beantwortet
extract a section of a vector and plot
Perhaps something like this — t = linspace(0, 10, 250); s = sin(2*pi*t); figure plot(t,s) grid [pks,locs] = findpeaks...

etwa 4 Jahre vor | 0

| akzeptiert

Mehr laden