Risposto
PSD curve into time series data
f = [0 10 30 100 120 500 2000]; % need f(1)=0; f(end)=fs/2 p = [0.01 .01 .002 .002 .0004 .0004 .0004]; % po...

circa 2 anni fa | 0

Risposto
Colormap by variable using plot function
% generate data x = rand(100,1); c = randi([1, 5], [100, 1]); y = exp(x).*c; tbl = table(x, y, c); scatter(tbl, 'x', 'y...

circa 2 anni fa | 0

| accettato

Risposto
draw a graph of peaks find peaks
[pks,locs,w,p]=findpeaks(X(1026,:),FsY,'MinPeakProminence',2); figure(1), clf % plot(Y,X(1026,:),'k-') plot(X(1026,:), Y, 'k-...

circa 2 anni fa | 0

Risposto
Varying vector from [0 100] to [100 0]
p1 = [0 100]; p2 = [100, 0]; dp = (p2-p1)/100; di = 10; % di=1 for i=0:di:100 p = p1 + i*dp; fprintf('%3d %3d\n...

circa 2 anni fa | 0

Risposto
Get Sensor positions manually in a uniform linear array (phased.ula) in phased array system toolbox
% Get the position of the array array = phased.ULA('NumElements',9,'ElementSpacing',0.05); p = getElementPosition(array) % Fo...

circa 2 anni fa | 0

| accettato

Risposto
Propability of x being less than y
In statistics toolbox, you can do the following: x = randn(20, 2) * 200; [h, pvalue, ci] = ttest2(x(:, 1), x(:, 2))

circa 2 anni fa | 0

| accettato

Risposto
Extract values from a data table and create a new table
T = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1057240/Sta_Teresa.csv"); T1 = T(T.PRCP > 1, :)

circa 2 anni fa | 0

| accettato

Risposto
spectrogram of a matrix with 32 channels in one graph with color
% generate some data fs = 500; x = sin(2*pi*(0:1023)'*(1:32)/fs) + randn(1024, 32); for i=1:size(x, 2) [s,f,t] = spe...

circa 2 anni fa | 0

| accettato

Risposto
how to remove the zeros inside a 3D matrix?
% Xroot(z,w,k) (10x33x402). m1 = 10; m2 = 33; m3 = 402; m1 = 4; m2 = 5; m3 = 6; % Generate data Xroot = zeros(m1, m2, m3)...

circa 2 anni fa | 1

Risposto
How to remove "some" spikes from data
Try the following: filloutliers hampel medfilt1

circa 2 anni fa | 0

Risposto
How to Merge the cells and name?
datayouhave = rand(8, 5); % replace this with your data t = array2table(datayouhave, "VariableNames", ["Maths", "Physics", "P...

circa 2 anni fa | 0

| accettato

Risposto
How to find euclidean distances of each column of the two matrices?
A= [0.5958 0.8909 0.9135 0.5348 0.0558 0.4093 0.0265 0.1159 0.8576 0.0066 0.1568 0.8366 ...

circa 2 anni fa | 0

| accettato

Risposto
DNN classify function uses GPU, or just CPU ?
Classify will automatically choose GPU (if it is available and suitable). You can also specify the use of GPU explicitly: clas...

circa 2 anni fa | 0

| accettato

Risposto
Issues using Summation in Matlab
This is symbolic computation. It's not clear what you want to calculate exactly. If you have value of d and n, you may want ...

circa 2 anni fa | 1

| accettato

Risposto
Second set of y-axis labels for same data
yyaxis left plot(randn(10,1)) ylabel('Original Unit') xl_orig = xlim; yl_orig = ylim; yyaxis right %plot(xl_orig, nan(1,...

circa 2 anni fa | 0

| accettato

Risposto
How to blur some part of image without affecting rest of the part?
I = imread("peppers.png"); imshow(I) LEN = 31; THETA = 11; PSF = fspecial('motion', LEN, THETA); % Blur part of image I(1...

circa 2 anni fa | 0

Risposto
Is it possible to create a surface plot from scattered points?
a= readmatrix("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1055560/Datas_xymises.txt") whos position_x = a(...

circa 2 anni fa | 0

Risposto
Neural Network Activation function
net = feedforwardnet([10 20]); % 2 hidden, 1 output layers % specify the transfer function as you want % Usually, layer1...

circa 2 anni fa | 1

| accettato

Risposto
How to read images sequentially from a folder?
% create some files system('touch a.png'); system('touch c.txt'); pause(1) % make sure b is newer in datenum system('touch ...

circa 2 anni fa | 0

Risposto
how to make horizontal bar graph in matlab?
a = readtable('data.txt'); % Read the data a n = height(a); barh(1:10, a.Var2(1:10)); hold on barh(11:n, a.Var2(11:n)); h...

circa 2 anni fa | 1

| accettato

Risposto
How to make a unit energy signal?
%y=audioread('speech.wav'); y = rand(1000, 1); subplot(2,3,1); plot(y); xlabel('Samples'); ylabel('Magnitude'); title('Ori...

circa 2 anni fa | 0

| accettato

Risposto
How to plot these two plots in a single figure and using both y axis?
Use yyaxis syms r psi_list = [1, 0.1, 0.01, 0.001]; % example: 0.1, 0.01, 0.001 figure yyaxis left hold on for i = 1:numel...

circa 2 anni fa | 0

| accettato

Risposto
streamlining or sliming endless if-elseif of rem function, How?
N =3 % 3 varieties of foce calc, or/and initial forces m_tol = zeros(1,N) for bbm=1:N m_tol(1,bbm)=m_tol(1,bbm)+ 0.1*bbm ...

circa 2 anni fa | 0

| accettato

Risposto
How to separate characters in a cell array by commas
Wondering why you want that. But it can be done as follows: e = [3 0 -6]; n = length(e); e_str = cell(1,2*n-1); for i = 1:n...

circa 2 anni fa | 0

| accettato

Risposto
Vectorized nD diag loop
n = 400; m = 500; A = rand(4,n,m); B = zeros(4,4,n,m); % initialize to speed up tic for i = 1:n for j = 1:m ...

circa 2 anni fa | 0

| accettato

Risposto
Random Band-Limited White Noise Excitation
% Band-limited noise can be generated by passing a white Gaussian noise % through a band pass filter fs = 5; ns = round(700*...

circa 2 anni fa | 0

| accettato

Risposto
Computing the overlapping area of curves
scale = 1.5; x{1} = [0,4,6,10,15,20]*scale; y{1} = [18,17.5,13,12,8,10]; x{2} = [0,10.5,28]*scale; y{2}= [18.2,10.6,10.3];...

circa 2 anni fa | 0

| accettato

Risposto
Change color of bar graphs?
y = [0.1064 0.1069 0.1084 0.1113 0 0.1130 0.1165 0.1189 0.1217]; b = barh(y); b.FaceColor = 'flat'; b.CData(1:4, :) = repmat(...

circa 2 anni fa | 2

| accettato

Risposto
Perfect Square in Matlab
x = (1:20); mod(sqrt(x), 1) == 0

circa 2 anni fa | 0

Risposto
How to calculate Fourier transform for exponential function without using FFT.
syms x f(x) = exp(-x.^2) y = fourier(f)

circa 2 anni fa | 0

Carica altro