Answered
How to get different patches (hatches) in my bar graph?
See the following: //www.tatmou.com/matlabcentral/fileexchange/24021-hatch-fill-patterns-plus-color-invert

1 month ago | 1

Answered
Labels above bar-plot
A = 1:10; B = randn(1, 10)*10; bar(A, B, 0.5); labels = compose('%.0f', B); text(A, B, labels, 'HorizontalAlignment','...

1 month ago | 0

Answered
Solving the following equation without taking inverse.
In matlab, you can solve the linear system by mldivide or \ "doc mldivide" for detailed description. B= randn(4, 4) g = randn...

1 month ago | 0

Answered
Fill missing data NaN
doc fillmissing fillmissing can be very powerful with various options.

1 month ago | 0

Answered
How to output multiple types of binary files in one file
x = [ 1 7 13 2 8 14 3 9 15 4 10 16 5 11 17 6 12 18]; fid = fopen("test.bin", "w", "ieee-le"); for i=1:s...

1 month ago | 0

Answered
Adding fading Background color (green --> yellow --> red) to plot(x,y)
xdata = [1.378 1.398 1.467 1.558 1.393 1.277 1.775 1.327]; ydata = [1.350 1.660 1.477 1.615 1.471 1.350 1.959 1.400]; figure(1...

1 month ago | 0

Answered
How to use matlab audioread Plot the spectrum with frequency on the x-axis and dBA /dBC on the y-axis?
doc audioread % for reading audio file doc pwelch % for computing power spectral density

1 month ago | 1

|accepted

Answered
Why do I receive this error "Invalid data type. Input arrays must be numeric or logical."?
It seems file to read the data using "readtable" as shown below. You can try "dbstop error" before running the code to locate w...

1 month ago | 0

|accepted

Answered
how to put each element of vector as a label for the plot
x = randn(5, 7); A = [69; 70; 74; 77; 118; 103; 104]; % Just use the string array instead of cell chr_A = string(A); h = b...

1 month ago | 0

|accepted

Answered
I have a signal which is quite noisy, I want to remove the noise from the signal, I did the smoothing but the results are still not good. The file is attached below
data= readmatrix("//www.tatmou.com/matlabcentral/answers/uploaded_files/934649/DSO0001.CSV"); anum1 = data(:,1); anum...

1 month ago | 0

Answered
How to check if all the data in the cell array are the same?
c = {100, 100, 100, 200} % cell array cm = cell2mat(c); same = all(cm == cm(1))

1 month ago | 0

Answered
how to find the correct value of the matrix
x=[1 1 1 2 2 2 2 3 3 3]; d=0.1:0.1:1; into = zeros(size(x)); for ii=1:10 if ii<=3 into(ii)=x(ii)*(d(1)); ...

2 months ago | 0

|accepted

Answered
Area under a PDF curve
For pdf that matlab supports, you can use cdf function to find the area under pdf. For your case zmax=10; m=0; sig=0.9; ...

2 months ago | 0

Answered
print table using printf
a = array2table(rand(4,3)); % a simple table s = formattedDisplayText(a); % formatted display fid = fopen('test.csv', '...

3 months ago | 0

|accepted

Answered
How to add maximum minimum points with respect to zero?
x1_min = -0.023 ; x1_max= 0.032; y1_min =-0.043; y1_max= 0.026; p1 = [x1_min, 0; 0, y1_min; x1_max, 0; 0, y1_max; x1_min, 0]; ...

3 months ago | 0

|accepted

Answered
Is there a way to count the integers in a matrix that fall within a certain range?
a = randi(100, [3 10]); idx = a>=20 & a<=29; x = sum(a(idx))

3 months ago | 1

Answered
Making a Grantt chart, labeling individually based on vector
D = [1,1,5;2,1,3;3,4,6;4,3,6;5,1,3;6,6,11]; B = [3,6,1,2,4,5]; hBar = barh(D, 'stacked'); hBar(1).Visible='off'; hBar(3).Vis...

3 months ago | 1

Answered
如何正确的格式我条形图吗?
How about this? x = [10 30 36.7 50]*1e9; y = rand(size(x))*30; bar(x, y); ax = gca; ax.XTick = x; ax.XAxis.Exponent = 9; ...

3 months ago | 0

Answered
How to plot the required number of subplots?
xs=8; v=1; L=20; ta=0.2; t=1; n=1:1:40; %x=0:0.1:20; x=0:0.1:60; position = 0; % position of plot in subplot fig_num = ...

3 months ago | 0

|accepted

Answered
How to plot the required number of subplots?
Since you have applied an amplitude factor of something like exp(-n.^2). The amplitude quickly drop to zero at larger iteration...

3 months ago | 0

Answered
How to create multiple matrices with multiple variable?
n = 5;% 100 % each slice of a is a matrix you want to produce: a = eye(3).*reshape(1:n, [1 1 n])

3 months ago | 0

Answered
Determine frequency of signals
load signal1 fs = 1; % normalized freq y = abs(fft(x)); L = length(y); f = (0:round(L/2)-1)/L*fs; p = y(1:round(L...

4 months ago | 0

Answered
How to integrate LFM signal into pulse
fl = 100; % Hz fu = 200; fs = 1000; pw = 0.1; % sec pri = 1; % sec % LFM t = (0:1/fs:pw)'; x = cos(2*pi*(fl*t + ...

4 months ago | 0

|accepted

Answered
Two x-axis (Arrhenius plots)
Not sure your equation. But you can modify the following to produce the plot: x = linspace(2.5, 4, 20); % x corrdinate ...

4 months ago | 0

|accepted

Answered
How do I find a specific x values in an array(?) of x,y locations?
% Now you have posted your data: load('location array.mat') whos % Your data is 2670x2 locations % floating point inside co...

4 months ago | 0

|accepted

Answered
Hi, I want to make the final output to 4 decimal places. But it kept showing only 1. I tried a lot but doesn't work. Please help me
Ass_1 = 60; Ass_2 = 75; Ass_3 = 80; totalass = (Ass_1 +Ass_2 + Ass_3)/3; %Quizzes quiz_1 = 76; quiz_2 = 90; quiz_3 = 54;...

4 months ago | 1

|accepted

Answered
store strings and numbers into an array
% You can use structure array PersonInfo(1) = struct("Name", "Peter", "Age", 28); PersonInfo(2) = struct("Name", "Fabian", "Ag...

4 months ago | 0

Answered
Vectorize nested for loop with matrix indexing
%以下代码是缓慢的,因为如果数组ze is growing. Memory % allocation will slow down the program % Z1_encryp...

4 months ago | 0

|accepted

Answered
plot complex eigenvalues over time
n = 20; x = (3+randn(n,8)) + 1i*(2+randn(n, 8)); % generate some data 20x8 instead of 1584 x 8 cmap = jet(n); % use differe...

4 months ago | 0

Answered
Convert Cell Arrays Containing Cell Arrays to separate columns
fn ='dbe-ew-transient analysis - 5% critical damped.f06'; linenum = 165164; M = readmatrix(fn, 'Range', 165164+":"+999);

4 months ago | 1

Load more