Risposto
Program code for convolution
u = [1 2 3 1]; v = [2 3]; conv(u, v) % filter(u, 1, v)

quasi 2 anni fa | 0

Risposto
plotting a surface on a cylinder top face
theta =0:0.01*pi:2*pi; r=0.8; x=r*cos(theta); y=r*sin(theta); z=zeros(size(x)); % simple patch for base p_base =patch(x,...

quasi 2 anni fa | 0

Risposto
How to remove cell data from specific column using dates as a reference?
T = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1085695/flowrate_dates.xlsx", "Sheet", 3) idx = T...

quasi 2 anni fa | 0

Risposto
combine two cell into one string
t = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1085370/SummaryResult%20-%20Copy.xlsx'); t = t(1:...

quasi 2 anni fa | 0

| accettato

Risposto
Echo+noise signal
% generate a waveform f0 =100; fs=1000; pw = 0.1; pri = 1; npulses = 10; s = cos(2*pi*f0*(0:1/fs:pw))'; % it can be ...

quasi 2 anni fa | 1

| accettato

Risposto
Spectogram Of I and Q data
x = xi + 1i*xq; spectrogram(x)

quasi 2 anni fa | 0

Risposto
Transfer Quarterly dates to Monthly
% Your data dtstr = ["31/3/1992" "30/6/1992" "30/9/1992" "31/12/1992"]; x = [1.2 1.3 1.4 1.5]...

quasi 2 anni fa | 0

| accettato

Risposto
What is the training accuracy of this model?
If Labels is character array instead of string array, then numel(Labels) will give the number of characters instead of the numbe...

quasi 2 anni fa | 0

| accettato

Risposto
Get coordinates points inside a 3-D circle in MATLAB
normal=[-3.5556 -0.2222 1.0000]; center=[138 146 219]; radius=3; plotCircle3D(center,normal,radius); hold on point = p...

quasi 2 anni fa | 0

Risposto
How can I label multiple routes on a geoscatter plot?
fig = figure; %pos = fig.Position; %files = dir('cast*.gpx'); for i = 1:5 %length(files) %filename = files(i).name; ...

quasi 2 anni fa | 0

| accettato

Risposto
operation on single elements in MATLAB
x=-2:1:2; %coordinates x y=x.^2; %coordinates y z=[x;y] d = diff(z, 1, 2) % diff along 2nd dim d = vecnorm(d...

quasi 2 anni fa | 1

Risposto
specifying frequencies in pwelch not working
No problem for on-line matlab. data = randn(20000,1); %assume this is 1 row of my EEG data of interest analysisWinSize = 1000...

quasi 2 anni fa | 0

Risposto
Create duration array template
ti = duration('00:00:0.00','Format','hh:mm:ss.SSS'); tf = duration('02:00:0.00','Format','hh:mm:ss.SSS'); interval = millise...

quasi 2 anni fa | 0

| accettato

Risposto
Multiply values in array by *-1
a = randn(1, 106); a(14:20) a(16:18)=-a(16:18); a(14:20)

circa 2 anni fa | 0

| accettato

Risposto
How to find sum of previous 5 numbers in a column..
x = [56 45 56 678 678 568 2 3 4 5]; y = filter(ones(5,1), 1, x) y1 = y(5:end)

circa 2 anni fa | 0

| accettato

Risposto
Graph function problem Incorrect values
What's wrong? x=[0:50]; y=-x.^3+3*x.^2+2*x-27; plot(x,y)

circa 2 anni fa | 0

| accettato

Risposto
How to reduce running time of diagonal matrix multiplication with full matrix in Matlab?
n = 2000; d=500; B = randn(d, n); dv = randn(n, 1); D = diag(dv); % Normal tic A = B*D*B'; toc % Speed up 1 tic C = ...

circa 2 anni fa | 0

| accettato

Risposto
How to make a number NaN when its both neighbours are NaN?
A = [NaN 2.35 NaN 2.358 1.68 1.98 2.88 NaN 2.68 NaN 2.70 NaN 2.20 NaN 3.03; NaN NaN 2.77 NaN 2.67 1.87 2.56 1.88 2.39 NaN...

circa 2 anni fa | 0

| accettato

Risposto
adding an if condition so the negative value would be set to zero
for i=1:length(t) DOD(i)=cumsum((T(i)*30)/(3600*14.6)); end DOD = max(DOD, 0)

circa 2 anni fa | 0

Risposto
Circular bar graph in matlab
% Some data T.Country = string(('A':'Z')'); T.Population = randi([1000 10000], size(T.Country)); T = struct2table(T); n = he...

circa 2 anni fa | 1

Risposto
Plot with break in curve
xy=[0.0000 -963.0477 0.0043 -961.9818 0.0085 -960.8602 0.0128 -959.6834 0.0171 -958.4515 0.0214 -957.16...

circa 2 anni fa | 0

Risposto
removing the pixels with different size and unregular shape
A simple approach is to find the regions you want to deleted (assign 0). Four your question, rectangle regions are sufficient: ...

circa 2 anni fa | 1

Risposto
How to plot like this graph?
% [1 2][3 4] % [6 7] h(1) = subplot(2, 4, [1 2]); % 4x2 grid, 1st subplot plot(randn(10, 1)); h(2) = subplot(2, 4, ...

circa 2 anni fa | 0

| accettato

Risposto
Error using mesh Z must be a matrix, not a scalar or vector. Error in untitled6 (line 5) mesh(W,Y,Z)
w = 200:50:450; y=120:30:240; [W,Y] = meshgrid(w,y); Z= 64.0189+1.4629*W-2.626*Y-0.0012*W.^2+0.0098*W.*Y+0.0082*Y.^2; whos ...

circa 2 anni fa | 0

Risposto
How to read .XY file?
file='random_x.txt'; fid = fopen(file, 'rt'); i=1; s1 = ''; while ~feof(fid) s{i} = [s1 fgetl(fid)]; %...

circa 2 anni fa | 0

| accettato

Risposto
regexp function - get index of string with two conditions
str = {'strawberry/banana#(';'apple#,melon*cherry';'apple_banana_cherry'}; s = regexp(str, '^apple.*(cherry)$', 'match'); id...

circa 2 anni fa | 0

| accettato

Risposto
creating a rectangle plot
p = [0 2 2 3 3 5 5 0 0; 0 0 1 1 0 0 4 4 0]; plot(p(1,:), p(2,:))

circa 2 anni fa | 0

Risposto
copying the contents of a vector onto a longer vector
a = [1 2 3 4]; b = a(mod(0:9, 4)+1)

circa 2 anni fa | 0

| accettato

Risposto
How to design a FIR filter by the -3db bandwidth?
Generally speaking, you don't have to worry about -3dB attenuation at the cut-off. You just specify the pass-band and stop band...

circa 2 anni fa | 0

| accettato

Risposto
To generate a series with n numbers on and n numbers off
n = 8; xmax=100; x = (0:n-1)'+(n:n*2:xmax); x=x(:)

circa 2 anni fa | 0

Carica altro