Community Profile

photo

Chunru


Last seen: Today Active since 2013

Matlab user since 1990

Statistics

All
  • Treasure Hunt Participant
  • MATLAB Central Treasure Hunt Finisher
  • 12 Month Streak
  • Guiding Light
  • Number Manipulation I Master
  • Indexing I Master
  • Revival Level 2
  • Knowledgeable Level 5
  • Commenter
  • Sequences And Series II Master
  • Speed Demon
  • Creator

View badges

Content Feed

View by

Answered
How can I generate sinusoidal signal with a time-varying frequency?
fs = 100e3; % 100kHz sampling frequency ts = 1/fs; Time = ts:ts:84986*ts; % 0.84986 sec load('Freq.mat'); % 84.986 freque...

ungefär 17 timmar ago | 0

| accepted

Answered
Remove row if its value is not different enough from the value in the row above it.
% Generate data latency = [1000 1010 1020 1800]'; dur = zeros(size(latency)); type = ones(size(latency)) * 256; T = table(...

ungefär 19 timmar ago | 0

| accepted

Answered
sum of series of matrix
A = randn(5, 5, 99); B = zeros(5, 5, 33); for i=1:33 B(:, :, i) = sum(A(:, :, (i-1)*3+(1:3)), 3); end whos B

ungefär 19 timmar ago | 2

| accepted

Answered
What is the equation used for taylor window function 'taylorwin'
The formulation of Taylor windown is a bit more complicated and not directly documented in "doc taylorwin". One reference is: ...

ungefär 21 timmar ago | 0

Answered
Assign values of array to indices of another array
A = [1; 2; 3; 4]; B = [11; 22; 33; 44]; B(A) A = [0; 2; 3; 4]; C = zeros(size(A)); C(A>0) = B(A(A>0))

ungefär 21 timmar ago | 0

Answered
matlab coder report Size mismatch (size [0 x 0] ~= size [1 x 2])
... coord_list = zeros(n, m1); % m1 is the length of yy below I_list = zeros(n, m2); % m2 is the lenght of zz ... fo...

en dag ago | 0

Answered
How to convert latitude and longitude of location to cartesian coordinates (x, y)?
First, you need a reference point. Second you have to assume that the posints are close enough to the reference points so that ...

en dag ago | 0

| accepted

Answered
how to use sprintf for xticklabel?
x = 0.1005:0.1:1.1005; y = randn(size(x)); plot(x, y) grid % for x tick format xtickformat('%.2f') % Conversion of array t...

en dag ago | 0

| accepted

Answered
extract numbers from text file
T = readtable("data.txt"); T=T(:, 2:end) x = table2array(T)

3 dagar ago | 1

Answered
How to convert negative numbers in parentheses (bank-formatted text) to numbers with minus sign?
xbank = [" (1,234)" "2,345,678" "(1,234.56)"] x = arrayfun(@bank2double, xbank) function x = bank2double(s) s...

10 dagar ago | 0

| accepted

Answered
Combine mat files into one, then combine all variables into one
filename = ["abc001.mat" "def002.mat"]; % list of the files in order variable1all = []; variable2all = []; for i=1:leng...

12 dagar ago | 0

Answered
there is nan in a column, delete the whole row
idx = isnan(c.lagpe); % find the index of nan c(idx, :) =[]; % remove the rows from table

12 dagar ago | 0

| accepted

Answered
How can I automate a process for n times?
J = [14 0 0 0 0; 15 0 0 0 0; 16 16 16 0 0; 22 22 0 0 0; 24 24 0 0 0; 25 25 25 25 25] Lr = size(J,1); for i = 1:Lr row = J...

13 dagar ago | 1

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

14 dagar ago | 0

Answered
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,...

14 dagar ago | 0

Answered
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...

15 dagar ago | 0

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

15 dagar ago | 0

| accepted

Answered
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 ...

15 dagar ago | 1

| accepted

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

16 dagar ago | 0

Answered
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]...

16 dagar ago | 0

| accepted

Answered
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...

16 dagar ago | 0

| accepted

Answered
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...

16 dagar ago | 0

Answered
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; ...

18 dagar ago | 0

| accepted

Answered
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...

19 dagar ago | 1

Answered
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...

19 dagar ago | 0

Answered
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...

19 dagar ago | 0

| accepted

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

20 dagar ago | 0

| accepted

Answered
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)

20 dagar ago | 0

| accepted

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

20 dagar ago | 0

| accepted

Answered
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 = ...

20 dagar ago | 0

| accepted

Load more