Answered
How can I integrate this function?
The function as presented appears to be a bit ambiguous, so I’m not certain which (if either) of these is correct. That aside...

3 years ago | 0

| accepted

Answered
How to fit a plot to a set of data points in a log-log scale?
Perhaps something like this — yfcn = @(x,m,q) (1 + (1 - q) .* x .* m).^1./(1 - q); % Objective Function ...

3 years ago | 0

Answered
How to properly create for loop with if statement
It is necessary to use the index on ‘L’ on both sides of the equation. L = -180:20:180 for l = 1:length(L) if L(l) < 0 ...

3 years ago | 0

| accepted

Answered
How to get the surface map better?
Use the contourf function with the jet colormap (the turbo colormap was introduced in R2020b).

3 years ago | 0

| accepted

Answered
Array indices must be positive integers or logical values. I get this error for f(x). How can I fix it?
The current syntax is (outszxide of the Symbolic Math Toolbox) an array indexing operation. Create it as an anonymous functon...

3 years ago | 0

Answered
Why is the line over imagesc not where I expected it to be?
The image functions such as imagesc reverse the y-axis direction. Experiment with: set(gca, 'YDir','normal') to see if tha...

3 years ago | 0

Answered
How do I fit a curve to the peaks of the data?
The approach depends on the result you want from the curve. If you want parameters, then findpeaks or islocalmax will be nece...

3 years ago | 0

Answered
intersection from a plot and loop
clear all; close all W_takeoff = 10000; W_landing=6000; S = 20; AR = 5; cd0 = 0.02; k = 1/pi/AR; RC=0.51; clalpha = ...

3 years ago | 0

Answered
How can I add linspace in a For Loop
There is not enough information (such as a description of what you want to do). However one possibility is something like thi...

3 years ago | 0

| accepted

Answered
Plot a function of three variables on a surface plot
If all the data are vectors (that would appear to be true since ‘x’ is a vector), it would be necessary to use either the gridda...

3 years ago | 0

Answered
How can I animate springs in MATLAB?
One approach — L = 1600; % Vector Lengths t = linspace(0, 16*pi-(1/L), L); ...

3 years ago | 0

| accepted

Answered
differentiate between month in dataset.
Perhaps something like this — secondsperyear = 60*60*24*365; DT = datetime(2023,1,1,0,0,0) + seconds(0:secondsperyear-1).'; ...

3 years ago | 0

Answered
To obtain the cumulative signal power spectrum from the single-sided spectrum of a biomechanical signal to identify the frequency under which 99% of the signal power is
I cannot find a time vector or sampling frequency. I need at least one of those. The article is open-source, however not ill...

3 years ago | 1

| accepted

Answered
Using rlocus I am confused
You appear to be overthinking it. Try this — G = tf([1 1], conv([1 2 2], [1 2 5])); figure rlocusplot(G) grid % title...

3 years ago | 0

| accepted

Answered
nlarx is not working at all
Check to see if you have another function (or something else) with the same name. To do that, run this: which nlarx -all f...

3 years ago | 0

| accepted

Answered
Why am I getting the same colour of the legend for the last 2 plots?
I suspect that it is because ‘y2’ has more than one row. The solution is to return the handles of the plots, and select only ...

3 years ago | 0

| accepted

Answered
Choosing dimension for filter
I believe so. From the filtfilt documentation for x: ‘The function operates along the first array dimension of x unless x i...

3 years ago | 0

Answered
How to draw the delta signal in matlab
The function normally will not plot in MATLAB because it has infinite amplitude and infinitesimal width. So it is necessary ...

3 years ago | 0

Answered
Problem during the use of 'fzero'
I am not certain what you want to do. I suspect that you want to loop over varying values of ‘t’ however ‘t’ never appears as...

3 years ago | 1

| accepted

Answered
Extracting datetime and adding reference time
This was a bit more involved than I theught it would be — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uplo...

3 years ago | 0

Answered
3 subplots with the bottom one split in 2 vertically?
Perhaps this — clearvars x = -10:0.01:10; y = cos(x); figure(1) subplot(2,2,[1 2]) plot(x, y) subplot(2,2,3) plot(x,...

3 years ago | 0

| accepted

Answered
Why is my "plot" function not working?
Use the str2double function on the last four variables. EDIT — (26 Mar 2023 at 10:28) T = readtable('https://www.mathworks...

3 years ago | 0

| accepted

Answered
what test to use on z-scores
Since the zscore is simply a standardised method of expressing data, and if the mean values and standard deviation (std) values ...

3 years ago | 0

| accepted

Answered
Using the surf and meshgrid command
I am not certain what function you want to plot, since you did not create ‘z’ as a separate matrix. (I am creating it here in p...

3 years ago | 0

| accepted

Answered
How do I save a data in my excel to matlab folder, i e how do i create a path to matlab folder
I am not certain whether you want to read from the Excel file or write an Excel file from data you have created. Depending on...

3 years ago | 0

| accepted

Answered
Displacement from acceleration measurements
The slopes are due to a constant that is being integrated can be removed by subtracting the mean of the variable to be integrate...

3 years ago | 0

Answered
Change rlocus() axis units to Hz?
First, use rlocusplot since it allows options — sys = tf([2 5 1],[1 2 3]); hrlp = rlocusplot(sys); opts = getoptions(hrlp) ...

3 years ago | 1

| accepted

Answered
Problems with signal processing
For a time-frequency plot, I would use the pspectrum function with the 'spectrogram' option, at least for an initial approach, a...

3 years ago | 0

Answered
Plotting Level Curves after function
Use the contour function. You can use fcontour, however it will not be possible to export its results to plot with contour. ...

3 years ago | 0

Answered
How can I line up plot edges in subplots?
I was hoping that the 'Position' (actually 'InnerPosition') of the first and last subplot axes would automatically be set correc...

3 years ago | 0

| accepted

Load more