Community Profile # Chunru

Last seen: Today Active since 2013

Matlab user since 1990

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

How to convert irregular daily data to annual data?

6 hours ago | 0

| accepted

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

7 hours ago | 0

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

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

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

1 day ago | 1

Numerical differentiation of a 2-D data set along one dimension

1 day ago | 0

| accepted

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

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

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

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

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

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

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

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

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

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

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

5 days ago | 1

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

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

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

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

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

16 days ago | 0

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

How to remove cell data from specific column using dates as a reference?

17 days ago | 0

combine two cell into one string

18 days ago | 0

| accepted

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

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

18 days ago | 0

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