# Chunru

Last seen: Today Active since 2013

Followers: 2   Following: 0

Matlab user since 1990

All

#### Feeds

View by

Modify Surface plot display format
Use "shading interp" [xq, yq] = meshgrid(linspace(-4, 0, 10), linspace(-0.5, 15, 10)); % Interpolate the scattered data to t...

4 months ago | 2

| accepted

Replacing substring not working
toBeChanged = "\dot{h}_j(\phi_j,x,y) = \delta _{u}-\delta _{l}\,{\mathrm{e}}^{-\frac{{\left(q_{\mathrm{jx}}-x\right)}^2+{\left(q...

4 months ago | 0

| accepted

How to remove (or isolate) side peaks except main peak after FFT
You can try "findpeaks" and using "MinPeakDistance" option. doc findpeaks

5 months ago | 0

% Test data f = (-100:1:100); p = randn(size(f)); p = p-min(p)+1; % extropolate data fe = [-125 f 125]; pe = interp1(fe...

5 months ago | 0

How to set the font in pdf generated by LiveScript
One workaround is to change the paper size, orientation and margin when exporting to pdf file. Export-->Show more--> Change Pap...

5 months ago | 0

Selecting one side of xy data points
You can use inpolygon to test if the dot is in red shape or blue shape: doc inpolygon

5 months ago | 0

Merge multiple cells into one cell array
n = 3; Degrees = randi([0 359], [n, 1]) Minutes = randi([0 59], [n, 1]) Seconds = rand([n, 1])*60 s = compose("%d%c%d%c%...

5 months ago | 1

How to to get a figure to fill a box or get a box around the figure
axis tight

6 months ago | 0

| accepted

HELP! How can i solve this array incompatible size issue
Make the change: N = length(t); If you need larger N, thant T in your code to a larger value. % Parameters fs = 1000; ...

6 months ago | 1

| accepted

Vertically Concatenating Tables in a Loop
TableAll = []; for m = 1:10 Trial = [COPData(m).data,OPALData(m).data]; %Original Table COPTv_y = diff(Trial.COPy)./d...

6 months ago | 0

| accepted

Is there a way to identify which dataset a value belongs to for overlapping datasets?

6 months ago | 0

| accepted

Choosing the role of NaN elements in the sum environment of matrices
aa=[1 2; 3 NaN]; bb=[NaN 1; 2 NaN]; cc = mean(cat(3, aa, bb), 3)

6 months ago | 0

Shift Filter outputs to align peaks
You can compute the group delay around the fc to align the output (approximately). fs = 20e3; numFilts = 32; % filter_numbe...

6 months ago | 1

How to create biphasic pulses?
N = 4; %400; % number of pulses Tp = 1; % pulse width; d1 = 1; % interphase delay d2 = 1; % in...

6 months ago | 0

| accepted

what does this mean , how and for what is it used ?
The following will produce a 5-dimensional array of 2x3x5x5x8. You can access the element by specifying 5-d index x=ones(2,3,4...

6 months ago | 0

| accepted

How to generate multiple tiff files into my file path?
thresholdarray = [0.01, 0.1, 0.001]; medfiltarray = [2, 8, 10, 16]; for i = 1:3 thresholdvalue = thresholdarray(1,i); ...

6 months ago | 0

How to create a series of separate tiff files?
It works here (in a unix environment). You may want to change ":" in file names into "_" for windows. thresholdarray = [0.01, ...

6 months ago | 0

clear; clc; xs = linspace(1,2,100); ys = linspace(1,3,100)'; % transpose here fun_values = zeros(100,100); %{ for ix...

6 months ago | 1

| accepted

Why does the fft function cut in half the amplitude of my signal?
Note that a sinosoidal signal can be expressed as: FFT of (normalized by N) will have a peak at f0 with amplitude of 1 (si...

6 months ago | 0

meaning of f in fprintf function
In old days, the command \f is used to make a printer to move to beginning of next pages. fprintf or print or printf are used b...

6 months ago | 1

| accepted

Sig figs on the rand function
==> Just another general question here, is there a reason the rand function has 6 sig figs? i.e. 12.3456 rand function (by defa...

6 months ago | 0

| accepted

Keep elements of an array that only fall within a given closed shape
space_a=linspace(0,168.3934962848858,50); % nm space_b=linspace(0,250,50); % nm z = peaks(50); % generate some test dat...

6 months ago | 1

| accepted

Modifying the graphical viewpoint
"doc view" for more details.

6 months ago | 0

| accepted

How to extend a curve until x-axis and y-axis?
Use "axis tight" r=0.03; T=10; t=2; lambda1=0.28:0.28:3.08; thai=0.43; alpha=7.2; delta=0.0609; s=100:100:1100; sigma=2...

6 months ago | 1

| accepted

I keep getting an error on my correlation coefficient on line 20
There is no error running here(see below). Can you show your error message? % Given data x = [0, 2, 4, 6, 9, 11, 12, 15, 17, 1...

6 months ago | 0

| accepted

How to up-sample both signals and labels together?

6 months ago | 0

| accepted

connecting each data points in a bar graph with an error bar
Saline1 = [41 55]; Saline2 = [34 26]; bar(1,mean(Saline1), 0.6, 'FaceColor',[0.7 0.7 0.7]) hold on bar(2,mean(Saline2), 0.6,...

6 months ago | 0

Which function used to use in M-Script to remove the variables
a = 3; b = 4; % use clear to remove variables clear a whos a

6 months ago | 0