Answered
how to find max and min value within a certain range of a plot
Use the bounds function on the specific plot argument.

3 years ago | 0

| accepted

Answered
How to plot data of only specified rows of matrix
It is straightforward to create ‘y’ to test the code — y = randn(8,1000); % Create 'y' save(...

3 years ago | 0

Answered
Error while creating a table from cell
Perhaps this — LD = load('Mode_shape.mat') Mode_shape = (LD.Mode_shape); freq = Mode_shape{1}.freq; mode = cellfun(@(x)x....

3 years ago | 0

| accepted

Answered
Element Wise Multiplication Not Giving Expected Result
I get the ‘Expected result’ when defining ‘n’ and ‘m’ both as 1. Perhaps the indices are the problem? n = 1; m = 1; % ...

3 years ago | 1

| accepted

Answered
plot a tangent line of zero point
That should work, and it appears to be appropriate. Try something like this — clearvars clc; close all %% READ DATA FR...

3 years ago | 0

| accepted

Answered
How to output additional variables from objective function using ga optimization?
‘Does anyone have an idea on how to do that?’ After the optimisation terminates, run the objective function with the optimise...

3 years ago | 0

Answered
Getting error in using code num2cell
Run this from a script or your Command Window — which num2cell -all It should return something similar to this. If it retu...

3 years ago | 1

| accepted

Answered
How to identify the repeated elements in an array and delete those rows?
Use unique — A = [1 100 2 200 3 200 4 200 5 500]; [Au,ix] = unique(A(:,2),'st...

3 years ago | 0

Answered
How do errorbars change in logplot?
The error bars scale with appropriate axis scales, and negative error bars or error bars equal; to zero do not plot at all on a ...

3 years ago | 0

Answered
fplot and laplace transform
I am not certain what the problem is. The inversion appears to be correct, and the result is what I would expect it to be. Sin...

3 years ago | 0

| accepted

Answered
Concatenate 2/more graphs into 1 graph
I do not have your files, however this is straightforward — t1 = linspace(0, 10, 250); signal1 = randn(size(t1)); t2 = linsp...

3 years ago | 0

| accepted

Answered
Plot with the same Y-axis on both sides
Duplicating the y-axis on the right side is not an option, however writing the tick labels on the right axis definitely is. T...

3 years ago | 0

| accepted

Answered
How to find 90% of each peak in a huge data range signal
It depends on what you define as a ‘peak’ and its relation to its surrounding values. Experiment with this and your data — ...

3 years ago | 0

Answered
Interpolated data is drifting downward
The Signal Processing Toolbox resample function is likely the best option here, at least in part because it uses an anti-aliasin...

3 years ago | 0

Answered
How to set risetime thresholds in stepinfo function
Try something like this — sys = tf([1 5 5],[1 1.65 5 6.5 2]); step(sys) si = stepinfo(sys, 'RiseTimeThreshold',[0 1]) T...

3 years ago | 0

| accepted

Answered
Having trouble finding a row in a table
We do not have ‘a.mat’ to work with. That aside, it may contain a struct (structure array), and if so, the struct2table funct...

3 years ago | 1

| accepted

Answered
How to create a table with a timedate
Try this — dates = datetime('2022-06-01'):days(1):datetime('2022-09-26'); times = {'21h', '24h', '3h', '6h', '9h', '12h', '15...

3 years ago | 0

| accepted

Answered
Remove quotation sign from values in cell
Without knowing more, see if the str2double funciton will do what you want.

3 years ago | 1

| accepted

Answered
I am looking for guidance in how to create multiple subplots based on a third variable
Just saw this now. Try this — Uz = unzip('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1333040/2022WQD%20...

3 years ago | 0

| accepted

Answered
hi, urgent help
I generaly prefer to use the ga (genetic algorithm) function to MultiStart or GlobalSearch because I have a bit more control ove...

3 years ago | 0

Answered
Getting an error message saying I haven't defined optimization variables even though I have
It always helps to check for typographical errors: theraOpt.Objective = (1/size(Xy,1))*(sum(((theta1.*XTrain_Data(:,1)+theta2....

3 years ago | 1

Answered
How to customise Polar Plots
Try something like this — th = linspace(0, 2*pi, 360); r = exp(-0.1*th).*sin(2*th).^2; figure polarplot(th,r) title('Ori...

3 years ago | 1

| accepted

Answered
Make cell arrays the same size for ttest
An acceptable alternative for unpaired data, (and the two vectors having unequal lengths would suggest this), that does not requ...

3 years ago | 0

| accepted

Answered
Remove NaN values from a table
I would not remove the NaN values. The fillmissing function using the 'previous' method might be the best option.

3 years ago | 0

Answered
Generate an exponential signal as seen in figure below.
Include ‘s’ in the complex exponent argument, and multiply the complex vector by a separate real decaying exponential function o...

3 years ago | 0

| accepted

Answered
How to compute the double integral over dx and dy?
You are integrating matrices, so use trapz (or cumtrapz, depending on the result you want) once in each dimension — % clear al...

3 years ago | 0

| accepted

Answered
Errors In User Defined Function for Solving ODE System
You need to tell ode45 what arguments it needs to use: [tSol, XSol] = ode45(@(t,x)ODEsystem(t,x,u,v),t,IC); It only needs to ...

3 years ago | 0

| accepted

Answered
Time normalize kinematic data for gait analyses
Note that ‘i_peaks’ is a (33x1) column vector, That means that: for j=1:size(i_peaks,2) -1 new_angle(:,ci) =interp1(a_hip,...

3 years ago | 0

| accepted

Answered
Search for a value in a table and get the corresponding value from the 2nd column
If you are searching for an exact match, try something like this — Col1 = linspace(0, 10, 21).'; Col2 = randn(numel(Col1),1);...

3 years ago | 0

| accepted

Answered
How can I draw 117 normal 292 abnormal heart sounds?
Drawing them depends on the result you want. Heart sounds are best displayed as time-frequency plots, so I would plot them usin...

3 years ago | 0

| accepted

Load more