Answered
Connect points to the straight line
Try this (with your own data): x = 1:10; % Create Data y = 2.5*rand(size(x)); ...

6 years ago | 0

Answered
If statement with == not working with vector
To compare strings, use strcmp (or the case-insensitive version, strcmpi, linked to in that page). Depending on what you want...

6 years ago | 0

Answered
Random variable with log-normal distribution
Try this: v = lognrnd(0, db2mag(4), [1,7]) % Convert 4dB’ To Magnitude, Then Calculate vdB = db(v2) ...

6 years ago | 0

Answered
RR interval extraction from ECG
If you only want the locations of the R-waves in a normal EKG, use findpeaks or islocalmax.

6 years ago | 0

| accepted

Answered
Plotting a bode graph extracted from LTSPICE simulator
This works for me: filename = 'DatosBodeFinal.txt'; fidi = fopen(filename, 'rt'); Dc = textscan(fidi, '%f(%fdB,%f°)', 'Colle...

6 years ago | 1

| accepted

Answered
Double integral of discrete data
Use the trapz (or cumtrapz) function to integrate your data, one time on each dimension to do a double integration.

6 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (1).
The input call works correctly for me. I suspect that you have assigned ‘input’ as a variable earlier in your code. In doing...

6 years ago | 0

| accepted

Answered
is a possible way to have the name of x axis in spanish?
See the datetime documentation for: Date and Time from Text in Foreign Language and 'Locale' under Name-Value Pair Arguments. ...

6 years ago | 0

| accepted

Answered
How to plot (1) amplitude vs time and (2) amplitude vs frequency plots from .wav file
The amplitude - Frequency plot would go something like this: [y,Fs]=audioread('HornC5.wav'); %Reads .wav file into 2 matrices ...

6 years ago | 1

| accepted

Answered
Data with different length of rows
Try this: fidi = fopen('file.txt','rt'); k = 1; while ~feof(fidi) row = fgetl(fidi); avg(k,:) = mean(str2num(row))...

6 years ago | 0

| accepted

Answered
Wrong graph is coming with this code
Using fsurf is not appropriate here. Try this instead: figure(14) hs = surf(S); grid on xlabel '\bfx';ylabel '\bfy';zlab...

6 years ago | 0

| accepted

Answered
Bar Graph;Add value at the top of a bar chart created with a matrix
Some of the data are missing, so I cannot run your code. Adapt this to get the values displayed on the top of eacch of the re...

6 years ago | 0

| accepted

Answered
Output of histfit without the plot
Try this: r = normrnd(10,1,100,1); % Create Data h = histfit(r,6); set(gcf,'Visible','off') ...

6 years ago | 1

| accepted

Answered
Transfer function. Find poles in acending order
Try this: syms s den = (s^6 + 143*s^5 + 6819*s^4 + 120387*s^3 + 696290*s^2 + 3.391e06*s + 476000); poles = vpasolve(den); T...

6 years ago | 1

| accepted

Answered
How to create surface from stacked 2D plots?
It would help to have your data. Lacking them, adapt this approach to your data. This should get you started: t = linspace...

6 years ago | 1

| accepted

Answered
Add an element if string meets conditions
This seems to be homework, however it’s nevertheless an interesting problem. Try this: A = ["tennis", "pizza", "switch", "p...

6 years ago | 0

Answered
if column 1 value is within a range, return values in column 3
If ‘M’ is your matrix, this should work: Col3 = M((M(:,1)>=25 & M(:,1)<=35), 3); .

6 years ago | 0

Answered
How to find the indexes of an specific group of values in an array.
This looks strange but it works: data = [1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1]; Idx = strfi...

6 years ago | 0

| accepted

Answered
Issues with graph plotting on to of itself
I cannot run your code, and I have no certain idea what the problem is. Experiment with creating separate figures, and change...

6 years ago | 0

| accepted

Answered
How to create a vector from a "for iteration"
Subscript them appropriately: for iter = 1:100 F2(k,iter) = (pk(k)-(qk(k)*1i))/conj(Vk); Vk(k,iter) = (F2-S1-S2)/F1 ...

6 years ago | 0

Answered
Need to draw line graph through the peaks.
See if the envelope function will do what you want.

6 years ago | 0

Answered
Bar plot set ylimit for the axis
Try this instead: ylim([0.11,0.125]) That should work.

6 years ago | 0

| accepted

Answered
integral does not give results
It works for me (in R2020a): x=sym('x') Int = int(x*exp(-x/3)+tan(x),x,0,5) producing: Int = NaN To understand the res...

6 years ago | 0

Answered
Applying low pass filter in frequency domain
Some of it appears to be correct. To see the result, add this to your code: figure plot(f,abs(X), f,abs(Y)) grid legend...

6 years ago | 0

| accepted

Answered
Removing time from datetime
Try this: dt = '31-Dec-2019 08:00:00'; Out = datetime(dt, 'InputFormat','dd-MMM-yyyy HH:mm:ss', 'Format','dd-MMM-yyyy') prod...

6 years ago | 4

Answered
Add time to datetime format
Try this: de = ['08/21/2020 (Aug)'; '09/21/2020 (Sep)'] DT = datenum(de, 'mm/dd/yyyy') DS = datestr([DT + zeros(size(DT,1),1...

6 years ago | 1

| accepted

Answered
Change imported date into datetime format
Try this: de = '08/21/2020 (Aug)'; DT = datetime(de, 'InputFormat','MM/dd/yyyy (MMM)') producing (using the default Format):...

6 years ago | 1

| accepted

Answered
Amplifier Model with Varying Input Amplitude
A relatively straightforward way to vary the amplitudes: Amplitudes = logspace(-2, 2, 25); % Amplitude Vector: 1...

6 years ago | 0

| accepted

Answered
Solve numerical equation with Y at both sides
A numeric approach: Y_0 = 3; % Define Constants B = 5; D = 7; alpha ...

6 years ago | 1

Answered
Detect change points in signal and ignore the values for a time duration
I would change the code slightly to use a while loop, since it is not possible to change for loop indices within the loop (it si...

6 years ago | 0

| accepted

Load more