MATLAB: Change sign of descending values sign How can i change the sign of decending values ? 4165 4230 4296 4361 4430 4476 4549 4604 4664 4705 4710 4714 4718 4718 4716 4713 4708 4697 4646 4572 4491 Best Answer Is this what you want?x = your vector of valuesd = [1;diff(x)];x(d<0) = -x(d<0); Related SolutionsMATLAB: Mismatch between file and format string. Hi,use readtable, then extract the data from the variable CLOSE (=column named CLOSE) in ascending order:data = readtable('semga.csv');CLOSE = data.CLOSE(1191:1376);Note that your table has only 1376 entries, since the first row are variable names. So i changed(1192:1377)to(1191:1376)If needed use flip function, to get the order you want:CLOSE = flip(CLOSE)Best regardsStephan MATLAB: How to perform fft [moved from comments]To remove the 0Hz-component from the analysis, use y=fft(x-mean(x)); Related QuestionReshape dataset with time intervalsHow does pdist2 workHow to interpolate mooring data and creat a Longitude-depth profile.Sort a matrix with respect to a date.
Best Answer