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

Answered
lsqcurvefit (with system of ODEs) does not iterate, it only displays the initial guess value
It is generally good practice to estimate the initial conditions as well, so I added that (not part of my original code, updated...

3 years ago | 0

| accepted

Answered
How to understand the design of lowpass butter filter?
It is best not to use the transfer function implementation of discrete (digital) filters, because those are frequently unstable....

3 years ago | 0

| accepted

Answered
Finding Highest Frequency Component from a Sound Recording
The audioread function has two outputs, the first being an (Nx2) matrix (the information) and the second being the sampling freq...

3 years ago | 0

Answered
Detect the boundary of signal
This is easier if you have the envelope function (introduced in R2015b) since it has options that hilbert does not — readExce...

3 years ago | 0

Answered
Breaking the axis of plots
Perhaps this — x = [linspace(0, 10, 21); linspace(40, 42.5, 21)]; % Create Da...

3 years ago | 1

Answered
How to find the intersection of two curves with the input data being two vectors?
Another approach — lambda = linspace(0, 10); arg_px = sin(2*pi*lambda/5); arg_ikTx = 1.1 - (lambda/8); L = numel(lambda);...

3 years ago | 0

Answered
How to extract specific data from a txt file
Using my code from my earlier Comment, one approach would be— % type('Niskin-Logger-Sample.txt') opts = detectImportOptions('...

3 years ago | 0

Answered
textbox doesnt like strings
The string array properties are a bit different from cell arrays in that string arrays can be grouped using square brackets [] w...

3 years ago | 0

| accepted

Answered
Normalized Wind Rose Plot help
Perhaps something like this — LD = load('winddata.mat'); N = LD.N; N.WD_Rad = deg2rad(N.WD_Deg) ...

3 years ago | 1

| accepted

Answered
Tiledlayout with different spacing in horizonal and vertical direction
The tiledlayout function does not offer any spacing options other than those provided, and they cannot be changed afterwards (at...

3 years ago | 0

| accepted

Answered
How to fix such type of problem?
The firstr two appear to be exactly the same, so they are over-plotting. % the variables are present at attached file LD1 ...

3 years ago | 1

| accepted

Answered
shaded area between 2 curves isnt showing up
There were two problems — First, the vectors are column vectors, not row vectors, so fliplr will not have any noticable effect...

3 years ago | 1

| accepted

Answered
It says Error in matlab and also in cumtrapz
In the ‘calculateShearForceAndBendingMoment’ call, ‘shearForce’ is a scalar, so the following cumtrapz call throws the error, si...

3 years ago | 0

Answered
I would like know the code for FIR filter respose
I have no idea what an ‘asteroid’ filter is, at least iin the context of signal processing. There are several ways to design ...

3 years ago | 0

| accepted

Answered
Removing noise peaks on 3D surface reconstruction
See if the filloutliers function (introduced in R2017b) will do what you want. The documentation indicates that it will work o...

3 years ago | 0

| accepted

Answered
Filter Only Data Meeting Certain Criteria out of Excel Spreadsheet
Use ‘logical indexing’ to return the desired values — Lat = 90*rand(10,1); Angle = pi*rand(size(Lat)); Data = table(Lat,An...

3 years ago | 0

Answered
fitting "K" paremeter in a adsorption breakthrough curve data
Estimating ‘K’ is likely straightforward, and requires creating an objective function similar to the ‘kinetics’ function here, d...

3 years ago | 0

Answered
Problem to read the number of characters in a line
Try something like this — Unz = unzip('SGC2023aiexsm_BLMC_10.zip') type(Unz{1}) ...

3 years ago | 0

| accepted

Answered
How color fill grid squares in plot?
The patch function would be appropriate here. Perhaps something like this — x = 0:5:20; y = 0:7; figure patch([5 10 10...

3 years ago | 0

Answered
How to plot discrete array with colors
One approach — status = randi([0 1], 1, 9) % 'Waiting' = 0, 'Busy' = 1 status = flip(status...

3 years ago | 0

Answered
Adding error bars to a grouped bar plot
An example using properties available in prior and recent MATLAB releases is provided in Putting error bars on bar plot? One ...

3 years ago | 0

Answered
Aplly average to a set of data
This seems to be a slightly different version of your earlier Question: Plot data from txt file. This does the same thing,, e...

3 years ago | 0

| accepted

Answered
Alternating between if conditions in a loop.
I am not dertain what you want to do. I would use either findpeaks (with normal and negated arguments to get the peaks and trou...

3 years ago | 0

Load more