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

20 hours ago | 1

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

4 days ago | 0

| accepted

Answered
How to up-sample both signals and labels together?
%websave("upsamp.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1642771/upsamp.mat"); websave("upsamp_R....

4 days ago | 0

| accepted

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

4 days ago | 0

Answered
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

5 days ago | 0

Answered
How to put different size vectors to one matrix or mat file?
d1=[1 2 3 4 5 6 7 8]; d2=[1 2 3 4 5]; d3=[1 2 3]; d4=1; % Use cell array d5 ={d1; d2; d3; d4} % you can save d5 as a mat f...

5 days ago | 2

Answered
How to filter out multiple outliers from a gradually changing dataset?
Adjust the threshold: websave("a_data.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1641186/a_data.mat"...

6 days ago | 0

| accepted

Answered
how to solve if interpolated data also contains NaN values
a = readmatrix("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1641181/V2_small.txt"); a(a>9999.8) = nan b...

6 days ago | 0

| accepted

Answered
How to plot data from an external MAT file against a time domain?
If you want to plot whole time series: ns = length(icpcomposite); t = (0:ns-1)/fs; plot(t, icpcomposite); If you want to plo...

6 days ago | 1

Answered
what is the meaning of int16>=int16
The following will read data from the file pointed by fid, assuming that the data in the file is of the format int16 and convert...

12 days ago | 0

Answered
transfer numerical data end with 'M' and 'B'
You can define your own function. Here is an example: sprintfkmb(12345678) sprintfkmb(-12345678) sprintfkmb(-1238) sprintfk...

12 days ago | 0

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
The following line is problematic: back_to_zero_indices = find(g1(t_values(nonzero_indices)) == 0, 1, 'last'); First, the func...

12 days ago | 0

Answered
How can I set zlabel log scale on 3d plot
[X,Y,Z] = peaks(50); X = X - min(X(:)) + 1; % make it +ve for log Y = Y - min(Y(:)) + 1; Z = Z - min(Z(:)) + 1; surf(X, Y...

13 days ago | 3

Answered
Finding the mean values of peak values using "findpeaks" function and displaying it
% load a1.mat % data = a1(:,2) % sample data x = linspace(0,1,1000); Pos = [1 2 3 5 7 8]/10; Hgt = [3 4 4 2 2 3]; Wdt ...

13 days ago | 0

Answered
I am trying to color a box on a plot.
You can change the face color of the box: square = rectangle('Position', [0, 0, 2.5, 15], 'EdgeColor','b','LineWidth',2,"Fa...

13 days ago | 0

| accepted

Answered
I am trying to color a box on a plot.
Try the following figure; an = annotation("textbox", "Color", "r", "BackgroundColor", "g", "String", "Text Box"); for i=0:0.0...

13 days ago | 0

Answered
How to workaround this problem with angle?
You can try unwrap function. %total range of omega delta_omega=20; %intervals of omega that are used to approximate omega_pr...

14 days ago | 1

Answered
I want lo graph a interseccion
% x= 3 -y^2 y1 = (-3:0.02:3); x1 = 3 - y1.^2; % y = x -1 x2 = (-2:0.01:3); y2 = x2 -1; plot(x1, y1, 'r-', x2, y2, 'b...

15 days ago | 1

Answered
Finding array index for a given array element does not work all the time
Mind the round off error in searching double array mf = 0:0.001:0.6; i = find(abs(mf - 0.3910) < 1e-6)

18 days ago | 0

Answered
How can i plot a 3D graph using excel file?
x = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1632251/data.xlsx"); waterfall(table2array(x)')...

18 days ago | 1

| accepted

Answered
I have sigmoid graph and I want to stop the time until 4th and continue from day 10th until day 30th. Can I make like this?
M1(1)=0; t(1)=0; h=0.01; dt=-5:h:30; t=zeros(length(dt),1); M1=zeros(length(dt),1); for i= 1:length(dt) t(i+1)=t(i)+h...

19 days ago | 0

| accepted

Answered
How to use a string to format multiple plots?
You can use cell array as the input arguments. Here is an example %tiledlayout(4,4) %Format='"linewidth",2'; %Arbitrary numb...

19 days ago | 0

| accepted

Answered
why cant I see any lines on the graph
It seems that the solution is not converging. Try setting an appropriate step size or other options to make it converging. % I...

20 days ago | 0

Answered
Adding a label with text on a plot
x = -3:.1:3 y = exp(-(x-0.5).^2/2); plot(x, y) % need to adjust the coordinates (normalized unit) % doc annotation for mor...

20 days ago | 0

| accepted

Answered
Hann window with a 2 km full width of window
N = 101; % Window length (# of points over -dz/2 to dz/2) w = hann(N); % hanning window plot(-(N-1)/2:(N-1)/2, w)

20 days ago | 0

| accepted

Answered
Color areas between two curves and the x and y-axis (not polynomial)
It seems that area function cannot individually change the basevalue (I have done some separate tests). One work around is to u...

20 days ago | 0

| accepted

Answered
how can I read and draw a plot and histogram from txt file on Matlab.
a = readtable("testdata.txt"); a.MESS_DATUM = string(a.MESS_DATUM) histogram(a.DD_10, 5) % 5bins

27 days ago | 0

Answered
recreating in matlab Butterworth Filter filter response
It seems that there is a confusion in s-domain and omega domain. The following is the Laplace Transform in s-domain. The plott...

3 months ago | 0

Answered
how can I calculate the nautical direction angle from Cartesian x- and y-component of velocity
vx = 10; vy = 10; v = sqrt(vx.^2 + vy.^2) theta = wrapTo360(90 - rad2deg(atan2(vy, vx))) % Earth coordinates, with ref to ...

3 months ago | 0

Answered
what is the map in this example?
"map" specifies the color of the image. load mri

3 months ago | 0

Load more