How to rank data and set corresponsing values
Assuming the rankings are just used to explain your final goal, the following seems to work: M1 = [0.004130861 0.001492476 -0...

How can I save the output figure into an image file?
A easy way is to use exportgraphics, introduced in R2020a: f = figure; imshow(...); exportgraphics(f, 'filename.jpg'); % or ....

Generate acoustic signal with difference rise time and fall time
Here's a simple approach that provides separate control for the rise or attack time (n1), the sustain time (n2), and the decay o...

| accepted

Store identical rows in specified column
This seems to answer your question. There are 41 uniques IDs in the second column of your data set. The code below extracts th...

| accepted

Save marked point on plot
OK, this seems to to work. The x-y coordinates of the marked points are output to the command window (along with the figure num...

| accepted

Save marked point on plot
Since you haven't provided any data or code, this is a rough answer only: [pks, locn] = findpeaks(-y, 'MinPeakProminence', 0.1)...

How to convert an excel file (.csv) to a .wav format/any other audio format file?
I was able to play your audio data and save it as a .wav file. It's some sort of noise along with a dripping sound. But, I had...

| accepted

how to easily and quickly change the variable names (headers) of multiple tables
For each table, it can be done like this: (To illustrate, this example is just for 5 columns) T = array2table(rand(3,5)); vn =...

How to assign Nans to specific column, not entire row
Your first attempt was almost correct. Here's the fix: ZB1array = rand(5,5) % test data idx = ZB1array(:,4) < 0.95; ZB1arra...

| accepted

How to find the sum of characters in a cell array?
bowling= {{7,2,8,'/',6,2,'X',9,'/',9,0,'X','X',8,1,7,'/',9}, {'X',9, '/','X',8,'/','X','X',7,2,'X',8,'/',9,0}}; num_spares = su...

| accepted

Plotting periodic sawtooth wave with 25%, 50% and 75% duty cycle
I'm sure there are other (perhaps better) ways to do this, but I think the following code achieves what you are after: % create...

| accepted

why is my plot only showing 1 diagonal line
First, you probably should move the plot functions outside the while loop. Build up the vectors, then plot! But, the reason ...

How can I draw a line with two points x1, y1 and x2, y2 and assign weight to the edge.
x1 = 0; x2 = 1; y1 = 0; y2 = 1; line([x1 x2], [y1 y2], 'linewidth', 5); text(0.45, 0.55, '10', 'FontSize', 14);

how to write equation in legend correctly in latex
MATLAB by default uses a subset of TeX. That's probably all you need: % test data a=1.2345; plot(rand(1,5)); legend(['t_{...

Subscript indices must either be real positive integers or logicals.
You've got some funny things going on with the S_x and S_y variables. I made a small change: building up the S_x and S_y values...

| accepted

How to draw a letter T ? the background is black and the letter itself white
Just add another white block for the top of the T: A = zeros(500, 500); A(100:200, 100:200) = 255; A(50:100, 50:250) = 255; ...

| accepted

Decide values of row in matrix for certain row intervals
rows=150001;window=500; res=zeros(rows-window,4); flagstart = [11600 42410 72480 102100 132000]; flagend = [22620 52410 825...

| accepted

Using fft to plot frequency spectrum of sum of rectangular pulses
I think this is what you are after. Mostly, this code just follows the example in the fft documentation, particularly w.r.t. ge...

Histrogram/bar chart plot problem
The code below uses your data and generates a bar chart similar to your sketch. I'm not sure how picky you are about the colors...

| accepted

How to specify max. number of outliers on which to apply the Hampel filter?
There's probably a simpler way to do this, but I believe the code below achieves what you are after: % test data x1 = randi([5...

| accepted

Remove unwanted noise from scatter plot using Matlab
There are many ways to approach this, for example using smoothdata or rmoutliers. Both functions have options to control how th...

How to Create a Surface Plot from Table Data Imported from Excel
Given some test data (attached) similar to yours... ... a surface plot can be created thus... M = readmatrix('testdata.xlsx'...

| accepted

How to use separate locations for axis location and axis labels?
You don't need to set the x-axis location. Delete that line and then use yline to get a line at y = 0: figure time = [0 1 2 3...

| accepted

How to draw sinewave with Scalling
Just shift the values in z up by constant... maxV=100; minV=5; f = 30; fs = 1e4; % samples per second t=...

| accepted

shift matrix to the right
Perhaps this is what you are looking for: A=[0 0 1 1 0 0 1 1] B=[0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1] m = numel(A); n = numel(B)...

Image plot with quiver vector overlain
quiver is drawing on top of the image. You haven't provided any data or code that can be executed, so it's hard to tell what th...

How to read array from a text file into each row of a matrix.
OK, this should work. First, combine dir and pktFile using the fullfile function. Read the data using readtable, then restore ...

Two way Repeated Measures ANOVA two different ways
@Mark Robinson The reason anovan and ranova give different results is that the within table in your solution using ranova is not...

| accepted