Answered
How do I change the color for a plot in a for loop?
You seem to be plotting point, not lines, in the loop, and to do that it is necessary to specify a marker. Perhaps this — p...

3 years ago | 1

| accepted

Answered
Detecting and removing data (faulty data) from stress-strain curve after rupture
Without the data to refer to, see if the ischange function (introduced in R2017b) will do what you want — strain = linspace(0,...

3 years ago | 0

| accepted

Answered
How to plot y-axis limits and y-limitation line
I am not certain what you want. You set the xlim values and drew the yline annotations, so you obviously want those as they are...

3 years ago | 1

Answered
Creating Frequency Modulated WAV File
I’m not certain what you want the result to be. In situations like this, I plot it (using various methods) to see what the re...

3 years ago | 0

Answered
calculate Wavelength of vortices from noisy velocity fluctuations data.
Try something like this — T1 = readtable('data.xlsx', 'VariableNamingRule','preserve') VN = T1.Properties.VariableNames; Z...

3 years ago | 0

| accepted

Answered
where I am making a mistake while using fsolve to evaluate two unknown with two equation
Only one minor problem. The fsolve function needs and returns a vector of paramters. Changing that call to: x=fsolve(@(b)f...

3 years ago | 0

| accepted

Answered
Why is nothing showing up on my plots?
It now fills the matrices corrrectly and plots something, however I cannot determine what you want it to plot — % Regarding th...

3 years ago | 0

Answered
integral() doesn't accept scalar function as input
It works correctly with the 'ArrayValued' name-value pair — Psi = @(x) [1 x] fun = @(x) abs(Psi(x)*Psi(x)') integral(fun,0,1...

3 years ago | 1

| accepted

Answered
How to plot a graph showing the upper and lower boundaries of data?
With random points, constructing the limits is a bit more of a challenge. I use the boundary function here, although there ar...

3 years ago | 0

Answered
How to determine phase shift between two waveforms?
I am not certain what you want. The easiest way too analyse the phase differences is to do a Fourier transform of the signals...

3 years ago | 1

| accepted

Answered
finding a trend line where x axis semilog and y axis linear and trend line follow the eqn y=a*exp(b*x)
AA straight horizonta line would be the best model, since ‘Depth’ does not change at all over time — T1 = readtable('data_mat_...

3 years ago | 0

Answered
Adding vertical trendline for mutiple y variables in one scatterplot
One option is to simply reshape all of the different ‘x’ and ‘y’ data vectors (combined into matrices here for convenience) into...

3 years ago | 0

| accepted

Answered
inverse log of a number
I have no idea what ‘logtcorr’ is. However, exp is the inverse of log, with 10^arg being the inversee of log10 and others fol...

3 years ago | 0

Answered
plotting horizontal scatter plots
Reverse the ‘x’ and ‘y’ coordinates in the scatter plot — x = 1:5; y = rand(size(x)); figure barh(rand(size(x))) hold on...

3 years ago | 0

| accepted

Answered
how can i use integral function with vector limits by using another for loop ?
All the vectors have to be the same size ()so I shortened ‘m’ here), then arrayfun works (and so would a loop, indexing each vec...

3 years ago | 1

Answered
stacked plots with contour- custom lsyout
It is likely easiest to use subplot because it allows more options for the axis sizing, while the others (tiledlayout and stacke...

3 years ago | 0

Answered
Parameter Estimation of a model
I would do something like this — Data = [(0:10).' rand(11, 3)]; % Data = [Time Current Voltag...

3 years ago | 0

| accepted

Answered
I have an indices error in my code
The problem is that in the ‘Update floater positions’ loop, both ‘ix’ and ‘iy’ are NaN at some point, and that throws the indexi...

3 years ago | 0

Answered
How to calculate every peak in plot
Peak locations, full-width-half-maximum, and areas — fabric_image = imread('Kain1.png'); % Replace 'fabric_image.jpg' with the...

3 years ago | 0

Answered
Need to count projections from a graph
It depends on what information you want. The red line appears to interpret the results of the image behind it, so it would like...

3 years ago | 0

| accepted

Answered
Calculate SNR from sampled real signal
The Signal Processing Toolbox snr function (introduced in R2013b) has a number of different ways to calculate it. If you only h...

3 years ago | 0

Answered
I want to calculate the moving rms of accelerometer data.
Try something like this — Fs = 5000; T = 100; t = linspace(0, T*Fs, T*Fs-1)/Fs; s = sin(2*pi*t*25); xrms = @(s, n) sqrt(...

3 years ago | 0

| accepted

Answered
lsqcurvefit Fitting kinetic model to estimate kinetic parameter.
That does not appear to me to be the same data. I get decent results except for and , leading me to believe that there is so...

3 years ago | 2

| accepted

Answered
Accessing local variables in a function.
One option would be to return it as an output. I am not certain which one you want to return, however assuming that it is ‘No...

3 years ago | 1

| accepted

Answered
How to get rid of spikes from the attached graph
It would help to know what the data represent. Try this — LD = load('batterycellhighvoltage.mat') M = LD.BMC_PACK1_CellHig...

3 years ago | 0

Answered
Help interpreting Fast Fourier Transform.
My analysis — M1 = readmatrix('fftpoop') t = M1(:,1); s = M1(:,2); L = size(M1,1) Ts = mean(diff(t)); Fs = 1/Ts; Fn = ...

3 years ago | 1

| accepted

Answered
How can I plot transfer function?
You can use the transfer function that you posted, if you define ‘s’ first, using the tf function. If you want the magnitude ...

3 years ago | 0

| accepted

Answered
dlmread error when performing fourier transform (FFT)
You could use the deprecated csvread function, however readmatrix is preferred, since the data are numeric and the variable name...

3 years ago | 1

| accepted

Answered
Creating 3d surf from 2d map
It would help to have the data. That aside, the plot would go something like this (I got tired of all that typing, so there a...

3 years ago | 1

| accepted

Answered
Finding max peaks and full width/half max for both curves in the given plot
It would help to have the data. Calculating the statistics of the peaks depends on how the peaks are defined. This defines t...

3 years ago | 1

| accepted

Load more