Community Profile # Chunru

Last seen: Today Active since 2013

Matlab user since 1990

#### Statistics

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

View by

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

etwa 19 Stunden 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...

2 Tage 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(...

2 Tage 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

2 Tage 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: ...

2 Tage ago | 0

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

2 Tage ago | 0

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

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

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

3 Tage ago | 0

| accepted

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

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

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

13 Tage 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

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

14 Tage ago | 1

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

15 Tage 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,...

15 Tage ago | 0

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

16 Tage ago | 0

combine two cell into one string

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

16 Tage ago | 1

| accepted

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

17 Tage 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]...

17 Tage ago | 0

| accepted

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

17 Tage ago | 0

| accepted

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

17 Tage ago | 0

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

19 Tage ago | 0

| accepted

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

20 Tage ago | 1

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

20 Tage ago | 0

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

20 Tage ago | 0

| accepted

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

21 Tage ago | 0

| accepted

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)

21 Tage ago | 0

| accepted