@findall in an arrayfun?
The cellfun function is likely a better option. Experiment with something like this: Out = cellfun(@(x)findall(0,'Tag','img...

11 giorni ago | 0

| accepted

How to create a function as sum of some sine functions?
A loop is not necessary. If you have R2016b or later, try this (using your own variable vectors): t = linspace(0, 2, 750); ...

11 giorni ago | 1

| accepted

Error in Ode 45
The problem here: [T,Y ]=ode45(@(t,y) vdp1(C,y,A),t_span,y_0); is that one of the input arguments to ‘vdp1’ needs to be ‘t’. ...

12 giorni ago | 0

| accepted

I need help with files of signals of ecm
See: How can i visualize ecg contain 12 leads in 12 different figures It has everything, including the ‘.mat’ files and my ...

12 giorni ago | 1

| accepted

3D surface plot
It depends what your data are. If you are currently using scatter3 or plot3, and your data are reasonably ordered, instead us...

12 giorni ago | 1

| accepted

Sensitivity and specificity graph
See the Wikipedia article on Sensitivity and specificity. It would not be difficult to write MATLAB code to do what you want. ...

13 giorni ago | 0

how to solve the error: Undefined function 'ecg' for input arguments of type 'double'. in the next code
Apparently, ‘ecg’ does not exist in your workspace. I see no specific call to load (or any similar function) that would import ...

13 giorni ago | 0

How can I smooth out this data?
I have no idea what result you want. One option would be the smoothdata function.

13 giorni ago | 0

extract decimal number from a file name
Try this: filnam = {'2C2C', '2.5C3.5C'}; nrs = cellfun(@(x)sscanf(x, '%fC%fC'), filnam, 'Unif',0) Result = cell2mat(nrs).' ...

13 giorni ago | 0

| accepted

Efficient pass filters for EEG signals
The lowpass function (and those like it) have 2 outputs, the second being a digital filter object. Save the digital filter obje...

14 giorni ago | 1

| accepted

3d plot from scalar values- how to
Try this: wn=500; t = linspace(0, 0.02, 100); zeta = 0.5; zetav = 0.5:0.01:2; for k = 1:numel(zetav) sys = tf([2*zeta...

14 giorni ago | 0

Definite intergral with one variable trying to solve for constant
There is no closed-form, analytic expression fot the integral. In order to solve for the value of ‘P’, it will be necessary to ...

14 giorni ago | 0

| accepted

How to plot FFT in MATLAB by executing Vibration data recorded in Excel?
Use the fft function. The documentation will tell you how best to implement it for your signal. Note that the sampling inter...

14 giorni ago | 1

| accepted

im trying to chop my signal so it only plots 1 second but any second I have choosen as the length of the signal is 10 seconds
First, please do not name the variable ‘sin’ since that makes the sin() function useless. This is called ‘overshadowing’ and is...

14 giorni ago | 0

How can I calculate Kurtosis of Sound data?
Not certain what you want. Try this: startidx = [2239 19576 ...

15 giorni ago | 0

| accepted

Undefined function 'upfirdn' for input arguments of type 'double'
‘Is there anyway to verify that I have the signal processing toolbox?’ Run this in a script or the Command Window: ver('signa...

15 giorni ago | 0

symbolic function to numeric value
First, ‘f1’ has to appear somewhere before it is used. With that correction, try this: syms j1(t) f1 Dj1=diff(j1); ode =...

15 giorni ago | 0

Problem to use spectrogram on audio file
You need to actually call the spectrgram or pspectrum functions! I do not see that you have called either one in your code. ...

15 giorni ago | 0

Issue with creating a plot from two for loops
Neither of the loops are necessary. Use element-wise operations (here, exponentiation (.^ instead of ^) and division (./ instea...

15 giorni ago | 1

| accepted

Mean and Median Frequency
If you have R2015a or later, use the medfreq and meanfreq functions.

15 giorni ago | 0

legend with multiple axes using yyaxis
Try this: A = rand(1,10); B = rand(1,15); C = rand(1,20); D = rand(1,30); figure hold on yyaxis left ha = plot(A); y...

15 giorni ago | 0

| accepted

How to put subscript/superscript in fprintf?
There is a very limited ability to do that. The ASCII codes for superscripts 1, 2, and 3 are 185, 178 and 179. You can inser...

16 giorni ago | 2

| accepted

Mirror pattern of the leading diagonal about the middle element of the matrix
This works for odd ‘n’: dv = @(n) abs(diag(unique(fix(-n/2:n/2)))); % Create Diagonal Matrix n = 5; m5...

16 giorni ago | 0

| accepted

Solving system of linear equations, where all answers have to be greater than 0?
See if the lsqnonneg function will do what you want.

16 giorni ago | 0

| accepted

MeshDensity: How to exactly set the number of evaluation points of fplot?
‘So, is it possible to set an exact fixed number of evaluation points?’ Likely not with fplot. Since fplot plots single-vari...

16 giorni ago | 0

Stopband's edges in bandpass IIR filter
This may have more to do with the way fvtool analyses filter Bode plots than the design of the filter itself. (The documentatio...

16 giorni ago | 0

Change origin of a mesh
Try this: rows=257; columns=251; x=0:40:columns.*3/4; xmin=x-1; theta=(0:5:360)*pi/180; [th,X]=meshgrid(theta,xmin); th...

17 giorni ago | 0

| accepted

Error using "plot" : Data must be numeric, datetime, duration or an array convertible to double??
Apparently, the error is that subplot attempts to plot a transfer function step response without evaluating it. Try this inst...

17 giorni ago | 1

| accepted