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 to convert irregular daily data to annual data?
T = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1101770/pcr.xlsx"); T(T.Tonnes == 0, :) =[]; % ...

6 hours ago | 0

| accepted

Answered
changing audio frequency to a constant
load handel.mat [p, q] = rat(2000/Fs) y2000 = resample(y, p, q); whos

7 hours ago | 0

Answered
Contour Plot when both x & y axis are in logscale
[x, y, z] = peaks; x = x+4; y = y+4; z=z+8; % make it positive figure contourf(x, y, z); colorbar xlabel('x'); ylabel...

9 hours ago | 0

Answered
Filter a data table (timebased) based on another table (based on known lap intervals)
load data.mat load ends.mat for i=1:size(E, 1) idx = T.Time >= E.Start_time(i) & T.Time <= E.Stop_time(i); T2 = T(...

1 day ago | 1

| accepted

Answered
Creating vector using rand() function in a range
A = rand(1,10)*7

1 day ago | 1

Answered
Numerical differentiation of a 2-D data set along one dimension
A = randn(4,5) % Your image [Ax, Ay] = gradient(A)

1 day ago | 0

| accepted

Answered
Verify plane equation perpendicular to vector
Your code is correct. Here is a slighly simplified and improved(?) version. %% Plot approach vector approach_vec=[-0.61649099...

1 day ago | 0

| accepted

Answered
How to make a line plot with Jet colored lines?
zz1.zz1 = load('z1.mat'); zz1.zz2 = load('x2.mat'); cmp1 = jet(64); % Use colororder colororder(cmp1); plot(zz1.zz2.X...

2 days ago | 0

| accepted

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

3 days 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(...

3 days 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

3 days 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: ...

4 days ago | 0

| accepted

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

4 days ago | 1

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

4 days 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 ...

4 days 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...

4 days ago | 0

| accepted

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

5 days 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...

12 days 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...

15 days 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

15 days 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...

16 days ago | 1

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

16 days 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,...

17 days 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...

17 days 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:...

18 days 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 ...

18 days ago | 1

| accepted

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

18 days 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]...

18 days 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...

19 days 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...

19 days ago | 0

Load more