Answered
Azimuthally average line plot to 2D image
Hello again Check this if it works for you. I had to divide y by 1000 so that x and y are in similar ranges (is one in mm and...

5 years ago | 0

| accepted

Answered
optimizing vector variables with N vector
hello I suspect this is the intention (corrected code) : N=10; z = rand(1,2*N); % dummy data (length must be >= 2N r= mai...

5 years ago | 0

| accepted

Answered
Parsing data from complicated text files
hello this is my 2 cents code to import the required data. The function will give you the time values (char array) and the num...

5 years ago | 1

Answered
unable to perform assignment because the left and right side are unequal
hello the first error occurs because at line 2417 of your data file Pressure = : -171.05 gauss wich is clearly not the "go...

5 years ago | 1

Answered
How to fft time signal and get given number of fft points and frequency resoution?
hello again your fft resolution depends on the sampling freq (Fs) and your fft length (nfft) df = Fs / nfft see example code ...

5 years ago | 0

| accepted

Answered
How do i use textscan to extract some of the numbers with certain pattern (not all the numbers) from one sentence in text file?
hello esther that was not my easiest code of the day, but finally managed to get it done ! attached my input / output text fi...

5 years ago | 1

| accepted

Answered
Savitzky-Golay polynomial order returning NaN above 110
hello I suspect you are confusing the order and the window length of the filter You should try first with low order filters (...

5 years ago | 0

| accepted

Answered
PLEASE HELP ME!! :(
hello Felika don't panic !! the code does exactly what you wrote by hand. It just a matter to know how to make a loop work w...

5 years ago | 0

Answered
How to plot horizontal line with waveform like the green line in the photo
hi looks like this would be the RMS value of the signal; so you simply have to calculate that rms value and plot it with the s...

5 years ago | 0

Answered
Desired input signal generation based on input and measured output and expected output with data comparision
hello so this my suggestion / code for you i first didn't understood evrything, so first thing was to try time align the 3 d...

5 years ago | 0

| accepted

Answered
Extracting only real numbers from a vector containing both real and complex values
hello see code below : A = [ -0.4406 - 1.5696i , -0.4406 + 1.5696i, 1.8812 + 0.0000i]; tol = eps; ind = find(abs(imag(A))...

5 years ago | 3

Answered
How to count the number of iterations in a loop?
hello at the very beginnin gof your ode you should initilalize a counter k = 0; then in the loop , you do : if Dist>...

5 years ago | 0

| accepted

Answered
How to calculate and plot trendline (fit curve) in matlab?
hello you can do a curve fit on your data converted to log scale ; here a demo below : x = [7.94, 16.23, 32.92, 66.8, 135.52...

5 years ago | 0

Answered
Sum function discrite time
hello this is an example of echo simulation - please adapt to your parameters hope it helps clear all; close all; infile...

5 years ago | 0

Answered
Own Welch procedure vs pwelch function
hello for me , your function compute the autospectrum and not a PSD to do a PSD : PSD = Y.^2/df; with df = Fs/nfft;

5 years ago | 0

| accepted

Answered
Plot data from while loop
hello you have to index the error variables with Iteration otherwise you're overwritting each time (and you get only a sc...

5 years ago | 0

| accepted

Answered
Colorize bar or line according to magnitude.
hello it's unclear how you want to associate color with 2 parameters (magnitude and the distance) fyi , this is one option : ...

5 years ago | 0

Answered
Finding the ramp response to a transfer function
You can use lsim function for any input t=0:0.01:10 slope = 2; ramp=slope*t; % Your input signal G = tf(poly([-2 -3]...

5 years ago | 0

| accepted

Answered
Comparing two row vectors to find constant slope for steady state condition
Hi again so I introduced the first and second derivative of c2 and plotted in figure 3 Attached is the function to do a finite...

5 years ago | 0

| accepted

Answered
Nested for loop for showing cooling of different thicknesses in a plot
hello Kenneth simply moved the figure display before the last end clc clearvars close all %------------------------------...

5 years ago | 0

| accepted

Answered
FFT of single max sided from signal
hello this is the code fixed : FYI, the frequency in your code is 200 and not 100 kHz as in image , but you can easily change...

5 years ago | 0

| accepted

Answered
How to save to .txt using WRITEMATRIX ?
writematrix(num2str(M,'% .14e'),'M.txt','Delimiter','tab');

5 years ago | 0

| accepted

Answered
why does spectrogram of stft shows different magnitude while changing the window size?
hello I was tired of not being able to understand why some matlab functions (mostly based on fft) would not scale the output a...

5 years ago | 0

| accepted

Answered
Error using polyfit (line 44) The first two inputs must have the same number of elements. Error in A12Prob2_airPolution_spetrone (line 37) coef_co2 = polyfit(co2_data, sf6_data,1);
hello this is the fix ! the longer file data must be resampled (interpolated) on the time dates of the shorter file. clc ...

5 years ago | 0

Answered
how to convert ADC values of ADXL335 connected to a beam using ARDUINO UNO to FFT in Matlab
hello attached one example to do fft (with averaging if needed) and spectrogram you'll probably have to adapt the way you rea...

5 years ago | 0

Answered
Read Multiple Entries from Text File
so this is the code , maybe there is still room for improvement , but I tested it ok vs the data file provided hope it helps ...

5 years ago | 0

| accepted

Answered
How to search a keyword in text files and if it is found,write the string next to it in an excel file under a column ?
hello this is a first code to show the basic functionnalities (getting a 1 or 0 result depending of presence of "import from" ...

5 years ago | 0

| accepted

Answered
DC/offset value
hello - simply by removing the mean value : signal = signal - mean(signal);

5 years ago | 0

Answered
Read Multiple Entries from Text File
hello you can concatenate datas and vectors of zeros like that : a = [zeros(1,32) 0.237024 0.248206 zeros(1,...

5 years ago | 0

Answered
How to fit data when yaxis in log scale and plot the fit?
so this is my proposal - see the lines of your code I modified ; look for comments including : % modified code the origina...

5 years ago | 0

Load more